Skip to content
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
2 changes: 1 addition & 1 deletion tencentcloud/resource_tc_address_template_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Example Usage
```hcl
resource "tencentcloud_address_template_group" "foo" {
name = "group-test"
addresses = ["ipl-axaf24151","ipl-axaf24152"]
template_ids = ["ipl-axaf24151","ipl-axaf24152"]
}
```

Expand Down
68 changes: 51 additions & 17 deletions tencentcloud/resource_tc_clb_listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,11 +526,17 @@ func resourceTencentCloudClbListenerRead(d *schema.ResourceData, meta interface{

_ = d.Set("clb_id", clbId)
_ = d.Set("listener_id", instance.ListenerId)
_ = d.Set("listener_name", instance.ListenerName)
_ = d.Set("target_type", instance.TargetType)
_ = d.Set("port", instance.Port)
_ = d.Set("protocol", instance.Protocol)
_ = d.Set("session_expire_time", instance.SessionExpireTime)
if instance.ListenerName != nil {
_ = d.Set("listener_name", instance.ListenerName)
}
if instance.TargetType != nil {
_ = d.Set("target_type", instance.TargetType)
}
if instance.SessionExpireTime != nil {
_ = d.Set("session_expire_time", instance.SessionExpireTime)
}
if *instance.Protocol == CLB_LISTENER_PROTOCOL_TCP || *instance.Protocol == CLB_LISTENER_PROTOCOL_TCPSSL || *instance.Protocol == CLB_LISTENER_PROTOCOL_UDP {
_ = d.Set("scheduler", instance.Scheduler)
}
Expand All @@ -543,20 +549,48 @@ func resourceTencentCloudClbListenerRead(d *schema.ResourceData, meta interface{
healthCheckSwitch = true
}
_ = d.Set("health_check_switch", healthCheckSwitch)
_ = d.Set("health_check_interval_time", instance.HealthCheck.IntervalTime)
_ = d.Set("health_check_time_out", instance.HealthCheck.TimeOut)
_ = d.Set("health_check_health_num", instance.HealthCheck.HealthNum)
_ = d.Set("health_check_unhealth_num", instance.HealthCheck.UnHealthNum)
_ = d.Set("health_check_port", instance.HealthCheck.CheckPort)
_ = d.Set("health_check_type", instance.HealthCheck.CheckType)
_ = d.Set("health_check_http_code", instance.HealthCheck.HttpCode)
_ = d.Set("health_check_http_path", instance.HealthCheck.HttpCheckPath)
_ = d.Set("health_check_http_domain", instance.HealthCheck.HttpCheckDomain)
_ = d.Set("health_check_http_method", instance.HealthCheck.HttpCheckMethod)
_ = d.Set("health_check_http_version", instance.HealthCheck.HttpVersion)
_ = d.Set("health_check_context_type", instance.HealthCheck.ContextType)
_ = d.Set("health_check_send_context", instance.HealthCheck.SendContext)
_ = d.Set("health_check_recv_context", instance.HealthCheck.RecvContext)
if instance.HealthCheck.IntervalTime != nil {
_ = d.Set("health_check_interval_time", instance.HealthCheck.IntervalTime)
}
if instance.HealthCheck.TimeOut != nil {
_ = d.Set("health_check_time_out", instance.HealthCheck.TimeOut)
}
if instance.HealthCheck.HealthNum != nil {
_ = d.Set("health_check_health_num", instance.HealthCheck.HealthNum)
}
if instance.HealthCheck.UnHealthNum != nil {
_ = d.Set("health_check_unhealth_num", instance.HealthCheck.UnHealthNum)
}
if instance.HealthCheck.CheckPort != nil {
_ = d.Set("health_check_port", instance.HealthCheck.CheckPort)
}
if instance.HealthCheck.CheckType != nil {
_ = d.Set("health_check_type", instance.HealthCheck.CheckType)
}
if instance.HealthCheck.HttpCode != nil {
_ = d.Set("health_check_http_code", instance.HealthCheck.HttpCode)
}
if instance.HealthCheck.HttpCheckPath != nil {
_ = d.Set("health_check_http_path", instance.HealthCheck.HttpCheckPath)
}
if instance.HealthCheck.HttpCheckDomain != nil {
_ = d.Set("health_check_http_domain", instance.HealthCheck.HttpCheckDomain)
}
if instance.HealthCheck.HttpCheckMethod != nil {
_ = d.Set("health_check_http_method", instance.HealthCheck.HttpCheckMethod)
}
if instance.HealthCheck.HttpVersion != nil {
_ = d.Set("health_check_http_version", instance.HealthCheck.HttpVersion)
}
if instance.HealthCheck.ContextType != nil {
_ = d.Set("health_check_context_type", instance.HealthCheck.ContextType)
}
if instance.HealthCheck.SendContext != nil {
_ = d.Set("health_check_send_context", instance.HealthCheck.SendContext)
}
if instance.HealthCheck.RecvContext != nil {
_ = d.Set("health_check_recv_context", instance.HealthCheck.RecvContext)
}
}

if instance.Certificate != nil {
Expand Down
3 changes: 1 addition & 2 deletions tencentcloud/resource_tc_kubernetes_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -2025,14 +2025,13 @@ func resourceTencentCloudTkeClusterCreate(d *schema.ResourceData, meta interface
name := dMap["name"].(string)
param := dMap["param"].(string)
addon := &tke.ExtensionAddon{
AddonName: helper.String(name),
AddonName: helper.String(name),
AddonParam: helper.String(param),
}
extensionAddons = append(extensionAddons, addon)
}
}


service := TkeService{client: meta.(*TencentCloudClient).apiV3Conn}
id, err := service.CreateCluster(ctx, basic, advanced, cvms, iAdvanced, cidrSet, tags, existInstances, &overrideSettings, iDiskMountSettings, extensionAddons)
if err != nil {
Expand Down
7 changes: 5 additions & 2 deletions tencentcloud/resource_tc_security_group_lite_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ resource "tencentcloud_security_group_lite_rule" "foo" {
"ACCEPT#192.168.1.0/24#80#TCP",
"DROP#8.8.8.8#80,90#UDP",
"ACCEPT#0.0.0.0/0#80-90#TCP",
"ACCEPT#sg-7ixn3foj/0#80-90#TCP",
"ACCEPT#ipm-epjq5kn0/0#80-90#TCP",
"ACCEPT#ipmg-3loavam6/0#80-90#TCP",
]

egress = [
Expand Down Expand Up @@ -65,13 +68,13 @@ func resourceTencentCloudSecurityGroupLiteRule() *schema.Resource {
Type: schema.TypeList,
Optional: true,
Elem: &schema.Schema{Type: schema.TypeString},
Description: "Ingress rules set. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is `ACCEPT` and `DROP`. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is `80`, `80,443`, `80-90` or `ALL`. The available value of 'protocol' is `TCP`, `UDP`, `ICMP` and `ALL`. When 'protocol' is `ICMP` or `ALL`, the 'port' must be `ALL`.",
Description: "Ingress rules set. A rule must match the following format: [action]#[source]#[port]#[protocol]. The available value of 'action' is `ACCEPT` and `DROP`. The 'source' can be an IP address network, segment, security group ID and Address Template ID. The 'port' valid format is `80`, `80,443`, `80-90` or `ALL`. The available value of 'protocol' is `TCP`, `UDP`, `ICMP` and `ALL`. When 'protocol' is `ICMP` or `ALL`, the 'port' must be `ALL`.",
},
"egress": {
Type: schema.TypeList,
Optional: true,
Elem: &schema.Schema{Type: schema.TypeString},
Description: "Egress rules set. A rule must match the following format: [action]#[cidr_ip]#[port]#[protocol]. The available value of 'action' is `ACCEPT` and `DROP`. The 'cidr_ip' must be an IP address network or segment. The 'port' valid format is `80`, `80,443`, `80-90` or `ALL`. The available value of 'protocol' is `TCP`, `UDP`, `ICMP` and `ALL`. When 'protocol' is `ICMP` or `ALL`, the 'port' must be `ALL`.",
Description: "Egress rules set. A rule must match the following format: [action]#[source]#[port]#[protocol]. The available value of 'action' is `ACCEPT` and `DROP`. The 'source' can be an IP address network, segment, security group ID and Address Template ID. The 'port' valid format is `80`, `80,443`, `80-90` or `ALL`. The available value of 'protocol' is `TCP`, `UDP`, `ICMP` and `ALL`. When 'protocol' is `ICMP` or `ALL`, the 'port' must be `ALL`.",
},
},
}
Expand Down
55 changes: 55 additions & 0 deletions tencentcloud/resource_tc_security_group_lite_rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,22 @@ func TestAccTencentCloudSecurityGroupLiteRule_update(t *testing.T) {
resource.TestCheckResourceAttr("tencentcloud_security_group_lite_rule.foo", "egress.#", "0"),
),
},
{
Config: testAccSecurityGroupLiteRuleUpdate6,
Check: resource.ComposeTestCheckFunc(
testAccCheckSecurityGroupLiteRuleExists("tencentcloud_security_group_lite_rule.foo", &liteRuleId),
resource.TestCheckResourceAttrSet("tencentcloud_security_group_lite_rule.foo", "security_group_id"),
resource.TestCheckResourceAttr("tencentcloud_security_group_lite_rule.foo", "ingress.#", "5"),
resource.TestCheckResourceAttrSet("tencentcloud_security_group_lite_rule.foo", "ingress.0"),
resource.TestCheckResourceAttrSet("tencentcloud_security_group_lite_rule.foo", "ingress.1"),
resource.TestCheckResourceAttr("tencentcloud_security_group_lite_rule.foo", "ingress.2", "ACCEPT#0.0.0.0/0#80-90#TCP"),
resource.TestCheckResourceAttr("tencentcloud_security_group_lite_rule.foo", "ingress.3", "DROP#8.8.8.8#80,90#UDP"),
resource.TestCheckResourceAttrSet("tencentcloud_security_group_lite_rule.foo", "ingress.4"),
resource.TestCheckResourceAttr("tencentcloud_security_group_lite_rule.foo", "egress.#", "2"),
resource.TestCheckResourceAttr("tencentcloud_security_group_lite_rule.foo", "egress.0", "ACCEPT#192.168.0.0/16#ALL#TCP"),
resource.TestCheckResourceAttrSet("tencentcloud_security_group_lite_rule.foo", "egress.1"),
),
},
},
})
}
Expand Down Expand Up @@ -274,3 +290,42 @@ resource "tencentcloud_security_group_lite_rule" "foo" {
security_group_id = tencentcloud_security_group.foo.id
}
`
const testAccSecurityGroupLiteRuleUpdate6 = `
resource "tencentcloud_security_group" "foo" {
name = "ci-temp-test-sg"
}

resource "tencentcloud_security_group" "group1" {
name = "tf-test-sec"
}

resource "tencentcloud_address_template" "addr-foo" {
name = "tf-test-addr"
addresses = ["10.0.0.1", "10.0.1.0/24", "10.0.0.1-10.0.0.100"]
}

resource "tencentcloud_address_template" "addr-bar" {
name = "cam-user-test"
addresses = ["10.0.2.1", "10.0.3.0/24"]
}

resource "tencentcloud_address_template_group" "foo" {
name = "group-test"
template_ids = [tencentcloud_address_template.addr-foo.id, tencentcloud_address_template.addr-bar.id]
}

resource "tencentcloud_security_group_lite_rule" "foo" {
security_group_id = tencentcloud_security_group.foo.id
ingress = [
"ACCEPT#${tencentcloud_address_template_group.foo.id}#8080#TCP",
"DROP#${tencentcloud_address_template.addr-foo.id}#8080#TCP",
"ACCEPT#0.0.0.0/0#80-90#TCP",
"DROP#8.8.8.8#80,90#UDP",
"ACCEPT#${tencentcloud_security_group.group1.id}#80#TCP",
]
egress = [
"ACCEPT#192.168.0.0/16#ALL#TCP",
"ACCEPT#${tencentcloud_security_group.group1.id}#ALL#TCP",
]
}
`
3 changes: 1 addition & 2 deletions tencentcloud/resource_tc_tdmq_namespace_role_attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ func resourceTencentCloudTdmqNamespaceRoleAttachmentUpdate(d *schema.ResourceDat
service := TdmqService{client: meta.(*TencentCloudClient).apiV3Conn}

var (
permissions [] *string
permissions []*string
)
old, now := d.GetChange("permissions")
if d.HasChange("permissions") {
Expand Down Expand Up @@ -237,7 +237,6 @@ func resourceTencentCloudTdmqNamespaceRoleAttachmentDelete(d *schema.ResourceDat
roleName := idSplit[1]
clusterId := d.Get("cluster_id").(string)


service := TdmqService{client: meta.(*TencentCloudClient).apiV3Conn}

err := resource.Retry(writeRetryTimeout, func() *resource.RetryError {
Expand Down
8 changes: 4 additions & 4 deletions tencentcloud/resource_tc_tdmq_role.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ func resourceTencentCloudTdmqRoleCreate(d *schema.ResourceData, meta interface{}
tdmqService := TdmqService{client: meta.(*TencentCloudClient).apiV3Conn}

var (
roleName string
clusterId string
remark string
roleName string
clusterId string
remark string
)
if temp, ok := d.GetOk("role_name"); ok {
roleName = temp.(string)
Expand Down Expand Up @@ -164,7 +164,7 @@ func resourceTencentCloudTdmqRoleUpdate(d *schema.ResourceData, meta interface{}
service := TdmqService{client: meta.(*TencentCloudClient).apiV3Conn}

var (
remark string
remark string
)
old, now := d.GetChange("remark")
if d.HasChange("remark") {
Expand Down
4 changes: 2 additions & 2 deletions tencentcloud/service_tencentcloud_tdmq.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ func (me *TdmqService) DeleteTdmqTopic(ctx context.Context, environId string, to
}
}()
var (
topicRecord tdmq.TopicRecord
topicRecord tdmq.TopicRecord
)
topicRecord.TopicName = &topicName
topicRecord.EnvironmentId = &environId
Expand Down Expand Up @@ -655,4 +655,4 @@ func (me *TdmqService) DeleteTdmqNamespaceRoleAttachment(ctx context.Context, en
return err
}
return
}
}
Loading