Skip to content

fix(mariadb): [116318703] support ip port #2583

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 3 commits into from
Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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/2583.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
datasource/tencentcloud_mariadb_db_instances: Support `vip`, `vport`, `internet_domain`, `internet_ip`, `internet_port` field
```
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,31 @@ func DataSourceTencentCloudMariadbDbInstances() *schema.Resource {
Computed: true,
Description: "db version id.",
},
"vip": {
Type: schema.TypeString,
Computed: true,
Description: "Intranet IP address.",
},
"vport": {
Type: schema.TypeInt,
Computed: true,
Description: "Intranet port.",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

新增的字段补充下测试用例覆盖

},
"internet_domain": {
Type: schema.TypeString,
Computed: true,
Description: "Public network access domain name.",
},
"internet_ip": {
Type: schema.TypeString,
Computed: true,
Description: "Public IP address.",
},
"internet_port": {
Type: schema.TypeInt,
Computed: true,
Description: "Public network port.",
},
"resource_tags": {
Type: schema.TypeList,
Computed: true,
Expand Down Expand Up @@ -231,6 +256,21 @@ func dataSourceTencentCloudMariadbDbInstancesRead(d *schema.ResourceData, meta i
if instance.DbVersionId != nil {
instanceMap["db_version_id"] = instance.DbVersionId
}
if instance.Vip != nil {
instanceMap["vip"] = instance.Vip
}
if instance.Vport != nil {
instanceMap["vport"] = instance.Vport
}
if instance.WanDomain != nil {
instanceMap["internet_domain"] = instance.WanDomain
}
if instance.WanVip != nil {
instanceMap["internet_ip"] = instance.WanVip
}
if instance.WanPort != nil {
instanceMap["internet_port"] = instance.WanPort
}
if instance.ResourceTags != nil {
resourceTagsList := []interface{}{}
for _, resourceTags := range instance.ResourceTags {
Expand Down
5 changes: 5 additions & 0 deletions website/docs/d/mariadb_db_instances.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ In addition to all arguments above, the following attributes are exported:
* `db_version_id` - db version id.
* `instance_id` - instance id.
* `instance_name` - instance name.
* `internet_domain` - Public network access domain name.
* `internet_ip` - Public IP address.
* `internet_port` - Public network port.
* `memory` - meory of instance.
* `project_id` - project id.
* `region` - region.
Expand All @@ -49,7 +52,9 @@ In addition to all arguments above, the following attributes are exported:
* `tag_value` - tag value.
* `storage` - storage of instance.
* `subnet_id` - subnet id.
* `vip` - Intranet IP address.
* `vpc_id` - vpc id.
* `vport` - Intranet port.
* `zone` - available zone.