gruntwork-io/cloud-nuke

NAT Gateway filtering is not working

Closed this issue · 1 comments

It looks like the filtering for NAT Gateways is not working.

config file:

default_regex: &default
  include:
    names_regex:
      - 'e2e-test-gf0'

s3: *default
AutoScalingGroup: *default
LambdaFunction: *default
LaunchConfiguration: *default
EBSVolume: *default
ECSService: *default
ECSCluster: *default
DynamoDB: *default
CloudWatchLogGroup: *default
VPC: *default
SecretsManager: *default
ELBv2: *default
IAMUsers: *default
OIDCProvider: *default
KMSCustomerKeys: *default
SecretsManager: *default
NATGateway: *default
ElasticIP: *default
EKSCluster: *default
Elasticache: *default
EC2: *default
TransitGateway: *default
OpenSearchDomain: *default
CloudWatchDashboard: *default
AccessAnalyzer: *default

cloud-nuke command:
cloud-nuke aws --log-level trace --region us-west-2 --dry-run --exclude-resource-type acmpca --exclude-resource-type accessanalyzer --exclude-resource-type transit-gateway --exclude-resource-type transit-gateway-attachment --exclude-resource-type rds --exclude-resource-type snap --exclude-resource-type ami --exclude-resource-type sqs --exclude-resource-type elb --config cloud-nuke-config.yaml

cloud-nuke output:

[cloud-nuke] INFO[2022-06-08T08:19:50Z] The following 6 AWS resources will be nuked: 
[cloud-nuke] INFO[2022-06-08T08:19:50Z] * nat-gateway nat-0a0b6383b409126ab us-west-2 
[cloud-nuke] INFO[2022-06-08T08:19:50Z] * nat-gateway nat-038077d19a3ab4f80 us-west-2 
[cloud-nuke] INFO[2022-06-08T08:19:50Z] * nat-gateway nat-02f79829098303bb1 us-west-2 
[cloud-nuke] INFO[2022-06-08T08:19:50Z] * nat-gateway nat-0782e8434b384b0b7 us-west-2 

AWS NAT gateways:
image

Expected ONLY found resources:
nat-038077d19a3ab4f80 us-west-2

This actually can be closed because there was a fault in configuration, the YAML config key for NAT Gateways should be NatGateway instead of NATGateway. The README.md is misleading since it actually says NATGateway so I'll create another issue to track that problem.