1 Answer
- Newest
- Most votes
- Most comments
1
Hi,
What you want to do can be achieved with a Custom Resource. This is a type of resource in Cloudformation that excutes (and waits for a response from) a Lambda function.
The way it would work in your scenario would be to remove the option of the AZ from the parameters sections completely.
Create a Lambda that does the lookup logic you describe and return the AZ. Then trigger this Lambda from a Custom Resource, this custom resource would then have a !Ref
or !GetAtt
value that you can access to populate the AZ value for the instance in place of using a parmeter.
I hope this helps.
If you are likely to create your Lambda in Python then there is a helper library specifically designed to make Custom Resources simpler to create in Python.
answered 5 months ago
Relevant content
- asked 9 months ago
- asked 3 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago