1 Answer
- Newest
- Most votes
- Most comments
0
This is very common use case and every single team using subnet cidr needs this. Unfortunately, there is not a straight way of doing this but solution to this use case is fairly common and fortunately there is a step by step guide, which would help you achieve end result.
AWS::EC2::Subnet type resource can't return its CIDR.
You'd need to create custom resource lambda function and then use that resource in your cloudformation template with syntax as !GetAtt CidrFindr.CidrBlock1 where CidrFindr is custom resource lambda function.
Here is the AWS CIDR Finder Solution, this has very detailed instructions in it and you should be able to use it quite comfortably.
Relevant content
- AWS OFFICIALUpdated 9 months ago
