Class SecretProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<SecretProps>
- Enclosing interface:
SecretProps
SecretProps
-
Constructor Summary
Constructors -
Method Summary
Modifier 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()
secretObjectValue
(Map<String, ? extends SecretValue> secretObjectValue) Sets the value ofSecretProps.getSecretObjectValue()
secretStringBeta1
(SecretStringValueBeta1 secretStringBeta1) Deprecated.Use `secretStringValue` instead.secretStringValue
(SecretValue secretStringValue) Sets the value ofSecretProps.getSecretStringValue()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
description
Sets the value ofSecretProps.getDescription()
- Parameters:
description
- An optional, human-friendly description of the secret.- Returns:
this
-
encryptionKey
Sets 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 ofsecretString
andgenerateSecretString
can be provided.- Returns:
this
-
removalPolicy
Sets 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
-
secretName
Sets 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
-
secretObjectValue
@Stability(Stable) public SecretProps.Builder secretObjectValue(Map<String, ? extends SecretValue> secretObjectValue) Sets the value ofSecretProps.getSecretObjectValue()
- Parameters:
secretObjectValue
- Initial value for a JSON secret. NOTE: *It is highly encouraged to leave this field undefined and allow SecretsManager to create the secret value. The secret object -- 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 a JSON object that you want to encrypt and store in this new version of the secret. To specify a simple string value instead, use
SecretProps.secretStringValue
Only one of
secretStringBeta1
,secretStringValue
, 'secretObjectValue', andgenerateSecretString
can be provided.- 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
, andgenerateSecretString
can be provided.- Returns:
this
-
secretStringValue
Sets 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. To provide a string representation of JSON structure, use
SecretProps.secretObjectValue
instead.Only one of
secretStringBeta1
,secretStringValue
, 'secretObjectValue', andgenerateSecretString
can be provided.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<SecretProps>
- Returns:
- a new instance of
SecretProps
- Throws:
NullPointerException
- if any required attribute was not provided
-