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
10 changes: 5 additions & 5 deletions tencentcloud/data_source_tc_kms_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ Use this data source to query detailed information of KMS key
Example Usage

```hcl
data "tencentcloud_kms_keys" "foo" {
search_key_alias = "test"
key_state = 0
origin = "TENCENT_KMS"
key_usage = "ALL"
data "tencentcloud_kms_keys" "example" {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changelog加一下

search_key_alias = "tf_example"
key_state = 0
origin = "TENCENT_KMS"
key_usage = "ALL"
}
```
*/
Expand Down
4 changes: 2 additions & 2 deletions tencentcloud/resource_tc_kms_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ func resourceTencentCloudKmsKeyCreate(d *schema.ResourceData, meta interface{})
return outErr
}

d.SetId(keyId)

if isEnabled := d.Get("is_enabled").(bool); !isEnabled {
err := resource.Retry(writeRetryTimeout, func() *resource.RetryError {
e := kmsService.DisableKey(ctx, d.Id())
Expand Down Expand Up @@ -247,9 +249,7 @@ func resourceTencentCloudKmsKeyCreate(d *schema.ResourceData, meta interface{})
}
}

d.SetId(keyId)
return resourceTencentCloudKmsKeyRead(d, meta)

}

func resourceTencentCloudKmsKeyRead(d *schema.ResourceData, meta interface{}) error {
Expand Down
4 changes: 2 additions & 2 deletions website/docs/d/kms_keys.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Use this data source to query detailed information of KMS key
## Example Usage

```hcl
data "tencentcloud_kms_keys" "foo" {
search_key_alias = "test"
data "tencentcloud_kms_keys" "example" {
search_key_alias = "tf_example"
key_state = 0
origin = "TENCENT_KMS"
key_usage = "ALL"
Expand Down