Skip to content

Commit 7b9348d

Browse files
authored
fix(ckafka): [126837459] tencentcloud_ckafka_acl optmize the value of principal (#3490)
* add * add
1 parent 9cef726 commit 7b9348d

File tree

4 files changed

+29
-14
lines changed

4 files changed

+29
-14
lines changed

.changelog/3490.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
resource/tencentcloud_ckafka_acl: optmize the value of principal
3+
```

tencentcloud/services/ckafka/resource_tc_ckafka_acl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func resourceTencentCloudCkafkaAclRead(d *schema.ResourceData, meta interface{})
121121
_ = d.Set("operation_type", CKAFKA_ACL_OPERATION_TO_STRING[*info.Operation])
122122
_ = d.Set("permission_type", CKAFKA_PERMISSION_TYPE_TO_STRING[*info.PermissionType])
123123
_ = d.Set("host", info.Host)
124-
_ = d.Set("principal", strings.TrimLeft(*info.Principal, CKAFKA_ACL_PRINCIPAL_STR))
124+
_ = d.Set("principal", strings.TrimPrefix(*info.Principal, CKAFKA_ACL_PRINCIPAL_STR))
125125

126126
return nil
127127
}

tencentcloud/services/ckafka/resource_tc_ckafka_acl.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,27 @@ Example Usage
55
Ckafka Acl
66

77
```hcl
8-
resource "tencentcloud_ckafka_acl" "foo" {
9-
instance_id = "ckafka-f9ife4zz"
8+
resource "tencentcloud_ckafka_user" "example" {
9+
instance_id = "ckafka-7k5nbnem"
10+
account_name = "tf-example"
11+
password = "Password@123"
12+
}
13+
14+
resource "tencentcloud_ckafka_acl" "example" {
15+
instance_id = "ckafka-7k5nbnem"
1016
resource_type = "TOPIC"
11-
resource_name = "topic-tf-test"
17+
resource_name = "tf-example-resource"
1218
operation_type = "WRITE"
1319
permission_type = "ALLOW"
1420
host = "*"
15-
principal = tencentcloud_ckafka_user.foo.account_name
21+
principal = tencentcloud_ckafka_user.example.account_name
1622
}
1723
```
1824

1925
Import
2026

21-
Ckafka acl can be imported using the instance_id#permission_type#principal#host#operation_type#resource_type#resource_name, e.g.
27+
Ckafka Acl can be imported using the instance_id#permission_type#principal#host#operation_type#resource_type#resource_name, e.g.
2228

2329
```
24-
$ terraform import tencentcloud_ckafka_acl.foo ckafka-f9ife4zz#ALLOW#test#*#WRITE#TOPIC#topic-tf-test
25-
```
30+
$ terraform import tencentcloud_ckafka_acl.example ckafka-7k5nbnem#ALLOW#tf-example#*#WRITE#TOPIC#tf-example-resource
31+
```

website/docs/r/ckafka_acl.html.markdown

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,20 @@ Provides a resource to create a Ckafka Acl.
1616
### Ckafka Acl
1717

1818
```hcl
19-
resource "tencentcloud_ckafka_acl" "foo" {
20-
instance_id = "ckafka-f9ife4zz"
19+
resource "tencentcloud_ckafka_user" "example" {
20+
instance_id = "ckafka-7k5nbnem"
21+
account_name = "tf-example"
22+
password = "Password@123"
23+
}
24+
25+
resource "tencentcloud_ckafka_acl" "example" {
26+
instance_id = "ckafka-7k5nbnem"
2127
resource_type = "TOPIC"
22-
resource_name = "topic-tf-test"
28+
resource_name = "tf-example-resource"
2329
operation_type = "WRITE"
2430
permission_type = "ALLOW"
2531
host = "*"
26-
principal = tencentcloud_ckafka_user.foo.account_name
32+
principal = tencentcloud_ckafka_user.example.account_name
2733
}
2834
```
2935

@@ -49,9 +55,9 @@ In addition to all arguments above, the following attributes are exported:
4955

5056
## Import
5157

52-
Ckafka acl can be imported using the instance_id#permission_type#principal#host#operation_type#resource_type#resource_name, e.g.
58+
Ckafka Acl can be imported using the instance_id#permission_type#principal#host#operation_type#resource_type#resource_name, e.g.
5359

5460
```
55-
$ terraform import tencentcloud_ckafka_acl.foo ckafka-f9ife4zz#ALLOW#test#*#WRITE#TOPIC#topic-tf-test
61+
$ terraform import tencentcloud_ckafka_acl.example ckafka-7k5nbnem#ALLOW#tf-example#*#WRITE#TOPIC#tf-example-resource
5662
```
5763

0 commit comments

Comments
 (0)