Skip to content

Commit 1fd3646

Browse files
committed
cloudpod release file
1 parent 69cd7da commit 1fd3646

File tree

8 files changed

+111
-147
lines changed

8 files changed

+111
-147
lines changed
Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,56 @@
11
{
2-
"name": "LocalStack DinD setup",
3-
"image": "mcr.microsoft.com/devcontainers/base:jammy",
2+
"name": "LocalStack DinD setup",
3+
"image": "mcr.microsoft.com/devcontainers/base:jammy",
44

5-
"remoteEnv": {
6-
// Activate LocalStack Pro: https://docs.localstack.cloud/getting-started/auth-token/
7-
"LOCALSTACK_AUTH_TOKEN": "${localEnv:LOCALSTACK_AUTH_TOKEN}", // required for Pro, not processed via template due to security reasons
8-
"LOCALSTACK_API_KEY": "${localEnv:LOCALSTACK_API_KEY}",
9-
// LocalStack configuration: https://docs.localstack.cloud/references/configuration/
10-
"ACTIVATE_PRO": true,
11-
"DEBUG": true,
12-
"LS_LOG": "trace",
13-
"PERSISTENCE": false,
14-
"AWS_ENDPOINT_URL": "http://localhost.localstack.cloud:4566",
15-
"AUTO_LOAD_POD": "",
16-
"ENFORCE_IAM": false,
17-
"AWS_REGION": "us-east-1",
18-
"AWS_DEFAULT_REGION": "us-east-1",
19-
"IMAGE_NAME": "localstack/localstack-pro:latest",
20-
"LOCALSTACK_VOLUME_DIR": "/data"
21-
},
5+
"remoteEnv": {
6+
// Activate LocalStack Pro: https://docs.localstack.cloud/getting-started/auth-token/
7+
"LOCALSTACK_AUTH_TOKEN": "${localEnv:LOCALSTACK_AUTH_TOKEN}", // required for Pro, not processed via template due to security reasons
8+
"LOCALSTACK_API_KEY": "${localEnv:LOCALSTACK_API_KEY}",
9+
// LocalStack configuration: https://docs.localstack.cloud/references/configuration/
10+
"ACTIVATE_PRO": true,
11+
"DEBUG": true,
12+
"LS_LOG": "trace",
13+
"PERSISTENCE": false,
14+
"AWS_ENDPOINT_URL": "http://localhost.localstack.cloud:4566",
15+
"AUTO_LOAD_POD": "",
16+
"ENFORCE_IAM": false,
17+
"AWS_REGION": "us-east-1",
18+
"AWS_DEFAULT_REGION": "us-east-1",
19+
"IMAGE_NAME": "localstack/localstack-pro:latest",
20+
"LOCALSTACK_VOLUME_DIR": "/data"
21+
},
2222

23-
// 👇 Features to add to the Dev Container. More info: https://containers.dev/implementors/features.
24-
"features": {
25-
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
26-
"ghcr.io/localstack/devcontainer-feature/localstack-cli:latest": {
27-
"version": "latest",
28-
"awslocal": true, // if true, add in features manually: ghcr.io/devcontainers/features/aws-cli
29-
"cdklocal": false, // if true, add in features manually: ghcr.io/devcontainers-contrib/features/aws-cdk
30-
"pulumilocal": false, // if true, add in features manually: ghcr.io/devcontainers-contrib/features/pulumi
31-
"samlocal": false, // if true, add in features manually: ghcr.io/customink/codespaces-features/sam-cli
32-
"tflocal": false // if true, add in features manually: ghcr.io/devcontainers-contrib/features/terraform-asdf
33-
},
34-
"ghcr.io/devcontainers/features/aws-cli:1": {},
35-
"ghcr.io/devcontainers/features/python:1": {
36-
"version": "3.11"
37-
}
38-
},
23+
// 👇 Features to add to the Dev Container. More info: https://containers.dev/implementors/features.
24+
"features": {
25+
"ghcr.io/devcontainers/features/docker-in-docker:2": {},
26+
"ghcr.io/localstack/devcontainer-feature/localstack-cli:latest": {
27+
"version": "latest",
28+
"awslocal": true, // if true, add in features manually: ghcr.io/devcontainers/features/aws-cli
29+
"cdklocal": true, // if true, add in features manually: ghcr.io/devcontainers-contrib/features/aws-cdk
30+
"pulumilocal": false, // if true, add in features manually: ghcr.io/devcontainers-contrib/features/pulumi
31+
"samlocal": false, // if true, add in features manually: ghcr.io/customink/codespaces-features/sam-cli
32+
"tflocal": false // if true, add in features manually: ghcr.io/devcontainers-contrib/features/terraform-asdf
33+
},
34+
"ghcr.io/devcontainers/features/aws-cli:1": {},
35+
"ghcr.io/devcontainers/features/python:1": {
36+
"version": "3.11"
37+
}
38+
},
3939

40-
// 👇 Use 'postCreateCommand' to run commands after the container is created.
41-
"postCreateCommand": "type localstack; true && localstack start -d || true",
42-
"mounts": [
43-
{
44-
// to persist build data and images
45-
"source": "dind-var-lib-docker",
46-
"target": "/var/lib/docker",
47-
"type": "volume"
48-
},
49-
{
50-
"source": "./.volume",
51-
"target": "/data",
52-
"type": "bind",
53-
"consistency": "cached"
54-
}
55-
]
40+
// 👇 Use 'postCreateCommand' to run commands after the container is created.
41+
"postCreateCommand": "type localstack; true && localstack start -d || true",
42+
"mounts": [
43+
{
44+
// to persist build data and images
45+
"source": "dind-var-lib-docker",
46+
"target": "/var/lib/docker",
47+
"type": "volume"
48+
},
49+
{
50+
"source": "./.volume",
51+
"target": "/data",
52+
"type": "bind",
53+
"consistency": "cached"
54+
}
55+
]
5656
}
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
{
2-
"name": "LocalStack DooD setup",
3-
"dockerComposeFile": "docker-compose.yml",
4-
"service": "app",
5-
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
2+
"name": "LocalStack DooD setup",
3+
"dockerComposeFile": "docker-compose.yml",
4+
"service": "app",
5+
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
66

7-
// 👇 Features to add to the Dev Container. More info: https://containers.dev/implementors/features.
8-
"features": {
9-
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
10-
"ghcr.io/localstack/devcontainer-feature/localstack-cli:latest": {
11-
"version": "latest",
12-
"awslocal": true, // if true, add in features manually: ghcr.io/devcontainers/features/aws-cli
13-
"cdklocal": false, // if true, add in features manually: ghcr.io/devcontainers-contrib/features/aws-cdk
14-
"pulumilocal": false, // if true, add in features manually: ghcr.io/devcontainers-contrib/features/pulumi
15-
"samlocal": false, // if true, add in features manually: ghcr.io/customink/codespaces-features/sam-cli
16-
"tflocal": false // if true, add in features manually: ghcr.io/devcontainers-contrib/features/terraform-asdf
17-
},
18-
"ghcr.io/devcontainers/features/aws-cli:1": {},
19-
"ghcr.io/devcontainers/features/python:1": {
20-
"version": "3.11"
21-
}
22-
}
7+
// 👇 Features to add to the Dev Container. More info: https://containers.dev/implementors/features.
8+
"features": {
9+
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {},
10+
"ghcr.io/localstack/devcontainer-feature/localstack-cli:latest": {
11+
"version": "latest",
12+
"awslocal": true, // if true, add in features manually: ghcr.io/devcontainers/features/aws-cli
13+
"cdklocal": true, // if true, add in features manually: ghcr.io/devcontainers-contrib/features/aws-cdk
14+
"pulumilocal": false, // if true, add in features manually: ghcr.io/devcontainers-contrib/features/pulumi
15+
"samlocal": false, // if true, add in features manually: ghcr.io/customink/codespaces-features/sam-cli
16+
"tflocal": false // if true, add in features manually: ghcr.io/devcontainers-contrib/features/terraform-asdf
17+
},
18+
"ghcr.io/devcontainers/features/aws-cli:1": {},
19+
"ghcr.io/devcontainers/features/python:1": {
20+
"version": "3.11"
21+
}
22+
}
2323
}

.github/workflows/cloudpod_release.yml

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ on:
1313
- .gitlab-ci.yml
1414
branches:
1515
- main
16-
16+
1717
permissions:
1818
contents: write
1919

@@ -34,35 +34,39 @@ jobs:
3434

3535
- name: Set up Project
3636
run: |
37-
pip install -r requirements-dev.txt
37+
pip install -e ".[deploy]"
38+
39+
- name: Set up NodeJS 22
40+
id: setup-nodejs
41+
uses: actions/setup-node@v4
42+
with:
43+
node-version: 22
44+
45+
- name: Set up CDK Local
46+
id: setup-cdklocal
47+
run: |
48+
npm install -g aws-cdk-local aws-cdk
3849
39-
- name: Start LocalStack
50+
51+
- name: Start LocalStackV2
4052
uses: LocalStack/[email protected]
4153
with:
4254
image-tag: ${{ inputs.release-tag || 'latest'}}
43-
use-pro: 'true'
44-
install-awslocal: 'true'
55+
use-pro: "true"
56+
install-awslocal: "true"
4557
env:
4658
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
4759

4860
- name: Deploy infrastructure
61+
working-directory: deployments/cdk
4962
run: |
50-
bin/deploy.sh
63+
cdklocal bootstrap && cdklocal deploy --require-approval never
5164
52-
- name: Run Tests
53-
env:
54-
AWS_DEFAULT_REGION: us-east-1
55-
AWS_REGION: us-east-1
56-
AWS_ACCESS_KEY_ID: test
57-
AWS_SECRET_ACCESS_KEY: test
58-
run: |
59-
pytest tests
60-
6165
# Not using action as state is not stored as an artifact
62-
- name: Save the Cloud Pod
66+
- name: Save the Cloud Pod
6367
env:
6468
LOCALSTACK_API_KEY: ${{ secrets.LOCALSTACK_API_KEY }}
65-
run: |
69+
run: |
6670
localstack state export release-pod.zip
6771
6872
- name: Prepare Release Notes
@@ -81,4 +85,4 @@ jobs:
8185
name: "Cloud Pod for LocalStack Version '${{ inputs.release-tag || 'latest'}}'"
8286
body_path: ./Release.txt
8387
files: |
84-
./release-pod.zip
88+
./release-pod.zip

.github/workflows/preview_create.yml

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

.github/workflows/sync.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Sync repo to Gitlab
2-
on: [ push, delete, workflow_dispatch ]
2+
on: [push, delete, workflow_dispatch]
33

44
jobs:
55
sync:
@@ -13,5 +13,5 @@ jobs:
1313
- name: Mirroring Repository
1414
uses: pixta-dev/[email protected]
1515
with:
16-
target_repo_url: [email protected]:localstack.cloud/samples/sample-serverless-image-resizer-s3-lambda.git
17-
ssh_private_key: ${{ secrets.GITLAB_SSH_PRIVATE_KEY }}
16+
target_repo_url: [email protected]:localstack.cloud/samples/wordpress-ecs-rds-cdk.git
17+
ssh_private_key: ${{ secrets.GITLAB_SSH_PRIVATE_KEY }}

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[![LocalStack Pods Launchpad](https://localstack.cloud/gh/launch-pod-badge.svg)](https://app.localstack.cloud/launchpad?url=https://github.com//releases/download/latest/release-pod.zip
2+
13
wordpress-ecs-rds-cdk
24
===============================
35

@@ -20,8 +22,8 @@ After running `make install`, when you activate the virtual environment with
2022

2123
source .venv/bin/activate
2224

23-
you get the *local commands:
24-
25+
you get the *local commands:
26+
2527
cdklocal
2628
awslocal
2729

deployments/cdk/wordpress.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def __init__(self, scope: constructs.Construct, construct_id: str, **kwargs) ->
2121
self,
2222
"VPC",
2323
nat_gateways=1,
24-
ipaddress=ec2.IpAddresses.cidr("10.0.0.0/16"),
24+
ip_addresses=ec2.IpAddresses.cidr("10.0.0.0/16"),
2525
subnet_configuration=[
2626
ec2.SubnetConfiguration(
2727
name="public", subnet_type=ec2.SubnetType.PUBLIC, cidr_mask=24
@@ -54,8 +54,11 @@ def __init__(self, scope: constructs.Construct, construct_id: str, **kwargs) ->
5454
cluster = ecs.Cluster(self, "ServiceCluster", vpc=self.vpc)
5555

5656
wp_health_check = ecs.HealthCheck(
57-
command=['CMD-SHELL', 'curl -s -o /dev/null -w "%{http_code}" http://localhost | grep -qE "200|301|302"'],
58-
start_period=cdk.Duration.minutes(2)
57+
command=[
58+
"CMD-SHELL",
59+
'curl -s -o /dev/null -w "%{http_code}" http://localhost | grep -qE "200|301|302"',
60+
],
61+
start_period=cdk.Duration.minutes(2),
5962
)
6063

6164
docker_image = ecs.ContainerImage.from_registry("wordpress")
@@ -87,7 +90,7 @@ def __init__(self, scope: constructs.Construct, construct_id: str, **kwargs) ->
8790
path="/index.php",
8891
healthy_http_codes="200,301,302",
8992
interval=cdk.Duration.seconds(120),
90-
unhealthy_threshold_count=10
93+
unhealthy_threshold_count=10,
9194
)
9295

9396
database.connections.allow_default_port_from(web_service.service.connections)

setup.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,9 @@ deploy =
3737
aws-cdk-lib==2.139.1
3838
constructs>=10.0.0,<11.0.0
3939

40+
test =
41+
boto3 >=
42+
pytest>=7.0
43+
4044
[options.package_data]
4145
* = *.md

0 commit comments

Comments
 (0)