Interface SecretProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
SecretProps.Jsii$Proxy
Example:
// Creates a new IAM user, access and secret keys, and stores the secret access key in a Secret. User user = new User(this, "User"); AccessKey accessKey = AccessKey.Builder.create(this, "AccessKey").user(user).build(); SecretStringValueBeta1 secretValue = SecretStringValueBeta1.fromToken(accessKey.secretAccessKey.toString()); Secret.Builder.create(this, "Secret") .secretStringBeta1(secretValue) .build();
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forSecretProps
static final class
An implementation forSecretProps
-
Method Summary
Modifier and TypeMethodDescriptionstatic SecretProps.Builder
builder()
default String
An optional, human-friendly description of the secret.default IKey
The customer-managed encryption key to use for encrypting the secret value.default SecretStringGenerator
Configuration for how to generate a secret value.default RemovalPolicy
Policy to apply when the secret is removed from this stack.default List<ReplicaRegion>
A list of regions where to replicate this secret.default String
A name for the secret.default SecretStringValueBeta1
Deprecated.default SecretValue
Initial value for the secret.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getDescription
An optional, human-friendly description of the secret.Default: - No description.
-
getEncryptionKey
The customer-managed encryption key to use for encrypting the secret value.Default: - A default KMS key for the account and region is used.
-
getGenerateSecretString
Configuration for how to generate a secret value.Only one of
secretString
andgenerateSecretString
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``.
-
getRemovalPolicy
Policy to apply when the secret is removed from this stack.Default: - Not set.
-
getReplicaRegions
A list of regions where to replicate this secret.Default: - Secret is not replicated
-
getSecretName
A name for the secret.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.
-
getSecretStringBeta1
Deprecated.UsesecretStringValue
instead.(deprecated) Initial value for the secret.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
, andgenerateSecretString
can be provided.Default: - SecretsManager generates a new secret value.
-
getSecretStringValue
Initial value for the secret.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
, andgenerateSecretString
can be provided.Default: - SecretsManager generates a new secret value.
-
builder
- Returns:
- a
SecretProps.Builder
ofSecretProps
-
secretStringValue
instead.