LocalStack CLI
The LocalStack Command Line Interface (CLI) is a tool for starting, managing, and configuring your LocalStack container. It provides convenience features to interact with LocalStack features like Cloud Pods, Extensions, State Management, and more.
To install the LocalStack CLI, follow the installation guide.
The following global options are available for the localstack CLI:
| Option | Description |
|---|---|
-v, --version | Show the version and exit |
-d, --debug | Enable CLI debugging mode |
-p, --profile TEXT | Set the configuration profile |
-h, --help | Show help message and exit |
The following commands are available for managing your LocalStack instance.
Authenticate with your LocalStack account
Usage: localstack auth [OPTIONS] COMMAND [ARGS]...
Authenticate with your LocalStack account.
Manage your credentials and authenticate with your LocalStack account.
Options:
-h, --help Show this message and exit.
Commands:
clear-token Clear any existing LocalStack auth token from your environment
set-token Set your Localstack auth token to allow you to start LocalStack
Pro
show-token Show the auth token in your configuration
Deprecated:
login Login to the your LocalStack account (DEPRECATED)
logout Log out from your LocalStack account (DEPRECATED)
Subcommands for localstack auth
Clear any existing LocalStack auth token from your environment
Usage: localstack auth clear-token [OPTIONS]
Options:
-h, --help Show this message and exit.
Set your Localstack auth token to allow you to start LocalStack
Usage: localstack auth set-token [OPTIONS] AUTH_TOKEN
Set up your auth token to activate your LocalStack for AWS license.
This differs from localstack auth login, which is used for platform features such as syncing Cloud Pods with your web account.
The auth token you configure here will be passed to the
`LOCALSTACK_AUTH_TOKEN` environment variable of the LocalStack container
when you run `localstack start`.
AUTH_TOKEN: Your Localstack auth token that you can find in
https://app.localstack.cloud.
Options:
-h, --help Show this message and exit.
Show the auth token in your configuration
Usage: localstack auth show-token [OPTIONS]
Show the token that LocalStack picks up from your environment. This can
either be the auth token set via `localstack auth set-token`, or the value
of `LOCALSTACK_AUTH_TOKEN`.
Options:
--plain Setting this flag will output only the value of the token in
plain text, so it can be used as input to other programs, like
`LOCALSTACK_AUTH_TOKEN=$(localstack auth show-token --plain)`.
-h, --help Show this message and exit.
(Deprecated) Login to the your LocalStack account (DEPRECATED)
Usage: localstack auth login [OPTIONS]
Login to the LocalStack Platform.
This command performs a login to your LocalStack account, giving you access
to features that require platform permissions, such as uploading cloud pods
to your account.
This command is deprecated and it will be removed soon. To use LocalStack
features that requires authentication to the LocalStack platform (e.g.,
Cloud Pods), please run `localstack auth set-token <AUTH_TOKEN>`, or set the
environment variable `LOCALSTACK_AUTH_TOKEN` to a valid auth token.
(DEPRECATED)
Options:
-u, --username USER Username (email address) for login [required]
-p, --password PWD Password for login [required]
-h, --help Show this message and exit.
(Deprecated) Log out from your LocalStack account (DEPRECATED)
Usage: localstack auth logout [OPTIONS]
Log out from the LocalStack Platform.
This command performs a logout from the LocalStack platform and deletes all
session information on your machine. (DEPRECATED)
Options:
-h, --help Show this message and exit.
CLI shell completion
Usage: localstack completion [OPTIONS] {bash|zsh|fish}
Print shell completion code for the specified shell (bash, zsh, or fish).
The shell code must be evaluated to enable the interactive shell completion
of LocalStack CLI commands. This is usually done by sourcing it from the
.bash_profile.
Examples:
# Bash
## Bash completion on Linux depends on the 'bash-completion' package.
## Write the LocalStack CLI completion code for bash to a file and source it from .bash_profile
localstack completion bash > ~/.localstack/completion.bash.inc
printf "
# LocalStack CLI bash completion
source '$HOME/.localstack/completion.bash.inc'
" >> $HOME/.bash_profile
source $HOME/.bash_profile
# zsh
## Set the LocalStack completion code for zsh to autoload on startup:
localstack completion zsh > "${fpath[1]}/_localstack"
# fish
## Set the LocalStack completion code for fish to autoload on startup:
localstack completion fish > ~/.config/fish/completions/localstack.fish
Options:
-h, --help Show this message and exit.
Manage your LocalStack config
Usage: localstack config [OPTIONS] COMMAND [ARGS]...
Inspect and validate your LocalStack configuration.
Options:
-h, --help Show this message and exit.
Commands:
show Show your config
validate Validate your config
Subcommands for localstack config
Show your config
Usage: localstack config show [OPTIONS]
Print the current LocalStack config values.
This command prints the LocalStack configuration values from your
environment. It analyzes the environment variables as well as the LocalStack
CLI profile. It does _not_ analyze a specific file (like a docker-compose-
yml).
Options:
-f, --format [table|plain|dict|json]
The formatting style for the command output.
[default: table]
-h, --help Show this message and exit.
Validate your config
Usage: localstack config validate [OPTIONS]
Validate your LocalStack configuration (docker compose).
This command inspects the given docker-compose file (by default docker-
compose.yml in the current working directory) and validates if the
configuration is valid.
It will show an error and return a non-zero exit code if:
- The docker-compose file is syntactically incorrect.
- If the file contains common issues when configuring LocalStack.
Options:
-f, --file PATH Path to compose file [default: docker-compose.yml]
-h, --help Show this message and exit.
Show LocalStack logs
Usage: localstack logs [OPTIONS]
Show the logs of the current LocalStack runtime.
This command shows the logs of the currently running LocalStack docker
container. By default, this command looks for a container named `localstack-
main` (which is the default container name used by the `localstack start`
command). If your LocalStack container has a different name, set the config
variable `MAIN_CONTAINER_NAME`.
Options:
-f, --follow Block the terminal and follow the log output
-n, --tail N Print only the last <N> lines of the log output
-h, --help Show this message and exit.
Restart LocalStack
Usage: localstack restart [OPTIONS]
Restarts the current LocalStack runtime.
Options:
-h, --help Show this message and exit.
Obtain a shell in LocalStack
Usage: localstack ssh [OPTIONS]
Obtain a shell in the current LocalStack runtime.
This command starts a new interactive shell in the currently running
LocalStack container. By default, this command looks for a container named
`localstack-main` (which is the default container name used by the
`localstack start` command). If your LocalStack container has a different
name, set the config variable `MAIN_CONTAINER_NAME`.
Options:
-h, --help Show this message and exit.
Start LocalStack
Usage: localstack start [OPTIONS]
Start the LocalStack runtime.
This command starts the LocalStack runtime with your current configuration.
By default, it will start a new Docker container from the latest
LocalStack(-Pro) Docker image with best-practice volume mounts and port
mappings.
Options:
--docker Start LocalStack in a docker container [default]
--host Start LocalStack directly on the host(DEPRECATED)
--no-banner Disable LocalStack banner
-d, --detached Start LocalStack in the background
--network TEXT The container network the LocalStack container should be
started in. By default, the default docker bridge
network is used.
-e, --env TEXT Additional environment variables that are passed to the
LocalStack container
-p, --publish TEXT Additional port mappings that are passed to the
LocalStack container
-v, --volume TEXT Additional volume mounts that are passed to the
LocalStack container
--host-dns Expose the LocalStack DNS server to the host using port
bindings.
-s, --stack TEXT Use a specific stack with optional version. Examples:
[localstack:4.5, snowflake]
-h, --help Show this message and exit.
Query status info
Usage: localstack status [OPTIONS] COMMAND [ARGS]...
Query status information about the currently running LocalStack instance.
Options:
-h, --help Show this message and exit.
Commands:
docker Query LocalStack Docker status
services Query LocalStack services status
Subcommands for localstack status
Query LocalStack Docker status
Usage: localstack status docker [OPTIONS]
Query information about the currently running LocalStack Docker image, its
container, and the LocalStack runtime.
Options:
-f, --format [table|plain|dict|json]
The formatting style for the command output.
[default: table]
-h, --help Show this message and exit.
Query LocalStack services status
Usage: localstack status services [OPTIONS]
Query information about the services of the currently running LocalStack
instance.
Options:
-f, --format [table|plain|dict|json]
The formatting style for the command output.
[default: table]
-h, --help Show this message and exit.
Stop LocalStack
Usage: localstack stop [OPTIONS]
Stops the current LocalStack runtime.
This command stops the currently running LocalStack docker container. By
default, this command looks for a container named `localstack-main` (which
is the default container name used by the `localstack start` command). If
your LocalStack container has a different name, set the config variable
`MAIN_CONTAINER_NAME`.
Options:
-h, --help Show this message and exit.
Update LocalStack
Usage: localstack update [OPTIONS] COMMAND [ARGS]...
Update different LocalStack components.
Options:
-h, --help Show this message and exit.
Commands:
all Update all LocalStack components
docker-images Update docker images LocalStack depends on
localstack-cli Update LocalStack CLI
Subcommands for localstack update
Update all LocalStack components
Usage: localstack update all [OPTIONS]
Update all LocalStack components.
This is the same as executing `localstack update localstack-cli` and
`localstack update docker-images`. Updating the LocalStack CLI is currently
only supported if the CLI is installed and run via Python / PIP. If you used
a different installation method, please follow the instructions on
https://docs.localstack.cloud/.
Options:
-h, --help Show this message and exit.
update docker-images
Update docker images LocalStack depends on
Usage: localstack update docker-images [OPTIONS]
Update all Docker images LocalStack depends on.
This command updates all Docker LocalStack docker images, as well as other
Docker images LocalStack depends on (and which have been used before / are
present on the machine).
Options:
-h, --help Show this message and exit.
update localstack-cli
Update LocalStack CLI
Usage: localstack update localstack-cli [OPTIONS]
Update the LocalStack CLI.
This command updates the LocalStack CLI. This is currently only supported if
the CLI is installed and run via Python / PIP. If you used a different
installation method, please follow the instructions on
https://docs.localstack.cloud/.
Options:
-h, --help Show this message and exit.
Wait for LocalStack
Usage: localstack wait [OPTIONS]
Wait for the LocalStack runtime to be up and running.
This commands waits for a started LocalStack runtime to be up and running,
ready to serve requests. By default, this command looks for a container
named `localstack-main` (which is the default container name used by the
`localstack start` command). If your LocalStack container has a different
name, set the config variable `MAIN_CONTAINER_NAME`.
Options:
-t, --timeout N Only wait for <N> seconds before raising a timeout error
-h, --help Show this message and exit.
Advanced Commands
The following advanced commands provide additional functionality for power users.
Access additional functionality on LocalStack AWS Services
Usage: localstack aws [OPTIONS] COMMAND [ARGS]...
Accesses additional functionality on LocalStack emulated AWS services.
This command provides tools to enhance your experience with certain emulated
AWS services.
Options:
-h, --help Show this message and exit.
Commands:
iam (Preview) Access LocalStack IAM features
Subcommands for localstack aws
(Preview) Access LocalStack IAM features
Usage: localstack aws iam [OPTIONS] COMMAND [ARGS]...
Access LocalStack IAM features.
This command provides tools to make it easier to write IAM policies for your
cloud application.
Options:
-h, --help Show this message and exit.
Commands:
stream Stream policies for all requests enforced on LocalStack
summary Summary of policies for all requests enforced on LocalStack
Manage LocalStack DNS host config
Usage: localstack dns [OPTIONS] COMMAND [ARGS]...
Manage the usage of the LocalStack DNS on your host.
This command provides tools to configure your the DNS on your host machine
to use the LocalStack DNS on your host machine. The LocalStack DNS is used
for certain Pro features (like the transparent endpoint injection).
Visit https://docs.localstack.cloud/user-guide/tools/transparent-endpoint-injection/dns-server/
for more information on the LocalStack DNS and how it is used.
Options:
-h, --help Show this message and exit.
Commands:
systemd-resolved Manage LocalStack DNS in systemd-resolved
Subcommands for localstack dns
dns systemd-resolved
Manage LocalStack DNS in systemd-resolved
Usage: localstack dns systemd-resolved [OPTIONS]
Manage the LocalStack DNS configuration using systemd-resolved (Ubuntu,
Debian, etc.).
This command sets (or reverts) the LocalStack DNS, running in the current
LocalStack runtime, in systemd-resolved for the docker network interface.
Most current Linux systems - like Ubuntu, Debian, or Fedora - use systemd-
resolved for the network name resolution.
Options:
-s, --set / -r, --revert Set or revert DNS settings [default: set]
-h, --help Show this message and exit.
(Preview) Manage ephemeral LocalStack instances
Usage: localstack ephemeral [OPTIONS] COMMAND [ARGS]...
(Preview) Manage ephemeral LocalStack instances in the cloud.
This command group allows you to create, list, and delete ephemeral
LocalStack instances. Ephemeral instances are temporary cloud instances that
can be used for testing and development.
Options:
-h, --help Show this message and exit.
Commands:
create Create a new ephemeral instance
delete Delete an ephemeral instance
list List all ephemeral instances
logs Fetch logs from an ephemeral instance
Subcommands for localstack ephemeral
Create a new ephemeral instance
Usage: localstack ephemeral create [OPTIONS]
Create a new ephemeral LocalStack instance in the cloud.
Specify an instance name and optional parameters like lifetime and
environment variables. The instance will be created with the specified
configuration and its connection details will be returned.
Examples:
localstack ephemeral create --name my-test-instance
localstack ephemeral create --name my-instance --lifetime 60
localstack ephemeral create --name my-instance --env DEBUG=1
Options:
--name TEXT Name of the ephemeral instance [required]
--lifetime INTEGER Lifetime of the instance in minutes
-e, --env TEXT Additional environment variables that are passed to the
LocalStack instance
-h, --help Show this message and exit.
Delete an ephemeral instance
Usage: localstack ephemeral delete [OPTIONS]
Delete a specific ephemeral LocalStack instance.
Specify the name of the instance you want to delete. Once deleted, the
instance cannot be recovered.
Example:
localstack ephemeral delete --name my-test-instance
Options:
--name TEXT Name of the ephemeral instance to delete [required]
-h, --help Show this message and exit.
List all ephemeral instances
Usage: localstack ephemeral list [OPTIONS]
List all available ephemeral LocalStack instances.
This command shows all ephemeral instances associated with your account,
including their names, status, and other relevant details.
Examples:
localstack ephemeral list
Options:
-h, --help Show this message and exit.
Fetch logs from an ephemeral instance
Usage: localstack ephemeral logs [OPTIONS]
Fetch logs from a specific ephemeral LocalStack instance.
Retrieve the logs of a running ephemeral instance by specifying its name.
The logs are returned in chronological order.
Example:
localstack ephemeral logs --name my-test-instance
Options:
--name TEXT Name of the ephemeral instance to fetch logs from [required]
-h, --help Show this message and exit.
(Preview) Manage LocalStack extensions
Usage: localstack extensions [OPTIONS] COMMAND [ARGS]...
(Preview) Manage LocalStack extensions.
LocalStack Extensions allow developers to extend and customize LocalStack.
The feature and the API are currently in a preview stage and may be subject
to change.
If you are using LocalStack extensions with docker-compose, you can use the
CLI by pointing the `LOCALSTACK_VOLUME_DIR=` variable to localstack volume
directory on your host. By default, the volume on your host is located in
`~/.cache/localstack` on Linux, and `~/Library/Caches` on Mac.
Visit https://docs.localstack.cloud/references/localstack-extensions/ for
more information on LocalStack Extensions.
Options:
-v, --verbose Print more output
-h, --help Show this message and exit.
Commands:
dev Developer tools for developing LocalStack extensions.
init Initialize the LocalStack extensions environment.
install Install a LocalStack extension.
list List installed extension.
uninstall Remove a LocalStack extension.
Subcommands for localstack extensions
Developer tools for developing LocalStack extensions.
Usage: localstack extensions dev [OPTIONS] COMMAND [ARGS]...
Developer tools for developing LocalStack extensions.
Options:
-h, --help Show this message and exit.
Commands:
disable Disables an extension on the host for developer mode.
enable Enables an extension on the host for developer mode.
list List LocalStack extensions for which dev mode is enabled.
new Create a new LocalStack extension from the official extension...
Initialize the LocalStack extensions environment.
Usage: localstack extensions init [OPTIONS]
Initialize the LocalStack extensions environment.
The environment variable `LOCALSTACK_VOLUME_DIR` currently defaults to
~/.cache/localstack, where the extension environment will be installed into
./lib/extensions/
Options:
-h, --help Show this message and exit.
extensions install
Install a LocalStack extension.
Usage: localstack extensions install [OPTIONS] NAME
Install a LocalStack extension.
This command installs a LocalStack extension, where the name can be any
valid pip dependency identifier. Additionally, we support the installation
of distribution files from disk, which you can indicate by a ``file://``
prefix in the name
Example invocations:
localstack extensions install localstack-extension-stripe
localstack extensions install "git+https://github.com/localstack/localstack-stripe.git#egg=localstack-stripe"
localstack extensions install file://./dist/localstack-extension-hello-world-0.1.0.tar.gz
localstack extensions install file://. # assumes the current directory is a source distribution
Options:
-h, --help Show this message and exit.
List installed extension.
Usage: localstack extensions list [OPTIONS]
List installed extension.
The environment variable `LOCALSTACK_VOLUME_DIR` currently defaults to
~/.cache/localstack, where the extension environment will be installed into
./lib/extensions/
Options:
-h, --help Show this message and exit.
extensions uninstall
Remove a LocalStack extension.
Usage: localstack extensions uninstall [OPTIONS] NAME
Remove a LocalStack extension.
This command removes a previously installed LocalStack extension, where the
name can be any valid package name.
Example invocations:
localstack extensions uninstall localstack-extension-stripe
Options:
-h, --help Show this message and exit.
(Preview) Manage and verify your LocalStack license
Usage: localstack license [OPTIONS] COMMAND [ARGS]...
(Preview) Manage and verify your LocalStack license.
Your LocalStack license allows you to use advanced features of LocalStack.
Options:
-h, --help Show this message and exit.
Commands:
activate
info
Subcommands for localstack license
Usage: localstack license activate [OPTIONS]
Options:
-h, --help Show this message and exit.
Usage: localstack license info [OPTIONS]
Options:
-h, --help Show this message and exit.
Manage the state of your instance via Cloud Pods.
Usage: localstack pod [OPTIONS] COMMAND [ARGS]...
Manage the state of your instance via Cloud Pods.
Options:
-h, --help Show this message and exit.
Commands:
delete Delete a Cloud Pod
list List all available Cloud Pods
load Load the state of a Cloud Pod into the application runtime.
remote Manage cloud pod remotes
save Create a new Cloud Pod
versions List all available versions for a Cloud Pod
Subcommands for localstack pod
Delete a Cloud Pod
Usage: localstack pod delete [OPTIONS] NAME [REMOTE]
Delete a Cloud Pod registered on a remote (by default, the LocalStack
platform).
This command will remove all the versions of a Cloud Pod, and the operation
is not reversible.
Options:
-h, --help Show this message and exit.
List all available Cloud Pods
Usage: localstack pod list [OPTIONS] [REMOTE]
List all the Cloud Pods available for a single user, or for an entire
organization, if the user is part of one.
With the --public flag, it lists the all the available public Cloud Pods. A
public Cloud Pod is available across the boundary of a user and/or
organization. In other words, any public Cloud Pod can be injected by any
other user holding a LocalStack for AWS license.
Options:
-p, --public List all the available public Cloud Pods
-m, --mine List only the Cloud Pods created by the current
user
-f, --format [table|json] The formatting style for the list pods command
output. [default: table]
-h, --help Show this message and exit.
Load the state of a Cloud Pod into the application runtime.
Usage: localstack pod load [OPTIONS] NAME [REMOTE]
Load the state of a Cloud Pod into the application runtime. Users can import
Cloud Pods from different remotes, with the LocalStack platform being the
default one. Users can also load a specific version by appending a version
number to the pod name after a colon (e.g., `localstack pod load my-pod:3`).
If not specified, the latest version will be loaded. Use the `localstack pod
versions` to list all the available versions.
Loading the state of a Cloud Pod into LocalStack might cause some conflicts
with the current state of the container. LocalStack will attempt a best-
effort merging strategy between the current state and the one from the Cloud
Pod. For a service X present in both the current state and the Cloud Pod, we
will attempt to merge states across different accounts and regions. If the
service X has a state for the same account and region both in the running
container and the Cloud Pod, the latter will be used. If a service Y is
present in the running container but not in the Cloud Pod, it will be left
untouched. This is the default merge strategy which is activated by either
the `--strategy account-region-merge` option or by omitting the `--strategy`
option at all.
In addition to the default one, LocalStack provides two more strategies:
- overwrite, in which the state of LocalStack is completely reset before loading the state from the Cloud Pod.
This strategy is activated with the `--strategy overwrite` option .
- service-merge: in which LocalStack merges the state of a service under the same account and region when
there is no resource overlap. In such a case, the loaded resources are preferred.
This option is activated with the `--strategy service-merge` option.
To load a local copy of a LocalStack state, you can use the 'localstack
state import' command.
Options:
-s, --secret TEXT Secret for the Cloud Pod encryption.
Encryption is an Enterprise only feature.
--strategy [overwrite|account-region-merge|service-merge]
The merge strategy to adopt when loading the
Cloud Pod. [default: account-region-merge]
-y, --yes Automatic yes to prompts. Assume a positive
answer to all prompts and run non-
interactively.
--dry-run Checks the resources added or modified in
the application runtime by loading a Cloud
Pod.
-h, --help Show this message and exit.
Manage cloud pod remotes
Usage: localstack pod remote [OPTIONS] COMMAND [ARGS]...
Manage cloud pod remotes
Options:
-h, --help Show this message and exit.
Commands:
add Add a remote
delete Delete a remote
list Lists the available remotes
Create a new Cloud Pod
Usage: localstack pod save [OPTIONS] NAME [REMOTE]
Save the current state of the LocalStack container in a Cloud Pod.
A Cloud Pod can be registered and saved with different storage options,
called remotes. By default, Cloud Pods are hosted in the LocalStack
platform. However, users can decide to store their Cloud Pods in other
remotes, such as AWS S3 buckets or ORAS registries.
An optional message can be attached to any Cloud Pod. Furthermore, one could
decide to export only a subset of services with the optional --services
option.
To use the LocalStack platform for storage, the desired Cloud Pod's name will suffice, e.g.:
localstack pod save <pod_name>
Please be aware that each following save invocation with the same name will
result in a new version being created.
To save a local copy of your state, you can use the 'localstack state export' command.
Options:
-m, --message TEXT Add a comment describing this Cloud Pod's
version
-s, --services TEXT Comma-delimited list of services to push in
the Cloud Pod (all by default)
--visibility [public|private] Set the visibility of the Cloud Pod [`public`
or `private`]. Does not create a new version
-S, --secret TEXT Secret for the Cloud Pod encryption.
Encryption is an Enterprise only feature.
-f, --format [json] The formatting style for the save command
output.
-h, --help Show this message and exit.
List all available versions for a Cloud Pod
Usage: localstack pod versions [OPTIONS] NAME
List all available versions for a Cloud Pod
This command lists the versions available for a Cloud Pod. Each invocation
of the save command is going to create a new version for a named Cloud Pod,
if a Pod with such name already does exist in the LocalStack platform.
Options:
-f, --format [table|json] The formatting style for the version command
output. [default: table]
-h, --help Show this message and exit.
(Preview) Start a replication job or check its status
Usage: localstack replicator [OPTIONS] COMMAND [ARGS]...
*** Preview Feature ***
This feature is currently in preview mode in our Teams offering and it's
availability may change in future releases.
The replicator command group allows you to replicate AWS resources into
LocalStack.
Options:
-h, --help Show this message and exit.
Commands:
resources List supported resources
start Replicate an AWS resource
status Check replication status
Subcommands for localstack replicator
replicator resources
List supported resources
Usage: localstack replicator resources [OPTIONS]
Options:
-h, --help Show this message and exit.
*** Preview Feature ***
This feature is currently in preview mode in our Teams offering and it's availability may change in future releases.
Replicate an AWS resource
Usage: localstack replicator start [OPTIONS]
Starts a job to replicate an AWS resource into localstack. You must have
credentials with sufficient read access to the resource trying to replicate.
At the moment only environment variables are recognized.
`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY` and `AWS_DEFAULT_REGION` must
be set. `AWS_ENDPOINT_URL` and `AWS_SESSION_TOKEN` are optional.
Options:
--replication-type [MOCK|SINGLE_RESOURCE|BATCH]
Type of replication job: MOCK,
SINGLE_RESOURCE, BATCH [default:
SINGLE_RESOURCE]
--resource-arn TEXT ARN of the resource to recreate. Optional
for SINGLE_RESOURCE replication
--resource-type TEXT CloudControl type of the resource to
recreate. Optional for SINGLE_RESOURCE
replication
--resource-identifier TEXT CloudControl identifier of the resource to
recreate. Mandatory if --resource-type is
used
--target-account-id TEXT Localstack account ID where the resources
will be replicated. Defaults to
000000000000. See <docs> to enable same
account replication
--target-region-name TEXT Localstack region where the resources will
be replicated. Only provide if different
than source AWS account.
--delay TEXT Delay for the MOCK replication work
-h, --help Show this message and exit.
*** Preview Feature ***
This feature is currently in preview mode in our Teams offering and it's availability may change in future releases.
replicator status
Check replication status
Usage: localstack replicator status [OPTIONS] JOB_ID
Check the status of a replication job using its Job ID. Use the --follow
flag to continuously check the status until the job is completed.
Options:
--follow Follow the status until completed
--delay INTEGER Delay between calls [default: 5]
-h, --help Show this message and exit.
*** Preview Feature ***
This feature is currently in preview mode in our Teams offering and it's availability may change in future releases.
(Preview) Export, restore, and reset LocalStack state.
Usage: localstack state [OPTIONS] COMMAND [ARGS]...
(Preview) Manage and manipulate the localstack state.
The state command group allows you to interact with LocalStack's state
backend.
Read more: https://docs.localstack.cloud/references/persistence-
mechanism/#snapshot-based-persistence
Options:
-h, --help Show this message and exit.
Commands:
export Export the state of LocalStack services
import Import the state of LocalStack services
inspect Inspect the state of LocalStack services
reset Reset the state of LocalStack services
Subcommands for localstack state
Export the state of LocalStack services
Usage: localstack state export [OPTIONS] [DESTINATION]
Save the current state of the LocalStack container to a file on the local
disk. This file can be restored at any point in time using the `localstack
state import` command. Please be aware that this might not be possible when
importing the state with a different version of LocalStack.
If you are looking for a managed solution to handle the state of your
LocalStack container, please check out the Cloud Pods feature:
https://docs.localstack.cloud/user-guide/tools/cloud-pods/.
Use the DESTINATION argument to specify an absolute or relative path for the
exported file. If no destination is specified, a file named `ls-state-
export` will be saved in the current working directory.
Examples:
localstack state export my-state
localstack state export ../parent-dir/my-state
localstack state export /home/johndoe/my-state
You can also specify a subset of services to export with the `--services`
option.
For example:
localstack state export my-state --services s3,lambda
By default, the state of all running services is exported.
Options:
-s, --services TEXT Comma-delimited list of services to reset. By default,
the state of all running services is exported.
-f, --format [json] The formatting style for the save command output.
-h, --help Show this message and exit.
Import the state of LocalStack services
Usage: localstack state import [OPTIONS] SOURCE
Load the state of LocalStack from a file into the running container. The
SOURCE argument is the absolute or relative path to the file containing the
state to import. This file must have been generated from a previous
`localstack state export` command. Please be aware that it might not be
possible to import a state generated from a different version of LocalStack.
Examples:
localstack state import my-state
localstack state import ../parent-dir/my-state
localstack state import /home/johndoe/my-state
Options:
-h, --help Show this message and exit.
Inspect the state of LocalStack services
Usage: localstack state inspect [OPTIONS]
Inspect the state of the Localstack Container.
By default, it starts a curses interface which allows an interactive
inspection of the contents of the LocalStack running instance.
Options:
-f, --format [curses|rich|json]
The formatting style for the inspect command
output. [default: curses]
-h, --help Show this message and exit.
Reset the state of LocalStack services
Usage: localstack state reset [OPTIONS]
Reset the service states of the current LocalStack runtime.
This command invokes a reset of services in the currently running LocalStack
container. By default, all services are rest. The `services` options allows
to select a subset of services which should be reset.
This command tries to automatically discover the running LocalStack
instance. If LocalStack has not been started with `localstack start` (and is
not automatically discoverable), please set `LOCALSTACK_HOST`.
Options:
-s, --services TEXT Comma-delimited list of services to reset. By default,
the state of all running services is reset.
-h, --help Show this message and exit.