Table of Contents

Interface ISecretAttributes

Namespace
Amazon.CDK.AWS.SecretsManager
Assembly
Amazon.CDK.AWS.SecretsManager.dll

Attributes required to import an existing secret into the Stack.

public interface ISecretAttributes

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

Properties

EncryptionKey

The encryption key that is used to encrypt the secret, unless the default SecretsManager key is used.

IKey? EncryptionKey { get; }

Property Value

IKey

SecretArn

(deprecated) The ARN of the secret in SecretsManager.

[Obsolete("use `secretCompleteArn` or `secretPartialArn` instead.")]
string? SecretArn { get; }

Property Value

string

Remarks

Cannot be used with secretCompleteArn or secretPartialArn.

Stability: Deprecated

SecretCompleteArn

The complete ARN of the secret in SecretsManager.

string? SecretCompleteArn { get; }

Property Value

string

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.

string? SecretPartialArn { get; }

Property Value

string

Remarks

This is the ARN without the Secrets Manager 6-character suffix. Cannot be used with secretArn or secretCompleteArn.