There are several steps to delete VPC without losing any resources associated with it. Following are the steps to delete a VPC.
Step 1 − Open the Amazon VPC console using the following link −
https://console.aws.amazon.com/vpc/
Step 2 − Select Instances option in the navigation bar.
Step 3 − Select the Instance from the list, then select the Actions → Instance State → Terminate button.
Step 4 − A new dialog box opens. Expand the Release attached Elastic IPs section, and select the checkbox next to the Elastic IP address. Click the Yes, Terminate button.
Step 5 − Again open the Amazon VPC console using the following link −
https://console.aws.amazon.com/vpc/
Step 6 − Select the VPC from the navigation bar. Then select Actions & finally click the Delete VPC button.
Step 7 − A confirmation message appears. Click the Yes, Delete button.