Skip to content

Commit

Permalink
fix(kms): [121454161] tencentcloud_kms_key support check `pending_d…
Browse files Browse the repository at this point in the history
…elete_window_in_days` params (#3047)

* add

* add
  • Loading branch information
SevenEarth authored Dec 31, 2024
1 parent 3d8c5c5 commit 608cf55
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 22 deletions.
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
```

0 comments on commit 608cf55

Please sign in to comment.