How to restrict creating AWS vpc if the CIDR in range 172.x.x.x/x using policies?

Viewed 14

We've shared AWS accounts among multiple teams and even though we ask not to create identical VPCs, there is always a case.

So my question is, how can we achieve this via policies (or if there is another way), that we define the set of CIDRs in AWS account policy so that when somebody creates a VPC with a CIDR that belongs to one of those, it throws an error?

Thank you.

1 Answers

when somebody creates a VPC with a CIDR that belongs to one of those, it throws an error?

No there is no such IAM policies. You have to develop your own custom solution for that. For example, trigger a lambda function based on CloudTrial events for creating VPC, and have the lambda function verify the CIDRs.

Related