Skip to content

Commit 72699fc

Browse files
authored
configure the sample application to work with LocalStack (#1)
* prepare application for developer hub * add a github action workflow * add README, Makefile and other fixes * fix headings
1 parent 6853c7a commit 72699fc

25 files changed

+266
-514
lines changed

.github/CODEOWNERS

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/pull_request_template.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/renovate.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/main.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Deploy on LocalStack
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- 'README.md'
7+
branches:
8+
- main
9+
pull_request:
10+
branches:
11+
- main
12+
13+
jobs:
14+
terraform:
15+
name: Setup infrastructure using CDK
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: 18
25+
26+
- name: Start LocalStack
27+
env:
28+
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
29+
DNS_ADDRESS: 0
30+
run: |
31+
pip install localstack awscli-local[ver1]
32+
pip install terraform-local
33+
docker pull localstack/localstack-pro:latest
34+
# Start LocalStack in the background
35+
DEBUG=1 localstack start -d
36+
# Wait 30 seconds for the LocalStack container to become ready before timing out
37+
echo "Waiting for LocalStack startup..."
38+
localstack wait -t 15
39+
echo "Startup complete"
40+
41+
- name: Install CDK
42+
run: |
43+
npm install -g aws-cdk-local aws-cdk
44+
cdklocal --version
45+
46+
- name: Install dependencies
47+
run: yarn
48+
49+
- name: Prepare Lambda functions
50+
run: yarn build:backend
51+
52+
- name: Bootstrap the infrastructure
53+
run: |
54+
yarn cdklocal bootstrap
55+
sleep 10
56+
57+
- name: Deploy the infrastructure
58+
uses: nick-fields/retry@v2
59+
with:
60+
max_attempts: 3
61+
retry_on: error
62+
timeout_seconds: 120
63+
retry_wait_seconds: 10
64+
command: |
65+
yarn cdklocal deploy

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,4 +144,4 @@ cdk.out
144144
!.yarn/plugins
145145
!.yarn/sdks
146146
!.yarn/versions
147-
.pnp.*
147+
.pnp.*

AmazonChangeLog.txt

Lines changed: 0 additions & 14 deletions
This file was deleted.

CODE_OF_CONDUCT.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 0 additions & 59 deletions
This file was deleted.

0 commit comments

Comments
 (0)