AWS has Fully Configured and Ready-to-Use Rotation Support for some supported RDS engines, including Amazon Aurora (Serverless also?)
I'm trying to setup the password rotation in my CloudFormation template using AWS::SecretsManager::RotationSchedule
(note that this is not a fully functional template, only an illustration):
DBCluster:
Type: AWS::RDS::DBCluster
Properties:
Engine : aurora
EngineMode : serverless
EngineVersion : 5.6.10a
Secret:
Type: AWS::SecretsManager::Secret
Properties:
GenerateSecretString:
SecretStringTemplate: '{"username": "admin"}'
GenerateStringKey: password
PasswordLength: 20
ExcludeCharacters: '"@/\'
SecretTargetAttachment:
Type: AWS::SecretsManager::SecretTargetAttachment
Properties:
SecretId: !Ref Secret
TargetId: !Ref DBCluster
TargetType: AWS::RDS::DBCluster
SecretRotation:
Type: AWS::SecretsManager::RotationSchedule
Properties:
SecretId: !Ref UserAdminSecret
RotationLambdaARN: <ARN_GET_FROM_SERVERLESS_APPLICATION_REPOSITORY>
RotationRules:
AutomaticallyAfterDays: 1
But the AWS Lambda rotation function fails with the following message:
"Database engine must be set to 'mysql' in order to use this rotation lambda": KeyError
Looks like Aurora Serverless is not supported by the AWS Lambda rotation function provided by AWS.
Is there an easy way to setup Aurora Serverless secret rotation using existing Lambda rotation templates?
Any example available to write my own rotation function for Aurora Serverless?
PS: This question is kind of related to Creating an Aurora Serverless Cluster from cloudformation?