Class SecretProps.Builder
java.lang.Object
software.amazon.awscdk.services.secretsmanager.SecretProps.Builder
- All Implemented Interfaces:
- software.amazon.jsii.Builder<SecretProps>
- Enclosing interface:
- SecretProps
@Stability(Stable)
public static final class SecretProps.Builder
extends Object
implements software.amazon.jsii.Builder<SecretProps>
A builder for 
SecretProps- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbuild()Builds the configured instance.description(String description) Sets the value ofSecretProps.getDescription()encryptionKey(IKey encryptionKey) Sets the value ofSecretProps.getEncryptionKey()generateSecretString(SecretStringGenerator generateSecretString) Sets the value ofSecretProps.getGenerateSecretString()removalPolicy(RemovalPolicy removalPolicy) Sets the value ofSecretProps.getRemovalPolicy()replicaRegions(List<? extends ReplicaRegion> replicaRegions) Sets the value ofSecretProps.getReplicaRegions()secretName(String secretName) Sets the value ofSecretProps.getSecretName()secretStringBeta1(SecretStringValueBeta1 secretStringBeta1) Deprecated.Use `secretStringValue` instead.secretStringValue(SecretValue secretStringValue) Sets the value ofSecretProps.getSecretStringValue()
- 
Constructor Details- 
Builderpublic Builder()
 
- 
- 
Method Details- 
descriptionSets the value ofSecretProps.getDescription()- Parameters:
- description- An optional, human-friendly description of the secret.
- Returns:
- this
 
- 
encryptionKeySets the value ofSecretProps.getEncryptionKey()- Parameters:
- encryptionKey- The customer-managed encryption key to use for encrypting the secret value.
- Returns:
- this
 
- 
generateSecretString@Stability(Stable) public SecretProps.Builder generateSecretString(SecretStringGenerator generateSecretString) Sets the value ofSecretProps.getGenerateSecretString()- Parameters:
- generateSecretString- Configuration for how to generate a secret value. Only one of- secretStringand- generateSecretStringcan be provided.
- Returns:
- this
 
- 
removalPolicySets the value ofSecretProps.getRemovalPolicy()- Parameters:
- removalPolicy- Policy to apply when the secret is removed from this stack.
- Returns:
- this
 
- 
replicaRegions@Stability(Stable) public SecretProps.Builder replicaRegions(List<? extends ReplicaRegion> replicaRegions) Sets the value ofSecretProps.getReplicaRegions()- Parameters:
- replicaRegions- A list of regions where to replicate this secret.
- Returns:
- this
 
- 
secretNameSets the value ofSecretProps.getSecretName()- Parameters:
- secretName- 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.
- Returns:
- this
 
- 
secretStringBeta1@Stability(Deprecated) @Deprecated public SecretProps.Builder secretStringBeta1(SecretStringValueBeta1 secretStringBeta1) Deprecated.Use `secretStringValue` instead.Sets the value ofSecretProps.getSecretStringBeta1()- Parameters:
- secretStringBeta1- 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, and- generateSecretStringcan be provided.
- Returns:
- this
 
- 
secretStringValueSets the value ofSecretProps.getSecretStringValue()- Parameters:
- secretStringValue- 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, and- generateSecretStringcan be provided.
- Returns:
- this
 
- 
buildBuilds the configured instance.- Specified by:
- buildin interface- software.amazon.jsii.Builder<SecretProps>
- Returns:
- a new instance of SecretProps
- Throws:
- NullPointerException- if any required attribute was not provided
 
 
-