gruntwork-io / cloud-nuke

A tool for cleaning up your cloud accounts by nuking (deleting) all resources within it
https://gruntwork.io/
MIT License
2.76k stars 354 forks source link

Cloud Nuke tries to remove organization-wide Transit Gateways #361

Closed rafaljanicki closed 7 months ago

rafaljanicki commented 2 years ago

Here's the log:

[cloud-nuke] time="2022-09-21T10:45:41Z" level=info msg="Deleting all Transit Gateways in region us-east-1"
[cloud-nuke] time="2022-09-21T10:45:41Z" level=error msg="[Failed] InvalidTransitGatewayID.NotFound: Transit Gateway <REDACTED> was deleted or does not exist.\n\tstatus code: 400, request id: <REDACTED>"
[cloud-nuke] time="2022-09-21T10:45:41Z" level=info msg="[OK] 0 Transit Gateway(s) deleted in us-east-1"

The TG that it tries to remove is shared inside the organization and doesn't belong to the account hence it can't be removed

Cloud Nuke version: 0.19.0

james03160927 commented 1 year ago

It seems like it requires checking the OwnerId of the TransitGateway to check whether this is owned by the current owner or it has been shared.