Skip to content

Commit

Permalink
Merge pull request #490 from ekristen/fixes-jan2025
Browse files Browse the repository at this point in the history
chore: docs and refactors
  • Loading branch information
ekristen authored Jan 2, 2025
2 parents 45a1d70 + 287ba27 commit f82fbbc
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 20 deletions.
31 changes: 26 additions & 5 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Preferred installation order is the following:

1. [GitHub Release](#github-releases-preferred)
2. [ekristen's homebrew tap](#ekristens-homebrew-tap-macoslinux)
2. [Homebrew Tap](#ekristens-homebrew-tap-macoslinux)
3. [Homebrew Core](#homebrew-core-macoslinux)

Docker images are also available via the GitHub Container Registry.
Expand All @@ -13,18 +13,24 @@ Docker images are also available via the GitHub Container Registry.
!!! success - "Recommended"
This supports all operating systems and most architectures.

You can download pre-compiled binaries from the [releases](https://github.com/ekristen/aws-nuke/releases) page.
You can download pre-compiled binaries from the [releases](https://github.com/ekristen/aws-nuke/releases) page, or you can use my tool
[distillery](https://github.com/ekristen/distillery) to download and install the latest version.

## ekristen's Homebrew Tap (MacOS/Linux)
```console
dist install ekristen/aws-nuke
```

## Homebrew Tap (macOS)

!!! info
I control this tap, and it sources the binaries directly from the GitHub releases. However, it only supports MacOS.
I control this tap, and it sources the binaries directly from the GitHub releases. However, it only supports MacOS
and it tends to lag a bit behind.

```console
brew install ekristen/tap/aws-nuke
```

## Homebrew Core (MacOS/Linux)
## Homebrew Core (macOS/Linux)

!!! note
I do not control the Homebrew Core formula, so it may not be up to date. Additionally, it is not compiled with
Expand All @@ -50,3 +56,18 @@ To compile **aws-nuke** from source you need a working [Golang](https://golang.o
goreleaser build --clean --snapshot --single-target
```

## Verifying Binaries

All the binaries are signed with [cosign](https://github.com/sigstore/cosign) and are signed with keyless signatures.
You can verify the build using the public transparency log and the cosign binary.

**Note:** swap out `VERSION` with `vX.Y.Z`.

```console
cosign verify-blob \
--signature https://github.com/ekristen/aws-nuke/releases/download/VERSION/checksums.txt.sig \
--certificate https://github.com/ekristen/aws-nuke/releases/download/VERSION/checksums.txt.pem \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
--certificate-identity "https://github.com/ekristen/aws-nuke/.github/workflows/goreleaser.yml@refs/tags/VERSION" \
https://github.com/ekristen/aws-nuke/releases/download/VERSION/checksums.txt
```
2 changes: 1 addition & 1 deletion resources/kms-alias.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (l *KMSAliasLister) List(_ context.Context, o interface{}) ([]resource.Reso
KeyId: alias.TargetKeyId,
})
if err != nil {
opts.Logger.WithError(err).Error("failed to list tags for key")
opts.Logger.WithError(err).Debug("failed to list tags for key for the alias")
}
tags = keyTags.Tags
}
Expand Down
2 changes: 1 addition & 1 deletion resources/kms-key.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (l *KMSKeyLister) List(_ context.Context, o interface{}) ([]resource.Resour
if errors.As(err, &awsError) {
if awsError.Code() == "AccessDeniedException" {
inaccessibleKeys = true
logrus.WithError(err).Debug("unable to list tags")
logrus.WithError(err).Debug("unable to list tags - inaccessible key")
continue
} else {
logrus.WithError(err).Error("unable to list tags")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ import (

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/resourceexplorer2"
"github.com/ekristen/aws-nuke/v3/pkg/nuke"

"github.com/ekristen/libnuke/pkg/registry"
"github.com/ekristen/libnuke/pkg/resource"
"github.com/ekristen/libnuke/pkg/types"

"github.com/ekristen/aws-nuke/v3/pkg/nuke"
)

const ResourceExplorer2ViewResource = "ResourceExplorer2View"
Expand All @@ -23,11 +26,6 @@ func init() {

type ResourceExplorer2ViewLister struct{}

type ResourceExplorer2View struct {
svc *resourceexplorer2.ResourceExplorer2
viewArn *string
}

func (l *ResourceExplorer2ViewLister) List(_ context.Context, o interface{}) ([]resource.Resource, error) {
opts := o.(*nuke.ListerOpts)
svc := resourceexplorer2.New(opts.Session)
Expand All @@ -43,8 +41,8 @@ func (l *ResourceExplorer2ViewLister) List(_ context.Context, o interface{}) ([]

for _, view := range output.Views {
resources = append(resources, &ResourceExplorer2View{
svc: svc,
viewArn: view,
svc: svc,
ARN: view,
})
}

Expand All @@ -58,14 +56,23 @@ func (l *ResourceExplorer2ViewLister) List(_ context.Context, o interface{}) ([]
return resources, nil
}

func (f *ResourceExplorer2View) Remove(_ context.Context) error {
_, err := f.svc.DeleteView(&resourceexplorer2.DeleteViewInput{
ViewArn: f.viewArn,
type ResourceExplorer2View struct {
svc *resourceexplorer2.ResourceExplorer2
ARN *string `description:"The ARN of the Resource Explorer View"`
}

func (r *ResourceExplorer2View) Remove(_ context.Context) error {
_, err := r.svc.DeleteView(&resourceexplorer2.DeleteViewInput{
ViewArn: r.ARN,
})

return err
}

func (f *ResourceExplorer2View) String() string {
return *f.viewArn
func (r *ResourceExplorer2View) String() string {
return *r.ARN
}

func (r *ResourceExplorer2View) Properties() types.Properties {
return types.NewPropertiesFromStruct(r)
}

0 comments on commit f82fbbc

Please sign in to comment.