I’m trying to implement aws secrets rotation using the serverless framework (Adding hosted secrets rotation Lambda to an RDS stack | Alex Harvey)
AppGraphqDbAppsSecretRotationSchedule:
Type: AWS::SecretsManager::RotationSchedule
Properties:
SecretId: !Ref AppGraphqlDbAppsSecretsManagerSecret
HostedRotationLambda:
RotationType: PostgreSQLSingleUser
RotationRules:
AutomaticallyAfterDays: 30
But I get the error
To use the HostedRotationLambda property, you must use the AWS::SecretsManager transform.
Probably I need to add “Transform: AWS::SecretsManager-2020-07-23” somewhere: where?
Below a working Aws Cloudformation template
AWSTemplateFormatVersion: 2010-09-09
Description: Rotation Lambda example stack
Transform: AWS::SecretsManager-2020-07-23
Parameters: {}
Resources: