Class SecretRotationProps.Builder
java.lang.Object
software.amazon.awscdk.services.secretsmanager.SecretRotationProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<SecretRotationProps>
- Enclosing interface:
SecretRotationProps
@Stability(Stable)
public static final class SecretRotationProps.Builder
extends Object
implements software.amazon.jsii.Builder<SecretRotationProps>
A builder for
SecretRotationProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionapplication
(SecretRotationApplication application) Sets the value ofSecretRotationProps.getApplication()
automaticallyAfter
(Duration automaticallyAfter) Sets the value ofSecretRotationProps.getAutomaticallyAfter()
build()
Builds the configured instance.endpoint
(IInterfaceVpcEndpoint endpoint) Sets the value ofSecretRotationProps.getEndpoint()
excludeCharacters
(String excludeCharacters) Sets the value ofSecretRotationProps.getExcludeCharacters()
masterSecret
(ISecret masterSecret) Sets the value ofSecretRotationProps.getMasterSecret()
rotateImmediatelyOnUpdate
(Boolean rotateImmediatelyOnUpdate) Sets the value ofSecretRotationProps.getRotateImmediatelyOnUpdate()
Sets the value ofSecretRotationProps.getSecret()
securityGroup
(ISecurityGroup securityGroup) Sets the value ofSecretRotationProps.getSecurityGroup()
target
(IConnectable target) Sets the value ofSecretRotationProps.getTarget()
Sets the value ofSecretRotationProps.getVpc()
vpcSubnets
(SubnetSelection vpcSubnets) Sets the value ofSecretRotationProps.getVpcSubnets()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
application
@Stability(Stable) public SecretRotationProps.Builder application(SecretRotationApplication application) Sets the value ofSecretRotationProps.getApplication()
- Parameters:
application
- The serverless application for the rotation. This parameter is required.- Returns:
this
-
secret
Sets the value ofSecretRotationProps.getSecret()
- Parameters:
secret
- The secret to rotate. It must be a JSON string with the following format:. This parameter is required.{ "engine": <required: database engine>, "host": <required: instance host name>, "username": <required: username>, "password": <required: password>, "dbname": <optional: database name>, "port": <optional: if not specified, default port will be used>, "masterarn": <required for multi user rotation: the arn of the master secret which will be used to create users/change passwords> }
This is typically the case for a secret referenced from an
AWS::SecretsManager::SecretTargetAttachment
or anISecret
returned by theattach()
method ofSecret
.- Returns:
this
-
target
Sets the value ofSecretRotationProps.getTarget()
- Parameters:
target
- The target service or database. This parameter is required.- Returns:
this
-
vpc
Sets the value ofSecretRotationProps.getVpc()
- Parameters:
vpc
- The VPC where the Lambda rotation function will run. This parameter is required.- Returns:
this
-
automaticallyAfter
@Stability(Stable) public SecretRotationProps.Builder automaticallyAfter(Duration automaticallyAfter) Sets the value ofSecretRotationProps.getAutomaticallyAfter()
- Parameters:
automaticallyAfter
- Specifies the number of days after the previous rotation before Secrets Manager triggers the next automatic rotation.- Returns:
this
-
endpoint
Sets the value ofSecretRotationProps.getEndpoint()
- Parameters:
endpoint
- The VPC interface endpoint to use for the Secrets Manager API. If you enable private DNS hostnames for your VPC private endpoint (the default), you don't need to specify an endpoint. The standard Secrets Manager DNS hostname the Secrets Manager CLI and SDKs use by default (https://secretsmanager..amazonaws.com) automatically resolves to your VPC endpoint. - Returns:
this
-
excludeCharacters
Sets the value ofSecretRotationProps.getExcludeCharacters()
- Parameters:
excludeCharacters
- Characters which should not appear in the generated password.- Returns:
this
-
masterSecret
Sets the value ofSecretRotationProps.getMasterSecret()
- Parameters:
masterSecret
- The master secret for a multi user rotation scheme.- Returns:
this
-
rotateImmediatelyOnUpdate
@Stability(Stable) public SecretRotationProps.Builder rotateImmediatelyOnUpdate(Boolean rotateImmediatelyOnUpdate) Sets the value ofSecretRotationProps.getRotateImmediatelyOnUpdate()
- Parameters:
rotateImmediatelyOnUpdate
- Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window.- Returns:
this
-
securityGroup
Sets the value ofSecretRotationProps.getSecurityGroup()
- Parameters:
securityGroup
- The security group for the Lambda rotation function.- Returns:
this
-
vpcSubnets
Sets the value ofSecretRotationProps.getVpcSubnets()
- Parameters:
vpcSubnets
- The type of subnets in the VPC where the Lambda rotation function will run.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<SecretRotationProps>
- Returns:
- a new instance of
SecretRotationProps
- Throws:
NullPointerException
- if any required attribute was not provided
-