Skip to content

About

LocalStack DevContainer Feature(s)

Resources

Code of conduct

Contributing

Stars

5 stars

Watchers

14 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

Repository files navigation

DevContainer Feature(s)

A collection of LocalStack related and managed Devcontainer Feature(s).

Features are self-contained units of installation code and development container configuration. Features are designed to install atop a wide-range of base container images (this repo focuses on debian based images).

Warning

This repo currently a work in progress which might introduce breaking changes without notification.

List of features

  • LocalStack CLI: installs lstk, the LocalStack CLI. lstk starts and manages LocalStack and runs the AWS CLI, Terraform, AWS CDK and AWS SAM against it, replacing awslocal, tflocal, cdklocal and samlocal. It can also install pulumilocal for Pulumi.

Version 1.x of the Feature installs lstk. Version 0.x installed the legacy Python localstack CLI and is still available as localstack-cli:0.

Usage

To reference a feature from this repository, add the desired features to a devcontainer.json. Each feature has a README.md that shows how to reference the feature and which options are available for that feature.

The example below installs lstk together with Docker-in-Docker and the AWS CLI, which lstk needs to start LocalStack and run lstk aws.

{
    "image": "mcr.microsoft.com/devcontainers/base:noble",
    "features": {
        "ghcr.io/devcontainers/features/docker-in-docker:4": {},
        "ghcr.io/devcontainers/features/aws-cli:1": {},
        "ghcr.io/localstack/devcontainer-feature/localstack-cli:1": {}
    },
    "remoteEnv": {
        "LOCALSTACK_AUTH_TOKEN": "${localEnv:LOCALSTACK_AUTH_TOKEN}"
    }
}

For a ready-made setup that also starts LocalStack, use the LocalStack DevContainer Templates.

Testing

The tests use the Dev Container CLI:

npm install -g @devcontainers/cli
devcontainer features test -f localstack-cli --skip-autogenerated .           # scenarios in test/localstack-cli/scenarios.json
devcontainer features test -f localstack-cli --skip-scenarios -i debian:latest .

Repo and Feature Structure

Similar to the devcontainers/features repo, this repository has a src folder. Each feature has its own sub-folder, containing at least a devcontainer-feature.json and an entrypoint script install.sh.

├── src
│   ├── hello
│   │   ├── devcontainer-feature.json
│   │   └── install.sh
│   ├── color
│   │   ├── devcontainer-feature.json
│   │   └── install.sh
|   ├── ...
│   │   ├── devcontainer-feature.json
│   │   └── install.sh
...

An implementing tool will composite the documented dev container properties from the feature's devcontainer-feature.json file, and execute in the install.sh entrypoint script in the container during build time. Implementing tools are also free to process attributes under the customizations property as desired.

About

LocalStack DevContainer Feature(s)

Resources

Code of conduct

Contributing

Stars

5 stars

Watchers

14 watching

Forks

Releases

Packages

Used by

Contributors

Languages