Skip to content

Commit 69d1eac

Browse files
committed
image consolidation into pro
1 parent e7e53d8 commit 69d1eac

File tree

5 files changed

+14
-6
lines changed

5 files changed

+14
-6
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,12 @@ jobs:
5454
fi
5555
5656
- name: Start LocalStack
57+
env:
58+
LOCALSTACK_AUTH_TOKEN: ${{ secrets.LOCALSTACK_AUTH_TOKEN }}
5759
run: |
5860
pip install localstack awscli-local[ver1]
59-
docker pull localstack/localstack
60-
localstack start -d
61+
docker pull localstack/localstack-pro
62+
localstack start -d --image localstack/localstack-pro
6163
localstack wait -t 30
6264
6365
- name: Run Lint and Test

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
This plugin allows Serverless applications to be deployed and tested on your local machine. Any requests to AWS to be redirected to a running LocalStack instance.
88

99
Pre-requisites:
10-
* LocalStack
10+
* LocalStack Pro (requires `LOCALSTACK_AUTH_TOKEN` environment variable)
1111

1212
## Installation
1313

@@ -64,6 +64,7 @@ custom:
6464
### Configuration via environment variables
6565

6666
The following environment variables can be configured (taking precedence over the values in `serverless.yml`):
67+
* `LOCALSTACK_AUTH_TOKEN`: **Required.** Your LocalStack auth token for LocalStack Pro. Obtain one from [LocalStack](https://app.localstack.cloud/).
6768
* `AWS_ENDPOINT_URL`: LocalStack endpoint URL to connect to (default: `http://localhost:4566`). This is the recommended configuration, and replaces the deprecated config options (`EDGE_PORT`/`LOCALSTACK_HOSTNAME`/`USE_SSL`) below.
6869
* `EDGE_PORT`: LocalStack edge port to connect to (deprecated; default: `4566`)
6970
* `LOCALSTACK_HOSTNAME`: LocalStack host name to connect to (deprecated; default: `localhost`)
@@ -208,6 +209,7 @@ custom:
208209
```
209210
210211
## Change Log
212+
* v1.4.0: Switch to LocalStack Pro image (`localstack/localstack-pro`), require `LOCALSTACK_AUTH_TOKEN`
211213
* v1.3.1: prevent the mounting of code if the Lambda uses an ECR Image
212214
* v1.3.0: add support for built-in Esbuild in Serverless Framework v4 #267
213215
* v1.2.1: Fix custom-resource bucket compatibility with serverless >3.39.0, continue improving support for `AWS_ENDPOINT_URL`

docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ version: "3.8"
33
services:
44
localstack:
55
container_name: "${LOCALSTACK_DOCKER_NAME:-localstack-main}"
6-
image: localstack/localstack
6+
image: localstack/localstack-pro
77
ports:
88
- "127.0.0.1:4566:4566" # LocalStack Gateway
99
- "127.0.0.1:4510-4559:4510-4559" # external services port range
1010
environment:
1111
# LocalStack configuration: https://docs.localstack.cloud/references/configuration/
1212
- DEBUG=${DEBUG:-0}
13+
- LOCALSTACK_AUTH_TOKEN=${LOCALSTACK_AUTH_TOKEN:?LOCALSTACK_AUTH_TOKEN must be set}
1314
volumes:
1415
- "${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack"
1516
- "/var/run/docker.sock:/var/run/docker.sock"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "serverless-localstack",
3-
"version": "1.3.1",
3+
"version": "1.4.0",
44
"description": "Connect Serverless to LocalStack!",
55
"main": "src/index.js",
66
"scripts": {

src/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,12 +531,15 @@ class LocalstackPlugin {
531531
env.LAMBDA_REMOTE_DOCKER = env.LAMBDA_REMOTE_DOCKER || '0';
532532
env.DOCKER_FLAGS = (env.DOCKER_FLAGS || '') + ` -v ${cwd}:${cwd}`;
533533
env.START_WEB = env.START_WEB || '0';
534+
if (!env.LOCALSTACK_AUTH_TOKEN) {
535+
this.log('Warning: LOCALSTACK_AUTH_TOKEN is not set. LocalStack Pro requires an auth token.');
536+
}
534537
const maxBuffer = +env.EXEC_MAXBUFFER || 50 * 1000 * 1000; // 50mb buffer to handle output
535538
if (this.shouldRunDockerSudo()) {
536539
env.DOCKER_CMD = 'sudo docker';
537540
}
538541
const options = { env: env, maxBuffer };
539-
return exec('localstack start -d', options)
542+
return exec('localstack start -d --image localstack/localstack-pro', options)
540543
.then(getContainer)
541544
.then((containerID) => addNetworks(containerID))
542545
.then((containerID) => checkStatus(containerID));

0 commit comments

Comments
 (0)