Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nuke IAMRolePolicy and EC2NetworkInterface associated with lambdas #108

Merged
merged 2 commits into from
Sep 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 34 additions & 9 deletions .github/aws-nuke.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ resource-types:
# only nuke these resources
targets:
- IAMRole
- IAMRolePolicy
- IAMRolePolicyAttachment
- IAMPolicy
- IAMGroup
Expand All @@ -23,6 +24,7 @@ resource-types:
- ElasticBeanstalkApplication
- ElasticBeanstalkEnvironment
- EC2VPC
- EC2DHCPOption
- EC2Instance
- EC2Volume
- EC2Subnet
Expand Down Expand Up @@ -90,16 +92,31 @@ presets:
EC2VPC:
- property: "IsDefault"
value: "true"
EC2DHCPOption:
- property: "tag:Name"
type: "regex"
value: "^$"
IAMRole:
- "OrganizationAccountAccessRole"
IAMRolePolicy:
- property: "role:RoleName"
type: "regex"
value: "^OrganizationAccountAccessRole$"
EC2SecurityGroup:
- property: "Name"
type: "regex"
value: "^fargate-default$"
EC2NetworkInterface:
- property: "tag:Name"
# Lambda's do not set the `tag:Name` and the `Description` is not available for filtering
# Description: AWS Lambda VPC ENI-eg-test-app-elasticsearch-cleanup-e45baaef-7c14-4926-b21c-04c6b77f9
# Instead, we'll delete all EC2NetworkInterface that have `Status` of `available`.
# - property: "tag:Name"
# type: "regex"
# value: "^$"
- property: "Status"
type: "regex"
value: "^$"
value: "^(attaching|attached|detaching|detached)$"

EC2Volume:
- property: "tag:Name"
type: "regex"
Expand Down Expand Up @@ -147,6 +164,9 @@ presets:
- property: "tag:Name"
type: "regex"
value: "^cpco-.*"
- property: "tag:Name"
type: "regex"
value: "^cpco-.*"
EC2InternetGateway:
- property: "tag:Name"
type: "regex"
Expand Down Expand Up @@ -204,8 +224,6 @@ presets:
ELBv2TargetGroup:
- type: "regex"
value: "^cpco-.*"
- type: "regex"
value: ".*atlantis.*"
CloudformationStack:
- property: "tag:Name"
type: "regex"
Expand All @@ -219,18 +237,22 @@ presets:
value: "^cpco-.*"
- type: "regex"
value: "^atlantis"
IAMRolePolicy:
- property: "role:RoleName"
type: "regex"
value: "^cpco-.*"
IAMRolePolicyAttachment:
- type: "regex"
value: "^cpco-.*"
- type: "regex"
value: "^atlantis.*"
IAMPolicy:
- type: "regex"
value: "^arn:aws:iam::[0-9]+:policy/cpco-.*"
- type: "regex"
value: "^arn:aws:iam::[0-9]+:policy/service-role/cpco-.*"
- type: "regex"
value: "^arn:aws:iam::[0-9]+:policy/atlantis.*"
IAMRolePolicyAttachment:
- type: "regex"
value: "^cpco-.*"
- type: "regex"
value: "^atlantis.*"
CloudWatchLogsLogGroup:
- type: "regex"
value: "^/aws/eks/cpco-.*"
Expand All @@ -252,6 +274,9 @@ presets:
- property: "Name"
type: "exact"
value: "testing.cloudposse.co."
- property: "Name"
type: "exact"
value: "us-west-2-ecs.testing.cloudposse.co."
- property: "Name"
type: "regex"
value: ".*atlantis.*"
Expand Down