Skip to content

change subnet VPC

0

Dear AWS how are you? I am contacting you to request your support since when setting up an ipsec tunnel I encounter the difficulty that by mistake a vpc was generated with the wrong subnet mask VPC vpc-07f408ee40e12bed3 CIDR 172.26.227.0/25 and it should be with mask 26 I need to modify that mask so that I can raise my ipsec vpn, when I want to modify it gives me the error "Failed to remove IPv4 CIDR: 172.26.227.0/25 The vpc vpc-07f408ee40e12bed3 currently has a subnet within CIDR block 172.26.227.0/25" and if I delete the entire vpc it asks me to delete the entire vpc with the servers included I await your comments, thank you very much

asked a year ago246 views

2 Answers
1

Hello,

unfortunately, there is no possibility to change/remove primary CIDR assigned to VPC.

If primary CIDR for a VPC: 172.26.227.0/26 is a must, the solution would be to create new VPC with respective CIDR block and migrate the workloads from the old VPC.

Deletion/Change of the primary CIDR is forbidden in order to prevent breaking existing resources.

Best regards, Neven

AWS

answered a year ago

AWS
EXPERT

reviewed a year ago

EXPERT

reviewed a year ago

0

In your situation, you need to provision a new VPC with the correct CIDR. You can change the primary VPC CIDR and you cannot change the subnet CIDRs.

For VPC: you can create a new VPC with the correct CIDR. Delete the current if it does not have resources. Overlapping CIDR for multiple VPC is allowed. For Subnet: you can delete existing subnets and provision new subnets. Overlapping CIDR for subnets within same VPC not allowed.

EXPERT

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.