Skip to content

fix(kms): [121454161] tencentcloud_kms_key support check pending_delete_window_in_days params #3047

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 31, 2024
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/3047.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
resource/tencentcloud_kms_key: support check `pending_delete_window_in_days` params
```
9 changes: 5 additions & 4 deletions tencentcloud/services/kms/resource_tc_kms_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ func TencentKmsBasicInfo() map[string]*schema.Schema {
Description: "Specify whether to archive key. Default value is `false`. This field is conflict with `is_enabled`, valid when key_state is `Enabled`, `Disabled`, `Archived`.",
},
"pending_delete_window_in_days": {
Type: schema.TypeInt,
Optional: true,
Default: 7,
Description: "Duration in days after which the key is deleted after destruction of the resource, must be between 7 and 30 days. Defaults to 7 days.",
Type: schema.TypeInt,
Optional: true,
Default: 7,
ValidateFunc: tccommon.ValidateIntegerInRange(7, 30),
Description: "Duration in days after which the key is deleted after destruction of the resource, must be between 7 and 30 days. Defaults to 7 days.",
},
"tags": {
Type: schema.TypeMap,
Expand Down
19 changes: 10 additions & 9 deletions tencentcloud/services/kms/resource_tc_kms_key.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,22 @@ Create and enable a instance.

```hcl
resource "tencentcloud_kms_key" "example" {
alias = "tf-example-kms-key"
description = "example of kms key"
key_rotation_enabled = false
is_enabled = true
alias = "tf-example-kms-key"
description = "example of kms key"
key_rotation_enabled = false
is_enabled = true
pending_delete_window_in_days = 7

tags = {
"createdBy" = "terraform"
createdBy = "Terraform"
}
}
```

Specify the Key Usage as an asymmetry method.

```hcl
resource "tencentcloud_kms_key" "example2" {
resource "tencentcloud_kms_key" "example" {
alias = "tf-example-kms-key"
description = "example of kms key"
key_usage = "ASYMMETRIC_DECRYPT_RSA_2048"
Expand All @@ -31,14 +32,14 @@ resource "tencentcloud_kms_key" "example2" {
Disable the kms key instance.

```hcl
resource "tencentcloud_kms_key" "example3" {
resource "tencentcloud_kms_key" "example" {
alias = "tf-example-kms-key"
description = "example of kms key"
key_rotation_enabled = false
is_enabled = false

tags = {
"test-tag" = "unit-test"
createdBy = "Terraform"
}
}
```
Expand All @@ -48,5 +49,5 @@ Import
KMS keys can be imported using the id, e.g.

```
$ terraform import tencentcloud_kms_key.foo 287e8f40-7cbb-11eb-9a3a-5254004f7f94
$ terraform import tencentcloud_kms_key.example 287e8f40-7cbb-11eb-9a3a-5254004f7f94
```
19 changes: 10 additions & 9 deletions website/docs/r/kms_key.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,22 @@ Provide a resource to create a KMS key.

```hcl
resource "tencentcloud_kms_key" "example" {
alias = "tf-example-kms-key"
description = "example of kms key"
key_rotation_enabled = false
is_enabled = true
alias = "tf-example-kms-key"
description = "example of kms key"
key_rotation_enabled = false
is_enabled = true
pending_delete_window_in_days = 7

tags = {
"createdBy" = "terraform"
createdBy = "Terraform"
}
}
```

### Specify the Key Usage as an asymmetry method.

```hcl
resource "tencentcloud_kms_key" "example2" {
resource "tencentcloud_kms_key" "example" {
alias = "tf-example-kms-key"
description = "example of kms key"
key_usage = "ASYMMETRIC_DECRYPT_RSA_2048"
Expand All @@ -42,14 +43,14 @@ resource "tencentcloud_kms_key" "example2" {
### Disable the kms key instance.

```hcl
resource "tencentcloud_kms_key" "example3" {
resource "tencentcloud_kms_key" "example" {
alias = "tf-example-kms-key"
description = "example of kms key"
key_rotation_enabled = false
is_enabled = false

tags = {
"test-tag" = "unit-test"
createdBy = "Terraform"
}
}
```
Expand Down Expand Up @@ -80,6 +81,6 @@ In addition to all arguments above, the following attributes are exported:
KMS keys can be imported using the id, e.g.

```
$ terraform import tencentcloud_kms_key.foo 287e8f40-7cbb-11eb-9a3a-5254004f7f94
$ terraform import tencentcloud_kms_key.example 287e8f40-7cbb-11eb-9a3a-5254004f7f94
```

Loading