aws-nuke
aws-nuke copied to clipboard
EC2VPCEndpointServiceConfiguration deletion failed because of existing VPC Endpoint Connections
problem: aws-nuke cannot delete EC2VPCEndpointServiceConfiguration if it has active connections.
expected: aws-nuke deletes EC2VPCEndpointServiceConfiguration
tested with:
version: v2.16.0
build date: Mon Sep 6 14:19:03 UTC 2021
scm hash: 048c4bb92e38f8a119fb5d988f548cc622fb1b26
environment: runner@fv-az290-655
Workaround: reject all connections first
Example (ansible wrapping commands):
# Reject all VPC connections
- name: Get all VPC endpoint connections
command: >-
aws ec2
describe-vpc-endpoint-connections
--query VpcEndpointConnections[] --output json
register: r_connections
- loop: "{{ r_connections.stdout | from_json }}"
loop_control:
loop_var: conn
command: >-
aws ec2
reject-vpc-endpoint-connections
--service-id {{ conn.ServiceId }}
--vpc-endpoint-ids {{ conn.VpcEndpointId }}