- 新しい順
- 投票が多い順
- コメントが多い順
It could be lot easier to answer this question, if you'd have mentioned CIDR ranges for already existing subnets. Most likely this error is coming because of CIDR conflicts with existing subnet CIDR ranges and there would be some overlap, which is why you are seeing this message.
Make sure that the subnets you are creating, have CIDR ranges without any overlap with existing subnets.
Hope you find this helpful.
Comment here if you have additional question, happy to help.
Does a subnet with the same address range as PublicSubnet02 already exist, and was created outside of this CloudFormation stack? If so then don't try to create it again here, but import it https://aws.amazon.com/blogs/aws/new-import-existing-resources-into-a-cloudformation-stack/
No, I don't haven't any resource created outside this cloudformation script.
Which subnets already exist in this VPC? Can you post the output of
aws ec2 describe-subnets --filters "Name=vpc-id,Values=vpc-abcd1234"
Hi
You have shared the Parameter part of the Template and not the actual creation of the Subnets in the Template. Have you changed how you create the Subnets in the Template? Do you override the default values? Are you changing CIDR on any existing Subnets in the updated Template?
Did you try to change/reuse the logical IDs of the subnets? If so, this could potentially cause your problem because CloudFormation will not be able to recognize that difference between new and old. That is, if you had a resource in your stack named Subnet01 with a given CIDR, and then you try to apply that CIDR to Subnet02, CloudFormation doesn't know that you "moved" the Subnet. Instead, it will recognize this as an "additional" Subnet with identical configuration. This will create a CIDR conflict when AWS begins to create your new Subnet without first deleting the old.
関連するコンテンツ
- 質問済み 6年前
- AWS公式更新しました 1年前
My Existing CIDR Ranges are:
VpcBlock: Type: String Default: 10.0.0.0/16 Description: The CIDR range for the VPC. This should be a valid private (RFC 1918) CIDR range. AllowedPattern: (\d{1,3}).(\d{1,3}).(\d{1,3}).(\d{1,3})/(\d{1,2}) ConstraintDescription: must be a valid IP CIDR range of the form x.x.x.x/x.
New CIDR Range I am trying to update is already shared in question. Thanks
As I mentioned in my answer, please mention CIDR ranges of existing subnets in this VPC. Go to VPC console and click Subnet at left pane. Then at the right side, you'll see IPV4 CIDR for each subnet. Please provide those CIDR by commenting here. If you are saying that subnet which already existed are included in this clodformation template, if so then it'd definitely give you this message as this cloudformation template would try to create new subnets with same CIDR ranges. All you need to do is:
This would import existing resources into your stack. Refer this AWS Documentation more in detail about how to import existing resources into your stack.
Tip: When you'll update the template in step-2, make sure for the existing subnet, don't forget to add "DeletionPolicy": "Retain" in those resources.
Hi Vishal,
I just added a comment above, please refer. Somewhere I feel that you have included existing subnets also into your resources, which is why you are getting this error. Comment here if the above explanation helps. I can indeed assist you further. Also, please mention the existing subnets CIDRs once, if possible.
Do you have additional questions happy to help.