In AWS, there are default limits (also known as quotas) for the number of various resources that can be created in an account. One of these limits is the number of Virtual Private Clouds (VPCs) that can be created in a single AWS account within a Region. The default limit for the number of VPCs per account per Region is typically 5.
If an organization is running multiple applications, each requiring a new VPC, it is possible to reach this limit, causing subsequent CloudFormation stack deployments that attempt to create additional VPCs to fail.
Check VPC Limits:
To verify the current limit and usage of VPCs in your account, you can use the AWS Service Quotas console.
Open the Service Quotas console at Service Quotas Console.
Navigate to AWS services and select Amazon VPC.
Check the VPCs per Region quota to see the limit and how many VPCs are currently in use.
Requesting a Quota Increase:
If the default limit is reached, you can request a quota increase.
In the Service Quotas console, select the quota and choose Request quota increase.
Fill in the required information and submit the request. AWS typically reviews and approves these requests, but it may take some time.
CloudFormation Stack Failure:
When a CloudFormation stack fails due to reaching the VPC limit, the error message will indicate the issue related to the quota being exceeded.
You can view the specific error in the CloudFormation console under the Events tab of the stack.
Preventative Measures:
To avoid this issue, monitor resource usage and limits regularly.
Consolidate applications within fewer VPCs if possible, using subnets and security groups to isolate resources.
Amazon VPC Quotas
Service Quotas for VPC
Requesting a Quota Increase
Submit