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
3 changes: 3 additions & 0 deletions .changelog/3490.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/tencentcloud_ckafka_acl: optmize the value of principal
```
2 changes: 1 addition & 1 deletion tencentcloud/services/ckafka/resource_tc_ckafka_acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func resourceTencentCloudCkafkaAclRead(d *schema.ResourceData, meta interface{})
_ = d.Set("operation_type", CKAFKA_ACL_OPERATION_TO_STRING[*info.Operation])
_ = d.Set("permission_type", CKAFKA_PERMISSION_TYPE_TO_STRING[*info.PermissionType])
_ = d.Set("host", info.Host)
_ = d.Set("principal", strings.TrimLeft(*info.Principal, CKAFKA_ACL_PRINCIPAL_STR))
_ = d.Set("principal", strings.TrimPrefix(*info.Principal, CKAFKA_ACL_PRINCIPAL_STR))

return nil
}
Expand Down
20 changes: 13 additions & 7 deletions tencentcloud/services/ckafka/resource_tc_ckafka_acl.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,27 @@ Example Usage
Ckafka Acl

```hcl
resource "tencentcloud_ckafka_acl" "foo" {
instance_id = "ckafka-f9ife4zz"
resource "tencentcloud_ckafka_user" "example" {
instance_id = "ckafka-7k5nbnem"
account_name = "tf-example"
password = "Password@123"
}

resource "tencentcloud_ckafka_acl" "example" {
instance_id = "ckafka-7k5nbnem"
resource_type = "TOPIC"
resource_name = "topic-tf-test"
resource_name = "tf-example-resource"
operation_type = "WRITE"
permission_type = "ALLOW"
host = "*"
principal = tencentcloud_ckafka_user.foo.account_name
principal = tencentcloud_ckafka_user.example.account_name
}
```

Import

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

```
$ terraform import tencentcloud_ckafka_acl.foo ckafka-f9ife4zz#ALLOW#test#*#WRITE#TOPIC#topic-tf-test
```
$ terraform import tencentcloud_ckafka_acl.example ckafka-7k5nbnem#ALLOW#tf-example#*#WRITE#TOPIC#tf-example-resource
```
18 changes: 12 additions & 6 deletions website/docs/r/ckafka_acl.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,20 @@ Provides a resource to create a Ckafka Acl.
### Ckafka Acl

```hcl
resource "tencentcloud_ckafka_acl" "foo" {
instance_id = "ckafka-f9ife4zz"
resource "tencentcloud_ckafka_user" "example" {
instance_id = "ckafka-7k5nbnem"
account_name = "tf-example"
password = "Password@123"
}

resource "tencentcloud_ckafka_acl" "example" {
instance_id = "ckafka-7k5nbnem"
resource_type = "TOPIC"
resource_name = "topic-tf-test"
resource_name = "tf-example-resource"
operation_type = "WRITE"
permission_type = "ALLOW"
host = "*"
principal = tencentcloud_ckafka_user.foo.account_name
principal = tencentcloud_ckafka_user.example.account_name
}
```

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

## Import

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

```
$ terraform import tencentcloud_ckafka_acl.foo ckafka-f9ife4zz#ALLOW#test#*#WRITE#TOPIC#topic-tf-test
$ terraform import tencentcloud_ckafka_acl.example ckafka-7k5nbnem#ALLOW#tf-example#*#WRITE#TOPIC#tf-example-resource
```

Loading