Skip to content

feat: switch to LocalStack Pro image#286

Open
pinzon wants to merge 1 commit intomasterfrom
246
Open

feat: switch to LocalStack Pro image#286
pinzon wants to merge 1 commit intomasterfrom
246

Conversation

@pinzon
Copy link
Member

@pinzon pinzon commented Mar 5, 2026

Motivation

The localstack/localstack image is being migrated to LocalStack Pro. After March 23rd, the community image will no longer work as expected. This update ensures the serverless-localstack plugin
continues to function by switching to localstack/localstack-pro and requiring users to set a LOCALSTACK_AUTH_TOKEN.

Changes

  • docker-compose.yml: Updated image from localstack/localstack to localstack/localstack-pro and added LOCALSTACK_AUTH_TOKEN environment variable
  • src/index.js: Updated startContainer() to use the pro image via and log a warning if LOCALSTACK_AUTH_TOKEN is not set
  • src/index.js: Added method to determine the image to use by the localstack-cli
  • .github/workflows/ci.yml: Updated CI to pull and start localstack/localstack-pro, passing LOCALSTACK_AUTH_TOKEN from GitHub secrets
  • README.md: Updated pre-requisites and environment variables documentation to reflect LocalStack Pro requirement
  • package.json: Bumped version from 1.3.1 to 1.4.0

Notes

  • Co-authored by Claude

@pinzon pinzon requested review from alexrashed and jw2 March 5, 2026 20:40
@pinzon pinzon marked this pull request as ready for review March 5, 2026 20:59
Copy link
Member

@alexrashed alexrashed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for preparing serverless-localstack for our upcoming image consolidation! But I think there might be a bit of a misunderstanding. I think we should move towards using the Pro image (with an auth token) everywhere now, such that - at the time of the image consolidation - this will just continue to work.
This PR - to me - seems like it's moving to explicitly use community (at least for as long as localstack/localstack is still the OSS version). This would mean that some users who are already using Pro would suddenly start using Community (?!) and for all users this will suddenly break with the image consolidation (because no auth token is set).

In addition, there are also other usages of Community here in the repo which are not touched by this PR:

  • const startContainer = () => {
    this.log('Starting LocalStack in Docker. This can take a while.');
    const cwd = process.cwd();
    const env = this.clone(process.env);
    env.DEBUG = '1';
    env.LAMBDA_EXECUTOR = env.LAMBDA_EXECUTOR || 'docker';
    env.LAMBDA_REMOTE_DOCKER = env.LAMBDA_REMOTE_DOCKER || '0';
    env.DOCKER_FLAGS = (env.DOCKER_FLAGS || '') + ` -v ${cwd}:${cwd}`;
    env.START_WEB = env.START_WEB || '0';
    const maxBuffer = +env.EXEC_MAXBUFFER || 50 * 1000 * 1000; // 50mb buffer to handle output
    if (this.shouldRunDockerSudo()) {
    env.DOCKER_CMD = 'sudo docker';
    }
    const options = { env: env, maxBuffer };
    return exec('localstack start -d', options)
  • - name: Start LocalStack
    run: |
    pip install localstack awscli-local[ver1]
    docker pull localstack/localstack
    localstack start -d
    localstack wait -t 30
  • https://github.com/localstack/serverless-examples/blob/c4874f3cb38d67d64f90cc2d444941c55d8064b9/Makefile#L7-L8

Happy to discuss this directly, but I guess the most important question is: How should this tool look like / act when there is no separation between Community and Pro anymore, and how can this be executed on as soon as possible (rather than breaking at the time of the consolidation or in the worst case even twice)?

run: |
pip install localstack localstack
docker pull localstack/localstack-pro
localstack auth set-token $LOCALSTACK_AUTH_TOKEN
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: I am a bit confused by this change. Why would you stop setting an auth token when switching to Pro explicitly?

Copy link
Member Author

@pinzon pinzon Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the LocalStack CLI detects if the LOCALSTACK_AUTH_TOKEN env var is set. For the case that it is, it will start the Pro image without extra arguments. The idea of the removal was to save 1 line of code. But I can add it it back if you prefer it.

@@ -59,7 +59,6 @@ jobs:
run: |
pip install localstack localstack
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: This is out of scope fore this PR, bit it definitely is weird 😄 Why is the package listed here twice?

Copy link
Member Author

@pinzon pinzon Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI triaging shenanigans 😅 . The awslocal-cli (the wrapper around aws-cli) is not necessary for the testing.

src/index.js Outdated
env.DOCKER_CMD = 'sudo docker';
}
const options = { env: env, maxBuffer };
return exec('localstack start -d --image localstack/localstack-pro', options)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Similar to the comment above, this change seems to be actually moving back from using Pro to Community (at least for as long as localstack/locastack is still referencing Community).
But I guess it would be fine, IF a user has set an auth token and its forwarded here correctly. Is this the case?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no --image parameter. This was Claude hallucinating.

@pinzon
Copy link
Member Author

pinzon commented Mar 6, 2026

@alexrashed Thank you so much for the thorough review. As you will notice from my answers to your questions, I was relying heavily on the auto detection of the auth token by the localstack-cli. That was because the docs and the help message of the tool do not describe any parameter to allow the specification of the docker image.

Looking at the PR I can see why you assumed I was setting the community version as the main image to use, and made me think that users of the plugin could also be confused. So I searched (and found) in the localstack-cli codebase for a config var that allows the specification of the LocalStack image: IMAGE_NAME.

So with that in mind. I added the option for users to set the image variable in the plugin configuration. Now the plugin will default to pro image if no configuration is specifically set.

Happy to discuss any more improvements to this pr 👍

@pinzon pinzon requested a review from alexrashed March 6, 2026 15:18
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.

2 participants