Can we disable or delete a VPC without terminating the EC2 instance.
Chitra, What is your use-case here? There's a dependency here that would need to be solved for first.
Hey Chitra,
First thing I wanted to clarify is that you cannot disable a VPC, it's either active or deleted entirely.
Regarding your question about deleting a VPC without terminating EC2 instances: the answer is no.
You must first terminate all instances and delete associated resources, including subnets, security groups, network ACLs, route tables, internet gateways, and any resources that create requester-managed network interfaces (such as ELBs or NAT gateways).
Per AWS Documentation here:
Before you can delete a VPC, you must first terminate or delete any resources that created a requester-managed network interface in the VPC. For example, you must terminate your EC2 instances and delete your load balancers, NAT gateways, transit gateway VPC attachments, and interface VPC endpoints.
Once those prerequisites are met, you can delete the VPC using the AWS Management Console, AWS CLI, or API.
That being said, if you could provide us with your use case that would help us understand better what you're trying to accomplish.
相关内容
- AWS 官方已更新 1 年前
