Skip to content

Commit

Permalink
Merge pull request #67 from volcengine/feat/ecs_prepaid_remove
Browse files Browse the repository at this point in the history
Feat/ecs prepaid remove
  • Loading branch information
xuyaming0800 authored Feb 22, 2023
2 parents e5edbf7 + 166e15a commit af47f4c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion common/common_volcengine_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ package common

const (
TerraformProviderName = "terraform-provider-volcengine"
TerraformProviderVersion = "0.0.56"
TerraformProviderVersion = "0.0.57"
)
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func EcsInstanceImportDiffSuppress(k, old, new string, d *schema.ResourceData) b
return true
}

if d.Get("instance_charge_type").(string) == "PostPaid" && (k == "period" || k == "period_unit" || k == "auto_renew" || k == "auto_renew_period") {
if d.Get("instance_charge_type").(string) == "PostPaid" && (k == "period" || k == "period_unit") {
return true
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,12 @@ func (s *VolcengineEcsService) CreateResource(resourceData *schema.ResourceData,
(*call.SdkParam)["Volumes.1.DeleteWithInstance"] = true
(*call.SdkParam)["Count"] = 1

if (*call.SdkParam)["InstanceChargeType"] != "PrePaid" {
delete(*call.SdkParam, "AutoRenew")
delete(*call.SdkParam, "AutoRenewPeriod")
delete(*call.SdkParam, "Period")
}

if _, ok := (*call.SdkParam)["ZoneId"]; !ok || (*call.SdkParam)["ZoneId"] == "" {
var (
vnet map[string]interface{}
Expand Down

0 comments on commit af47f4c

Please sign in to comment.