Repository navigation
Run LocalStack with lstk in both templates (1.0.0) - #7
Merged
Merged
Conversation
Bump localstack-dind and localstack-dood to 1.0.0 and replace the legacy localstack CLI and the awslocal, cdklocal, pulumilocal, samlocal and tflocal options with lstk from localstack-cli:1. DinD: lstk starts LocalStack on every container start, reads .devcontainer/lstk/config.toml, keeps state in a Docker volume and writes a localstack AWS profile. AWS_ENDPOINT_URL is no longer set, since lstk start refuses to run with it. DooD: lstk targets the compose service through LSTK_ENDPOINT_URL. Lambda containers join the shared network via LAMBDA_DOCKER_NETWORK. Fix the option description typo, drop usePro and LOCALSTACK_API_KEY, add end-to-end scenario tests and stop CI from ignoring failures.
Add a feature-ref input to the test workflow and both test actions. When set, CI checks out localstack/devcontainer-feature at that ref and builds the Templates with it through LOCAL_FEATURE_DIR.
Startup failures of the DooD LocalStack service, such as a rejected auth token, only surfaced as an unreachable endpoint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of DEVX-1046. Depends on localstack/devcontainer-feature#9.
Both Templates still run the legacy
localstackCLI withawslocal,tflocal,cdklocalandsamlocal, and point atlocalstack-cli:latestof the Feature. A user flagged the deprecatedtflocalin the community Slack. This PR moves both Templates tolstkand bumps them to 1.0.0.Docker-in-Docker (
localstack-dind)lstkstarts LocalStack on every container start (postStartCommand), after waiting for the inner Docker daemon.lstk startreturns once LocalStack is ready, so nolocalstack wait..devcontainer/lstk/config.toml(image tag,/datastate mount, LocalStack variables as an[env.devcontainer]profile).~/.config/lstk/config.tomllinks to it, so everylstkcommand in the container uses it, from any folder.lstk setup awswrites thelocalstackprofile and the Template setsAWS_PROFILE=localstack. Plainawsand the SDKs hit LocalStack.AWS_ENDPOINT_URLinremoteEnv.lstk startrefuses to run when it is set (lstkreads it as "target an external emulator").localstack-data-${devcontainerId}volume. The old setup failed when the host folder did not exist. ThevolumePathoption is gone.dind-var-lib-dockermount. The docker-in-docker Feature (now:4) already mounts a per-container volume at the same path, and the template's fixed volume name was shared by every dev container built from it.post-start.shtells the user to set the token or runlstk login.Docker-outside-of-Docker (
localstack-dood)LSTK_ENDPOINT_URL, solstk status,lstk aws,lstk terraformand the snapshot commands talk to it.lstk startandlstk stoprefuse to run, which replaces the old warning in the README.LAMBDA_DOCKER_NETWORKand gave the network a fixedname, so Lambda containers join the shared network whatever the Compose project is called. The smoke test invokes a Lambda function to cover this.environmentfrom the host..envonly carries LocalStack variables now, not client settings.post-start.shwaits for LocalStack and printslstk status.versionkey.Both
awslocal,cdklocal,pulumilocal,samlocal,tflocalandusePro. Both now add the AWS CLI Feature, needed bylstk awsand the profile. NOTES list the Feature to add forlstk terraform,lstk cdkandlstk sam.LOCALSTACK_API_KEYandACTIVATE_PRO.descripitontypo on most options. VS Code showed them with no description.imageVariant:noble(default),jammy,resolute,bookworm. Droppedfocal(EOL) andbullseye.versionproposals arelatest,stable,2026.10.localstack-cli:1instead of:latest.CI
continue-on-error: true. It kept CI green while the tests failed.mainand manual runs test both. Changes to.githubortest/test-utilstest both.loadPodsno longer needs a" "default.cleanup.shstops the Compose services, removes containers LocalStack started on the network (Lambda), then the network. Before, a leftover Lambda container blocked the network removal.LOCAL_FEATURE_DIRlets the scripts test against a local Feature checkout. I used it for the local runs below.feature-refinput on the workflow and both actions. It checks outlocalstack/devcontainer-featureat that ref and tests against it, so a Template change can be tested before the Feature it needs is released.lstk aws, profile, Lambda invoke,lstk stop), Terraform + CDK + SAM throughlstkon jammy, persistence with a pinned2026.10image andlstk restarton bookworm, IAM enforcement + region + trace logging, Cloud Pod auto-load on resolute,startup: false.lstk startrefused,lstk aws, profile, Lambda over the shared network), custom host + IAM + region, persistence with a pinned image on jammy,lstk terraformover the endpoint + Cloud Pod auto-load + trace logging on bookworm.Testing
Run locally on arm64 (OrbStack) with Dev Container CLI 0.91.0,
LOCAL_FEATURE_DIRpointing at the Feature PR, and the DooD host ports removed (a LocalStack was already bound to 4566 on my machine):test.sh)iac_tools_on_jammylstk terraformapply/destroy,lstk cdkbootstrap/deploy,lstk samdeploy + invokeiam_region_and_debugload_podno_startuppersistence_pinned_version_on_bookwormtest.sh)custom_host_iam_and_regionpersistence_pinned_version_on_jammyterraform_pod_and_debug_on_bookwormI also checked the DinD lifecycle by hand. Stopping and starting the dev container brings LocalStack back. A rebuild on the same volumes reuses the image and starts it. A rebuild with no
LOCALSTACK_AUTH_TOKENstill comes up, and prints the hint instead of failingdevcontainer up.Merge order
The last commit (
ci: TEMP ...) points this PR's CI at themigrate-to-lstkbranch of the Feature repo, so the full suite runs on GitHub's amd64 runners before the Feature is released. It has to be reverted before merge.localstack-cli:1exists on GHCR.ci: TEMPcommit here and re-run CI against the published Feature.CI status
CI is red because the repo secret
LOCALSTACK_AUTH_TOKEN(last set July 2024) is no longer valid. With theci: TEMPcommit, the runs get as far as the license check on GitHub's amd64 runners. The Feature installs from its branch, docker-in-docker starts, and the image pulls. Thenlstk startstops with:A repo admin needs to set
LOCALSTACK_AUTH_TOKENto a valid CI auth token. Then re-run this workflow.