You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+109-10
Original file line number
Diff line number
Diff line change
@@ -8,34 +8,120 @@ A GitHub Action to setup [LocalStack](https://github.com/localstack/localstack)
8
8
- Pulling a specific version of the LocalStack Docker Image into the GitHub Action runner.
9
9
- Configuring the [LocalStack CLI](https://docs.localstack.cloud/get-started/#localstack-cli) to launch the Docker container with an optional API token for pro usage.
10
10
- Installing [LocalStack AWS CLI](https://github.com/localstack/awscli-local), a thin wrapper around the `aws` command line interface for use with LocalStack to run integration tests over AWS services.
11
+
- Export/import [LocalStack state](https://docs.localstack.cloud/user-guide/state-management/export-import-state/) as an artifact
> **NOTE**: The `LOCALSTACK_API_KEY` environment variable is required to be set to save/load LocalStack's state either as a Cloud Pod or as a file artifact.
> **NOTE**: To load a **local state** from a different GitHub Actions workflow, one must set the `WORKFLOW_ID` environment variable.
76
+
77
+
> **NOTE**: The `LOCALSTACK_API_KEY` environment variable is required to be set to **save/load** LocalStack's state either as a Cloud Pod or as a file artifact.
78
+
79
+
### Manage App Preview (Ephemeral Instance)
80
+
```yml
81
+
uses: LocalStack/setup-localstack@$v0.2.0
82
+
with:
83
+
github-token: ${{ secrets.GITHUB_TOKEN }}
84
+
state-backend: ephemeral
85
+
state-action: start
86
+
# Adding this option prevents Ephemeral Instance to be stopped after the `preview-cmd` run
| `skip-startup` | Explicitly prevent LocalStack start up, only installs CLI(s). Recommended to manage state later on in the pipeline or start up an ephemeral instance. | `false` |
118
+
| `skip-wait` | Skip waiting for LocalStack to start up | `false` |
119
+
| `state-action` | Valid values are `load`, `save`, `start`, `stop`, `` (empty, don't manage state). Values `start`/`stop` only usable with app previews. | `` |
120
+
| `state-backend` | Either store the state of LocalStack locally, as a Cloud Pod or start an Ephemeral Instance. Valid values are `cloud-pods`, `ephemeral` or `local`. Use this option in unison with `state-action` to control behaviour. | `cloud-pods` |
121
+
| `state-name` | Name of the state artifact (without extension) | `false` |
33
122
| `use-pro` | Whether to use the Pro version of LocalStack (requires API key to be configured) | `false` |
34
123
35
-
> **NOTE**: The `LOCALSTACK_API_KEY` environment variable is required to be set if `use-pro` is set to `true`.
0 commit comments