2 Answers
- Newest
- Most votes
- Most comments
1
I don't see a way to do it, but here's an idea for a workaround that may help depending on how you invoke stack create/update. Add a "StackName" parameter to your template, and set it to the name of the stack when it's created. Template parameters like this get passed to the Lambda function.
0
Not sure what your specific scenario is but I managed to resolve this in a Macro I created using the AWS::StackName
pseudo parameter. So my Macro would add a resource with a value of { "Fn::Sub": "SomeValue-${AWS::StackName}" }
and CloudFormation would resolve that to "SomeValue-MyStackName" after the Macro returns the updated template.
answered a year ago
Relevant content
- asked 5 months ago
- asked 3 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a month ago
- AWS OFFICIALUpdated 2 years ago
Thanks for your response. Yes, I managed to get it working using parameters and accessing the parameter in the handler using 'event.templateParameterValues.stack'. I was expecting a more direct way to get this value as CF is already aware of the stack name.