Modifier and Type | Method and Description |
---|---|
Secret |
build() |
static Secret.Builder |
create(software.constructs.Construct scope,
java.lang.String id) |
Secret.Builder |
description(java.lang.String description)
An optional, human-friendly description of the secret.
|
Secret.Builder |
encryptionKey(IKey encryptionKey)
The customer-managed encryption key to use for encrypting the secret value.
|
Secret.Builder |
generateSecretString(SecretStringGenerator generateSecretString)
Configuration for how to generate a secret value.
|
Secret.Builder |
removalPolicy(RemovalPolicy removalPolicy)
Policy to apply when the secret is removed from this stack.
|
Secret.Builder |
replicaRegions(java.util.List<? extends ReplicaRegion> replicaRegions)
A list of regions where to replicate this secret.
|
Secret.Builder |
secretName(java.lang.String secretName)
A name for the secret.
|
Secret.Builder |
secretStringBeta1(SecretStringValueBeta1 secretStringBeta1)
Deprecated.
Use `secretStringValue` instead.
|
Secret.Builder |
secretStringValue(SecretValue secretStringValue)
Initial value for the secret.
|
public static Secret.Builder create(software.constructs.Construct scope, java.lang.String id)
scope
- This parameter is required.id
- This parameter is required.Secret.Builder
.public Secret.Builder description(java.lang.String description)
Default: - No description.
description
- An optional, human-friendly description of the secret. This parameter is required.this
public Secret.Builder encryptionKey(IKey encryptionKey)
Default: - A default KMS key for the account and region is used.
encryptionKey
- The customer-managed encryption key to use for encrypting the secret value. This parameter is required.this
public Secret.Builder generateSecretString(SecretStringGenerator generateSecretString)
Only one of secretString
and generateSecretString
can be provided.
Default: - 32 characters with upper-case letters, lower-case letters, punctuation and numbers (at least one from each category), per the default values of ``SecretStringGenerator``.
generateSecretString
- Configuration for how to generate a secret value. This parameter is required.this
public Secret.Builder removalPolicy(RemovalPolicy removalPolicy)
Default: - Not set.
removalPolicy
- Policy to apply when the secret is removed from this stack. This parameter is required.this
public Secret.Builder replicaRegions(java.util.List<? extends ReplicaRegion> replicaRegions)
Default: - Secret is not replicated
replicaRegions
- A list of regions where to replicate this secret. This parameter is required.this
public Secret.Builder secretName(java.lang.String secretName)
Note that deleting secrets from SecretsManager does not happen immediately, but after a 7 to 30 days blackout period. During that period, it is not possible to create another secret that shares the same name.
Default: - A name is generated by CloudFormation.
secretName
- A name for the secret. This parameter is required.this
@Deprecated public Secret.Builder secretStringBeta1(SecretStringValueBeta1 secretStringBeta1)
NOTE: *It is highly encouraged to leave this field undefined and allow SecretsManager to create the secret value. The secret string -- if provided -- will be included in the output of the cdk as part of synthesis, and will appear in the CloudFormation template in the console. This can be secure(-ish) if that value is merely reference to another resource (or one of its attributes), but if the value is a plaintext string, it will be visible to anyone with access to the CloudFormation template (via the AWS Console, SDKs, or CLI).
Specifies text data that you want to encrypt and store in this new version of the secret. May be a simple string value, or a string representation of a JSON structure.
Only one of secretStringBeta1
, secretStringValue
, and generateSecretString
can be provided.
Default: - SecretsManager generates a new secret value.
secretStringBeta1
- Initial value for the secret. This parameter is required.this
public Secret.Builder secretStringValue(SecretValue secretStringValue)
NOTE: *It is highly encouraged to leave this field undefined and allow SecretsManager to create the secret value. The secret string -- if provided -- will be included in the output of the cdk as part of synthesis, and will appear in the CloudFormation template in the console. This can be secure(-ish) if that value is merely reference to another resource (or one of its attributes), but if the value is a plaintext string, it will be visible to anyone with access to the CloudFormation template (via the AWS Console, SDKs, or CLI).
Specifies text data that you want to encrypt and store in this new version of the secret. May be a simple string value, or a string representation of a JSON structure.
Only one of secretStringBeta1
, secretStringValue
, and generateSecretString
can be provided.
Default: - SecretsManager generates a new secret value.
secretStringValue
- Initial value for the secret. This parameter is required.this
public Secret build()