aws-cdk-lib.aws_secretsmanager.CfnRotationSchedule.HostedRotationLambdaProperty

interface HostedRotationLambdaProperty

LanguageType name
.NETAmazon.CDK.AWS.SecretsManager.CfnRotationSchedule.HostedRotationLambdaProperty
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awssecretsmanager#CfnRotationSchedule_HostedRotationLambdaProperty
Javasoftware.amazon.awscdk.services.secretsmanager.CfnRotationSchedule.HostedRotationLambdaProperty
Pythonaws_cdk.aws_secretsmanager.CfnRotationSchedule.HostedRotationLambdaProperty
TypeScript aws-cdk-lib » aws_secretsmanager » CfnRotationSchedule » HostedRotationLambdaProperty

Obtainable from HostedRotation.bind()

Creates a new Lambda rotation function based on one of the Secrets Manager rotation function templates .

You must specify Transform: AWS::SecretsManager-2020-07-23 at the beginning of the CloudFormation template.

For Amazon RDS master user credentials, see AWS::RDS::DBCluster MasterUserSecret .

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_secretsmanager as secretsmanager } from 'aws-cdk-lib';
const hostedRotationLambdaProperty: secretsmanager.CfnRotationSchedule.HostedRotationLambdaProperty = {
  rotationType: 'rotationType',

  // the properties below are optional
  excludeCharacters: 'excludeCharacters',
  kmsKeyArn: 'kmsKeyArn',
  masterSecretArn: 'masterSecretArn',
  masterSecretKmsKeyArn: 'masterSecretKmsKeyArn',
  rotationLambdaName: 'rotationLambdaName',
  runtime: 'runtime',
  superuserSecretArn: 'superuserSecretArn',
  superuserSecretKmsKeyArn: 'superuserSecretKmsKeyArn',
  vpcSecurityGroupIds: 'vpcSecurityGroupIds',
  vpcSubnetIds: 'vpcSubnetIds',
};

Properties

NameTypeDescription
rotationTypestringThe rotation template to base the rotation function on, one of the following:.
excludeCharacters?stringA string of the characters that you don't want in the password.
kmsKeyArn?stringThe ARN of the KMS key that Secrets Manager uses to encrypt the secret.
masterSecretArn?stringThe ARN of the secret that contains superuser credentials, if you use the Alternating users rotation strategy . CloudFormation grants the execution role for the Lambda rotation function GetSecretValue permission to the secret in this property. For more information, see Lambda rotation function execution role permissions for Secrets Manager .
masterSecretKmsKeyArn?stringThe ARN of the KMS key that Secrets Manager used to encrypt the superuser secret, if you use the alternating users strategy and the superuser secret is encrypted with a customer managed key. You don't need to specify this property if the superuser secret is encrypted using the key aws/secretsmanager . CloudFormation grants the execution role for the Lambda rotation function Decrypt , DescribeKey , and GenerateDataKey permission to the key in this property. For more information, see Lambda rotation function execution role permissions for Secrets Manager .
rotationLambdaName?stringThe name of the Lambda rotation function.
runtime?stringBy default, CloudFormation deploys Python 3.9 binaries for the rotation function. To use a different version of Python, you must do the following two steps:.
superuserSecretArn?stringThe ARN of the secret that contains superuser credentials, if you use the Alternating users rotation strategy . CloudFormation grants the execution role for the Lambda rotation function GetSecretValue permission to the secret in this property. For more information, see Lambda rotation function execution role permissions for Secrets Manager .
superuserSecretKmsKeyArn?stringThe ARN of the KMS key that Secrets Manager used to encrypt the superuser secret, if you use the alternating users strategy and the superuser secret is encrypted with a customer managed key. You don't need to specify this property if the superuser secret is encrypted using the key aws/secretsmanager . CloudFormation grants the execution role for the Lambda rotation function Decrypt , DescribeKey , and GenerateDataKey permission to the key in this property. For more information, see Lambda rotation function execution role permissions for Secrets Manager .
vpcSecurityGroupIds?stringA comma-separated list of security group IDs applied to the target database.
vpcSubnetIds?stringA comma separated list of VPC subnet IDs of the target database network.

rotationType

Type: string

The rotation template to base the rotation function on, one of the following:.

  • MySQLSingleUser to use the template SecretsManagerRDSMySQLRotationSingleUser .
  • MySQLMultiUser to use the template SecretsManagerRDSMySQLRotationMultiUser .
  • PostgreSQLSingleUser to use the template SecretsManagerRDSPostgreSQLRotationSingleUser
  • PostgreSQLMultiUser to use the template SecretsManagerRDSPostgreSQLRotationMultiUser .
  • OracleSingleUser to use the template SecretsManagerRDSOracleRotationSingleUser .
  • OracleMultiUser to use the template SecretsManagerRDSOracleRotationMultiUser .
  • MariaDBSingleUser to use the template SecretsManagerRDSMariaDBRotationSingleUser .
  • MariaDBMultiUser to use the template SecretsManagerRDSMariaDBRotationMultiUser .
  • SQLServerSingleUser to use the template SecretsManagerRDSSQLServerRotationSingleUser .
  • SQLServerMultiUser to use the template SecretsManagerRDSSQLServerRotationMultiUser .
  • RedshiftSingleUser to use the template SecretsManagerRedshiftRotationSingleUsr .
  • RedshiftMultiUser to use the template SecretsManagerRedshiftRotationMultiUser .
  • MongoDBSingleUser to use the template SecretsManagerMongoDBRotationSingleUser .
  • MongoDBMultiUser to use the template SecretsManagerMongoDBRotationMultiUser .

excludeCharacters?

Type: string (optional)

A string of the characters that you don't want in the password.


kmsKeyArn?

Type: string (optional)

The ARN of the KMS key that Secrets Manager uses to encrypt the secret.

If you don't specify this value, then Secrets Manager uses the key aws/secretsmanager . If aws/secretsmanager doesn't yet exist, then Secrets Manager creates it for you automatically the first time it encrypts the secret value.


masterSecretArn?

Type: string (optional)

The ARN of the secret that contains superuser credentials, if you use the Alternating users rotation strategy . CloudFormation grants the execution role for the Lambda rotation function GetSecretValue permission to the secret in this property. For more information, see Lambda rotation function execution role permissions for Secrets Manager .

You must create the superuser secret before you can set this property.

You must also include the superuser secret ARN as a key in the JSON of the rotating secret so that the Lambda rotation function can find it. CloudFormation does not hardcode secret ARNs in the Lambda rotation function, so you can use the function to rotate multiple secrets. For more information, see JSON structure of Secrets Manager secrets .

You can specify MasterSecretArn or SuperuserSecretArn but not both. They represent the same superuser secret.


masterSecretKmsKeyArn?

Type: string (optional)

The ARN of the KMS key that Secrets Manager used to encrypt the superuser secret, if you use the alternating users strategy and the superuser secret is encrypted with a customer managed key. You don't need to specify this property if the superuser secret is encrypted using the key aws/secretsmanager . CloudFormation grants the execution role for the Lambda rotation function Decrypt , DescribeKey , and GenerateDataKey permission to the key in this property. For more information, see Lambda rotation function execution role permissions for Secrets Manager .

You can specify MasterSecretKmsKeyArn or SuperuserSecretKmsKeyArn but not both. They represent the same superuser secret KMS key .


rotationLambdaName?

Type: string (optional)

The name of the Lambda rotation function.


runtime?

Type: string (optional)

By default, CloudFormation deploys Python 3.9 binaries for the rotation function. To use a different version of Python, you must do the following two steps:.

  • Deploy the matching version Python binaries with your rotation function.
  • Set the version number in this field. For example, for Python 3.7, enter python3.7

If you only do one of the steps, your rotation function will be incompatible with the binaries. For more information, see Why did my Lambda rotation function fail with a "pg module not found" error .


superuserSecretArn?

Type: string (optional)

The ARN of the secret that contains superuser credentials, if you use the Alternating users rotation strategy . CloudFormation grants the execution role for the Lambda rotation function GetSecretValue permission to the secret in this property. For more information, see Lambda rotation function execution role permissions for Secrets Manager .

You must create the superuser secret before you can set this property.

You must also include the superuser secret ARN as a key in the JSON of the rotating secret so that the Lambda rotation function can find it. CloudFormation does not hardcode secret ARNs in the Lambda rotation function, so you can use the function to rotate multiple secrets. For more information, see JSON structure of Secrets Manager secrets .

You can specify MasterSecretArn or SuperuserSecretArn but not both. They represent the same superuser secret.


superuserSecretKmsKeyArn?

Type: string (optional)

The ARN of the KMS key that Secrets Manager used to encrypt the superuser secret, if you use the alternating users strategy and the superuser secret is encrypted with a customer managed key. You don't need to specify this property if the superuser secret is encrypted using the key aws/secretsmanager . CloudFormation grants the execution role for the Lambda rotation function Decrypt , DescribeKey , and GenerateDataKey permission to the key in this property. For more information, see Lambda rotation function execution role permissions for Secrets Manager .

You can specify MasterSecretKmsKeyArn or SuperuserSecretKmsKeyArn but not both. They represent the same superuser secret KMS key .


vpcSecurityGroupIds?

Type: string (optional)

A comma-separated list of security group IDs applied to the target database.

The template applies the same security groups as on the Lambda rotation function that is created as part of this stack.


vpcSubnetIds?

Type: string (optional)

A comma separated list of VPC subnet IDs of the target database network.

The Lambda rotation function is in the same subnet group.