1回答
- 新しい順
- 投票が多い順
- コメントが多い順
1
Hello.
Use !Sub or !Join to Construct Unique Names: These functions allow you to concatenate strings and include dynamic elements like stack name or unique IDs. Incorporate AWS::StackName and/or AWS::Region: Using these pseudo parameters ensures that your Lambda function name is unique per stack and region.
For example:
Resources:
MyLambdaFunction:
Type: AWS::Lambda::Function
Properties:
# Other required properties like Code, Handler, Role, Runtime
FunctionName: !Sub
- "${StackName}-${AWS::Region}-${UniqueID}-RotationLambda"
- StackName: !Ref AWS::StackName
UniqueID: !Ref UniqueResource # Replace with a unique resource in your template
MySecretRotationSchedule:
Type: AWS::SecretsManager::RotationSchedule
Properties:
SecretId: !Ref Xyz
HostedRotationLambda:
RotationType: MySQLSingleUser
RotationLambdaName: !Ref MyLambdaFunction
RotationRules:
AutomaticallyAfterDays: 30
Regards, Andrii