Reputation: 52443
How to delete a FAILED VPC Peering Connection Creation?
While creating a VPC peering connection, I gave an invalid VPC id and the peering connection creation failed. Later I corrected the VPC id and could create the peering connection. Now I am trying to delete the failed peering connection, but the option is greyed out in AWS dashboard.
CLI is not letting me to delete it. How do I delete a failed VPC peering connection?
$ aws ec2 delete-vpc-peering-connection --vpc-peering-connection-id pcx-xxxxxxxx
An error occurred (InvalidStateTransition) when calling the DeleteVpcPeeringConnection operation: Invalid state transition for pcx-xxxxxxxx, attempted to transition from failed to deleting
Upvotes: 7
Views: 6441
Reputation: 52443
Looks like the FAILED peering connection will remain for 2 days for the requestor and 2 hours for the acceptor.
See: VPC Peering Connection Lifecycle
Rejected: The owner of the accepter VPC has rejected a pending-acceptance VPC peering connection request. During this state, the request cannot be accepted. The rejected VPC peering connection remains visible to the owner of the requester VPC for 2 days, and visible to the owner of the accepter VPC for 2 hours. If the request was created within the same AWS account, the rejected request remains visible for 2 hours.
Upvotes: 12