Skip to content

Commit 4ef5158

Browse files
committedJul 11, 2023
Rebrand and Updates (ekristen#7)
* rebrand and update content accordingly for the fork * add config for renovate * remove old files * rework tests and release workflows, sign all builds
1 parent 3d53872 commit 4ef5158

13 files changed

+210
-371
lines changed
 

‎.github/CODEOWNERS

-1
This file was deleted.

‎.github/renovate.json

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"extends": [
3+
"config:base"
4+
],
5+
"packageRules": [
6+
{
7+
"matchManagers": [
8+
"dockerfile"
9+
],
10+
"matchUpdateTypes": [
11+
"pin",
12+
"digest"
13+
],
14+
"automerge": true
15+
},
16+
{
17+
"matchPackagePatterns": [
18+
"^golang.*"
19+
],
20+
"groupName": "golang",
21+
"groupSlug": "golang"
22+
}
23+
],
24+
"regexManagers": [
25+
{
26+
"fileMatch": [
27+
"^.github/workflows/.*"
28+
],
29+
"matchStrings": [
30+
"go-version: (?<currentValue>.*?)\n"
31+
],
32+
"depNameTemplate": "golang",
33+
"datasourceTemplate": "docker"
34+
}
35+
]
36+
}

‎.github/workflows/ci.yaml

-84
This file was deleted.

‎.github/workflows/golang.yaml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: golang
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
schedule:
11+
- cron: "15 3 * * 0"
12+
13+
jobs:
14+
build:
15+
name: Test and Build
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Setup Go
19+
uses: actions/setup-go@v2
20+
with:
21+
go-version: 1.17
22+
- name: Setup tools
23+
run: |
24+
go get golang.org/x/lint/golint
25+
- name: Checkout code
26+
uses: actions/checkout@v2
27+
- name: Test Project
28+
run: |
29+
make test
30+
- name: Build Project
31+
run: |
32+
make

‎.github/workflows/release.yaml

+23-97
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,30 @@
1-
name: Publish release artifacts
1+
name: release
22

33
on:
4-
release:
5-
types: [created]
4+
push:
5+
tags:
6+
- "v*"
7+
68
permissions:
79
contents: write
8-
pull-requests: write
910

1011
jobs:
11-
update_readme:
12-
name: Update Readme
13-
runs-on: ubuntu-22.04
14-
steps:
15-
- name: Checkout code
16-
uses: actions/checkout@v3
17-
with:
18-
fetch-depth: 0
19-
ref: main
20-
- name: Update versions in readme
21-
run: |
22-
sed -r -i "s/aws-nuke:v[0-9]+\.[0-9]+\.[0-9]+/aws-nuke:${{ github.ref_name }}/" README.md
23-
sed -r -i "s/aws-nuke-v[0-9]+\.[0-9]+\.[0-9]+/aws-nuke-${{ github.ref_name }}/" README.md
24-
sed -r -i "s/\/v[0-9]+\.[0-9]+\.[0-9]+\//\/${{ github.ref_name }}\//" README.md
25-
- uses: peter-evans/create-pull-request@v5
26-
name: Create Pull Request
27-
with:
28-
title: Update readme for ${{ github.ref_name }} release
29-
commit-message: Update readme for ${{ github.ref_name }} release
30-
body: Updating version references in the readme to ${{ github.ref_name }}
31-
branch: update-readme-${{ github.ref_name }}
32-
delete-branch: true
33-
34-
release:
35-
name: Publish binaries
36-
runs-on: ubuntu-22.04
37-
steps:
38-
- name: Setup Go
39-
uses: actions/setup-go@v3
40-
with:
41-
go-version: '1.20'
42-
- name: Checkout code
43-
uses: actions/checkout@v3
44-
with:
45-
fetch-depth: 0
46-
- name: Build Project binaries
47-
env:
48-
CGO_ENABLED: 0
49-
run: |
50-
make xc
51-
- name: Upload binaries to release
52-
uses: svenstaro/upload-release-action@v2
53-
with:
54-
repo_token: ${{ secrets.GITHUB_TOKEN }}
55-
file: dist/aws*
56-
tag: ${{ github.ref }}
57-
overwrite: true
58-
file_glob: true
59-
60-
docker_build:
61-
runs-on: ubuntu-22.04
62-
name: Docker Build
63-
12+
goreleaser:
13+
runs-on: ubuntu-latest
6414
steps:
65-
- uses: actions/checkout@v3
66-
with:
67-
fetch-depth: 0
68-
69-
- name: Generate image tags
70-
shell: bash
71-
run: echo "tags=quay.io/rebuy/aws-nuke:${GITHUB_REF#refs/tags/},docker.io/rebuy/aws-nuke:${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
72-
id: generate_tags
73-
74-
- name: Set up QEMU
75-
id: qemu
76-
uses: docker/setup-qemu-action@v2
77-
with:
78-
platforms: arm64
79-
80-
- name: Set up Docker Buildx
81-
uses: docker/setup-buildx-action@v2
82-
with:
83-
install: true
84-
85-
- name: Login to Docker Hub
86-
uses: docker/login-action@v2
87-
with:
88-
username: ${{ secrets.DOCKER_USERNAME }}
89-
password: ${{ secrets.DOCKER_PASSWORD }}
90-
91-
- name: Login to Quay.io
92-
uses: docker/login-action@v2
93-
with:
94-
registry: quay.io
95-
username: ${{ secrets.QUAY_USERNAME }}
96-
password: ${{ secrets.QUAY_PASSWORD }}
97-
98-
- name: Build and push
99-
uses: docker/build-push-action@v3
100-
with:
101-
context: .
102-
push: true
103-
tags: ${{ steps.generate_tags.outputs.tags }}
104-
platforms: linux/amd64,linux/arm64
15+
- name: Checkout
16+
uses: actions/checkout@v2
17+
with:
18+
fetch-depth: 0
19+
- name: Set up Go
20+
uses: actions/setup-go@v2
21+
with:
22+
go-version: 1.17
23+
- name: Run GoReleaser
24+
uses: goreleaser/goreleaser-action@v2
25+
with:
26+
distribution: goreleaser
27+
version: latest
28+
args: release --rm-dist
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.RELEASES_GITHUB_TOKEN }}

‎.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
/releases
66
/mocks
77
.envrc
8-
config.yaml
8+
config.yaml
9+
cosign.key

‎.goreleaser.yml

+26-26
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
dist: releases
22
release:
33
github:
4-
owner: rebuy-de
4+
owner: ekristen
55
name: aws-nuke
66
builds:
77
- id: default
@@ -14,7 +14,7 @@ builds:
1414
- arm64
1515
- arm
1616
goarm:
17-
- 7
17+
- "7"
1818
ignore:
1919
- goos: windows
2020
goarch: arm64
@@ -24,14 +24,14 @@ builds:
2424
goarch: arm
2525
ldflags:
2626
- -s
27-
- -X '{{ .ModulePath }}/cmd.BuildVersion=v{{ .Version }}'
27+
- -X '{{ .ModulePath }}/cmd.BuildVersion={{ .Version }}'
2828
- -X '{{ .ModulePath }}/cmd.BuildDate={{ .Date }}'
2929
- -X '{{ .ModulePath }}/cmd.BuildHash={{ .Commit }}'
3030
archives:
3131
- id: default
3232
builds:
3333
- default
34-
name_template: "{{ .ProjectName }}-v{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ .Arm }}"
34+
name_template: "{{ .ProjectName }}-{{ .Version }}-{{ .Os }}-{{ .Arch }}{{ .Arm }}"
3535
format_overrides:
3636
- goos: windows
3737
format: zip
@@ -41,60 +41,60 @@ dockers:
4141
goarch: amd64
4242
dockerfile: Dockerfile.goreleaser
4343
image_templates:
44-
- ghcr.io/rebuy-de/aws-nuke:v{{ .Version }}-amd64
45-
#- quay.io/rebuy/aws-nuke:v{{ .Version }}-amd64
44+
- ghcr.io/ekristen/aws-nuke:{{ .Version }}-amd64
4645
build_flag_templates:
4746
- "--pull"
4847
- "--label=org.opencontainers.image.created={{.Date}}"
4948
- "--label=org.opencontainers.image.title={{.ProjectName}}"
5049
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
51-
- "--label=org.opencontainers.image.version=v{{.Version}}"
52-
- "--label=org.opencontainers.image.source=https://github.com/debuy-de/aws-nuke"
50+
- "--label=org.opencontainers.image.version={{.Version}}"
51+
- "--label=org.opencontainers.image.source=https://github.com/ekristen/aws-nuke"
5352
- "--platform=linux/amd64"
5453
- use: buildx
5554
goos: linux
5655
goarch: arm64
5756
dockerfile: Dockerfile.goreleaser
5857
image_templates:
59-
- ghcr.io/rebuy-de/aws-nuke:v{{ .Version }}-arm64
60-
#- quay.io/rebuy/aws-nuke:v{{ .Version }}-amd64
58+
- ghcr.io/ekristen/aws-nuke:{{ .Version }}-arm64
6159
build_flag_templates:
6260
- "--pull"
6361
- "--label=org.opencontainers.image.created={{.Date}}"
6462
- "--label=org.opencontainers.image.title={{.ProjectName}}"
6563
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
66-
- "--label=org.opencontainers.image.version=v{{.Version}}"
67-
- "--label=org.opencontainers.image.source=https://github.com/debuy-de/aws-nuke"
64+
- "--label=org.opencontainers.image.version={{.Version}}"
65+
- "--label=org.opencontainers.image.source=https://github.com/ekristen/aws-nuke"
6866
- "--platform=linux/arm64"
6967
- use: buildx
7068
goos: linux
7169
goarch: arm
7270
goarm: "7"
7371
dockerfile: Dockerfile.goreleaser
7472
image_templates:
75-
- ghcr.io/rebuy-de/aws-nuke:v{{ .Version }}-arm32v7
76-
#- quay.io/rebuy-de/aws-nuke:v{{ .Version }}-arm32v7
73+
- ghcr.io/ekristen/aws-nuke:{{ .Version }}-arm32v7
7774
build_flag_templates:
7875
- "--pull"
7976
- "--label=org.opencontainers.image.created={{.Date}}"
8077
- "--label=org.opencontainers.image.title={{.ProjectName}}"
8178
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
82-
- "--label=org.opencontainers.image.version=v{{.Version}}"
83-
- "--label=org.opencontainers.image.source=https://github.com/debuy-de/aws-nuke"
79+
- "--label=org.opencontainers.image.version={{.Version}}"
80+
- "--label=org.opencontainers.image.source=https://github.com/ekristen/aws-nuke"
8481
- "--platform=linux/arm/v7"
8582
docker_manifests:
8683
- use: docker
87-
name_template: ghcr.io/rebuy-de/aws-nuke:v{{ .Version }}
84+
name_template: ghcr.io/ekristen/aws-nuke:{{ .Version }}
8885
image_templates:
89-
- ghcr.io/rebuy-de/aws-nuke:v{{ .Version }}-amd64
90-
- ghcr.io/rebuy-de/aws-nuke:v{{ .Version }}-arm64
91-
- ghcr.io/rebuy-de/aws-nuke:v{{ .Version }}-arm32v7
92-
#- use: docker
93-
# name_template: quay.io/rebuy-de/aws-nuke:v{{ .Version }}
94-
# image_templates:
95-
# - quay.io/rebuy-de/aws-nuke:v{{ .Version }}-amd64
96-
# - quay.io/rebuy-de/aws-nuke:v{{ .Version }}-arm64
97-
# - quay.io/rebuy-de/aws-nuke:v{{ .Version }}-arm32v7
86+
- ghcr.io/ekristen/aws-nuke:{{ .Version }}-amd64
87+
- ghcr.io/ekristen/aws-nuke:{{ .Version }}-arm64
88+
- ghcr.io/ekristen/aws-nuke:{{ .Version }}-arm32v7
89+
signs:
90+
- cmd: cosign
91+
stdin: "{{ .Env.COSIGN_PWD }}"
92+
args:
93+
["sign-blob", "--key=cosign.key", "--output=${signature}", "${artifact}"]
94+
artifacts: all
95+
docker_signs:
96+
- artifacts: all
97+
stdin: "{{ .Env.COSIGN_PWD }}"
9898
checksum:
9999
name_template: "checksums.txt"
100100
snapshot:

‎CONTRIBUTING.md

+5-16
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ Because of the amount of AWS services and their rate of change, we rely on your
66
participation. For the same reason we can only act retroactive on changes of
77
AWS services. Otherwise it would be a fulltime job to keep up with AWS.
88

9-
109
## How Can I Contribute?
1110

1211
### Some Resource Is Not Supported by *aws-nuke*
@@ -19,7 +18,6 @@ resolve this:
1918
* Add the resource yourself and open a Pull Request. Please follow the
2019
guidelines below to see how to create such a resource.
2120

22-
2321
### Some Resource Does Not Get Deleted
2422

2523
Please check the following points before creating a bug issue:
@@ -32,15 +30,14 @@ Please check the following points before creating a bug issue:
3230
know about dependencies between resources. To work around this it will just
3331
retry deleting all resources in multiple iterations. Therefore it is normal
3432
that there are a lot of dependency errors in the first one. The iterations
35-
are separated by lines starting with `Removal requested: ` and only the
33+
are separated by lines starting with `Removal requested:` and only the
3634
errors in the last block indicate actual errros.
3735

3836
File [an issue](https://github.com/rebuy-de/aws-nuke/issues/new) and describe
3937
as accurately as possible how to generate the resource on AWS that cause the
4038
errors in *aws-nuke*. Ideally this is provided in a reproducible way like
4139
a Terraform template or AWS CLI commands.
4240

43-
4441
### I Have Ideas to Improve *aws-nuke*
4542

4643
You should take these steps if you have an idea how to improve *aws-nuke*:
@@ -55,21 +52,16 @@ You should take these steps if you have an idea how to improve *aws-nuke*:
5552
the case, open a new issue and describe your idea. Afterwards, we can
5653
discuss this idea and form a proposal.
5754

58-
5955
### I Just Have a Question
6056

61-
Please use our mailing list for questions: aws-nuke@googlegroups.com. You can
62-
also search in the mailing list archive, whether someone already had the same
63-
problem: https://groups.google.com/d/forum/aws-nuke
64-
57+
Please use [GitHub Discussions](https://github.com/ekristen/aws-nuke/discussions)
6558

6659
## Resource Guidelines
6760

6861
### Consider Pagination
6962

7063
Most AWS resources are paginated and all resources should handle that.
7164

72-
7365
### Use Properties Instead of String Functions
7466

7567
Currently, each resource can offer two functions to describe itself, that are
@@ -90,7 +82,6 @@ Properties() types.Properties
9082
The interface for the String function is still there, because not all resources
9183
are migrated yet. Please use the Properties function for new resources.
9284

93-
9485
### Filter Resources That Cannot Get Removed
9586

9687
Some AWS APIs list resources, that cannot be deleted. For example:
@@ -100,7 +91,6 @@ Some AWS APIs list resources, that cannot be deleted. For example:
10091

10192
Those resources should be excluded in the filter step, rather than in the list step.
10293

103-
10494
## Styleguide
10595

10696
### Go
@@ -111,7 +101,6 @@ Like almost all Go projects, we are using `go fmt` as a single source of truth
111101
for formatting the source code. Please use `go fmt` before committing any
112102
change.
113103

114-
115104
### Git
116105

117106
#### Setup Email
@@ -122,21 +111,21 @@ is registered with a GitHub account.
122111

123112
To set the email for all git commits, you can use this command:
124113

125-
```
114+
```bash
126115
git config --global user.email "email@example.com"
127116
```
128117

129118
If you want to change the email only for the *aws-nuke* repository, you can
130119
skip the `--global` flag. You have to make sure that you are executing this in
131120
the *aws-nuke* directory:
132121

133-
```
122+
```bash
134123
git config user.email "email@example.com"
135124
```
136125

137126
If you already committed something with a wrong email, you can use this command:
138127

139-
```
128+
```bash
140129
git commit --amend --author="Author Name <email@address.com>"
141130
```
142131

‎Dockerfile

-29
This file was deleted.

‎LICENSE

+5-16
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2016 reBuy reCommerce GmbH
3+
Copyright 2021 Erik Kristensen
4+
Copyright 2016-2021 reBuy reCommerce GmbH
45

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
6+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
117

12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
8+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
149

15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
10+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

‎README.md

+77-99
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,32 @@
1-
# aws-nuke
1+
# aws-nuke (managed fork)
22

3-
![Build Status](https://github.com/rebuy-de/aws-nuke/workflows/Golang%20CI/badge.svg?branch=main)
4-
[![license](https://img.shields.io/github/license/rebuy-de/aws-nuke.svg)](https://github.com/rebuy-de/aws-nuke/blob/main/LICENSE)
5-
[![GitHub release](https://img.shields.io/github/release/rebuy-de/aws-nuke.svg)](https://github.com/rebuy-de/aws-nuke/releases)
6-
[![Docker Hub](https://img.shields.io/docker/pulls/rebuy/aws-nuke)](https://hub.docker.com/r/rebuy/aws-nuke)
3+
[![license](https://img.shields.io/github/license/ekristen/aws-nuke.svg)](https://github.com/ekristen/aws-nuke/blob/main/LICENSE)
4+
[![GitHub release](https://img.shields.io/github/release/ekristen/aws-nuke.svg)](https://github.com/ekristen/aws-nuke/releases)
75

86
Remove all resources from an AWS account.
97

10-
> **Development Status** *aws-nuke* is stable, but it is likely that not all AWS
8+
**Development Status** *aws-nuke* is stable, but it is likely that not all AWS
119
resources are covered by it. Be encouraged to add missing resources and create
12-
a Pull Request or to create an [Issue](https://github.com/rebuy-de/aws-nuke/issues/new).
10+
a Pull Request or to create an [Issue](https://github.com/ekristen/aws-nuke/issues/new).
1311

14-
## Caution!
12+
## This is a Managed Fork
13+
14+
**Important:** this is a full fork of the original tool written by the folks
15+
over at [rebuy-de](https://github.com/rebuy-de). This fork became necessary after
16+
attempting to make contributions and respond to issues to learn that the current
17+
maintainers only have time to work on the project about once a month and while
18+
receptive to bringing in other people to help maintain, made it clear it would take
19+
time. Considering the feedback cycle was already weeks on initial comms, I had
20+
to make the hard decision to fork and maintain myself.
21+
22+
### Plans
23+
24+
- Tests - would like to get more mock tests and integration tests in place
25+
- Tooling - make it easier to contribute by adding tools to automatically generate
26+
base resources that need to be slightly modified for use.
27+
- Other Clouds - would like to add Azure and GCP (likely rename project at that point)
28+
29+
## Caution
1530

1631
Be aware that *aws-nuke* is a very destructive tool, hence you have to be very
1732
careful while using it. Otherwise you might delete production data.
@@ -48,14 +63,13 @@ To reduce the blast radius of accidents, there are some safety precautions:
4863
Feel free to create an issue, if you have any ideas to improve the safety
4964
procedures.
5065

51-
5266
## Use Cases
5367

54-
* We are testing our [Terraform](https://www.terraform.io/) code with Jenkins.
68+
- We are testing our [Terraform](https://www.terraform.io/) code with Jenkins.
5569
Sometimes a Terraform run fails during development and messes up the account.
5670
With *aws-nuke* we can simply clean up the failed account so it can be reused
5771
for the next build.
58-
* Our platform developers have their own AWS Accounts where they can create
72+
- Our platform developers have their own AWS Accounts where they can create
5973
their own Kubernetes clusters for testing purposes. With *aws-nuke* it is
6074
very easy to clean up these account at the end of the day and keep the costs
6175
low.
@@ -65,12 +79,11 @@ procedures.
6579
We usually release a new version once enough changes came together and have
6680
been tested for a while.
6781

68-
You can find Linux, macOS and Windows binaries on the
69-
[releases page](https://github.com/rebuy-de/aws-nuke/releases), but we also
70-
provide containerized versions on [quay.io/rebuy/aws-nuke](https://quay.io/rebuy/aws-nuke)
71-
and [docker.io/rebuy/aws-nuke](https://hub.docker.com/r/rebuy/aws-nuke). Both
72-
are available for multiple architectures (amd64, arm64 & armv7).
73-
82+
You can find Linux, macOS and Windows binaries on the [releases page](https://github.com/ekristen/aws-nuke/releases),
83+
but we also provide containerized versions on [ghcr.io/ekristen/aws-nuke](https://ghcr.io/ekristen/aws-nuke)
84+
and [docker.io/ekristen/aws-nuke](https://hub.docker.com/r/ekristen/aws-nuke). Both
85+
are available for multiple architectures (amd64, arm64 & armv7) using Docker manifests. You can reference
86+
the main tag on any system and get the correct docker image automatically.
7487

7588
## Usage
7689

@@ -90,7 +103,7 @@ accounts:
90103
91104
With this config we can run *aws-nuke*:
92105
93-
```
106+
```bash
94107
$ aws-nuke -c config/nuke-config.yml --profile aws-nuke-example
95108
aws-nuke version v1.0.39.gc2f318f - Fri Jul 28 16:26:41 CEST 2017 - c2f318f37b7d2dec0e646da3d4d05ab5296d5bce
96109

@@ -121,7 +134,6 @@ the `--no-dry-run` flag is missing. Also it wants to delete the
121134
administrator. We don't want to do this, because we use this user to access
122135
our account. Therefore we have to extend the config so it ignores this user:
123136

124-
125137
```yaml
126138
regions:
127139
- eu-west-1
@@ -140,7 +152,7 @@ accounts:
140152
- "my-user -> ABCDEFGHIJKLMNOPQRST"
141153
```
142154
143-
```
155+
```bash
144156
$ aws-nuke -c config/nuke-config.yml --profile aws-nuke-example --no-dry-run
145157
aws-nuke version v1.0.39.gc2f318f - Fri Jul 28 16:26:41 CEST 2017 - c2f318f37b7d2dec0e646da3d4d05ab5296d5bce
146158

@@ -219,7 +231,7 @@ or in [shared config
219231
file](https://docs.aws.amazon.com/cli/latest/userguide/cli-roles.html) with an
220232
assuming role.
221233

222-
### Using custom AWS endpoint
234+
### Using Custom AWS Endpoints
223235

224236
It is possible to configure aws-nuke to run against non-default AWS endpoints.
225237
It could be used for integration testing pointing to a local endpoint such as an
@@ -267,7 +279,8 @@ accounts:
267279
```
268280
269281
This can then be used as follows:
270-
```buildoutcfg
282+
283+
```log
271284
$ aws-nuke -c config/my.yaml --access-key-id <access-key> --secret-access-key <secret-key> --default-region demo10
272285
aws-nuke version v2.11.0.2.gf0ad3ac.dirty - Tue Nov 26 19:15:12 IST 2019 - f0ad3aca55eb66b93b88ce2375f8ad06a7ca856f
273286

@@ -300,6 +313,7 @@ demo10 - EC2Volume - vol-dbea1d1083654d30a43366807a125aed - [tag:Name: "volume-5
300313

301314
--- truncating long output ---
302315
```
316+
303317
### Specifying Resource Types to Delete
304318

305319
*aws-nuke* deletes a lot of resources and there might be added more at any
@@ -310,13 +324,13 @@ One way are filters, which already got mentioned. This requires to know the
310324
identifier of each resource. It is also possible to prevent whole resource
311325
types (eg `S3Bucket`) from getting deleted with two methods.
312326

313-
* The `--target` flag limits nuking to the specified resource types.
314-
* The `--exclude` flag prevent nuking of the specified resource types.
327+
- The `--target` flag limits nuking to the specified resource types.
328+
- The `--exclude` flag prevent nuking of the specified resource types.
315329

316330
It is also possible to configure the resource types in the config file like in
317331
these examples:
318332

319-
```
333+
```yaml
320334
---
321335
regions:
322336
- "eu-west-1"
@@ -334,7 +348,7 @@ accounts:
334348
555133742: {}
335349
```
336350
337-
```
351+
```yaml
338352
---
339353
regions:
340354
- "eu-west-1"
@@ -358,56 +372,10 @@ If an exclude is used, then all its resource types will not be deleted.
358372
359373
**Hint:** You can see all available resource types with this command:
360374
361-
```
375+
```bash
362376
aws-nuke resource-types
363377
```
364378

365-
### AWS Cloud Control API Support
366-
367-
> This feature is not yet released and is probably part of `v2.18`.
368-
369-
_aws-nuke_ supports removing resources via the AWS Cloud Control API. When
370-
executing _aws-nuke_ it will automatically remove a manually managed set of
371-
resources via Cloud Control.
372-
373-
Only a subset of Cloud Control supported resources will be removed
374-
automatically, because there might be resources that were already implemented
375-
and adding them too would bypass existing filters in user configs as Cloud
376-
Control has another naming scheme and a different set of properties. Moreover,
377-
there are some Cloud Control resources that need special handling which is not
378-
yet supported by _aws-nuke_.
379-
380-
Even though the subset of automatically supported Cloud Control resources is
381-
limited, you can can configure _aws-nuke_ to make it try any additional
382-
resource. Either via command line flags of via the config file.
383-
384-
For the config file you have to add the resource to
385-
the`resource-types.cloud-control` list:
386-
387-
```yaml
388-
resource-types:
389-
cloud-control:
390-
- AWS::EC2::TransitGateway
391-
- AWS::EC2::VPC
392-
```
393-
394-
If you want to use the command line, you have to add a `--cloud-control` flag
395-
for each resource you want to add:
396-
397-
```sh
398-
aws-nuke \
399-
-c nuke-config.yaml \
400-
--cloud-control AWS::EC2::TransitGateway \
401-
--cloud-control AWS::EC2::VPC
402-
```
403-
404-
**Note:** There are some resources that are supported by Cloud Control and are
405-
already natively implemented by _aws-nuke_. If you configure to use Cloud
406-
Control for those resources, it will not execute the natively implemented code
407-
for this resource. For example with the `--cloud-control AWS::EC2::VPC` it will
408-
not use the `EC2VPC` resource.
409-
410-
411379
### Feature Flags
412380

413381
There are some features, which are quite opinionated. To make those work for
@@ -424,7 +392,6 @@ feature-flags:
424392
force-delete-lightsail-addons: true
425393
```
426394
427-
428395
### Filtering Resources
429396
430397
It is possible to filter this is important for not deleting the current user
@@ -473,7 +440,7 @@ the list will be skipped. These will be marked as "filtered by config" on the
473440
Some resources support filtering via properties. When a resource support these
474441
properties, they will be listed in the output like in this example:
475442

476-
```
443+
```log
477444
global - IAMUserPolicyAttachment - 'admin -> AdministratorAccess' - [RoleName: "admin", PolicyArn: "arn:aws:iam::aws:policy/AdministratorAccess", PolicyName: "AdministratorAccess"] - would remove
478445
```
479446

@@ -493,21 +460,21 @@ IAMUserAccessKey:
493460

494461
There are also additional comparision types than an exact match:
495462

496-
* `exact` – The identifier must exactly match the given string. This is the default.
497-
* `contains` – The identifier must contain the given string.
498-
* `glob` – The identifier must match against the given [glob
463+
- `exact` – The identifier must exactly match the given string. This is the default.
464+
- `contains` – The identifier must contain the given string.
465+
- `glob` – The identifier must match against the given [glob
499466
pattern](https://en.wikipedia.org/wiki/Glob_(programming)). This means the
500467
string might contains wildcards like `*` and `?`. Note that globbing is
501468
designed for file paths, so the wildcards do not match the directory
502469
separator (`/`). Details about the glob pattern can be found in the [library
503470
documentation](https://godoc.org/github.com/mb0/glob).
504-
* `regex` – The identifier must match against the given regular expression.
471+
- `regex` – The identifier must match against the given regular expression.
505472
Details about the syntax can be found in the [library
506473
documentation](https://golang.org/pkg/regexp/syntax/).
507-
* `dateOlderThan` - The identifier is parsed as a timestamp. After the offset is added to it (specified in the `value` field), the resulting timestamp must be AFTER the current
508-
time. Details on offset syntax can be found in
509-
the [library documentation](https://golang.org/pkg/time/#ParseDuration). Supported
510-
date formats are epoch time, `2006-01-02`, `2006/01/02`, `2006-01-02T15:04:05Z`,
474+
- `dateOlderThan` - The identifier is parsed as a timestamp. After the offset is added
475+
to it (specified in the `value` field), the resulting timestamp must be AFTER the
476+
current time. Details on offset syntax can be found in the [library documentation](https://golang.org/pkg/time/#ParseDuration).
477+
Supported date formats are epoch time, `2006-01-02`, `2006/01/02`, `2006-01-02T15:04:05Z`,
511478
`2006-01-02T15:04:05.999999999Z07:00`, and `2006-01-02T15:04:05Z07:00`.
512479

513480
To use a non-default comparision type, it is required to specify an object with
@@ -522,7 +489,6 @@ IAMUserAccessKey:
522489
value: "admin -> *"
523490
```
524491

525-
526492
#### Using Them Together
527493

528494
It is also possible to use Filter Properties and Filter Types together. For
@@ -535,9 +501,10 @@ Route53HostedZone:
535501
value: "*.rebuy.cloud."
536502
```
537503

538-
#### Inverting Filter Results
504+
#### Inverting Filter Results
539505

540506
Any filter result can be inverted by using `invert: true`, for example:
507+
541508
```yaml
542509
CloudFormationStack:
543510
- property: Name
@@ -549,7 +516,6 @@ In this case *any* CloudFormationStack ***but*** the ones called "foo" will be
549516
filtered. Be aware that *aws-nuke* internally takes every resource and applies
550517
every filter on it. If a filter matches, it marks the node as filtered.
551518

552-
553519
#### Filter Presets
554520

555521
It might be the case that some filters are the same across multiple accounts.
@@ -598,7 +564,6 @@ presets:
598564
- "OrganizationAccountAccessRole"
599565
```
600566

601-
602567
## Install
603568

604569
### For macOS
@@ -607,21 +572,39 @@ presets:
607572
### Use Released Binaries
608573

609574
The easiest way of installing it, is to download the latest
610-
[release](https://github.com/rebuy-de/aws-nuke/releases) from GitHub.
575+
[release](https://github.com/ekristen/aws-nuke/releases) from GitHub.
611576

612577
#### Example for Linux Intel/AMD
613578

614579
Download and extract
615-
`$ wget -c https://github.com/rebuy-de/aws-nuke/releases/download/v2.23.0/aws-nuke-v2.23.0-linux-amd64.tar.gz -O - | tar -xz -C $HOME/bin`
580+
581+
```bash
582+
wget -c https://github.com/rebuy-de/aws-nuke/releases/download/v2.16.0/aws-nuke-v2.16.0-linux-amd64.tar.gz -O - | sudo tar -xz -C $HOME/bin
583+
```
616584

617585
Run
618-
`$ aws-nuke-v2.23.0-linux-amd64`
586+
587+
```bash
588+
aws-nuke-v2.16.0-linux-amd64
589+
```
619590

620591
### Compile from Source
621592

622593
To compile *aws-nuke* from source you need a working
623-
[Golang](https://golang.org/doc/install) development environment. The sources
624-
must be cloned to `$GOPATH/src/github.com/rebuy-de/aws-nuke`.
594+
[Golang](https://golang.org/doc/install) development environment.
595+
596+
*aws-nuke* uses go modules and so the clone path should no matter.
597+
598+
The easiest way to compile is by using [goreleaser](https://goreleaser.io)
599+
600+
```bash
601+
goreleaser --rm-dist --snapshot --single-target
602+
```
603+
604+
**Note:** this will automatically build for your current architecture and place the result
605+
in the releases directory.
606+
607+
You may also use `make` to compile the binary, this was left over from before the fork.
625608

626609
Also you need to install [golint](https://github.com/golang/lint/) and [GNU
627610
Make](https://www.gnu.org/software/make/).
@@ -639,7 +622,7 @@ $ docker run \
639622
--rm -it \
640623
-v /full-path/to/nuke-config.yml:/home/aws-nuke/config.yml \
641624
-v /home/user/.aws:/home/aws-nuke/.aws \
642-
quay.io/rebuy/aws-nuke:v2.23.0 \
625+
ghcr.io/ekristen/aws-nuke \
643626
--profile default \
644627
--config /home/aws-nuke/config.yml
645628
```
@@ -654,7 +637,6 @@ Make sure you use the latest version in the image tag. Alternatiely you can use
654637
`main` for the latest development version, but be aware that this is more
655638
likely to break at any time.
656639

657-
658640
## Testing
659641

660642
### Unit Tests
@@ -667,13 +649,9 @@ To run the unit tests:
667649
make test
668650
```
669651

670-
671652
## Contact Channels
672653

673-
Feel free to create a GitHub Issue for any bug reports or feature requests.
674-
Please use our mailing list for questions: aws-nuke@googlegroups.com. You can
675-
also search in the mailing list archive, whether someone already had the same
676-
problem: https://groups.google.com/d/forum/aws-nuke
654+
For now GitHub issues, may open a Slack or Discord if warranted.
677655

678656
## Contribute
679657

‎cosign.pub

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-----BEGIN PUBLIC KEY-----
2+
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEzwDt3+veru3N3fCnc0kYxm4mnCO4
3+
464OTkXk2z+PjI11g5ZRv7UrORXcZ20mmuGUN3/aVfexq+aGb5Bi+uHrPw==
4+
-----END PUBLIC KEY-----

‎golang.mk

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Source: https://github.com/rebuy-de/golang-template
2-
31
TARGETS?="."
42
PACKAGE=$(shell GOPATH= go list $(TARGET))
53
NAME=$(notdir $(shell echo $(PACKAGE) | sed 's/\/v2//'))

0 commit comments

Comments
 (0)
Please sign in to comment.