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
18 changes: 5 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,15 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- uses: gautamkrishnar/keepalive-workflow@v1

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install CDK
run: |
npm install -g aws-cdk-local aws-cdk
cdklocal --version
npm install -g @localstack/lstk aws-cdk
cdk --version

- name: Install Python
uses: actions/setup-python@v4
Expand All @@ -48,14 +46,8 @@ jobs:
env:
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
run: |
pip install localstack awscli-local[ver1]
docker pull localstack/localstack-pro:latest
# Start LocalStack in the background
DEBUG=1 localstack start -d
# Wait 30 seconds for the LocalStack container to become ready before timing out
echo "Waiting for LocalStack startup..."
localstack wait -t 15
echo "Startup complete"
LOCALSTACK_DEBUG=1 lstk start

- name: Deploy using CDK
env:
Expand All @@ -64,8 +56,8 @@ jobs:
AWS_ACCESS_KEY_ID: test
AWS_SECRET_ACCESS_KEY: test
run: |
cdklocal bootstrap aws://000000000000/us-east-1
cdklocal deploy --require-approval never
lstk cdk bootstrap aws://000000000000/us-east-1
lstk cdk deploy --require-approval never

- name: Send a Slack notification
if: failure() || github.event_name != 'pull_request'
Expand Down
18 changes: 7 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,23 @@ usage: ## Show this help
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'

install: ## Install dependencies
@which localstack || pip install localstack
@which awslocal || pip install awscli-local
@which lstk || npm install -g @localstack/lstk
virtualenv env
. env/bin/activate && pip install -r requirements.txt

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
@LOCALSTACK_AUTH_TOKEN=$(LOCALSTACK_AUTH_TOKEN) lstk start

stop: ## Stop LocalStack
@localstack stop
@lstk 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
@lstk logs > logs.txt

deploy: ## Deploy the CDK stack
cdklocal bootstrap
cdklocal deploy --require-approval never
lstk cdk bootstrap
lstk cdk deploy --require-approval never

.PHONY: usage install start stop ready logs deploy
.PHONY: usage install start stop logs deploy
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ The sample code in this repository demonstrates how to use the ECS Code Mounting

## Prerequisites

- 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.
- [`localstack` CLI](https://docs.localstack.cloud/getting-started/installation/#localstack-cli).
- [Cloud Development Kit](https://docs.localstack.cloud/user-guide/integrations/aws-cdk/) with the [`cdklocal`](https://www.npmjs.com/package/aws-cdk-local) installed.
- A valid [LocalStack for AWS license](https://localstack.cloud/pricing). Your license provides a [`LOCALSTACK_AUTH_TOKEN`](https://docs.localstack.cloud/aws/getting-started/auth-token/) to activate LocalStack.
- [`lstk` CLI](https://docs.localstack.cloud/aws/developer-tools/running-localstack/lstk/) to manage the LocalStack container lifecycle. The AWS CLI is required by `lstk aws`.
- [Cloud Development Kit](https://docs.localstack.cloud/user-guide/integrations/aws-cdk/) used via the `lstk cdk` proxy.
- [Python 3.9+](https://www.python.org/downloads/) & `pip` package manager.
- [`virtualenv`](https://pypi.org/project/virtualenv/) for creating isolated Python environments.
- `cURL` or any other tool to send HTTP requests.
Expand All @@ -30,7 +30,7 @@ Start LocalStack with the `LOCALSTACK_AUTH_TOKEN` pre-configured:

```shell
export LOCALSTACK_AUTH_TOKEN=<your-auth-token>
localstack start
lstk start
```

## Instructions
Expand All @@ -52,13 +52,13 @@ pip install -r requirements.txt
To bootstrap the CDK, run the following command:

```shell
cdklocal bootstrap
lstk cdk bootstrap
```

To deploy the infrastructure, run the following command:

```shell
cdklocal deploy
lstk cdk deploy
```

You are expected to see the following output:
Expand Down Expand Up @@ -124,7 +124,7 @@ Hello, ECS Code Mounting!
To clean up the resources, run the following command:

```shell
localstack stop
lstk stop
```

## How do I set up the ECS Code Mounting feature?
Expand Down
Loading