Class SecretAttributes
- Namespace
- Amazon.CDK.AWS.SecretsManager
- Assembly
- Amazon.CDK.AWS.SecretsManager.dll
Attributes required to import an existing secret into the Stack.
public class SecretAttributes : ISecretAttributes
- Inheritance
-
SecretAttributes
- Implements
- Inherited Members
Examples
Key encryptionKey;
var secret = Secret.FromSecretAttributes(this, "ImportedSecret", new SecretAttributes {
SecretArn = "arn:aws:secretsmanager:<region>:<account-id-number>:secret:<secret-name>-<random-6-characters>",
// If the secret is encrypted using a KMS-hosted CMK, either import or reference that key:
EncryptionKey = encryptionKey
});
Remarks
One ARN format (secretArn, secretCompleteArn, secretPartialArn) must be provided.
ExampleMetadata: infused
Constructors
SecretAttributes()
public SecretAttributes()
Properties
EncryptionKey
The encryption key that is used to encrypt the secret, unless the default SecretsManager key is used.
public IKey? EncryptionKey { get; set; }
Property Value
- IKey
SecretArn
(deprecated) The ARN of the secret in SecretsManager.
[Obsolete("use `secretCompleteArn` or `secretPartialArn` instead.")]
public string? SecretArn { get; set; }
Property Value
Remarks
Cannot be used with secretCompleteArn or secretPartialArn.
Stability: Deprecated
SecretCompleteArn
The complete ARN of the secret in SecretsManager.
public string? SecretCompleteArn { get; set; }
Property Value
Remarks
This is the ARN including the Secrets Manager 6-character suffix.
Cannot be used with secretArn or secretPartialArn.
SecretPartialArn
The partial ARN of the secret in SecretsManager.
public string? SecretPartialArn { get; set; }
Property Value
Remarks
This is the ARN without the Secrets Manager 6-character suffix.
Cannot be used with secretArn or secretCompleteArn.