aws-cdk-lib.SecretsManagerSecretOptions

interface SecretsManagerSecretOptions

LanguageType name
.NETAmazon.CDK.SecretsManagerSecretOptions
Gogithub.com/aws/aws-cdk-go/awscdk/v2#SecretsManagerSecretOptions
Javasoftware.amazon.awscdk.SecretsManagerSecretOptions
Pythonaws_cdk.SecretsManagerSecretOptions
TypeScript (source)aws-cdk-lib » SecretsManagerSecretOptions

Options for referencing a secret value from Secrets Manager.

Example

new codebuild.BitBucketSourceCredentials(this, 'CodeBuildBitBucketCreds', {
  username: SecretValue.secretsManager('my-bitbucket-creds', { jsonField: 'username' }),
  password: SecretValue.secretsManager('my-bitbucket-creds', { jsonField: 'password' }),
});

Properties

NameTypeDescription
jsonField?stringThe key of a JSON field to retrieve.
versionId?stringSpecifies the unique identifier of the version of the secret you want to use.
versionStage?stringSpecifies the secret version that you want to retrieve by the staging label attached to the version.

jsonField?

Type: string (optional, default: returns all the content stored in the Secrets Manager secret.)

The key of a JSON field to retrieve.

This can only be used if the secret stores a JSON object.


versionId?

Type: string (optional, default: AWSCURRENT)

Specifies the unique identifier of the version of the secret you want to use.

Can specify at most one of versionId and versionStage.


versionStage?

Type: string (optional, default: AWSCURRENT)

Specifies the secret version that you want to retrieve by the staging label attached to the version.

Can specify at most one of versionId and versionStage.