How to specify "Transform: AWS::SecretsManager-2020-07-23" in CDK(L1). #19980
-
I would like to use cron to specify the time of rotation of the secret in the secret manager. However, when I try to deploy it, I get an error because I have not specified "Transform: AWS::SecretsManager-2020-07-23". If I use the L1 constructor, do I have to rewrite the template after it is generated?
example const secret = new CfnSecret(this, 'Secret', {
generateSecretString: {
generateStringKey: 'password',
secretStringTemplate: JSON.stringify({
username: 'example username',
})
}
});
new CfnSecretTargetAttachment(this, 'SecretTargetAttachment', {
secretId: secrets.ref,
targetId: 'example clusterIdentifier',
targetType: 'AWS::RDS::DBCluster'
});
new CfnRotationSchedule(this, 'RotationSchedule', {
secretId: secret.ref,
hostedRotationLambda: {
rotationType: 'PostgreSQLSingleUser',
},
rotationRules: {
scheduleExpression: 'cron(0 9 1 * ? *)'
}
}); |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
I solved the problem by doing the following stack.addTransform('AWS::SecretsManager-2020-07-23'); |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
I solved the problem by doing the following