Skip to content

fix(sqlserver): [123397725]add params #3315

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/3315.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/tencentcloud_sqlserver_general_cloud_instance: add auto_voucher, voucher_ids, multi_zones, multi_nodes, dr_zones, disk_encrypt_flag
```
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ require (
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/clb v1.0.1107
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit v1.0.1033
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.1135
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1142
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1145
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cvm v1.0.1128
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cwp v1.0.762
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cynosdb v1.0.1111
Expand Down Expand Up @@ -78,7 +78,7 @@ require (
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/scf v1.0.1034
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ses v1.0.748
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sms v1.0.486
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sqlserver v1.0.1073
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sqlserver v1.0.1136
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl v1.0.1015
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssm v1.0.691
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sts v1.0.1142
Expand Down
7 changes: 5 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -941,8 +941,9 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1130/go.mod
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1133/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1135 h1:NAu4sH5c+kGTZQ0rwhnuYjIXbentw3Np+TbwimH22uc=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1135/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1142 h1:tQRy/XRJOqtl4TKUVONQy8EvYEoU6alMM0sHO5bW5Q8=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1142/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1136/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1145 h1:DETyir/MtG+GLOD0OatzjrQTTXRguFSJo1ZtPXtbIQw=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1145/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/controlcenter v1.0.993 h1:WlPgXldQCxt7qi5Xrc6j6zTrsXWzN5BcOGs7Irq7fwQ=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/controlcenter v1.0.993/go.mod h1:Z9U8zNtyuyKhjS0698wqsrG/kLx1TQ5CEixXBwVe7xY=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/csip v1.0.860 h1:F3esKBIT3HW9+7Gt8cVgf8X06VdGIczpgLBUECzSEzU=
Expand Down Expand Up @@ -1021,6 +1022,8 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sms v1.0.486 h1:eHLaL+h
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sms v1.0.486/go.mod h1:MSsho0YlAsoPCOMqdBfwqGd/SMQ0FTGh0a6emBy2X+g=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sqlserver v1.0.1073 h1:sjLorWu5GwioPHJSbLPv/prfvvRYlK8FTtwtCHAjKzc=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sqlserver v1.0.1073/go.mod h1:ldl6POfJqrGX8zi46gkZfZtloBrqLwlbgXijZFBc5fM=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sqlserver v1.0.1136 h1:WbkKZyPVRzr2pPlQKxPwVNCZ3prVWt2nseo1ja7NyEo=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sqlserver v1.0.1136/go.mod h1:m7a2VoL3Cf2dECJN3QZPnHwaqJAfG2Vu17sLpnfBqho=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl v1.0.1015 h1:4fTbXtkXwleuDu/xYVELGpkuBLPgW+raED6y7Ni63sA=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl v1.0.1015/go.mod h1:0ZWI4Rd0p6LnXEvEaj/DbUza8B2s74AllJr1WXrsLtY=
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssm v1.0.691 h1:UE55TqueOP889MDcJ+cBW+MBjtzvWUw5fuOBWGCBIjs=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,36 @@ func ResourceTencentCloudSqlserverGeneralCloudInstance() *schema.Resource {
Computed: true,
Description: "External port number.",
},
"auto_voucher": {
Type: schema.TypeInt,
Optional: true,
Description: "Whether to automatically use vouchers;1-Yes, 0-No, not used by default.",
},
"voucher_ids": {
Type: schema.TypeInt,
Optional: true,
Description: "Voucher ID array. Currently, only one can be used for a single order.",
},
"multi_zones": {
Type: schema.TypeInt,
Optional: true,
Description: "Whether to deploy across availability zones, the default value is false.",
},
"multi_nodes": {
Type: schema.TypeInt,
Optional: true,
Description: "Whether it is a multi-node architecture instance, the default value is false. When MultiNodes = true, the parameter MultiZones must be true.",
},
"dr_zones": {
Type: schema.TypeInt,
Optional: true,
Description: "The standby node availability area is empty by default. When MultiNodes = true, the primary node and standby node availability areas cannot all be the same. The minimum number of standby availability areas set is 2, and the maximum number is no more than 5.",
},
"disk_encrypt_flag": {
Type: schema.TypeInt,
Optional: true,
Description: "Disk encryption identification, 0-not encrypted, 1-encrypted.",
},
},
}
}
Expand Down Expand Up @@ -279,6 +309,25 @@ func resourceTencentCloudSqlserverGeneralCloudInstanceCreate(d *schema.ResourceD
request.TimeZone = helper.String(v.(string))
}

if v, ok := d.GetOk("auto_voucher"); ok {
request.AutoVoucher = helper.IntInt64(v.(int))
}
if v, ok := d.GetOk("voucher_ids"); ok {
request.VoucherIds = helper.InterfacesStringsPoint(v.([]interface{}))
}
if v, ok := d.GetOkExists("multi_zones"); ok {
request.MultiZones = helper.Bool(v.(bool))
}
if v, ok := d.GetOkExists("multi_nodes"); ok {
request.MultiZones = helper.Bool(v.(bool))
}
if v, ok := d.GetOk("dr_zones"); ok {
request.DrZones = helper.InterfacesStringsPoint(v.([]interface{}))
}
if v, ok := d.GetOkExists("disk_encrypt_flag"); ok {
request.DiskEncryptFlag = helper.IntInt64(v.(int))
}

err := resource.Retry(tccommon.WriteRetryTimeout, func() *resource.RetryError {
result, e := meta.(tccommon.ProviderMeta).GetAPIV3Conn().UseSqlserverClient().CreateCloudDBInstances(request)
if e != nil {
Expand Down Expand Up @@ -488,7 +537,7 @@ func resourceTencentCloudSqlserverGeneralCloudInstanceUpdate(d *schema.ResourceD
)

request.InstanceId = &instanceId
immutableArgs := []string{"zone", "machine_type", "instance_charge_type", "project_id", "subnet_id", "vpc_id", "period", "security_group_list", "weekly", "start_time", "span", "resource_tags", "collation", "time_zone"}
immutableArgs := []string{"zone", "machine_type", "instance_charge_type", "project_id", "subnet_id", "vpc_id", "period", "security_group_list", "weekly", "start_time", "span", "resource_tags", "collation", "time_zone", "auto_voucher", "voucher_ids", "multi_zones", "multi_nodes", "dr_zones", "disk_encrypt_flag"}

for _, v := range immutableArgs {
if d.HasChange(v) {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1166,7 +1166,7 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cloudaudit/v20190319
# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls v1.0.1135
## explicit; go 1.14
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/cls/v20201016
# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1142
# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1145
## explicit; go 1.11
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/errors
Expand Down Expand Up @@ -1288,7 +1288,7 @@ github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ses/v20201002
# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sms v1.0.486
## explicit; go 1.14
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sms/v20210111
# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sqlserver v1.0.1073
# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sqlserver v1.0.1136
## explicit; go 1.14
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sqlserver/v20180328
# github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ssl v1.0.1015
Expand Down
Loading
Loading