ALIYUN::KMS::Secret is used to create a secret and store the initial version of the secret.
Syntax
{
"Type": "ALIYUN::KMS::Secret",
"Properties": {
"VersionId": String,
"SecretName": String,
"Description": String,
"SecretDataType": String,
"SecretData": String,
"VersionStages": List,
"EncryptionKeyId": String,
"RecoveryWindowInDays": Integer,
"ForceDeleteWithoutRecovery": Boolean,
"SecretType": String,
"EnableAutomaticRotation": Boolean,
"RotationInterval": String,
"ExtendedConfig": Map,
"DKMSInstanceId": String,
"Policy": Map,
"Tags": List
}
}Properties
Property Name | Type | Required | Enable updates | Description | Constraint |
VersionId | String | Yes | Yes | The initial version number. | Version numbers are unique in each secret. |
SecretName | String | Yes | No | The name of the secret. | None. |
Description | String | No | Yes | Description of the credential. | None. |
SecretDataType | String | No | No | The type of the secret value. | Valid values:
|
SecretData | String | Yes | Yes | The value of the secret that you want to create. Secrets Manager encrypts the secret value and stores the encrypted value in the initial version. | None. |
VersionStages | List | No | Yes | Mark indicating the version status. | Default value: ACSCurrent. You can specify up to seven labels. |
EncryptionKeyId | String | No | No | The ID of the customer master key (CMK) that is used to encrypt the secret value. | If you leave this property empty, Secrets Manager uses a CMK that is created by Key Management Service (KMS) to encrypt and protect the secret value. Note The CMK must be a symmetric key. |
RecoveryWindowInDays | Integer | No | Yes | You can schedule a credential for deletion and specify a recovery window. | Default value: 30. Unit: day. |
ForceDeleteWithoutRecovery | Boolean | No | Yes | Specifies whether to forcefully delete the secret. A forcefully deleted secret cannot be recovered. | Valid values:
|
SecretType | String | No | No | The type of the secret. | Valid values:
|
EnableAutomaticRotation | Boolean | No | No | Specifies whether to enable automatic key rotation. | Valid values:
|
RotationInterval | String | No | No | The interval of automatic key rotation. | The format is Note This property is returned if automatic key rotation is enabled. |
ExtendedConfig | Map | No | No | Advanced credential configuration. | None. |
Policy | Map | No | No | The key policy. | The value must be in JSON format and have a maximum length of 32,768 bytes. For more information about key policies, see Key policy overview. If you do not specify this parameter, the default credential policy is used. A key policy includes the following parts:
The key policy format is: |
Tags | List | No | Yes | The tags. | The maximum number of tags is 20. For more information, see the Tags properties section. |
DKMSInstanceId | String | No | No | The ID of the dedicated KMS instance. | None. |
Tags syntax
"Tags": [
{
"Key": String,
"Value": String
}
] Tags properties
Property Name | Type | Required | Allow Updates | Description | Constraint |
Key | String | Yes | No | The tag key. | The tag key must be 1 to 128 characters in length. It cannot start with |
Value | String | No | No | The tag value. | The tag value can be 0 to 128 characters in length. It cannot start with |
Return values
Fn::GetAtt
SecretName: the name of the secret.
Arn: the Alibaba Cloud Resource Name (ARN) of the secret.
Examples
ROSTemplateFormatVersion: '2015-09-01'
Parameters: {}
Resources:
Secret:
Type: ALIYUN::KMS::Secret
Properties:
VersionId: v1
SecretName: TestSecret
SecretData: DemoSecretData
ForceDeleteWithoutRecovery: false
Outputs: {}{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
},
"Resources": {
"Secret": {
"Type": "ALIYUN::KMS::Secret",
"Properties": {
"VersionId": "v1",
"SecretName": "TestSecret",
"SecretData": "DemoSecretData",
"ForceDeleteWithoutRecovery": false
}
}
},
"Outputs": {
}
}