Skip to content
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

fix(teo): [117723500]Change the records list type to set #2680

Merged
merged 2 commits into from
Jun 14, 2024
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
3 changes: 3 additions & 0 deletions .changelog/2680.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/tencentcloud_clb_instance: Change the record list type to a set to solve the order problem.
```
22 changes: 9 additions & 13 deletions tencentcloud/services/teo/resource_tc_teo_origin_group.go

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

28 changes: 24 additions & 4 deletions tencentcloud/services/teo/resource_tc_teo_origin_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,19 @@ func TestAccTencentCloudTeoOriginGroup_basic(t *testing.T) {
resource.TestCheckResourceAttrSet("tencentcloud_teo_origin_group.basic", "zone_id"),
resource.TestCheckResourceAttr("tencentcloud_teo_origin_group.basic", "name", "keep-group-1"),
resource.TestCheckResourceAttr("tencentcloud_teo_origin_group.basic", "type", "GENERAL"),
resource.TestCheckResourceAttr("tencentcloud_teo_origin_group.basic", "records.#", "1"),
resource.TestCheckResourceAttr("tencentcloud_teo_origin_group.basic", "records.#", "3"),
resource.TestCheckResourceAttrSet("tencentcloud_teo_origin_group.basic", "records.0.record"),
resource.TestCheckResourceAttr("tencentcloud_teo_origin_group.basic", "records.0.type", "IP_DOMAIN"),
resource.TestCheckResourceAttr("tencentcloud_teo_origin_group.basic", "records.0.weight", "100"),
resource.TestCheckResourceAttr("tencentcloud_teo_origin_group.basic", "records.0.private", "false"),
resource.TestCheckResourceAttrSet("tencentcloud_teo_origin_group.basic", "records.0.type"),
resource.TestCheckResourceAttrSet("tencentcloud_teo_origin_group.basic", "records.0.weight"),
resource.TestCheckResourceAttrSet("tencentcloud_teo_origin_group.basic", "records.0.private"),
resource.TestCheckResourceAttrSet("tencentcloud_teo_origin_group.basic", "records.1.record"),
resource.TestCheckResourceAttrSet("tencentcloud_teo_origin_group.basic", "records.1.type"),
resource.TestCheckResourceAttrSet("tencentcloud_teo_origin_group.basic", "records.1.weight"),
resource.TestCheckResourceAttrSet("tencentcloud_teo_origin_group.basic", "records.1.private"),
resource.TestCheckResourceAttrSet("tencentcloud_teo_origin_group.basic", "records.2.record"),
resource.TestCheckResourceAttrSet("tencentcloud_teo_origin_group.basic", "records.2.type"),
resource.TestCheckResourceAttrSet("tencentcloud_teo_origin_group.basic", "records.2.weight"),
resource.TestCheckResourceAttrSet("tencentcloud_teo_origin_group.basic", "records.2.private"),
),
},
{
Expand Down Expand Up @@ -127,6 +135,18 @@ resource "tencentcloud_teo_origin_group" "basic" {
weight = 100
private = false
}
records {
private = false
record = "21.1.1.1"
type = "IP_DOMAIN"
weight = 100
}
records {
private = false
record = "21.1.1.2"
type = "IP_DOMAIN"
weight = 11
}
}

`
Expand Down
2 changes: 1 addition & 1 deletion tencentcloud/services/teo/service_tencentcloud_teo.go
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ func (me *TeoService) DescribeTeoOriginGroupById(ctx context.Context, originGrou
request := teo.NewDescribeOriginGroupRequest()
advancedFilter := &teo.AdvancedFilter{
Name: helper.String("origin-group-id"),
Values: []*string{&originGroupId},
Values: []*string{helper.String(originGroupId)},
}
request.Filters = append(request.Filters, advancedFilter)

Expand Down
2 changes: 1 addition & 1 deletion website/docs/r/teo_origin_group.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ resource "tencentcloud_teo_origin_group" "basic" {

The following arguments are supported:

* `records` - (Required, List) Origin site records.
* `records` - (Required, Set) Origin site records.
* `type` - (Required, String) Type of the origin site. Valid values:
- `GENERAL`: Universal origin site group, only supports adding IP/domain name origin sites, which can be referenced by domain name service, rule engine, four-layer proxy, general load balancing, and HTTP-specific load balancing.
- `HTTP`: The HTTP-specific origin site group, supports adding IP/domain name and object storage origin site as the origin site, it cannot be referenced by the four-layer proxy, it can only be added to the acceleration domain name, rule engine-modify origin site, and HTTP-specific load balancing reference.
Expand Down
Loading