Skip to content

fix: AWS CDK legacy exports#117

Open
dytyniuk wants to merge 1 commit intolocalstack:mainfrom
dytyniuk:fix/dont-use-aws-cdk-legacy-exports
Open

fix: AWS CDK legacy exports#117
dytyniuk wants to merge 1 commit intolocalstack:mainfrom
dytyniuk:fix/dont-use-aws-cdk-legacy-exports

Conversation

@dytyniuk
Copy link

@dytyniuk dytyniuk commented Mar 7, 2026

This PR fixes the following issues:


A little context for the proposed changes

I have spent at least several hours setting up the environment to point the vanilla AWS CDK CLI to LocalStack.
I have checked the changelogs for the AWS SDK for JavaScript, the AWS CDK CLI, and LocalStack.
And I want to share what I think the way for aws-cdk-local is:

  1. There's no need to patch the AWS SDK instance within AWS CDK CLI because it now runs the aws-sdk-js v3 that respects environment variables just like AWS CLI does.
  2. LocalStack deprecated Lambda source code mounts, so there's no need to hack it anymore. And, cdk(local) watch --hotswap, IMHO, is a more convenient alternative.
  3. The latest version of AWS CDK CLI (as of 2026/03/06) is 2.1109.0, so supporting AWS CDK versions prior to v2.14 is irrational.

Tested against LocalStack running in Docker:

$ printenv | grep AWS
$ docker ps
CONTAINER ID   IMAGE                          COMMAND                  CREATED          STATUS                    PORTS                                                          NAMES
90529edf6b13   localstack/localstack:stable   "docker-entrypoint.sh"   20 minutes ago   Up 15 seconds (healthy)   127.0.0.1:4510-4559->4510-4559/tcp, 127.0.0.1:4566->4566/tcp   localstack-main
$ awslocal s3 ls
$ cdklocal bootstrap
 ⏳  Bootstrapping environment aws://000000000000/us-east-1...
Trusted accounts for deployment: (none)
Trusted accounts for lookup: (none)
Using default execution policy of 'arn:aws:iam::aws:policy/AdministratorAccess'. Pass '--cloudformation-execution-policies' to customize.
CDKToolkit: creating CloudFormation changeset...
 ✅  Environment aws://000000000000/us-east-1 bootstrapped.
$ awslocal s3 ls
2026-03-07 21:12:33 cdk-hnb659fds-assets-000000000000-us-east-1

@dytyniuk dytyniuk force-pushed the fix/dont-use-aws-cdk-legacy-exports branch from bddba3a to 94d060f Compare March 7, 2026 20:35
@dytyniuk dytyniuk force-pushed the fix/dont-use-aws-cdk-legacy-exports branch from 94d060f to f5a5ba3 Compare March 7, 2026 20:40
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