Skip to content

Migrate CLI usage to lstk and fix CDK deployment - #38

Draft
peter-smith-phd wants to merge 2 commits into
mainfrom
devx-989-migrate-to-lstk
Draft

Migrate CLI usage to lstk and fix CDK deployment#38
peter-smith-phd wants to merge 2 commits into
mainfrom
devx-989-migrate-to-lstk

Conversation

@peter-smith-phd

@peter-smith-phd peter-smith-phd commented Jul 30, 2026

Copy link
Copy Markdown

Summary

  • Replace localstack/awslocal/cdklocal invocations with lstk across the Makefile, README, deploy scripts, and GitHub Actions workflows.
  • Various fixes to documentation and code, necessary to get examples working correctly.
  • Temporarily disabled GitHub Actions workflows for Ephemeral Instances and App Preview, until those are supported in future.

Testing

  • Manually invoked the commands from the README.md
  • Invoked CI workflows to ensure they work as expected.

- Replace localstack/awslocal/cdklocal invocations with lstk across the
  Makefile, README, deploy scripts, and GitHub Actions workflows.
- Fix bin/deploy_cdk.sh to activate the project .venv and invoke $CDK_CMD
  directly (needed since CDK_CMD="lstk cdk" can't go through `npm run`).
- Drop the BucketDeployment construct from FrontendStack: its singleton
  Lambda shells out to a real, unpatched AWS CLI binary, and LocalStack's
  Lambda executor unconditionally blanks AWS_CA_BUNDLE for every function,
  which that binary rejects. Sync the frontend build and invalidate
  CloudFront directly via `lstk aws` from deploy_cdk.sh instead.
- Add an early pytest plugin (pytest.ini + tests/_version_guard.py) that
  fails fast with a clear message on Python < 3.11, since
  localstack-sdk-python's pytest plugin crashes on import otherwise.
- Document the dummy AWS credentials tests/test_infra.py and
  test_outage.py need, and note where lstk has no equivalent yet
  (ephemeral instances, extensions install).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

⚡️ Running CI build with LocalStack ...

- cdk.yml: `lstk cdk --version` ran before `lstk start`, but it needs the
  emulator running even just to report its version — move it after.
- cdk.yml, e2e.yml, integration-test.yml: `lstk aws` prints "Note: No AWS
  profile found, run 'lstk setup aws'" to stdout when no profile exists,
  which corrupts every $(lstk aws ...) command substitution in
  bin/deploy.sh/bin/deploy_cdk.sh (confirmed via a fresh-HOME repro and
  fix, matching the exact CI failure). Add an `lstk setup aws
  --non-interactive --force` step before deploying.
- preview.yml, ephemeral.yml: disable their automatic triggers.
  `lstk aws` always targets its own locally-managed emulator and
  unconditionally ignores AWS_ENDPOINT_URL, so bin/deploy.sh (which now
  uses `lstk aws` throughout) can't reach the remote ephemeral instance
  these workflows provision. Left as manual-only (workflow_dispatch)
  until that's resolved, rather than reworking bin/deploy.sh's AWS
  client selection.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant