Skip to content

feat(sql): [122260381] add new resource #3198

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

Merged
merged 7 commits into from
Mar 14, 2025
Merged
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
15 changes: 15 additions & 0 deletions .changelog/3198.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```release-note:new-resource
tencentcloud_sqlserver_wan_ip_config
```

```release-note:enhancement
resource/tencentcloud_sqlserver_general_cloud_instance: add new params
```

```release-note:enhancement
resource/tencentcloud_sqlserver_basic_instance: add new params
```

```release-note:enhancement
resource/tencentcloud_sqlserver_instance: add new params
```
1 change: 1 addition & 0 deletions tencentcloud/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -1669,6 +1669,7 @@ func Provider() *schema.Provider {
"tencentcloud_sqlserver_database_tde": sqlserver.ResourceTencentCloudSqlserverDatabaseTDE(),
"tencentcloud_sqlserver_general_cloud_ro_instance": sqlserver.ResourceTencentCloudSqlserverGeneralCloudRoInstance(),
"tencentcloud_sqlserver_instance_ssl": sqlserver.ResourceTencentCloudSqlserverInstanceSsl(),
"tencentcloud_sqlserver_wan_ip_config": sqlserver.ResourceTencentCloudSqlserverWanIpConfig(),
"tencentcloud_tcr_instance": tcr.ResourceTencentCloudTcrInstance(),
"tencentcloud_tcr_namespace": tcr.ResourceTencentCloudTcrNamespace(),
"tencentcloud_tcr_repository": tcr.ResourceTencentCloudTcrRepository(),
Expand Down
1 change: 1 addition & 0 deletions tencentcloud/provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,7 @@ tencentcloud_sqlserver_start_xevent
tencentcloud_sqlserver_instance_tde
tencentcloud_sqlserver_database_tde
tencentcloud_sqlserver_general_cloud_ro_instance
tencentcloud_sqlserver_wan_ip_config

SSL Certificates(ssl)
Data Source
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,16 @@ func ResourceTencentCloudSqlserverBasicInstance() *schema.Resource {
Optional: true,
Description: "The tags of the SQL Server basic instance.",
},
"dns_pod_domain": {
Type: schema.TypeString,
Computed: true,
Description: "Internet address domain name.",
},
"tgw_wan_vport": {
Type: schema.TypeInt,
Computed: true,
Description: "External port number.",
},
},
}
}
Expand Down Expand Up @@ -333,6 +343,13 @@ func resourceTencentCloudSqlserverBasicInstanceRead(d *schema.ResourceData, meta
_ = d.Set("storage", instance.Storage)
_ = d.Set("vip", instance.Vip)
_ = d.Set("vport", instance.Vport)
if instance.DnsPodDomain != nil {
_ = d.Set("dns_pod_domain", instance.DnsPodDomain)
}

if instance.TgwWanVPort != nil {
_ = d.Set("tgw_wan_vport", instance.TgwWanVPort)
}

//maintanence
var weekSet []int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,16 @@ func ResourceTencentCloudSqlserverGeneralCloudInstance() *schema.Resource {
Deprecated: "It has been deprecated from version 1.81.2.",
Description: "Upgrade the high-availability architecture of sqlserver, upgrade from mirror disaster recovery to always on cluster disaster recovery, only support 2017 and above and support always on high-availability instances, do not support downgrading to mirror disaster recovery, CLUSTER-upgrade to always on capacity Disaster, if not filled, the high-availability architecture will not be modified.",
},
"dns_pod_domain": {
Type: schema.TypeString,
Computed: true,
Description: "Internet address domain name.",
},
"tgw_wan_vport": {
Type: schema.TypeInt,
Computed: true,
Description: "External port number.",
},
},
}
}
Expand Down Expand Up @@ -412,6 +422,14 @@ func resourceTencentCloudSqlserverGeneralCloudInstanceRead(d *schema.ResourceDat
_ = d.Set("time_zone", generalCloudInstance.TimeZone)
}

if generalCloudInstance.DnsPodDomain != nil {
_ = d.Set("dns_pod_domain", generalCloudInstance.DnsPodDomain)
}

if generalCloudInstance.TgwWanVPort != nil {
_ = d.Set("tgw_wan_vport", generalCloudInstance.TgwWanVPort)
}

maintenanceSpan, err := service.DescribeMaintenanceSpanById(ctx, instanceId)
if err != nil {
return err
Expand Down
18 changes: 18 additions & 0 deletions tencentcloud/services/sqlserver/resource_tc_sqlserver_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,16 @@ func TencentSqlServerBasicInfo(isROInstance bool) map[string]*schema.Schema {
Deprecated: "It has been deprecated from version 1.81.2.",
Description: "The way to execute the allocation. Supported values include: 0 - execute immediately, 1 - execute in maintenance window.",
},
"dns_pod_domain": {
Type: schema.TypeString,
Computed: true,
Description: "Internet address domain name.",
},
"tgw_wan_vport": {
Type: schema.TypeInt,
Computed: true,
Description: "External port number.",
},
}

if !isROInstance {
Expand Down Expand Up @@ -616,6 +626,14 @@ func tencentSqlServerBasicInfoRead(ctx context.Context, d *schema.ResourceData,
_ = d.Set("charge_type", svcpostgresql.COMMON_PAYTYPE_POSTPAID)
}

if instance.DnsPodDomain != nil {
_ = d.Set("dns_pod_domain", instance.DnsPodDomain)
}

if instance.TgwWanVPort != nil {
_ = d.Set("tgw_wan_vport", instance.TgwWanVPort)
}

var securityGroup []string
outErr = resource.Retry(tccommon.ReadRetryTimeout, func() *resource.RetryError {
securityGroup, inErr = sqlserverService.DescribeInstanceSecurityGroups(ctx, instanceId)
Expand Down
Loading
Loading