Skip to content

Commit b21571a

Browse files
committed
Merge branch 'feat/teo-function' of github.com:tencentcloudstack/terraform-provider-tencentcloud into feat/teo-function
2 parents 6bb14d1 + a51ca16 commit b21571a

5 files changed

+50
-23
lines changed

tencentcloud/provider.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"strings"
1313

1414
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
15+
"github.com/mitchellh/go-homedir"
1516
sdkcommon "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common"
1617
commonJson "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/json"
1718
sdksts "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sts/v20180813"

tencentcloud/services/teo/resource_tc_teo_function_rule_priority.go

Lines changed: 15 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tencentcloud/services/teo/resource_tc_teo_function_rule_priority.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ Example Usage
44

55
```hcl
66
resource "tencentcloud_teo_function_rule_priority" "teo_function_rule_priority" {
7+
function_id = "ef-txx7fnua"
8+
rule_ids = [
9+
"rule-equpbht3",
10+
"rule-ax28n3g6",
11+
]
12+
zone_id = "zone-2qtuhspy7cr6"
713
}
814
```
915

@@ -12,5 +18,5 @@ Import
1218
teo teo_function_rule_priority can be imported using the id, e.g.
1319

1420
```
15-
terraform import tencentcloud_teo_function_rule_priority.teo_function_rule_priority teo_function_rule_priority_id
21+
terraform import tencentcloud_teo_function_rule_priority.teo_function_rule_priority zone_id#function_id
1622
```

tencentcloud/services/teo/resource_tc_teo_function_rule_priority_extension.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ func resourceTencentCloudTeoFunctionRulePriorityReadPreHandleResponse0(ctx conte
1212

1313
rulesList := []string{}
1414
if resp.FunctionRules != nil {
15-
for _, functionRules := range respData.FunctionRules {
15+
for _, functionRules := range resp.FunctionRules {
1616
if functionRules.RuleId != nil {
17-
rulesList = append(rulesList, functionRules.RuleId)
17+
rulesList = append(rulesList, *functionRules.RuleId)
1818
}
1919
}
2020

2121
_ = d.Set("rule_ids", rulesList)
2222
}
23+
24+
return nil
2325
}
Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package teo
1+
package teo_test
22

33
import (
44
"testing"
@@ -15,19 +15,33 @@ func TestAccTencentCloudTeoFunctionRulePriorityResource_basic(t *testing.T) {
1515
tcacctest.AccPreCheck(t)
1616
},
1717
Providers: tcacctest.AccProviders,
18-
Steps: []resource.TestStep{{
19-
Config: testAccTeoFunctionRulePriority,
20-
Check: resource.ComposeTestCheckFunc(resource.TestCheckResourceAttrSet("tencentcloud_teo_function_rule_priority.teo_function_rule_priority", "id")),
21-
}, {
22-
ResourceName: "tencentcloud_teo_function_rule_priority.teo_function_rule_priority",
23-
ImportState: true,
24-
ImportStateVerify: true,
25-
}},
18+
Steps: []resource.TestStep{
19+
{
20+
Config: testAccTeoFunctionRulePriority,
21+
Check: resource.ComposeTestCheckFunc(
22+
resource.TestCheckResourceAttrSet("tencentcloud_teo_function_rule_priority.teo_function_rule_priority", "id"),
23+
resource.TestCheckResourceAttrSet("tencentcloud_teo_function_rule_priority.teo_function_rule_priority", "function_id"),
24+
resource.TestCheckResourceAttrSet("tencentcloud_teo_function_rule_priority.teo_function_rule_priority", "zone_id"),
25+
resource.TestCheckResourceAttr("tencentcloud_teo_function_rule_priority.teo_function_rule_priority", "rule_ids.#", "2"),
26+
),
27+
},
28+
{
29+
ResourceName: "tencentcloud_teo_function_rule_priority.teo_function_rule_priority",
30+
ImportState: true,
31+
ImportStateVerify: true,
32+
},
33+
},
2634
})
2735
}
2836

2937
const testAccTeoFunctionRulePriority = `
3038
3139
resource "tencentcloud_teo_function_rule_priority" "teo_function_rule_priority" {
40+
function_id = "ef-txx7fnua"
41+
rule_ids = [
42+
"rule-equpbht3",
43+
"rule-ax28n3g6",
44+
]
45+
zone_id = "zone-2qtuhspy7cr6"
3246
}
3347
`

0 commit comments

Comments
 (0)