Skip to content
Merged
Show file tree
Hide file tree
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
21 changes: 20 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
.PHONY: deploy-localstack deploy-aws
export AWS_ACCESS_KEY_ID ?= test
export AWS_SECRET_ACCESS_KEY ?= test
export AWS_DEFAULT_REGION=us-east-1
SHELL := /bin/bash

.PHONY: deploy-localstack deploy-aws start stop ready logs

list-resources-localstack:
@echo "List resources"
Expand All @@ -7,6 +12,20 @@ list-resources-localstack:
awslocal firehose list-delivery-streams
awslocal redshift describe-clusters

start: ## Start LocalStack
@test -n "${LOCALSTACK_AUTH_TOKEN}" || (echo "LOCALSTACK_AUTH_TOKEN is not set. Find your token at https://app.localstack.cloud/workspace/auth-token"; exit 1)
@LOCALSTACK_AUTH_TOKEN=$(LOCALSTACK_AUTH_TOKEN) localstack start -d

stop: ## Stop LocalStack
@localstack stop

ready: ## Wait until LocalStack is ready
@echo Waiting on the LocalStack container...
@localstack wait -t 30 && echo LocalStack is ready to use! || (echo Gave up waiting on LocalStack, exiting. && exit 1)

logs: ## Save the logs in a separate file
@localstack logs > logs.txt

start-localstack:
@docker ps -f "name=localstack" | grep localstack > /dev/null || (echo "Starting localstack..." && localstack start)

Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ LocalStack sample CDK app deploying cross-region and cross-account EventBridge b
# Prerequisites

## Required Software
- A valid [LocalStack for AWS license](https://localstack.cloud/pricing). Your license provides a [`LOCALSTACK_AUTH_TOKEN`](https://docs.localstack.cloud/getting-started/auth-token/) to activate LocalStack.
- Python 3.11
- node >16
- Docker
- AWS CLI
- AWS CDK
- LocalStack CLI
- [`localstack` CLI](https://docs.localstack.cloud/getting-started/installation/#localstack-cli)

<details>
<summary>if you are on Mac:</summary>
Expand Down Expand Up @@ -113,7 +114,9 @@ Against LocalStack
- You need to bootstrap for the desired region and account each time you start LocalStack

```bash
localstack start
export LOCALSTACK_AUTH_TOKEN=<your-auth-token>
make start
make ready
cdklocal synth
cdklocal bootstrap aws://000000000000/us-east-1
cdklocal bootstrap aws://000000000000/eu-central-1
Expand Down