Skip to content

Commit afc6dea

Browse files
committed
README and Dockerfile update
1 parent 1899ae6 commit afc6dea

File tree

2 files changed

+32
-24
lines changed

2 files changed

+32
-24
lines changed
Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
FROM ghcr.io/ekristen/aws-nuke:v3.42.0
22

3-
# Set environment variable for AWS SDK debug logging
4-
ENV AWS_SDK_LOAD_CONFIG=1
5-
ENV AWS_DEBUG=true
3+
# Set environment variables
4+
ENV AWS_SDK_LOAD_CONFIG=1 \
5+
AWS_DEBUG=true
66

7-
USER root
8-
9-
# Install AWS CLI
7+
# Switch to root, install AWS CLI and cleanup in single layer
108
USER root
119
RUN apk add --no-cache \
12-
python3 \
13-
py3-pip \
14-
aws-cli
10+
python3 \
11+
py3-pip \
12+
aws-cli
1513

14+
# Copy configuration and script
1615
COPY nuke_generic_config.yaml /nuke_generic_config.yaml
17-
18-
# Add a script for debugging
1916
COPY --chmod=755 run.sh /run.sh
2017

21-
# Use shell as entrypoint
18+
# Switch back to non-root user for security
19+
USER aws-nuke
20+
2221
ENTRYPOINT ["/run.sh"]

.tools/test/stacks/nuke/typescript/README.md

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,43 @@ Please use caution and configure this tool to delete unused resources only in yo
1111

1212
## Overview
1313

14-
The code in this repository deploys the following architecture to a peovided "Plugin" AWS account:
14+
Defined in [account_nuker.ts](account_nuker.ts), this CDK stack deploys an AWS Lambda function that runs in a Docker container, scheduled to execute weekly via EventBridge.
1515

16-
![infrastructure-overview](nuke-overview.png)
16+
It includes:
17+
- A Docker-based Lambda function with ARM64 architecture and 1GB memory
18+
- An IAM role with administrative permissions for the Lambda
19+
- An EventBridge rule that triggers the function every Sunday at midnight
20+
- Deployment configurations including termination protection
1721

18-
## Feature Outline
22+
The Lambda function is built from a [Dockerfile](Dockerfile) and runs with a 15-minute timeout. It contains [this Nuke configuration](nuke_generic_config.yaml).
1923

20-
1. **Scheduled Trigger**: Amazon EventBridge invokes AWS Step Functions daily.
21-
2. **Regional Scalability**: Runs AWS CodeBuild projects per region.
22-
4. **Custom Config**: Pulls resource filters and region targets in [nuke_generic_config.yaml](nuke_generic_config.yaml).
24+
![infrastructure-overview](nuke-overview.png)
2325

2426
## Prerequisites
25-
1. **Non-Prod AWS Account Alias**: A non-prod account alias must exist in target account. Set the alias by running `python create_account_alias.py demo` or following [these instructions](https://docs.aws.amazon.com/IAM/latest/UserGuide/account-alias-create.html).
27+
1. **Non-Prod AWS Account Alias**: A non-prod account alias must exist in target account. Set the alias by running `python create_account_alias.py weathertop-test` or following [these instructions](https://docs.aws.amazon.com/IAM/latest/UserGuide/account-alias-create.html).
2628

2729
## Setup and Installation
28-
* Deploy the stack using the below command. You can run it in any desired region.
30+
For multi-account deployments, please use the [deploy.py](../../../DEPLOYMENT.md#option-1-using-deploypy) script.
31+
32+
For single-account deployment, you can just run:
2933
```sh
3034
cdk bootstrap && cdk deploy
3135
```
3236

3337
Note a successful stack creation, e.g.:
3438

3539
```bash
40+
NukeStack: success: Published 956fbd116734e79edb987e767fe7f45d0b97e23b8882e6b1af543843f80ba4c1:616362385685-us-east-1
41+
Stack undefined
42+
NukeStack: deploying... [1/1]
43+
NukeStack: creating CloudFormation changeset...
44+
3645
✅ NukeStack
3746

38-
✨ Deployment time: 172.66s
47+
✨ Deployment time: 27.93s
3948

40-
Outputs:
41-
NukeStack.NukeS3BucketValue = nuke-account-stack-config-616362312345-us-east-1-c043b470
4249
Stack ARN:
43-
arn:aws:cloudformation:us-east-1:123456788985:stack/NukeStack/cfhdkiott-acec-11ef-ba2e-4555c1356d07
50+
arn:aws:cloudformation:us-east-1:616362385685:stack/NukeStack/9835cc20-d358-11ef-bccf-123407dc82dd
51+
52+
✨ Total time: 33.24s
4453
```

0 commit comments

Comments
 (0)