Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cdklocal package installer for lpm #10715

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Conversation

simonrw
Copy link
Contributor

@simonrw simonrw commented Apr 24, 2024

Motivation

It would be nice to support using cdklocal in init hooks.

Changes

  • Add package installer for lpm

Testing

Create a script with the following contents:

#!/bin/bash

set -euo pipefail

CDKLOCAL_VERSION=2.18.0
python -m localstack.cli.lpm install cdklocal --version ${CDKLOCAL_VERSION} --target var_libs
export PATH=/var/lib/localstack/lib/aws-cdk-local/${CDKLOCAL_VERSION}/node_modules/.bin:$PATH

cd /app
cdklocal bootstrap
cdklocal deploy --require-approval never --all

Then start LocalStack with the following additional settings:

  1. Mount your CDK app into the LocalStack container at start time, e.g. to /opt/cdk in the container
  2. Mount the script above into the container at /etc/localstack/init/ready.d/00-cdk.sh and make it executable

For example, using the CLI:

localstack start -v <path to cdk app>:/opt/cdk -v <path to init script>:/etc/localstack/init/ready.d/00-cdk.sh

Then LocalStack should start up, install cdklocal if it does not already exist, then proceed to bootstrap and deploy your application.

@simonrw simonrw added this to the Playground milestone Apr 24, 2024
@simonrw simonrw added area: integration/cdk Issues related to AWS Cloud Development Kit semver: patch Non-breaking changes which can be included in patch releases labels Apr 24, 2024
@simonrw simonrw self-assigned this Apr 24, 2024
Copy link

github-actions bot commented Apr 24, 2024

LocalStack Community integration with Pro

    2 files  ±0      2 suites  ±0   1h 37m 58s ⏱️ + 1m 45s
2 935 tests ±0  2 639 ✅ ±0  296 💤 ±0  0 ❌ ±0 
2 937 runs  ±0  2 639 ✅ ±0  298 💤 ±0  0 ❌ ±0 

Results for commit 0f3d2b3. ± Comparison against base commit 094740e.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented May 13, 2024

S3 Image Test Results (AMD64 / ARM64)

  2 files    2 suites   3m 8s ⏱️
398 tests 346 ✅  52 💤 0 ❌
796 runs  692 ✅ 104 💤 0 ❌

Results for commit 0f3d2b3.

♻️ This comment has been updated with latest results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: integration/cdk Issues related to AWS Cloud Development Kit semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant