|
| 1 | +--- |
| 2 | +subcategory: "SSM" |
| 3 | +layout: "tencentcloud" |
| 4 | +page_title: "TencentCloud: tencentcloud_ssm_secret" |
| 5 | +sidebar_current: "docs-tencentcloud-resource-ssm_secret" |
| 6 | +description: |- |
| 7 | + Provide a resource to create a SSM secret. |
| 8 | +--- |
| 9 | + |
| 10 | +# tencentcloud_ssm_secret |
| 11 | + |
| 12 | +Provide a resource to create a SSM secret. |
| 13 | + |
| 14 | +## Example Usage |
| 15 | + |
| 16 | +```hcl |
| 17 | +resource "tencentcloud_ssm_secret" "foo" { |
| 18 | + secret_name = "test" |
| 19 | + description = "test secret" |
| 20 | + recovery_window_in_days = 0 |
| 21 | + is_enabled = true |
| 22 | +
|
| 23 | + init_secret { |
| 24 | + version_id = "v1" |
| 25 | + secret_string = "123456" |
| 26 | + } |
| 27 | +
|
| 28 | + tags = { |
| 29 | + test-tag = "test" |
| 30 | + } |
| 31 | +} |
| 32 | +``` |
| 33 | + |
| 34 | +## Argument Reference |
| 35 | + |
| 36 | +The following arguments are supported: |
| 37 | + |
| 38 | +* `init_secret` - (Required) The secret of initial version. |
| 39 | +* `secret_name` - (Required, ForceNew) Name of secret which cannot be repeated in the same region. The maximum length is 128 bytes. The name can only contain English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number. |
| 40 | +* `description` - (Optional) Description of secret. The maximum is 2048 bytes. |
| 41 | +* `is_enabled` - (Optional) Specify whether to enable secret. Default value is `true`. |
| 42 | +* `kms_key_id` - (Optional, ForceNew) KMS keyId used to encrypt secret. If it is empty, it means that the CMK created by SSM for you by default is used for encryption. You can also specify the KMS CMK created by yourself in the same region for encryption. |
| 43 | +* `recovery_window_in_days` - (Optional) Specify the scheduled deletion date. Default value is `0` that means to delete immediately. 1-30 means the number of days reserved, completely deleted after this date. |
| 44 | +* `tags` - (Optional) Tags of secret. |
| 45 | + |
| 46 | +The `init_secret` object supports the following: |
| 47 | + |
| 48 | +* `version_id` - (Required) Version of secret. The maximum length is 64 bytes. The version_id can only contain English letters, numbers, underscore and hyphen '-'. The first character must be a letter or number. |
| 49 | +* `secret_binary` - (Optional) The base64-encoded binary secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes. When secret status is `Disabled`, this field will not update anymore. |
| 50 | +* `secret_string` - (Optional) The string text of secret. secret_binary and secret_string must be set only one, and the maximum support is 4096 bytes. When secret status is `Disabled`, this field will not update anymore. |
| 51 | + |
| 52 | +## Attributes Reference |
| 53 | + |
| 54 | +In addition to all arguments above, the following attributes are exported: |
| 55 | + |
| 56 | +* `id` - ID of the resource. |
| 57 | +* `status` - Status of secret. |
| 58 | + |
| 59 | + |
| 60 | +## Import |
| 61 | + |
| 62 | +SSM secret can be imported using the secretName, e.g. |
| 63 | +``` |
| 64 | +$ terraform import tencentcloud_ssm_secret.foo test |
| 65 | +``` |
| 66 | + |
0 commit comments