Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit b560bf4

Browse files
author
CodingNagger
committed
Move the S3 deletiong outside of the nuke command for safety
1 parent b4b6cb5 commit b560bf4

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,16 @@ invoke_lambda:
190190
create_s3_bucket:
191191
aws s3 mb "s3://$(AWS_BUCKET)" --profile $(AWS_PROFILE)
192192

193+
delete_s3_bucket:
194+
aws s3 ls "s3://$(AWS_BUCKET)" 2>/dev/null >/dev/null && aws s3 rb "s3://$(AWS_BUCKET)" --force
195+
193196
delete_layer:
194197
aws lambda list-layer-versions --layer-name nio-swift-lambda-runtime-5-1 --output text | \
195198
awk '{ print $$NF }' | \
196199
xargs aws lambda delete-layer-version --layer-name $(SWIFT_LAMBDA_LIBRARY) --version-number
197200

198201
nuke: clean_layer clean_lambda delete_layer
199202
-aws lambda get-function --function-name $(LAMBDA_FUNCTION_NAME) 2>/dev/null >/dev/null && aws lambda delete-function --function-name $(LAMBDA_FUNCTION_NAME)
200-
-aws s3 ls "s3://$(AWS_BUCKET)" 2>/dev/null >/dev/null && aws s3 rb "s3://$(AWS_BUCKET)" --force
201203

202204
#quick commands - no clean
203205
quick_build_lambda: build_lambda create_build_directory

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,15 @@ Sometimes you want to go back to a clean slate and we have a command for that wh
325325
make nuke
326326
```
327327

328-
That command will clean your local build folders and delete S3 buckets, lambdas and layers created based off the configuration you use.
328+
That command will clean your local build folders then delete lambdas and layers created based off the configuration you use.
329+
330+
### 7) Delete S3 bucket
331+
332+
You can delete the S3 bucket where you hold your lambdas and layers with the command below:
333+
334+
```console
335+
make delete_s3_bucket
336+
```
329337

330338
# Update the lambda layer
331339

0 commit comments

Comments
 (0)