Skip to content
v2.274.0

SecretRotationProps Struct ​

Construction properties for a SecretRotation.

Example ​

ts
declare const myUserSecret: secretsmanager.Secret;
declare const myMasterSecret: secretsmanager.Secret;
declare const myDatabase: ec2.IConnectable;
declare const myVpc: ec2.Vpc;

new secretsmanager.SecretRotation(this, 'SecretRotation', {
  application: secretsmanager.SecretRotationApplication.MYSQL_ROTATION_MULTI_USER,
  secret: myUserSecret, // The secret that will be rotated
  masterSecret: myMasterSecret, // The secret used for the rotation
  target: myDatabase,
  vpc: myVpc,
});

Properties ​

The serverless application for the rotation.
automaticallyAfteroptionalDurationautomatically_afteroptionalDurationautomaticallyAfteroptionalDurationAutomaticallyAfteroptionalDurationAutomaticallyAfteroptionalDuration= Duration.days(30)#
Specifies the number of days after the previous rotation before Secrets Manager triggers the next automatic rotation.
endpointoptionalIInterfaceVpcEndpointendpointoptionalIInterfaceVpcEndpointendpointoptionalIInterfaceVpcEndpointEndpointoptionalIInterfaceVpcEndpointEndpointoptionalIInterfaceVpcEndpoint#
The VPC interface endpoint to use for the Secrets Manager API.

Default: https://secretsmanager.<region>.amazonaws.com

notes

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.<region>.amazonaws.com) automatically resolves to your VPC endpoint.

excludeCharactersoptionalstringexclude_charactersoptionalstrexcludeCharactersoptionalStringExcludeCharactersoptionalstringExcludeCharactersoptional*string#
Characters which should not appear in the generated password.

Default: no additional characters are explicitly excluded

masterSecretoptionalISecretmaster_secretoptionalISecretmasterSecretoptionalISecretMasterSecretoptionalISecretMasterSecretoptionalISecret#
The master secret for a multi user rotation scheme.

Default: single user rotation scheme

rotateImmediatelyOnUpdateoptionalbooleanrotate_immediately_on_updateoptionalboolrotateImmediatelyOnUpdateoptionalBooleanRotateImmediatelyOnUpdateoptionalboolRotateImmediatelyOnUpdateoptional*bool= true#
Specifies whether to rotate the secret immediately or wait until the next scheduled rotation window.
secretISecretsecretISecretsecretISecretSecretISecretSecretISecretrequired#
The secret to rotate. It must be a JSON string with the following format:.
notes
{
  "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 an ISecret returned by the attach() method of Secret.

securityGroupoptionalISecurityGroupsecurity_groupoptionalISecurityGroupsecurityGroupoptionalISecurityGroupSecurityGroupoptionalISecurityGroupSecurityGroupoptionalISecurityGroup#
The security group for the Lambda rotation function.

Default: a new security group is created

The target service or database.
vpcIVpcvpcIVpcvpcIVpcVpcIVpcVpcIVpcrequired#
The VPC where the Lambda rotation function will run.
vpcSubnetsoptionalSubnetSelectionvpc_subnetsoptionalSubnetSelectionvpcSubnetsoptionalSubnetSelectionVpcSubnetsoptionalSubnetSelectionVpcSubnetsoptionalSubnetSelection#
The type of subnets in the VPC where the Lambda rotation function will run.

Default: the Vpc default strategy if not specified.