Git Product home page Git Product logo

serverless-localstack's Introduction

Build Status

LocalStack Serverless Plugin

Serverless Plugin to support running against Localstack.

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.

Pre-requisites:

  • LocalStack

Installation

The easiest way to get started is to install via npm.

npm install -g serverless
npm install --save-dev serverless-localstack

Configuring

The plugin can be configured via serverless.yml, or alternatively via environment variables.

There are two supported methods for configuring the endpoints, globally via the host property, or individually. These properties may be mixed, allowing for global override support while also override specific endpoints.

A host or individual endpoints must be configured, or this plugin will be deactivated.

Configuration via serverless.yml

Please refer to the example configuration template below. (Please note that most configurations in the sample are optional and need not be specified.)

service: myService

plugins:
  - serverless-localstack

custom:
  localstack:
    stages:
      # list of stages for which the plugin should be enabled
      - local
    host: http://localhost  # optional - LocalStack host to connect to
    edgePort: 4566  # optional - LocalStack edge port to connect to
    autostart: true  # optional - Start LocalStack in Docker on Serverless deploy
    networks: #optional - attaches the list of networks to the localstack docker container after startup
      - host
      - overlay
      - my_custom_network
    lambda:
      # Enable this flag to improve performance
      mountCode: true  # specify either "true", or a relative path to the root Lambda mount path
    docker:
      # Enable this flag to run "docker ..." commands as sudo
      sudo: False
      compose_file: /home/localstack_compose.yml # optional to use docker compose instead of docker or localstack cli
  stages:
    local:
      ...

Configuration via environment variables

The following environment variables can be configured (taking precedence over the values in serverless.yml):

  • 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.
  • EDGE_PORT: LocalStack edge port to connect to (deprecated; default: 4566)
  • LOCALSTACK_HOSTNAME: LocalStack host name to connect to (deprecated; default: localhost)
  • USE_SSL: Whether to use SSL/HTTPS when connecting to the LocalStack endpoint (deprecated)

Activating the plugin for certain stages

Note the stages attribute in the config above. The serverless-localstack plugin gets activated if either:

  1. the serverless stage (explicitly defined or default stage "dev") is included in the stages config; or
  2. serverless is invoked without a --stage flag (default stage "dev") and no stages config is provided

Mounting Lambda code for better performance

Note that the localstack.lambda.mountCode flag above will mount the local directory into the Docker container that runs the Lambda code in LocalStack. You can either specify the boolean value true (to mount the project root folder), or a relative path to the root Lambda mount path within your project (e.g., ./functions).

If you remove this flag, your Lambda code is deployed in the traditional way which is more in line with how things work in AWS, but also comes with a performance penalty: packaging the code, uploading it to the local S3 service, downloading it in the local Lambda API, extracting it, and finally copying/mounting it into a Docker container to run the Lambda. Mounting code from multiple projects is not supported with simple configuration, and you must use the autostart feature, as your code will be mounted in docker at start up. If you do need to mount code from multiple serverless projects, manually launch localstack with volumes specified. For example:

localstack start --docker -d \
  -v /path/to/project-a:/path/to/project-a \
  -v /path/to/project-b:/path/to/project-b

If you use either serverless-webpack, serverless-plugin-typescript, or serverless-esbuild, serverless-localstack will detect it and modify the mount paths to point to your output directory. You will need to invoke the build command in order for the mounted code to be updated. (eg: serverless webpack). There is no --watch support for this out of the box, but could be accomplished using nodemon:

npm i --save-dev nodemon

Webpack example's package.json:

  "scripts": {
    "build": "serverless webpack --stage local",
    "deploy": "serverless deploy --stage local",
    "watch": "nodemon -w src -e '.*' -x 'npm run build'",
    "start": "npm run deploy && npm run watch"
  },
npm run start

A note on using webpack

serverless-webpack is supported, with code mounting. However, there are some assumptions and configuration requirements. First, your output directory must be .webpack. Second, you must retain your output directory contents. You can do this by modifying the custom > webpack portion of your serverless configuration file.

custom:
  webpack:
    webpackConfig: webpack.config.js
    includeModules: true
    keepOutputDirectory: true
  localstack:
    stages:
      - local
    lambda:
      mountCode: true
    autostart: true

Environment Configurations

  • LAMBDA_MOUNT_CWD: Allow users to define a custom working directory for Lambda mounts. For example, when deploying a Serverless app in a Linux VM (that runs Docker) on a Windows host where the -v <local_dir>:<cont_dir> flag to docker run requires us to specify a local_dir relative to the Windows host file system that is mounted into the VM (e.g., "c:/users/guest/...").
  • LAMBDA_EXECUTOR: Executor type to use for running Lambda functions (default docker) - see LocalStack repo
  • LAMBDA_REMOTE_DOCKER: Whether to assume that we're running Lambda containers against a remote Docker daemon (default false) - see LocalStack repo
  • BUCKET_MARKER_LOCAL: Magic S3 bucket name for Lambda mount and Hot Reloading.

Only enable serverless-localstack for the listed stages

  • serverless deploy --stage local would deploy to LocalStack.
  • serverless deploy --stage production would deploy to aws.
service: myService

plugins:
  - serverless-localstack

custom:
  localstack:
    stages:
      - local
      - dev
    endpointFile: path/to/file.json

LocalStack

For full documentation, please refer to https://github.com/localstack/localstack

Contributing

Setting up a development environment is easy using Serverless' plugin framework.

Clone the Repo

git clone https://github.com/localstack/serverless-localstack

Setup your project

cd /path/to/serverless-localstack
npm link

cd myproject
npm link serverless-localstack

Optional Debug Flag

An optional debug flag is supported via serverless.yml that will enable additional debug logs.

custom:
  localstack:
    debug: true

Change Log

  • v1.2.1: Fix custom-resource bucket compatibility with serverless >3.39.0, continue improving support for AWS_ENDPOINT_URL
  • v1.2.0: Add docker-compose config and fix autostart when plugin is not active
  • v1.1.3: Fix replacing host from environment variable AWS_ENDPOINT_URL
  • v1.1.2: Unify construction of target endpoint URL, add support for configuring AWS_ENDPOINT_URL
  • v1.1.1: Fix layer deployment if mountCode is enabled by always packaging and deploying
  • v1.1.0: Fix SSM environment variables resolving issues with serverless v3, change default for BUCKET_MARKER_LOCAL to hot-reload
  • v1.0.6: Add BUCKET_MARKER_LOCAL configuration for customizing S3 bucket for lambda mount and Hot Reloading.
  • v1.0.5: Fix S3 Bucket LocationConstraint issue when the provider region is us-east-1
  • v1.0.4: Fix IPv4 fallback check to prevent IPv6 connection issue with localhost on macOS
  • v1.0.3: Set S3 Path addressing for internal Serverless Custom Resources - allow configuring S3 Events Notification for functions
  • v1.0.2: Add check to prevent IPv6 connection issue with localhost on MacOS
  • v1.0.1: Add support for Serverless projects with esbuild source config; enable config via environment variables
  • v1.0.0: Allow specifying path for mountCode, to point to a relative Lambda mount path
  • v0.4.36: Add patch to avoid "TypeError" in AwsDeploy plugin on Serverless v3.4.0+
  • v0.4.35: Add config option to connect to additional Docker networks
  • v0.4.33: Fix parsing StepFunctions endpoint if the endpointInfo isn't defined
  • v0.4.32: Add endpoint to AWS credentials for compatibility with serverless-domain-manager plugin
  • v0.4.31: Fix format of API GW endpoints printed in stack output
  • v0.4.30: Fix plugin for use with Serverless version 2.30+
  • v0.4.29: Add missing service endpoints to config
  • v0.4.28: Fix plugin activation for variable refs in profile names
  • v0.4.27: Fix loading of endpoints file with variable references to be resolved
  • v0.4.26: Fix resolution of template variables during plugin initialization
  • v0.4.25: Use single edge port instead of deprecated service-specific ports
  • v0.4.24: Fix resolving of stage/profiles via variable expansion
  • v0.4.23: Fix config loading to enable file imports; fix output of API endpoints if plugin is not activated; enable SSM and CF output refs by performing early plugin loading
  • v0.4.21: Fix integration with serverless-plugin-typescript when mountCode is enabled
  • v0.4.20: Use LAMBDA_EXECUTOR/LAMBDA_REMOTE_DOCKER configurations from environment
  • v0.4.19: Fix populating local test credentials in AWS provider
  • v0.4.18: Fix output of API Gateway endpoints; add port mappings; fix config init code
  • v0.4.17: Enable configuration of $START_WEB
  • v0.4.16: Add option for running Docker as sudo; add fix for downloadPackageArtifacts
  • v0.4.15: Enable plugin on aws:common:validate events
  • v0.4.14: Initialize LocalStack using hooks for each "before:" event
  • v0.4.13: Add endpoint for SSM; patch serverless-secrets plugin; allow customizing $DOCKER_FLAGS
  • v0.4.12: Fix Lambda packaging for mountCode:false
  • v0.4.11: Add polling loop for starting LocalStack in Docker
  • v0.4.8: Auto-create deployment bucket; autostart LocalStack in Docker
  • v0.4.7: Set S3 path addressing; add eslint to CI config
  • v0.4.6: Fix port mapping for service endpoints
  • v0.4.5: Fix config to activate or deactivate the plugin for certain stages
  • v0.4.4: Add LAMBDA_MOUNT_CWD configuration for customizing Lambda mount dir
  • v0.4.3: Support local mounting of Lambda code to improve performance
  • v0.4.0: Add support for local STS

serverless-localstack's People

Contributors

a-zharkov avatar aahdahl avatar aazbeltran avatar azizur avatar beau6183 avatar bentsku avatar clive-shine avatar dependabot[bot] avatar dfangl avatar domdomegg avatar harshcasper avatar joe4dev avatar joffarex avatar jorgenfb avatar joshuaflanagan avatar justinm avatar kristallizer avatar llatinov avatar maxenglander avatar nealeu avatar opb-bbeach avatar padmanabhan-rajaraman-tm avatar pinzon avatar robblovell avatar roberttaylor426 avatar steffyp avatar temyers avatar varqasim avatar whummer avatar yonahforst avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

serverless-localstack's Issues

Proposal: do not install the Docker image if an older image exists

The version 0.9.1 of localstack is buggy:

localstack/localstack#1270
localstack/localstack#1267
localstack/localstack#1220
localstack/localstack#1202

A similar issue has already popped up: #3

At the moment, if the localstack 0.9.0 is installed, the local copy of the plugin still installs the latest localstack image even if the docker-compose.yml is modified.

image: localstack/localstack

Skipping the installation of the latest image would solve the problem.

AWS cloudformation 503 (Service Unavailable)

My serverless.yml file worked with deploys directly to AWS, but adding the serverless-localstack plugin breaks deploys. I have tried the example service files included in here too and got same error below:

Serverless: Invoke aws:deploy:deploy
Serverless: [AWS cloudformation 503 0.702s 3 retries] describeStacks({ StackName: 'serverless-demo-local' })
Serverless: Recoverable error occurred (Service Unavailable), sleeping for 5 seconds. Try 1 of 4
Serverless: [AWS cloudformation 503 0.916s 3 retries] describeStacks({ StackName: 'serverless-demo-local' })
Serverless: Recoverable error occurred (Service Unavailable), sleeping for 5 seconds. Try 2 of 4
Serverless: [AWS cloudformation 503 0.981s 3 retries] describeStacks({ StackName: 'serverless-demo-local' })
Serverless: Recoverable error occurred (Service Unavailable), sleeping for 5 seconds. Try 3 of 4
Serverless: [AWS cloudformation 503 1.017s 3 retries] describeStacks({ StackName: 'serverless-demo-local' })
Serverless: Recoverable error occurred (Service Unavailable), sleeping for 5 seconds. Try 4 of 4
Serverless: [AWS cloudformation 503 0.863s 3 retries] describeStacks({ StackName: 'serverless-demo-local' })

Current docker-compose.yml looks like this:

version: '2.1'

services:
  localstack:
    image: localstack/localstack
    ports:
      - "4567-4593:4567-4593"
      - "${PORT_WEB_UI-8080}:${PORT_WEB_UI-8080}"
    environment:
      - SERVICES=serverless,cloudformation,iam,sts
      - DEBUG=1
      - LAMBDA_EXECUTOR=docker
      - DOCKER_HOST=unix:///var/run/docker.sock
    volumes:
      - "${TMPDIR:-/tmp/localstack}:/tmp/localstack"
      - "/var/run/docker.sock:/var/run/docker.sock"

Localstack cloudformation seems to be running fine:

aws cloudformation describe-stacks --endpoint "http://localhost:4581" --region us-west-2
{
    "Stacks": []
}

Is anyone familiar with the error?

┆Issue is synchronized with this Jira Task by Unito

Plugin not activated, looking for dev although deploy arg is --stage local

Receiving this message during startup:

Serverless: serverless-localstack plugin not activated. 'dev' is not present in config custom.localstack.stages

It should not be defaulting to dev, as --stage local is sent as an arg to sls deploy, and configuration should activate only for local:

From serverless.yml:

# Service Name
service: ${file(package.json):name}

# Serverless framework version
# -----------------------------
frameworkVersion: '>=1.26.0 <2.0.0'

# Provider Configurations
# ------------------------
provider:
  name: aws
  runtime: nodejs8.10
  region: ${opt:region, 'us-east-1'}

  # Application Environment
  stage: ${opt:stage, 'local'}

  # Configure the S3 bucket where your application package is stored
  deploymentBucket:
    name: ${file(serverless/stages/${self:provider.stage}.yml):sls.deploymentBucket}
    serverSideEncryption: AES256

  # Disable lambda versioning
  versionFunctions: false

  # Enable X-Ray tracing (serverless-plugin-tracing)
  tracing: true

  # IAM Role used for Deployment
  #   This is always account-specific and is different for each environment
  cfnRole: ${file(serverless/stages/${self:provider.stage}.yml):sls.cfnRole}

  # IAM Role used by Lambda
  #   This is a resource defined in serverless/cloudformation-resources.yml
  role: LambdaDefaultIamRole

  # Memory Configurations
  #   Max is ~3GB. Also provides 2 CPUs
  memorySize: 3008

  # Set the timeout to 28 seconds. Max allowed is 30
  timeout: 28

  # Application Environment Variables
  environment:
    APP_NAME: ${self:service}
    APP_VERSION: ${file(package.json):version}
    APP_ENV: ${self:provider.stage}

plugins:
  - serverless-plugin-aws-alerts
  - serverless-plugin-tracing
  - serverless-pseudo-parameters
  - serverless-webpack
  - serverless-localstack

custom:
  # Configurations for serverless-plugin-aws-alerts
  alerts: ${file(serverless/lambda-cloudwatch-alerts.yml)}

  # Configurations for serverless-webpack
  webpack:
    includeModules: true

  # Configuration for serverless-localstack
  localstack:
    debug: true
    stages: ['local']
    autostart: false

# Function Configurations
# -------------------------
functions:
  myFunction:
    handler: src/lambda.handler
    description: ${file(package.json):description}
    events: ${file(serverless/stages/lambda-events.${self:provider.stage}.yml):myEvents}

# CloudFormation Resources
# -------------------------
resources:
  - ${file(serverless/cloudformation-resources.yml)}

Unable to create environment variable using serverless-localstack

I am unable to get environment variable to work in serverless-localstack.

provider:

name: aws
environment:
  helloworld: ${file(env.yml):{self:provider.stage}.hello

I am trying to set environment variable using env.yml file. Please let me know if this is a known issue and what is the work around to import environment variables

┆Issue is synchronized with this Jira Task by Unito

500 error from serverless on deployment

Copied from: localstack/localstack#855 Koalk


Can't seem to create tickets on the new project, feel free to copy this into it once issues are enabled on it.
I am trying to deploy a local version of 2 lambdas plus a stepfunction, all quite basic stuff.
I get a 500 error from the serverless side of the deployment and quite the amount of logs in the localstack side. I'll put both here in case they are of any use.
Localstack logs
Serverless logs
serverless.yml

Is suppose to be a basic "lambda one loads new data somewhere and lambda two does some processing on it" with the step function as a glue between them and failover.

┆Issue is synchronized with this Jira Task by Unito

connect ECONNREFUSED 127.0.0.1:4592

Hello,

Seems like I cannot force serverless-localstack to push my lambda towards localstack.

Here's serverless config:

provider:
  name: aws
  runtime: python3.7
  region: us-east-1
  timeout: 30
  environment:
    LAMBDA_REMOTE_DOCKER: true
functions:
  .......
plugins:
   - serverless-python-requirements
   - serverless-localstack
custom:
  pythonRequirements:
     dockerizePip: true
  localstack:
    host: http://localhost  # optional - LocalStack host to connect to
    debug: true

Docker Compose:

version: "3"
services:
  localstack:
    container_name: localstack
    image: localstack/localstack
    environment:
      - SERVICES=s3,dynamodb,kinesis,lambda,iam,apigateway,sns,cloudformation,serverless
      - DEBUG=1
      - DATA_DIR=/tmp/localstack/data
      - LAMBDA_EXECUTOR=docker
      - PORT_WEB_UI=8080
      - DOCKER_HOST=unix:///var/run/docker.sock
    volumes:
      - ./localstack:/tmp/localstack
      - "/var/run/docker.sock:/var/run/docker.sock"
    ports:
      - "4567-4584:4567-4584"
      - "8080:8080"

Logs serverless:

Serverless: Using serverless-localstack
Serverless: Reconfiguring service apigateway to use http://localhost:4567
Serverless: Reconfiguring service cloudformation to use http://localhost:4581
Serverless: Reconfiguring service cloudwatch to use http://localhost:4582
Serverless: Reconfiguring service lambda to use http://localhost:4574
Serverless: Reconfiguring service dynamodb to use http://localhost:4569
Serverless: Reconfiguring service kinesis to use http://localhost:4568
Serverless: Reconfiguring service route53 to use http://localhost:4580
Serverless: Reconfiguring service firehose to use http://localhost:4573
Serverless: Reconfiguring service stepfunctions to use http://localhost:4585
Serverless: Reconfiguring service es to use http://localhost:4578
Serverless: Reconfiguring service s3 to use http://localhost:4572
Serverless: Reconfiguring service ses to use http://localhost:4579
Serverless: Reconfiguring service sns to use http://localhost:4575
Serverless: Reconfiguring service sqs to use http://localhost:4576
Serverless: Reconfiguring service sts to use http://localhost:4592
Serverless: Reconfiguring service iam to use http://localhost:4593
Serverless: Reconfiguring service ssm to use http://localhost:4583
Serverless: Reconfiguring service rds to use http://localhost:4594
Serverless: Reconfiguring service ec2 to use http://localhost:4597
Serverless: Reconfiguring service elasticache to use http://localhost:4598
Serverless: Reconfiguring service kms to use http://localhost:4599
Serverless: Reconfiguring service secretsmanager to use http://localhost:4584
Serverless: Reconfiguring service logs to use http://localhost:4586
Serverless: Reconfiguring service cloudwatchlogs to use http://localhost:4586
Serverless: Reconfiguring service iot to use http://localhost:4589
Serverless: Reconfiguring service cognito-idp to use http://localhost:4590
Serverless: Reconfiguring service cognito-identity to use http://localhost:4591
Serverless: Reconfiguring service ecs to use http://localhost:4601
Serverless: Reconfiguring service eks to use http://localhost:4602
Serverless: Reconfiguring service xray to use http://localhost:4603
Serverless: Reconfiguring service appsync to use http://localhost:4605
Serverless: Reconfiguring service cloudfront to use http://localhost:4606
Serverless: Reconfiguring service athena to use http://localhost:4607
Serverless: Warning: Unable to find plugin named: TypeScriptPlugin
Serverless: config.options_stage: undefined
Serverless: serverless.service.custom.stage: undefined
Serverless: serverless.service.provider.stage: dev
Serverless: config.stage: dev
Serverless: Generated requirements from /.../requirements.txt in /.../.serverless/requirements.txt...
Serverless: Using static cache of requirements found at /.../.cache/serverless-python-requirements/0b6046c3411ae9fc7ee5417b702696535b44420a56ff46a0d8d7a4fbdf03d488_slspyc ...
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Injecting required Python packages to package...
Serverless: Creating Stack...
Serverless: Checking Stack create progress...
Serverless: Recoverable error occurred (502), sleeping for ~5 seconds. Try 1 of 4
Serverless: Recoverable error occurred (502), sleeping for ~6 seconds. Try 2 of 4
Serverless: Recoverable error occurred (502), sleeping for ~6 seconds. Try 3 of 4
Serverless: Recoverable error occurred (502), sleeping for ~6 seconds. Try 4 of 4
 
  Serverless Error ---------------------------------------
 
  502
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     Operating System:          linux
     Node Version:              10.17.0
     Framework Version:         1.59.3
     Plugin Version:            3.2.5
     SDK Version:               2.2.1
     Components Core Version:   1.1.2
     Components CLI Version:    1.4.0

Log docker-compose:

localstack    | 2019-12-10 08:07:00,408 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
localstack    | 2019-12-10 08:07:00,411 INFO supervisord started with pid 13
localstack    | 2019-12-10 08:07:01,416 INFO spawned: 'dashboard' with pid 19
localstack    | 2019-12-10 08:07:01,419 INFO spawned: 'infra' with pid 20
localstack    | (. .venv/bin/activate; bin/localstack web)
localstack    | 2019-12-10 08:07:01,424 INFO success: dashboard entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
localstack    | (. .venv/bin/activate; exec bin/localstack start --host)
localstack    | 2019-12-10 08:07:02,426 INFO success: infra entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
localstack    | 2019-12-10T08:07:03:WARNING:bootstrap.py: Unable to load plugins from file /opt/code/localstack/.venv/lib/python3.7/site-packages/localstack_ext/plugins.py: No module named 'localstack_ext.utils.aws.aws_models'
localstack    | 2019-12-10T08:07:03:INFO:localstack.utils.common: Unable to store certificate file under /tmp/localstack/server.test.pem, using tmp file instead: [Errno 13] Permission denied: '/tmp/localstack/server.test.pem'
localstack    | Starting local dev environment. CTRL-C to quit.
localstack    | Starting mock API Gateway (http port 4567)...
localstack    | 2019-12-10T08:07:06:INFO:localstack.multiserver: Starting multi API server process on port 51492
localstack    | Starting mock CloudFormation (http port 4581)...
localstack    | Starting mock DynamoDB (http port 4569)...
localstack    | Starting mock IAM (http port 4593)...
localstack    | Starting mock Kinesis (http port 4568)...
localstack    | Starting mock Lambda service (http port 4574)...
localstack    | Starting mock CloudWatch Logs (http port 4586)...
localstack    | Starting mock S3 (http port 4572)...
localstack    | Starting mock SNS (http port 4575)...
localstack    | Starting mock STS (http port 4592)...
localstack    | 2019-12-10 08:07:07,035:API:  * Running on http://0.0.0.0:4566/ (Press CTRL+C to quit)
localstack    | 2019-12-10 08:07:07,035:API:  * Running on http://0.0.0.0:4566/ (Press CTRL+C to quit)
localstack    | 2019-12-10 08:07:07,035:API:  * Running on http://0.0.0.0:4566/ (Press CTRL+C to quit)
localstack    | 2019-12-10 08:07:07,035:API:  * Running on http://0.0.0.0:4559/ (Press CTRL+C to quit)
localstack    | 2019-12-10 08:07:07,035:API:  * Running on http://0.0.0.0:4559/ (Press CTRL+C to quit)
localstack    | 2019-12-10 08:07:07,035:API:  * Running on http://0.0.0.0:4559/ (Press CTRL+C to quit)
localstack    | 2019-12-10 08:07:07,085:API:  * Running on http://0.0.0.0:4557/ (Press CTRL+C to quit)
localstack    | 2019-12-10 08:07:07,085:API:  * Running on http://0.0.0.0:4557/ (Press CTRL+C to quit)
localstack    | 2019-12-10 08:07:07,085:API:  * Running on http://0.0.0.0:4557/ (Press CTRL+C to quit)
localstack    | Waiting for all LocalStack services to be ready
localstack    | Listening at http://:::4565
localstack    | Initializing DynamoDB Local with the following configuration:
localstack    | Port:   4564
localstack    | InMemory:       false
localstack    | DbPath: /tmp/localstack/data/dynamodb
localstack    | SharedDb:       true
localstack    | shouldDelayTransientStatuses:   false
localstack    | CorsParams:     *
localstack    | 
localstack    | 2019-12-10 08:07:12,601:API: 127.0.0.1 - - [10/Dec/2019 08:07:12] "GET / HTTP/1.1" 200 -
localstack    | 2019-12-10 08:07:12,617:API: 127.0.0.1 - - [10/Dec/2019 08:07:12] "PUT /analytics-kinesis-dev-serverlessdeploymentbucket-2z36qljexnpv HTTP/1.1" 200 -
localstack    | 2019-12-10 08:07:12,626:API: 127.0.0.1 - - [10/Dec/2019 08:07:12] "PUT /analytics-kinesis-dev-serverlessdeploymentbucket-8n3t25w37a1e HTTP/1.1" 200 -
localstack    | 2019-12-10 08:07:12,634:API: 127.0.0.1 - - [10/Dec/2019 08:07:12] "PUT /analytics-kinesis-dev-serverlessdeploymentbucket-sn3afro2r9tz HTTP/1.1" 200 -
localstack    | 2019-12-10 08:07:12,643:API: 127.0.0.1 - - [10/Dec/2019 08:07:12] "PUT /analytics-kinesis-dev-serverlessdeploymentbucket-cxbicls3wsno HTTP/1.1" 200 -
localstack    | 2019-12-10 08:07:12,651:API: 127.0.0.1 - - [10/Dec/2019 08:07:12] "PUT /analytics-kinesis-dev-serverlessdeploymentbucket-manjno7od7om HTTP/1.1" 200 -
localstack    | 2019-12-10 08:07:12,659:API: 127.0.0.1 - - [10/Dec/2019 08:07:12] "PUT /analytics-kinesis-dev-serverlessdeploymentbucket-63x6v8nbah14 HTTP/1.1" 200 -
localstack    | 2019-12-10 08:07:12,667:API: 127.0.0.1 - - [10/Dec/2019 08:07:12] "PUT /analytics-kinesis-dev-serverlessdeploymentbucket-2g2c7o9ebwxb HTTP/1.1" 200 -
localstack    | 2019-12-10 08:07:12,675:API: 127.0.0.1 - - [10/Dec/2019 08:07:12] "PUT /analytics-kinesis-dev-serverlessdeploymentbucket-8ah9wcak0jaa HTTP/1.1" 200 -
localstack    | 2019-12-10 08:07:12,683:API: 127.0.0.1 - - [10/Dec/2019 08:07:12] "PUT /analytics-sls-apis-dev-serverlessdeploymentbucket-gw1fwz2adsfk HTTP/1.1" 200 -
localstack    | 2019-12-10 08:07:12,692:API: 127.0.0.1 - - [10/Dec/2019 08:07:12] "PUT /analytics-sls-apis-dev-serverlessdeploymentbucket-kos9v49a8a5y HTTP/1.1" 200 -
localstack    | Ready.
localstack    | 2019-12-10T08:07:12:INFO:localstack.utils.persistence: Restored 10 API calls from persistent file: /tmp/localstack/data/s3_api_calls.json
localstack    | 2019-12-10 08:08:32,124:API: 127.0.0.1 - - [10/Dec/2019 08:08:32] "GET /analytics-sls-apis-dev-serverlessdeploymentbucket-y192p6ynaelz?location HTTP/1.1" 404 -
localstack    | 2019-12-10 08:08:32,134:API: 127.0.0.1 - - [10/Dec/2019 08:08:32] "HEAD /analytics-sls-apis-dev-serverlessdeploymentbucket-y192p6ynaelz HTTP/1.1" 404 -
localstack    | 2019-12-10 08:08:32,150:API: 127.0.0.1 - - [10/Dec/2019 08:08:32] "PUT /analytics-sls-apis-dev-serverlessdeploymentbucket-y192p6ynaelz HTTP/1.1" 200 -
localstack    | 2019-12-10T08:08:32:DEBUG:localstack.services.cloudformation.cloudformation_listener: Error response from CloudFormation (400) POST /: b'<ErrorResponse xmlns="http://cloudformation.amazonaws.com/doc/2010-05-15/">\n  <Error>\n    <Type>Sender</Type>\n    <Code>ValidationError</Code>\n    <Message>Stack with id analytics-sls-apis-dev does not exist</Message>\n  </Error>\n  <RequestId>cf4c737e-5ae2-11e4-a7c9-ad44eEXAMPLE</RequestId>\n</ErrorResponse>'
localstack    | 2019-12-10T08:08:32:DEBUG:localstack.services.cloudformation.cloudformation_starter: Currently updating stack resource analytics-sls-apis-dev/ServerlessDeploymentBucket: None
localstack    | 2019-12-10T08:08:32:DEBUG:localstack.services.cloudformation.cloudformation_starter: Deploying CloudFormation resource (update=False, exists=False, updateable=False): {'Type': 'AWS::S3::Bucket', 'Properties': {'BucketEncryption': {'ServerSideEncryptionConfiguration': [{'ServerSideEncryptionByDefault': {'SSEAlgorithm': 'AES256'}}]}, 'BucketName': 'analytics-sls-apis-dev-ServerlessDeploymentBucket-Y192P6YNAELZ'}}
localstack    | 2019-12-10T08:08:32:DEBUG:localstack.utils.cloudformation.template_deployer: Deploying resource type "S3::Bucket" id "ServerlessDeploymentBucket"
localstack    | 2019-12-10T08:08:32:DEBUG:localstack.utils.cloudformation.template_deployer: Request for creating resource type "S3::Bucket" in region us-east-1: create_bucket {'Bucket': 'analytics-sls-apis-dev-ServerlessDeploymentBucket-Y192P6YNAELZ', 'ACL': 'public-read', 'CreateBucketConfiguration': {'LocationConstraint': 'us-east-1'}}
localstack    | 2019-12-10T08:08:32:DEBUG:localstack.services.cloudformation.cloudformation_starter: Currently updating stack resource analytics-sls-apis-dev/ServerlessDeploymentBucketPolicy: None
localstack    | 2019-12-10T08:08:32:WARNING:moto: No Moto CloudFormation support for AWS::S3::BucketPolicy
localstack    | 2019-12-10T08:08:37:DEBUG:localstack.services.cloudformation.cloudformation_listener: Error response from CloudFormation (400) POST /: b'<ErrorResponse xmlns="http://cloudformation.amazonaws.com/doc/2010-05-15/">\n  <Error>\n    <Type>Sender</Type>\n    <Code>ValidationError</Code>\n    <Message>Unable to find stack "analytics-sls-apis-dev" in region us-east-1</Message>\n  </Error>\n  <RequestId>cf4c737e-5ae2-11e4-a7c9-ad44eEXAMPLE</RequestId>\n</ErrorResponse>'
localstack    | 2019-12-10T08:08:37:ERROR:localstack.services.generic_proxy: Error forwarding request: An error occurred (ValidationError) when calling the DescribeStackEvents operation: Unable to find stack "analytics-sls-apis-dev" in region us-east-1 Traceback (most recent call last):
localstack    |   File "/opt/code/localstack/localstack/services/generic_proxy.py", line 242, in forward
localstack    |     path=path, data=data, headers=forward_headers)
localstack    |   File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_listener.py", line 149, in forward_request
localstack    |     tmp = client.describe_stack_events(StackName=stack_name)['StackEvents'][:1]
localstack    |   File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 272, in _api_call
localstack    |     return self._make_api_call(operation_name, kwargs)
localstack    |   File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 576, in _make_api_call
localstack    |     raise error_class(parsed_response, operation_name)
localstack    | botocore.exceptions.ClientError: An error occurred (ValidationError) when calling the DescribeStackEvents operation: Unable to find stack "analytics-sls-apis-dev" in region us-east-1
localstack    | 
localstack    | 

Type Error when attempting to deploy to local stack.

I get the following when attempting to deploy to localstack. The only odd thing I can think of is that I'm running babel to transpile my files into a .bin directory and that's where I'm pointing my handlers.

My serverless.yaml looks like this:

service: api-cloud-functions 

provider:
  name: aws
  runtime: nodejs8.10

# you can overwrite defaults here
  region: us-east-1

functions:
  console-auth:
    handler: handler.consoleAuth
plugins:
  - serverless-localstack

custom:
  localstack:
    host: http://localhost
    endpoints:
      # This section is optional - can be used for customizing the target endpoints
      S3: http://localhost:4572
      DynamoDB: http://localhost:4570
      CloudFormation: http://localhost:4581
      Elasticsearch: http://localhost:4571
      ES: http://localhost:4578
      SNS: http://localhost:4575
      SQS: http://localhost:4576
      Lambda: http://localhost:4574
      Kinesis: http://localhost:4568

The deploy output looks like this:

Serverless: Using serverless-localstack
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Recoverable error occurred (502), sleeping for 5 seconds. Try 1 of 4
Serverless: Recoverable error occurred (502), sleeping for 5 seconds. Try 2 of 4
Serverless: Recoverable error occurred (502), sleeping for 5 seconds. Try 3 of 4
Serverless: Recoverable error occurred (502), sleeping for 5 seconds. Try 4 of 4
 
  Type Error ---------------------------------------------
 
  e.message.indexOf is not a function
 
     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information -----------------------------
     OS:                     darwin
     Node Version:           11.11.0
     Serverless Version:     1.39.1
 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] deploy: `serverless deploy`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Localstack is printing the following when I attempt to deploy:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/Users/user.name/Library/Python/3.7/lib/python/site-packages/urllib3/connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/Users/user.name/Library/Python/3.7/lib/python/site-packages/urllib3/util/retry.py", line 388, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=4559): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10fb61eb8>: Failed to establish a new connection: [Errno 61] Connection refused'))

Im unsure how to proceed. Thanks!

Cannot read endpointFile from environment Variable

I used to pass the location of my endpoint file like this:

custom:
  localstack:
    stages:
      - local
    endpointFile: ${env:ENDPOINT_FILE, './tests/dummy.json'}

For some reason, that ceased to work starting with version 0.4.21 (works up to 0.4.20) and throws the following error:
ReferenceError: Endpoint: "${env:ENDPOINT_FILE, './tests/dummy.json'}" is invalid: Error: ENOENT: no such file or directory, open '${env:ENDPOINT_FILE, './tests/dummy.json'}'

This suggests to me that the variable is no longer evaluated and serverless-localstack tries to open a file called ${env...}, but looking at the source code I don't see any relevant changes that ought to trigger such a change in behaviour (but then again I'm not very experienced in Node.js).

Any help on this is highly appreciated.

Fn::GetAtt with S3

I have a simple S3 bucket 'MyBucket' declared alongside an IAM Role 'MyBucketRole', if I attempt to access the bucket's ARN via:
{ "Fn::GetAtt": ["MyBucket", "Arn"] }
it will throw:
Template error: resource CommandArchive does not support attribute type Arn in Fn::GetAtt

However, if I attempt to access the ARN via:
{ "Fn::GetAtt": [{"Fn::GetAtt": ["MyBucket", "BucketName"]}, "Arn"] }
it works fine.

Under normal Serverless circumstance the first option works fine, am I being silly or is this a legitimate/known issue?

Getting credentials fail when profile is referenced with variables

In my serverless.yml my profile is set with variables like

provider:
  profile: ${self:custom.profiles.${self:custom.currentStage}, self:custom.defaultProfile}

But when serverless-localstack tries to get profile like

const tmpCreds = this.awsProvider.getCredentials();

it fails with exception:

Error: Profile ${self:custom.profiles.${self:custom.currentStage}, self:custom.defaultProfile} does not exist
      at Object.addProfileCredentials (/usr/local/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:100:15)
      at AwsProvider.getCredentials (/usr/local/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:362:12)
      at LocalstackPlugin.reconfigureAWS (/Users/cansahin/Git/EkoTaksi-Backend/node_modules/serverless-localstack/src/index.js:339:41)
      at new LocalstackPlugin (/Users/cansahin/Git/EkoTaksi-Backend/node_modules/serverless-localstack/src/index.js:72:10)
      at PluginManager.addPlugin (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:65:28)

EDIT:
I realized that issue is fixed but not yet deployed.

Serverless localstack: block does not support variables

I would like to be able to use variables in the localstack: block in the servlerless.yml:custom section, e.g.:

custom:
  localstack:
    host: http://${env:AWS_ENDPOINT}

serverless-localstack does not currently support this, because it is reading the localstack block from the options passed to the plugin constructor. This is better explained here.

Error deploying to localstack: InvalidBucketName

I get this error, starting localstack with DEBUG=1, when I try to deploy a hello world test project (1 lambda and 1 API Gateway endpoint).

Seems like serverless framework or this plugin generates an invalid bucket name (contains uppercase letters)

2019-11-27 15:11:39,901:API: 127.0.0.1 - - [27/Nov/2019 15:11:39] "GET /test-project-local-ServerlessDeploymentBucket-5M5NXDTVY08Z?location HTTP/1.1" 404 -
2019-11-27 15:11:39,916:API: 127.0.0.1 - - [27/Nov/2019 15:11:39] "HEAD /test-project-local-ServerlessDeploymentBucket-5M5NXDTVY08Z HTTP/1.1" 404 -
2019-11-27T15:11:39:DEBUG:localstack.services.cloudformation.cloudformation_listener: Error response from CloudFormation (400) POST /: b'<ErrorResponse xmlns="http://cloudformation.amazonaws.com/doc/2010-05-15/">\n  <Error>\n    <Type>Sender</Type>\n    <Code>ValidationError</Code>\n    <Message>Stack with id test-project-local does not exist</Message>\n  </Error>\n  <RequestId>cf4c737e-5ae2-11e4-a7c9-ad44eEXAMPLE</RequestId>\n</ErrorResponse>'
2019-11-27T15:11:39:DEBUG:localstack.services.cloudformation.cloudformation_starter: Currently updating stack resource test-project-local/ServerlessDeploymentBucket: None
2019-11-27T15:11:39:DEBUG:localstack.services.cloudformation.cloudformation_starter: Deploying CloudFormation resource (update=False, exists=False, updateable=False): {'Type': 'AWS::S3::Bucket', 'Properties': {'BucketEncryption': {'ServerSideEncryptionConfiguration': [{'ServerSideEncryptionByDefault': {'SSEAlgorithm': 'AES256'}}]}, 'BucketName': 'test-project-local-ServerlessDeploymentBucket-5M5NXDTVY08Z'}}
2019-11-27T15:11:39:DEBUG:localstack.utils.cloudformation.template_deployer: Deploying resource type "S3::Bucket" id "ServerlessDeploymentBucket"
2019-11-27T15:11:39:DEBUG:localstack.utils.cloudformation.template_deployer: Request for creating resource type "S3::Bucket" in region eu-west-1: create_bucket {'Bucket': 'test-project-local-ServerlessDeploymentBucket-5M5NXDTVY08Z', 'ACL': 'public-read', 'CreateBucketConfiguration': {'LocationConstraint': 'eu-west-1'}}
2019-11-27 15:11:40,564:API: 127.0.0.1 - - [27/Nov/2019 15:11:40] "GET /test-project-local-ServerlessDeploymentBucket-MPGD7SKUJ7QN?location HTTP/1.1" 404 -
2019-11-27 15:11:40,576:API: 127.0.0.1 - - [27/Nov/2019 15:11:40] "HEAD /test-project-local-ServerlessDeploymentBucket-MPGD7SKUJ7QN HTTP/1.1" 404 -
2019-11-27 15:11:40,691:API: 127.0.0.1 - - [27/Nov/2019 15:11:40] "GET /test-project-local-ServerlessDeploymentBucket-3T2BTL9C5DMP?location HTTP/1.1" 404 -
2019-11-27 15:11:40,703:API: 127.0.0.1 - - [27/Nov/2019 15:11:40] "HEAD /test-project-local-ServerlessDeploymentBucket-3T2BTL9C5DMP HTTP/1.1" 404 -
2019-11-27T15:11:40:WARNING:localstack.utils.cloudformation.template_deployer: Error calling <bound method ClientCreator._create_api_method.<locals>._api_call of <botocore.client.S3 object at 0x7f8cd1aaa350>> with params: {'Bucket': 'test-project-local-ServerlessDeploymentBucket-5M5NXDTVY08Z', 'ACL': 'public-read', 'CreateBucketConfiguration': {'LocationConstraint': 'eu-west-1'}} for resource: {'Type': 'AWS::S3::Bucket', 'Properties': {'BucketEncryption': {'ServerSideEncryptionConfiguration': [{'ServerSideEncryptionByDefault': {'SSEAlgorithm': 'AES256'}}]}, 'BucketName': 'test-project-local-ServerlessDeploymentBucket-5M5NXDTVY08Z'}}
2019-11-27T15:11:40:ERROR:localstack.services.cloudformation.cloudformation_starter: Unable to parse and create resource "ServerlessDeploymentBucket": An error occurred (InvalidBucketName) when calling the CreateBucket operation: The specified bucket is not valid. Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_starter.py", line 173, in parse_and_create_resource
    return _parse_and_create_resource(logical_id, resource_json, resources_map, region_name)
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_starter.py", line 260, in _parse_and_create_resource
    result = deploy_func(logical_id, resource_wrapped, stack_name=stack_name)
  File "/opt/code/localstack/localstack/utils/cloudformation/template_deployer.py", line 713, in deploy_resource
    result = deploy_resource_via_sdk_function(resource_id, resources, resource_type, func, stack_name)
  File "/opt/code/localstack/localstack/utils/cloudformation/template_deployer.py", line 783, in deploy_resource_via_sdk_function
    raise e
  File "/opt/code/localstack/localstack/utils/cloudformation/template_deployer.py", line 780, in deploy_resource_via_sdk_function
    result = function(**params)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 661, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (InvalidBucketName) when calling the CreateBucket operation: The specified bucket is not valid.

No lambda function resource when using with `aws-ruby` serverless template

There is a bug in creation of the .serverless/cloudformation-template-update-stack.json file with serverless projects created with the aws-ruby template. With serverless version 1.38.0 and serveless-localstack version 0.43, this cfn template is generated without an AWS::Lambda::Function resource definition for stages where the localstack plugin should not be enabled. This results in the following output when running a command like serverless deploy --stage staging:

Serverless: Loading endpointJson from localstack-endpoints.json
Serverless: Intercepting service APIGateway
Serverless: Intercepting service CloudFormation
Serverless: Intercepting service CloudWatch
Serverless: Intercepting service DynamoDB
Serverless: Intercepting service DynamoDBStreams
Serverless: Intercepting service ES
Serverless: Intercepting service Firehose
Serverless: Intercepting service Kinesis
Serverless: Intercepting service Lambda
Serverless: Intercepting service Redshift
Serverless: Intercepting service Route53
Serverless: Intercepting service S3
Serverless: Intercepting service SES
Serverless: Intercepting service SNS
Serverless: Intercepting service SQS
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: config.options_stage: staging
Serverless: serverless.service.custom.stage: undefined
Serverless: serverless.service.provider.stage: staging
Serverless: Skipping serverless-localstack:
custom.localstack.stages: ["local"]
stage: staging
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service oops.zip file to S3 (4.32 KB)...
Serverless: Validating template...
Serverless: Skipping template validation: Unsupported in Localstack
Serverless: Updating Stack...
 
  Serverless Error ---------------------------------------
 
  Template error: instance of Fn::GetAtt references undefined resource HelloLambdaFunction
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information -----------------------------
     OS:                     darwin
     Node Version:           11.10.0
     Serverless Version:     1.38.0

The serverless.yml file that is the stock generated file from the sls create -t aws-ruby -p oops with the plugin added and an apigateway triggering event for the hello function (comments removed):

service: oops

plugins:
  - serverless-localstack

provider:
  name: aws
  runtime: ruby2.5
  stage: ${opt:stage, "local"}

custom:
  localstack:
    debug: true
    stages:
      - local
    endpointFile: localstack-endpoints.json

functions:
  hello:
    handler: handler.hello
    events:
      - http:
          path: motd
          method: get

If I comment out the inclusion of the serverless-localstack plugin, deployment works fine and I can curl against the generated apigateway endpoint:

> sls deploy -s staging
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service oops.zip file to S3 (6.02 KB)...
Serverless: Validating template...
Serverless: Updating Stack...
Serverless: Checking Stack update progress...
..........
Serverless: Stack update finished...
Service Information
service: oops
stage: staging
region: us-east-1
stack: oops-staging
resources: 10
api keys:
  None
endpoints:
  GET - https://93vucvet8a.execute-api.us-east-1.amazonaws.com/staging/motd
functions:
  hello: oops-staging-hello
layers:
  None
> curl https://93vucvet8a.execute-api.us-east-1.amazonaws.com/staging/motd
"Go Serverless v1.0! Your function executed successfully!"

Diffing .serverless/cloudformation-template-update-stack.json with and without the plugin included in the serverless.yml reveals the following differences (left is with plugin, right is without):

98a99,134
>     "HelloLambdaFunction": {
>       "Type": "AWS::Lambda::Function",
>       "Properties": {
>         "Code": {
>           "S3Bucket": {
>             "Ref": "ServerlessDeploymentBucket"
>           },
>           "S3Key": "serverless/oops/staging/1551290294665-2019-02-27T17:58:14.665Z/oops.zip"
>         },
>         "FunctionName": "oops-staging-hello",
>         "Handler": "handler.hello",
>         "MemorySize": 1024,
>         "Role": {
>           "Fn::GetAtt": [
>             "IamRoleLambdaExecution",
>             "Arn"
>           ]
>         },
>         "Runtime": "ruby2.5",
>         "Timeout": 6
>       },
>       "DependsOn": [
>         "HelloLogGroup",
>         "IamRoleLambdaExecution"
>       ]
>     },
>     "HelloLambdaVersion1cVajWpnVGAqI0YL9qpTRp6wZDgsAAw1eoS3HXfU": {
>       "Type": "AWS::Lambda::Version",
>       "DeletionPolicy": "Retain",
>       "Properties": {
>         "FunctionName": {
>           "Ref": "HelloLambdaFunction"
>         },
>         "CodeSha256": "XL84oYDLNsVEZj3OYtn2OoUzJ2a0/XbK8sJ6zZy9FiM="
>       }
>     },
168c204
<     "ApiGatewayDeployment1551289756547": {
---
>     "ApiGatewayDeployment1551290294677": {
233a270,275
>     "HelloLambdaFunctionQualifiedArn": {
>       "Description": "Current Lambda function version",
>       "Value": {
>         "Ref": "HelloLambdaVersion1cVajWpnVGAqI0YL9qpTRp6wZDgsAAw1eoS3HXfU"
>       }
>     },

That HelloLambdaFunction resource definition is not included in the generated template when the serverless-localstack plugin is in place when packaging/deploying for the staging stage.

I'll be looking deeper as to why, but I wanted to go ahead and get this in submitted in the meantime.

reconfigureAWS doesn't resolve env variables

I'm getting KeyError: '${env:AWS_REGION}' error bc plugin doesn't resolve AWS_REGION env variable in serverless config.
When deploying to real aws it's resolved to region: 'eu-west-1', in config, but when I use localstack it stays region: '${env:AWS_REGION}',

Use `docker-compose.yml` for `autostart: true`

The current implementation depends on user having to install localstack binary on their machine since it uses the following command (https://github.com/localstack/serverless-localstack/blob/master/src/index.js#L332) to start docker container.

localstack infra start --docker

This repo comes with a docker-compose.yml but it's not used at all.

IMHO, when auto-starting it should use the docker-compose.yml as the default way to start docker container. The reason being, I want to use locastack but I don't want to install the binary locally on my machine. That's the essence of using docker containers.

┆Issue is synchronized with this Jira Task by Unito

Cloudwatch event schedule not working.

I am trying to create a ruby lambda and linking it to an event schedule which is set to trigger every minute.
Lambda is working properly. I am able to deploy and invoke as expected.
But, the event rule is not created.
I tried the same serverless configuration on AWS without localstack, it works.
Please help me to resolve this

serverless.yml:

service: reminders

provider:
  name: aws
  runtime: ruby2.5

plugins:
  - serverless-localstack
  - serverless-ruby-package

custom:
  rubyPackage:
    alwaysCrossCompileExtensions: true
  localstack:
    stages:
      - dev
    host: http://serverless-localstack
    lambda:
      mountCode: False

package:
  excludeDevDependencies: false
  include:
    - lib/**

functions:
  confirmSchoolReminder:
    handler: lib/confirm_school_reminder.ConfirmSchoolReminder.perform
    events:
      - schedule: rate(1 minute)

sls deploy --stage dev:

sls invoke local -f confirmSchoolReminder:

ws events list-rules --endpoint http://serverless-localstack:4587 --region us-east-1:

┆Issue is synchronized with this Jira Task by Unito

Deploying to aws rather than Localstack when config is in a referenced file

Bug Report

What went wrong:
When referencing the custom: section of serverless.yml from a separate config file, serverless-localstack did not redirect properly and it deployed to real aws.

As soon as I switched from providing my config within serverless.yml like so:

custom:
  app_name: "serverless-localstack-bug"
  stage: ${opt:stage, 'dev'}

  localstack: 
    host: http://localhost
    stages:
      # list of stages for which the plugin should be enabled
      - local
    endpoints:
      # This section is optional - can be used for customizing the target endpoints
      S3: http://localhost:4572
      DynamoDB: http://localhost:4570
      CloudFormation: http://localhost:4581
      Elasticsearch: http://localhost:4571
      ES: http://localhost:4578
      SNS: http://localhost:4575
      SQS: http://localhost:4576
      Lambda: http://localhost:4574
      Kinesis: http://localhost:4568
    lambda:
      # Enable this flag to improve performance
      mountCode: True

to referencing a file using:

custom: ${file(./config/serverless.${opt:stage, 'dev'}.config.yml):custom}

which contains the exact same code, the problem started.

Expected Outcome:
Before the plugin starts, it reads the whole processed serverless file and acts as it did when the custom section was part of the main serverless.yml file. A deployment to localstack and no interaction with real AWS.

Actual Outcome:
S3 bucket created and cloudformation template uploaded, but failed as the template was invalid.

it seems to ignore the config and create the S3 bucket on AWS instead which then fails to deploy properly with the following error:

  Error --------------------------------------------------

  The CloudFormation template is invalid: Invalid template resource property 'Subscription'

     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

  Stack Trace --------------------------------------------

Error: The CloudFormation template is invalid: Invalid template resource property 'Subscription'
    at provider.request.catch (/home/mjenner/.nvm/versions/node/v10.9.0/lib/node_modules/serverless/lib/plugins/aws/deploy/lib/validateTemplate.js:24:13)
From previous event:
    at AwsDeploy.validateTemplate (/home/mjenner/.nvm/versions/node/v10.9.0/lib/node_modules/serverless/lib/plugins/aws/deploy/lib/validateTemplate.js:19:12)
From previous event:
    at AwsDeploy.BbPromise.bind.then (/home/mjenner/.nvm/versions/node/v10.9.0/lib/node_modules/serverless/lib/plugins/aws/deploy/index.js:119:39)
From previous event:
    at Object.aws:deploy:deploy:validateTemplate [as hook] (/home/mjenner/.nvm/versions/node/v10.9.0/lib/node_modules/serverless/lib/plugins/aws/deploy/index.js:115:10)
    at BbPromise.reduce (/home/mjenner/.nvm/versions/node/v10.9.0/lib/node_modules/serverless/lib/classes/PluginManager.js:407:55)
From previous event:
    at PluginManager.invoke (/home/mjenner/.nvm/versions/node/v10.9.0/lib/node_modules/serverless/lib/classes/PluginManager.js:407:22)
    at PluginManager.spawn (/home/mjenner/.nvm/versions/node/v10.9.0/lib/node_modules/serverless/lib/classes/PluginManager.js:425:17)
    at AwsDeploy.BbPromise.bind.then (/home/mjenner/.nvm/versions/node/v10.9.0/lib/node_modules/serverless/lib/plugins/aws/deploy/index.js:93:48)
From previous event:
    at Object.deploy:deploy [as hook] (/home/mjenner/.nvm/versions/node/v10.9.0/lib/node_modules/serverless/lib/plugins/aws/deploy/index.js:89:10)
    at BbPromise.reduce (/home/mjenner/.nvm/versions/node/v10.9.0/lib/node_modules/serverless/lib/classes/PluginManager.js:407:55)
From previous event:
    at PluginManager.invoke (/home/mjenner/.nvm/versions/node/v10.9.0/lib/node_modules/serverless/lib/classes/PluginManager.js:407:22)
    at PluginManager.run (/home/mjenner/.nvm/versions/node/v10.9.0/lib/node_modules/serverless/lib/classes/PluginManager.js:438:17)
    at variables.populateService.then.then (/home/mjenner/.nvm/versions/node/v10.9.0/lib/node_modules/serverless/lib/Serverless.js:114:33)
    at runCallback (timers.js:693:18)
    at tryOnImmediate (timers.js:664:5)
    at processImmediate (timers.js:646:5)
    at process.topLevelDomainCallback (domain.js:121:23)
From previous event:
    at Serverless.run (/home/mjenner/.nvm/versions/node/v10.9.0/lib/node_modules/serverless/lib/Serverless.js:101:6)
    at serverless.init.then (/home/mjenner/.nvm/versions/node/v10.9.0/lib/node_modules/serverless/bin/serverless:43:28)
    at /home/mjenner/.nvm/versions/node/v10.9.0/lib/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:111:16
    at /home/mjenner/.nvm/versions/node/v10.9.0/lib/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:45:10
    at FSReqWrap.oncomplete (fs.js:139:20)
From previous event:
    at initializeErrorReporter.then (/home/mjenner/.nvm/versions/node/v10.9.0/lib/node_modules/serverless/bin/serverless:43:6)
    at runCallback (timers.js:693:18)
    at tryOnImmediate (timers.js:664:5)
    at processImmediate (timers.js:646:5)
    at process.topLevelDomainCallback (domain.js:121:23)
From previous event:
    at /home/mjenner/.nvm/versions/node/v10.9.0/lib/node_modules/serverless/bin/serverless:28:46
    at Object.<anonymous> (/home/mjenner/.nvm/versions/node/v10.9.0/lib/node_modules/serverless/bin/serverless:67:4)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:266:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3)

Notes

I've successfully used serverless-localstack to deploy locally, but as I come to extend my code to containerize it, I need to create a separate stage and config forcontainerised running to point serverless at the containerized endpoint names (http://localhost --> http://localstack).

I'm not quite sure if the bug lies within how the plugin reads the config or how serverless prepares the final version of the serverless configuration before starting the plugins but any help would be greatly appreciated as this is blocking my integration test efforts in CI, thanks in advance.

Turning off mount code results in no lambda function resource

This is clearly related to issue #5, which fixed the problem for non-local stages. The issue is that if mount code is turned off, the cloud formation update template is missing the actual lambda function resource. Working off of the super helpful notes that @lwoodson on #5, I managed to isolate this as the behaviour within the skipIfMountLambda method in index.js.

What happens is, so far as I can tell, that if mount code is false, on line 80 in index.js this is hit:

this.skipIfMountLambda('AwsCompileFunctions', 'compileFunction', compileFunction);

The presence of compileFunction then means that instead of line 119 being hit if mount code is false, and the original function just returned, instead it's just lines 55-57, i.e., this is triggered:

if (!this.shouldMountCode()) { 
   return Promise.resolve(); 
}

I.e., instead of the original AWS compile happening, an empty promise is returned.

It seems to me the simple solution is to insert a check for whether mountcode is on to the beginning of skipIfMountLambda, i.e., something like this, inserted at line 106:

if (!this.shouldMountCode()) {
      this.log('Not skipping plugin function ' + functionName + ' (lambda.mountCode not enabled)');
      return;
}

This also seems to me much cleaner. If mount code is off then there's no point bothering with all the rest of the logic in that block and should just do nothing (ie skip if mount lambda, do nothing otherwise). I have tested and inserting those lines solves the problem. But I admit that I haven't fully digested everything happening in this sequence, so am not sure if that might not introduce side effects - although the tests pass, as does running it on a couple of my lambdas.

If this seems like the right way to go I'm happy to do a PR. Otherwise, what's the best way to fix?

This plugin breaks serverless provider.profile configuration

Serverless allows you to configure a default AWS profile in your serverless.yml (example).

provider:
  name: example
  profile: production

However, this no longer works when using the serverless-localstack plugin. It was broken when #13 was merged.

Specifically, these lines incorrectly set environment-level fake credentials:

process.env.AWS_ACCESS_KEY_ID = process.env.AWS_ACCESS_KEY_ID || 'test';
process.env.AWS_SECRET_ACCESS_KEY = process.env.AWS_SECRET_ACCESS_KEY || 'test';

The serverless AWS provider is will override the profile setting from serverless.yml if those environment variables are set:

https://github.com/serverless/serverless/blob/825f20c80fb25400dd971af49184269ff3d68078/lib/plugins/aws/provider/awsProvider.js#L332-L334

serverless-localstack should not set environment-level credentials.

Cannot read property 'bind' of undefined

Getting the following error when using sls deploy --stage local:

Serverless Error ---------------------------------------

  Serverless plugin "serverless-localstack" initialization errored: Cannot read property 'bind' of undefined

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information -----------------------------
     OS:                     darwin
     Node Version:           11.0.0
     Serverless Version:     1.32.0

I have used SLS_DEBUG and found the error is coming from:

TypeError: Cannot read property 'bind' of undefined at LocalstackPlugin.skipIfMountLambda (/.../node_modules/serverless-localstack/src/index.js:102:51)

Serverless Error 502

Deploying our Tanks project Commandeer Open Source project into LocalStack throws a 502 error whereas deploying it to AWS works just fine. We're using the latest version of LocalStack Docker image started using localstack start with all services started.

Serverless Setup: https://github.com/commandeer/open/pull/25/files

sls deploy output

Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command create
Serverless: Load command install
Serverless: Load command package
Serverless: Load command deploy
Serverless: Load command deploy:function
Serverless: Load command deploy:list
Serverless: Load command deploy:list:functions
Serverless: Load command invoke
Serverless: Load command invoke:local
Serverless: Load command info
Serverless: Load command logs
Serverless: Load command metrics
Serverless: Load command print
Serverless: Load command remove
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command slstats
Serverless: Load command plugin
Serverless: Load command plugin
Serverless: Load command plugin:install
Serverless: Load command plugin
Serverless: Load command plugin:uninstall
Serverless: Load command plugin
Serverless: Load command plugin:list
Serverless: Load command plugin
Serverless: Load command plugin:search
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command deploy
Serverless: Invoke deploy
Serverless: Invoke package
Serverless: Invoke aws:common:validate
Serverless: Using serverless-localstack
Serverless: Unable to find function downloadPackageArtifacts on plugin AwsCompileFunctions
Serverless: Invoke aws:common:cleanupTempDir
Serverless: Compiling with Typescript...
Serverless: Typescript compiled.
Serverless: Skip plugin function Package.packageService (lambda.mountCode flag is enabled)
Serverless: Skip plugin function TypeScriptPlugin.cleanup (lambda.mountCode flag is enabled)
Serverless: Invoke aws:package:finalize
Serverless: Invoke aws:common:moveArtifactsToPackage
Serverless: Invoke aws:common:validate
Serverless: Skip plugin function AwsDeploy.extendedValidate (lambda.mountCode flag is enabled)
Serverless: Invoke aws:deploy:deploy
Serverless: [AWS cloudformation 400 0.029s 0 retries] describeStacks({ StackName: 'commandeer-tanks-local' })
Serverless: Creating Stack...
Serverless: [AWS cloudformation 200 0.048s 0 retries] createStack({ StackName: 'commandeer-tanks-local',
  OnFailure: 'DELETE',
  Capabilities: [ 'CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM', [length]: 2 ],
  Parameters: [ [length]: 0 ],
  TemplateBody:
   '{"AWSTemplateFormatVersion":"2010-09-09","Description":"The AWS CloudFormation template for this Serverless application","Resources":{"ServerlessDeploymentBucket":{"Type":"AWS::S3::Bucket","Properties":{"BucketEncryption":{"ServerSideEncryptionConfiguration":[{"ServerSideEncryptionByDefault":{"SSEAlgorithm":"AES256"}}]}}}},"Outputs":{"ServerlessDeploymentBucketName":{"Value":{"Ref":"ServerlessDeploymentBucket"}}}}',
  Tags: [ { Key: 'STAGE', Value: 'local' }, [length]: 1 ] })
Serverless: Checking Stack create progress...
Serverless: [AWS cloudformation 502 0.888s 3 retries] describeStackEvents({ StackName:
   'arn:aws:cloudformation:us-east-1:000000000000:stack/commandeer-tanks-local/758a3436-4e35-4c93-8f01-008d4d06b36a' })
Serverless: Recoverable error occurred (502), sleeping for 5 seconds. Try 1 of 4
Serverless: [AWS cloudformation 502 0.404s 3 retries] describeStackEvents({ StackName:
   'arn:aws:cloudformation:us-east-1:000000000000:stack/commandeer-tanks-local/758a3436-4e35-4c93-8f01-008d4d06b36a' })
Serverless: Recoverable error occurred (502), sleeping for 5 seconds. Try 2 of 4
Serverless: [AWS cloudformation 502 0.21s 3 retries] describeStackEvents({ StackName:
   'arn:aws:cloudformation:us-east-1:000000000000:stack/commandeer-tanks-local/758a3436-4e35-4c93-8f01-008d4d06b36a' })
Serverless: Recoverable error occurred (502), sleeping for 5 seconds. Try 3 of 4
Serverless: [AWS cloudformation 502 0.505s 3 retries] describeStackEvents({ StackName:
   'arn:aws:cloudformation:us-east-1:000000000000:stack/commandeer-tanks-local/758a3436-4e35-4c93-8f01-008d4d06b36a' })
Serverless: Recoverable error occurred (502), sleeping for 5 seconds. Try 4 of 4
Serverless: [AWS cloudformation 502 0.36s 3 retries] describeStackEvents({ StackName:
   'arn:aws:cloudformation:us-east-1:000000000000:stack/commandeer-tanks-local/758a3436-4e35-4c93-8f01-008d4d06b36a' })
 
  Serverless Error ---------------------------------------
 
  502
 
  Stack Trace --------------------------------------------
 
ServerlessError: 502
    at provider.request.then.catch (~/.config/yarn/global/node_modules/serverless/lib/plugins/aws/lib/monitorStack.js:130:26)
From previous event:
    at AwsDeploy.monitorStack (~/.config/yarn/global/node_modules/serverless/lib/plugins/aws/lib/monitorStack.js:31:12)
    at provider.request.then (~/.config/yarn/global/node_modules/serverless/lib/plugins/aws/deploy/lib/createStack.js:43:31)
From previous event:
    at AwsDeploy.create (~/.config/yarn/global/node_modules/serverless/lib/plugins/aws/deploy/lib/createStack.js:43:9)
From previous event:
    at AwsDeploy.BbPromise.bind.then.catch (~/.config/yarn/global/node_modules/serverless/lib/plugins/aws/deploy/lib/createStack.js:87:14)
From previous event:
    at AwsDeploy.createStack (~/.config/yarn/global/node_modules/serverless/lib/plugins/aws/deploy/lib/createStack.js:80:13)
From previous event:
    at Object.aws:deploy:deploy:createStack [as hook] (~/.config/yarn/global/node_modules/serverless/lib/plugins/aws/deploy/index.js:100:10)
    at BbPromise.reduce (~/.config/yarn/global/node_modules/serverless/lib/classes/PluginManager.js:407:55)
From previous event:
    at PluginManager.invoke (~/.config/yarn/global/node_modules/serverless/lib/classes/PluginManager.js:407:22)
    at PluginManager.spawn (~/.config/yarn/global/node_modules/serverless/lib/classes/PluginManager.js:425:17)
    at AwsDeploy.BbPromise.bind.then (~/.config/yarn/global/node_modules/serverless/lib/plugins/aws/deploy/index.js:93:48)
From previous event:
    at Object.deploy:deploy [as hook] (~/.config/yarn/global/node_modules/serverless/lib/plugins/aws/deploy/index.js:89:10)
    at BbPromise.reduce (~/.config/yarn/global/node_modules/serverless/lib/classes/PluginManager.js:407:55)
From previous event:
    at PluginManager.invoke (~/.config/yarn/global/node_modules/serverless/lib/classes/PluginManager.js:407:22)
    at PluginManager.run (~/.config/yarn/global/node_modules/serverless/lib/classes/PluginManager.js:438:17)
    at variables.populateService.then.then (~/.config/yarn/global/node_modules/serverless/lib/Serverless.js:114:33)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
    at process.topLevelDomainCallback (domain.js:120:23)
From previous event:
    at Serverless.run (~/.config/yarn/global/node_modules/serverless/lib/Serverless.js:101:6)
    at serverless.init.then (~/.config/yarn/global/node_modules/serverless/bin/serverless:43:28)
    at ~/.config/yarn/global/node_modules/graceful-fs/graceful-fs.js:111:16
    at ~/code/commandeer/open/templates/serverless/node_modules/graceful-fs/graceful-fs.js:57:14
    at ~/.config/yarn/global/node_modules/graceful-fs/graceful-fs.js:45:10
    at FSReqWrap.oncomplete (fs.js:141:20)
From previous event:
    at initializeErrorReporter.then (~/.config/yarn/global/node_modules/serverless/bin/serverless:43:6)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)
    at process.topLevelDomainCallback (domain.js:120:23)
From previous event:
    at ~/.config/yarn/global/node_modules/serverless/bin/serverless:28:46
    at Object.<anonymous> (~/.config/yarn/global/node_modules/serverless/bin/serverless:67:4)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information -----------------------------
     OS:                     darwin
     Node Version:           10.15.2
     Serverless Version:     1.38.0

Localstack Output

localstack start
Starting local dev environment. CTRL-C to quit.
docker run -it -e LOCALSTACK_HOSTNAME="localhost" -e DEFAULT_REGION="us-east-1" -e TEST_AWS_ACCOUNT_ID="000000000000" -e LOCALSTACK_HOSTNAME="localhost" --rm --privileged --name localstack_main -p 8080:8080 -p 8081:8081  -p 443:443 -p 4567-4608:4567-4608  -v "/private/var/folders/s0/k_wc_qsn43d5t5n2_fv9bqxm0000gn/T/localstack:/tmp/localstack" -v "/var/run/docker.sock:/var/run/docker.sock" -e DOCKER_HOST="unix:///var/run/docker.sock" -e HOST_TMP_FOLDER="/private/var/folders/s0/k_wc_qsn43d5t5n2_fv9bqxm0000gn/T/localstack" "localstack/localstack"
Waiting for all LocalStack services to be ready
2019-11-22 19:40:48,802 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
2019-11-22 19:40:48,806 INFO supervisord started with pid 13
2019-11-22 19:40:49,809 INFO spawned: 'dashboard' with pid 19
2019-11-22 19:40:49,810 INFO spawned: 'infra' with pid 20
(. .venv/bin/activate; bin/localstack web)
2019-11-22 19:40:49,820 INFO success: dashboard entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
(. .venv/bin/activate; exec bin/localstack start --host)
2019-11-22 19:40:50,824 INFO success: infra entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2019-11-22T19:40:52:WARNING:bootstrap.py: Unable to load plugins from file /opt/code/localstack/.venv/lib/python3.7/site-packages/localstack_ext/plugins.py: No module named 'localstack_ext.utils.aws.aws_models'
Starting local dev environment. CTRL-C to quit.
Starting mock ES service (http port 4578)...
Starting local Elasticsearch (http port 4571)...
Starting mock S3 (http port 4572)...
Starting mock SNS (http port 4575)...
Starting mock SQS (http port 4576)...
Starting mock SES (http port 4579)...
Starting mock SSM (http port 4583)...
Starting mock STS (http port 4592)...
Starting mock IAM (http port 4593)...
Starting mock Secrets Manager (http port 4584)...
Starting mock API Gateway (http port 4567)...
Starting mock DynamoDB (http port 4569)...
Starting mock DynamoDB Streams service (http port 4570)...
Starting mock Firehose service (http port 4573)...
Starting mock Lambda service (http port 4574)...
Starting mock Kinesis (http port 4568)...
Starting mock Redshift (http port 4577)...
Starting mock Route53 (http port 4580)...
Starting mock CloudFormation (http port 4581)...
Starting mock CloudWatch (http port 4582)...
Starting mock CloudWatch Events (http port 4587)...
Starting mock CloudWatch Logs (http port 4586)...
Starting mock StepFunctions (http port 4585)...
Starting mock EC2 (http port 4597)...
2019-11-22T19:40:54:INFO:localstack.multiserver: Starting multi API server process on port 51492
2019-11-22T19:40:55:ERROR:localstack.services.generic_proxy: Error forwarding request: HTTPConnectionPool(host='127.0.0.1', port=4564): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5ee24b96d0>: Failed to establish a new connection: [Errno 111] Connection refused')) Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/urllib3/connection.py", line 157, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/urllib3/util/connection.py", line 84, in create_connection
    raise err
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/urllib3/util/connection.py", line 74, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
    chunked=chunked,
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 387, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.7/http/client.py", line 1252, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.7/http/client.py", line 1298, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.7/http/client.py", line 1247, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.7/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/usr/lib/python3.7/http/client.py", line 966, in send
    self.connect()
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/urllib3/connection.py", line 184, in connect
    conn = self._new_conn()
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/urllib3/connection.py", line 169, in _new_conn
    self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f5ee24b96d0>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 720, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/urllib3/util/retry.py", line 436, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=4564): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5ee24b96d0>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 275, in forward
    headers=forward_headers, stream=True)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/requests/api.py", line 116, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=4564): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5ee24b96d0>: Failed to establish a new connection: [Errno 111] Connection refused'))

Waiting for all LocalStack services to be ready
2019-11-22T19:40:55:ERROR:localstack.services.generic_proxy: Error forwarding request: HTTPConnectionPool(host='127.0.0.1', port=4564): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5ee2438a10>: Failed to establish a new connection: [Errno 111] Connection refused')) Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/urllib3/connection.py", line 157, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/urllib3/util/connection.py", line 84, in create_connection
    raise err
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/urllib3/util/connection.py", line 74, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
    chunked=chunked,
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 387, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.7/http/client.py", line 1252, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/lib/python3.7/http/client.py", line 1298, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.7/http/client.py", line 1247, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/lib/python3.7/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/usr/lib/python3.7/http/client.py", line 966, in send
    self.connect()
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/urllib3/connection.py", line 184, in connect
    conn = self._new_conn()
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/urllib3/connection.py", line 169, in _new_conn
    self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f5ee2438a10>: Failed to establish a new connection: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 720, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/urllib3/util/retry.py", line 436, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=4564): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5ee2438a10>: Failed to establish a new connection: [Errno 111] Connection refused'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 275, in forward
    headers=forward_headers, stream=True)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/requests/api.py", line 116, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=4564): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f5ee2438a10>: Failed to establish a new connection: [Errno 111] Connection refused'))

Waiting for all LocalStack services to be ready
Waiting for all LocalStack services to be ready
Waiting for all LocalStack services to be ready
Ready.





2019-11-22T19:41:46:ERROR:localstack.services.generic_proxy: Error forwarding request: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n' Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 432, in _parse_xml_string_to_dom
    parser.feed(xml_string)
  File "<string>", line None
xml.etree.ElementTree.ParseError: syntax error: line 1, column 54

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 240, in forward
    path=path, data=data, headers=forward_headers)
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_listener.py", line 149, in forward_request
    tmp = client.describe_stack_events(StackName=stack_name)['StackEvents'][:1]
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 648, in _make_api_call
    operation_model, request_dict, request_context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 667, in _make_request
    return self._endpoint.make_request(operation_model, request_dict)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 102, in make_request
    return self._send_request(request_dict, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 135, in _send_request
    request, operation_model, context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 167, in _get_response
    request, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 218, in _do_get_response
    response_dict, operation_model.output_shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 240, in parse
    parsed = self._do_error_parse(response, shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 485, in _do_error_parse
    root = self._parse_xml_string_to_dom(xml_contents)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 437, in _parse_xml_string_to_dom
    "invalid XML received:\n%s" % (e, xml_string))
botocore.parsers.ResponseParserError: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n'

2019-11-22T19:41:46:ERROR:localstack.services.generic_proxy: Error forwarding request: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n' Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 432, in _parse_xml_string_to_dom
    parser.feed(xml_string)
  File "<string>", line None
xml.etree.ElementTree.ParseError: syntax error: line 1, column 54

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 240, in forward
    path=path, data=data, headers=forward_headers)
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_listener.py", line 149, in forward_request
    tmp = client.describe_stack_events(StackName=stack_name)['StackEvents'][:1]
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 648, in _make_api_call
    operation_model, request_dict, request_context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 667, in _make_request
    return self._endpoint.make_request(operation_model, request_dict)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 102, in make_request
    return self._send_request(request_dict, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 135, in _send_request
    request, operation_model, context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 167, in _get_response
    request, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 218, in _do_get_response
    response_dict, operation_model.output_shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 240, in parse
    parsed = self._do_error_parse(response, shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 485, in _do_error_parse
    root = self._parse_xml_string_to_dom(xml_contents)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 437, in _parse_xml_string_to_dom
    "invalid XML received:\n%s" % (e, xml_string))
botocore.parsers.ResponseParserError: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n'

2019-11-22T19:41:46:ERROR:localstack.services.generic_proxy: Error forwarding request: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n' Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 432, in _parse_xml_string_to_dom
    parser.feed(xml_string)
  File "<string>", line None
xml.etree.ElementTree.ParseError: syntax error: line 1, column 54

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 240, in forward
    path=path, data=data, headers=forward_headers)
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_listener.py", line 149, in forward_request
    tmp = client.describe_stack_events(StackName=stack_name)['StackEvents'][:1]
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 648, in _make_api_call
    operation_model, request_dict, request_context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 667, in _make_request
    return self._endpoint.make_request(operation_model, request_dict)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 102, in make_request
    return self._send_request(request_dict, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 135, in _send_request
    request, operation_model, context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 167, in _get_response
    request, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 218, in _do_get_response
    response_dict, operation_model.output_shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 240, in parse
    parsed = self._do_error_parse(response, shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 485, in _do_error_parse
    root = self._parse_xml_string_to_dom(xml_contents)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 437, in _parse_xml_string_to_dom
    "invalid XML received:\n%s" % (e, xml_string))
botocore.parsers.ResponseParserError: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n'

2019-11-22T19:41:47:ERROR:localstack.services.generic_proxy: Error forwarding request: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n' Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 432, in _parse_xml_string_to_dom
    parser.feed(xml_string)
  File "<string>", line None
xml.etree.ElementTree.ParseError: syntax error: line 1, column 54

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 240, in forward
    path=path, data=data, headers=forward_headers)
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_listener.py", line 149, in forward_request
    tmp = client.describe_stack_events(StackName=stack_name)['StackEvents'][:1]
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 648, in _make_api_call
    operation_model, request_dict, request_context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 667, in _make_request
    return self._endpoint.make_request(operation_model, request_dict)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 102, in make_request
    return self._send_request(request_dict, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 135, in _send_request
    request, operation_model, context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 167, in _get_response
    request, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 218, in _do_get_response
    response_dict, operation_model.output_shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 240, in parse
    parsed = self._do_error_parse(response, shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 485, in _do_error_parse
    root = self._parse_xml_string_to_dom(xml_contents)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 437, in _parse_xml_string_to_dom
    "invalid XML received:\n%s" % (e, xml_string))
botocore.parsers.ResponseParserError: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n'

2019-11-22T19:41:52:ERROR:localstack.services.generic_proxy: Error forwarding request: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n' Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 432, in _parse_xml_string_to_dom
    parser.feed(xml_string)
  File "<string>", line None
xml.etree.ElementTree.ParseError: syntax error: line 1, column 54

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 240, in forward
    path=path, data=data, headers=forward_headers)
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_listener.py", line 149, in forward_request
    tmp = client.describe_stack_events(StackName=stack_name)['StackEvents'][:1]
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 648, in _make_api_call
    operation_model, request_dict, request_context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 667, in _make_request
    return self._endpoint.make_request(operation_model, request_dict)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 102, in make_request
    return self._send_request(request_dict, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 135, in _send_request
    request, operation_model, context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 167, in _get_response
    request, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 218, in _do_get_response
    response_dict, operation_model.output_shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 240, in parse
    parsed = self._do_error_parse(response, shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 485, in _do_error_parse
    root = self._parse_xml_string_to_dom(xml_contents)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 437, in _parse_xml_string_to_dom
    "invalid XML received:\n%s" % (e, xml_string))
botocore.parsers.ResponseParserError: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n'

2019-11-22T19:41:52:ERROR:localstack.services.generic_proxy: Error forwarding request: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n' Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 432, in _parse_xml_string_to_dom
    parser.feed(xml_string)
  File "<string>", line None
xml.etree.ElementTree.ParseError: syntax error: line 1, column 54

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 240, in forward
    path=path, data=data, headers=forward_headers)
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_listener.py", line 149, in forward_request
    tmp = client.describe_stack_events(StackName=stack_name)['StackEvents'][:1]
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 648, in _make_api_call
    operation_model, request_dict, request_context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 667, in _make_request
    return self._endpoint.make_request(operation_model, request_dict)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 102, in make_request
    return self._send_request(request_dict, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 135, in _send_request
    request, operation_model, context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 167, in _get_response
    request, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 218, in _do_get_response
    response_dict, operation_model.output_shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 240, in parse
    parsed = self._do_error_parse(response, shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 485, in _do_error_parse
    root = self._parse_xml_string_to_dom(xml_contents)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 437, in _parse_xml_string_to_dom
    "invalid XML received:\n%s" % (e, xml_string))
botocore.parsers.ResponseParserError: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n'

2019-11-22T19:41:52:ERROR:localstack.services.generic_proxy: Error forwarding request: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n' Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 432, in _parse_xml_string_to_dom
    parser.feed(xml_string)
  File "<string>", line None
xml.etree.ElementTree.ParseError: syntax error: line 1, column 54

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 240, in forward
    path=path, data=data, headers=forward_headers)
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_listener.py", line 149, in forward_request
    tmp = client.describe_stack_events(StackName=stack_name)['StackEvents'][:1]
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 648, in _make_api_call
    operation_model, request_dict, request_context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 667, in _make_request
    return self._endpoint.make_request(operation_model, request_dict)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 102, in make_request
    return self._send_request(request_dict, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 135, in _send_request
    request, operation_model, context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 167, in _get_response
    request, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 218, in _do_get_response
    response_dict, operation_model.output_shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 240, in parse
    parsed = self._do_error_parse(response, shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 485, in _do_error_parse
    root = self._parse_xml_string_to_dom(xml_contents)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 437, in _parse_xml_string_to_dom
    "invalid XML received:\n%s" % (e, xml_string))
botocore.parsers.ResponseParserError: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n'

2019-11-22T19:41:52:ERROR:localstack.services.generic_proxy: Error forwarding request: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n' Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 432, in _parse_xml_string_to_dom
    parser.feed(xml_string)
  File "<string>", line None
xml.etree.ElementTree.ParseError: syntax error: line 1, column 54

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 240, in forward
    path=path, data=data, headers=forward_headers)
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_listener.py", line 149, in forward_request
    tmp = client.describe_stack_events(StackName=stack_name)['StackEvents'][:1]
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 648, in _make_api_call
    operation_model, request_dict, request_context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 667, in _make_request
    return self._endpoint.make_request(operation_model, request_dict)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 102, in make_request
    return self._send_request(request_dict, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 135, in _send_request
    request, operation_model, context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 167, in _get_response
    request, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 218, in _do_get_response
    response_dict, operation_model.output_shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 240, in parse
    parsed = self._do_error_parse(response, shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 485, in _do_error_parse
    root = self._parse_xml_string_to_dom(xml_contents)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 437, in _parse_xml_string_to_dom
    "invalid XML received:\n%s" % (e, xml_string))
botocore.parsers.ResponseParserError: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n'

2019-11-22T19:41:57:ERROR:localstack.services.generic_proxy: Error forwarding request: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n' Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 432, in _parse_xml_string_to_dom
    parser.feed(xml_string)
  File "<string>", line None
xml.etree.ElementTree.ParseError: syntax error: line 1, column 54

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 240, in forward
    path=path, data=data, headers=forward_headers)
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_listener.py", line 149, in forward_request
    tmp = client.describe_stack_events(StackName=stack_name)['StackEvents'][:1]
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 648, in _make_api_call
    operation_model, request_dict, request_context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 667, in _make_request
    return self._endpoint.make_request(operation_model, request_dict)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 102, in make_request
    return self._send_request(request_dict, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 135, in _send_request
    request, operation_model, context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 167, in _get_response
    request, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 218, in _do_get_response
    response_dict, operation_model.output_shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 240, in parse
    parsed = self._do_error_parse(response, shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 485, in _do_error_parse
    root = self._parse_xml_string_to_dom(xml_contents)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 437, in _parse_xml_string_to_dom
    "invalid XML received:\n%s" % (e, xml_string))
botocore.parsers.ResponseParserError: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n'

2019-11-22T19:41:57:ERROR:localstack.services.generic_proxy: Error forwarding request: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n' Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 432, in _parse_xml_string_to_dom
    parser.feed(xml_string)
  File "<string>", line None
xml.etree.ElementTree.ParseError: syntax error: line 1, column 54

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 240, in forward
    path=path, data=data, headers=forward_headers)
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_listener.py", line 149, in forward_request
    tmp = client.describe_stack_events(StackName=stack_name)['StackEvents'][:1]
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 648, in _make_api_call
    operation_model, request_dict, request_context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 667, in _make_request
    return self._endpoint.make_request(operation_model, request_dict)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 102, in make_request
    return self._send_request(request_dict, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 135, in _send_request
    request, operation_model, context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 167, in _get_response
    request, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 218, in _do_get_response
    response_dict, operation_model.output_shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 240, in parse
    parsed = self._do_error_parse(response, shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 485, in _do_error_parse
    root = self._parse_xml_string_to_dom(xml_contents)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 437, in _parse_xml_string_to_dom
    "invalid XML received:\n%s" % (e, xml_string))
botocore.parsers.ResponseParserError: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n'

2019-11-22T19:41:57:ERROR:localstack.services.generic_proxy: Error forwarding request: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n' Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 432, in _parse_xml_string_to_dom
    parser.feed(xml_string)
  File "<string>", line None
xml.etree.ElementTree.ParseError: syntax error: line 1, column 54

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 240, in forward
    path=path, data=data, headers=forward_headers)
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_listener.py", line 149, in forward_request
    tmp = client.describe_stack_events(StackName=stack_name)['StackEvents'][:1]
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 648, in _make_api_call
    operation_model, request_dict, request_context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 667, in _make_request
    return self._endpoint.make_request(operation_model, request_dict)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 102, in make_request
    return self._send_request(request_dict, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 135, in _send_request
    request, operation_model, context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 167, in _get_response
    request, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 218, in _do_get_response
    response_dict, operation_model.output_shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 240, in parse
    parsed = self._do_error_parse(response, shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 485, in _do_error_parse
    root = self._parse_xml_string_to_dom(xml_contents)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 437, in _parse_xml_string_to_dom
    "invalid XML received:\n%s" % (e, xml_string))
botocore.parsers.ResponseParserError: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n'

2019-11-22T19:41:57:ERROR:localstack.services.generic_proxy: Error forwarding request: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n' Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 432, in _parse_xml_string_to_dom
    parser.feed(xml_string)
  File "<string>", line None
xml.etree.ElementTree.ParseError: syntax error: line 1, column 54

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 240, in forward
    path=path, data=data, headers=forward_headers)
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_listener.py", line 149, in forward_request
    tmp = client.describe_stack_events(StackName=stack_name)['StackEvents'][:1]
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 648, in _make_api_call
    operation_model, request_dict, request_context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 667, in _make_request
    return self._endpoint.make_request(operation_model, request_dict)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 102, in make_request
    return self._send_request(request_dict, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 135, in _send_request
    request, operation_model, context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 167, in _get_response
    request, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 218, in _do_get_response
    response_dict, operation_model.output_shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 240, in parse
    parsed = self._do_error_parse(response, shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 485, in _do_error_parse
    root = self._parse_xml_string_to_dom(xml_contents)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 437, in _parse_xml_string_to_dom
    "invalid XML received:\n%s" % (e, xml_string))
botocore.parsers.ResponseParserError: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n'

2019-11-22T19:42:02:ERROR:localstack.services.generic_proxy: Error forwarding request: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n' Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 432, in _parse_xml_string_to_dom
    parser.feed(xml_string)
  File "<string>", line None
xml.etree.ElementTree.ParseError: syntax error: line 1, column 54

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 240, in forward
    path=path, data=data, headers=forward_headers)
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_listener.py", line 149, in forward_request
    tmp = client.describe_stack_events(StackName=stack_name)['StackEvents'][:1]
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 648, in _make_api_call
    operation_model, request_dict, request_context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 667, in _make_request
    return self._endpoint.make_request(operation_model, request_dict)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 102, in make_request
    return self._send_request(request_dict, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 135, in _send_request
    request, operation_model, context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 167, in _get_response
    request, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 218, in _do_get_response
    response_dict, operation_model.output_shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 240, in parse
    parsed = self._do_error_parse(response, shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 485, in _do_error_parse
    root = self._parse_xml_string_to_dom(xml_contents)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 437, in _parse_xml_string_to_dom
    "invalid XML received:\n%s" % (e, xml_string))
botocore.parsers.ResponseParserError: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n'

2019-11-22T19:42:02:ERROR:localstack.services.generic_proxy: Error forwarding request: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n' Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 432, in _parse_xml_string_to_dom
    parser.feed(xml_string)
  File "<string>", line None
xml.etree.ElementTree.ParseError: syntax error: line 1, column 54

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 240, in forward
    path=path, data=data, headers=forward_headers)
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_listener.py", line 149, in forward_request
    tmp = client.describe_stack_events(StackName=stack_name)['StackEvents'][:1]
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 648, in _make_api_call
    operation_model, request_dict, request_context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 667, in _make_request
    return self._endpoint.make_request(operation_model, request_dict)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 102, in make_request
    return self._send_request(request_dict, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 135, in _send_request
    request, operation_model, context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 167, in _get_response
    request, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 218, in _do_get_response
    response_dict, operation_model.output_shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 240, in parse
    parsed = self._do_error_parse(response, shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 485, in _do_error_parse
    root = self._parse_xml_string_to_dom(xml_contents)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 437, in _parse_xml_string_to_dom
    "invalid XML received:\n%s" % (e, xml_string))
botocore.parsers.ResponseParserError: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n'

2019-11-22T19:42:02:ERROR:localstack.services.generic_proxy: Error forwarding request: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n' Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 432, in _parse_xml_string_to_dom
    parser.feed(xml_string)
  File "<string>", line None
xml.etree.ElementTree.ParseError: syntax error: line 1, column 54

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 240, in forward
    path=path, data=data, headers=forward_headers)
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_listener.py", line 149, in forward_request
    tmp = client.describe_stack_events(StackName=stack_name)['StackEvents'][:1]
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 648, in _make_api_call
    operation_model, request_dict, request_context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 667, in _make_request
    return self._endpoint.make_request(operation_model, request_dict)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 102, in make_request
    return self._send_request(request_dict, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 135, in _send_request
    request, operation_model, context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 167, in _get_response
    request, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 218, in _do_get_response
    response_dict, operation_model.output_shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 240, in parse
    parsed = self._do_error_parse(response, shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 485, in _do_error_parse
    root = self._parse_xml_string_to_dom(xml_contents)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 437, in _parse_xml_string_to_dom
    "invalid XML received:\n%s" % (e, xml_string))
botocore.parsers.ResponseParserError: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n'

2019-11-22T19:42:03:ERROR:localstack.services.generic_proxy: Error forwarding request: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n' Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 432, in _parse_xml_string_to_dom
    parser.feed(xml_string)
  File "<string>", line None
xml.etree.ElementTree.ParseError: syntax error: line 1, column 54

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 240, in forward
    path=path, data=data, headers=forward_headers)
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_listener.py", line 149, in forward_request
    tmp = client.describe_stack_events(StackName=stack_name)['StackEvents'][:1]
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 648, in _make_api_call
    operation_model, request_dict, request_context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 667, in _make_request
    return self._endpoint.make_request(operation_model, request_dict)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 102, in make_request
    return self._send_request(request_dict, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 135, in _send_request
    request, operation_model, context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 167, in _get_response
    request, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 218, in _do_get_response
    response_dict, operation_model.output_shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 240, in parse
    parsed = self._do_error_parse(response, shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 485, in _do_error_parse
    root = self._parse_xml_string_to_dom(xml_contents)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 437, in _parse_xml_string_to_dom
    "invalid XML received:\n%s" % (e, xml_string))
botocore.parsers.ResponseParserError: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n'

2019-11-22T19:42:08:ERROR:localstack.services.generic_proxy: Error forwarding request: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n' Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 432, in _parse_xml_string_to_dom
    parser.feed(xml_string)
  File "<string>", line None
xml.etree.ElementTree.ParseError: syntax error: line 1, column 54

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 240, in forward
    path=path, data=data, headers=forward_headers)
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_listener.py", line 149, in forward_request
    tmp = client.describe_stack_events(StackName=stack_name)['StackEvents'][:1]
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 648, in _make_api_call
    operation_model, request_dict, request_context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 667, in _make_request
    return self._endpoint.make_request(operation_model, request_dict)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 102, in make_request
    return self._send_request(request_dict, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 135, in _send_request
    request, operation_model, context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 167, in _get_response
    request, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 218, in _do_get_response
    response_dict, operation_model.output_shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 240, in parse
    parsed = self._do_error_parse(response, shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 485, in _do_error_parse
    root = self._parse_xml_string_to_dom(xml_contents)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 437, in _parse_xml_string_to_dom
    "invalid XML received:\n%s" % (e, xml_string))
botocore.parsers.ResponseParserError: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n'

2019-11-22T19:42:08:ERROR:localstack.services.generic_proxy: Error forwarding request: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n' Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 432, in _parse_xml_string_to_dom
    parser.feed(xml_string)
  File "<string>", line None
xml.etree.ElementTree.ParseError: syntax error: line 1, column 54

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 240, in forward
    path=path, data=data, headers=forward_headers)
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_listener.py", line 149, in forward_request
    tmp = client.describe_stack_events(StackName=stack_name)['StackEvents'][:1]
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 648, in _make_api_call
    operation_model, request_dict, request_context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 667, in _make_request
    return self._endpoint.make_request(operation_model, request_dict)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 102, in make_request
    return self._send_request(request_dict, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 135, in _send_request
    request, operation_model, context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 167, in _get_response
    request, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 218, in _do_get_response
    response_dict, operation_model.output_shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 240, in parse
    parsed = self._do_error_parse(response, shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 485, in _do_error_parse
    root = self._parse_xml_string_to_dom(xml_contents)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 437, in _parse_xml_string_to_dom
    "invalid XML received:\n%s" % (e, xml_string))
botocore.parsers.ResponseParserError: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n'

2019-11-22T19:42:08:ERROR:localstack.services.generic_proxy: Error forwarding request: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n' Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 432, in _parse_xml_string_to_dom
    parser.feed(xml_string)
  File "<string>", line None
xml.etree.ElementTree.ParseError: syntax error: line 1, column 54

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 240, in forward
    path=path, data=data, headers=forward_headers)
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_listener.py", line 149, in forward_request
    tmp = client.describe_stack_events(StackName=stack_name)['StackEvents'][:1]
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 648, in _make_api_call
    operation_model, request_dict, request_context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 667, in _make_request
    return self._endpoint.make_request(operation_model, request_dict)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 102, in make_request
    return self._send_request(request_dict, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 135, in _send_request
    request, operation_model, context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 167, in _get_response
    request, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 218, in _do_get_response
    response_dict, operation_model.output_shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 240, in parse
    parsed = self._do_error_parse(response, shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 485, in _do_error_parse
    root = self._parse_xml_string_to_dom(xml_contents)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 437, in _parse_xml_string_to_dom
    "invalid XML received:\n%s" % (e, xml_string))
botocore.parsers.ResponseParserError: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n'

2019-11-22T19:42:08:ERROR:localstack.services.generic_proxy: Error forwarding request: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n' Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 432, in _parse_xml_string_to_dom
    parser.feed(xml_string)
  File "<string>", line None
xml.etree.ElementTree.ParseError: syntax error: line 1, column 54

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 240, in forward
    path=path, data=data, headers=forward_headers)
  File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_listener.py", line 149, in forward_request
    tmp = client.describe_stack_events(StackName=stack_name)['StackEvents'][:1]
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 357, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 648, in _make_api_call
    operation_model, request_dict, request_context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 667, in _make_request
    return self._endpoint.make_request(operation_model, request_dict)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 102, in make_request
    return self._send_request(request_dict, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 135, in _send_request
    request, operation_model, context)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 167, in _get_response
    request, operation_model)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/endpoint.py", line 218, in _do_get_response
    response_dict, operation_model.output_shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 240, in parse
    parsed = self._do_error_parse(response, shape)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 485, in _do_error_parse
    root = self._parse_xml_string_to_dom(xml_contents)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/parsers.py", line 437, in _parse_xml_string_to_dom
    "invalid XML received:\n%s" % (e, xml_string))
botocore.parsers.ResponseParserError: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n'

Error Attempting to Invoke Lambda Using Serverless

I created a simple test function, but when I attempt to invoke it using serverless, I get an error "Function not found: arn:aws:lambda:us-east-1:902088074489:function:localstack-test-local-hello".

I have a feeling that the invoke is actually attempting to invoke the function on AWS and not localstack.

localstack version: 0.9.1
serverless version: 1.44.1
serverless-localstack version: 0.4.15

I am running localstack via the command line.

$ localstack start
Starting local dev environment. CTRL-C to quit.
Starting mock SES (http port 4579)...
Starting mock CloudWatch Logs (http port 4586)...
Starting mock Redshift (http port 4577)...
Starting mock CloudFormation (http port 4581)...
Starting mock Firehose service (http port 4573)...
Starting mock Route53 (http port 4580)...
 * Serving Flask app "firehose_api" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
Starting mock ES service (http port 4578)...
   Use a production WSGI server instead.
 * Debug mode: off
 * Serving Flask app "es_api" (lazy loading)
Starting mock IAM (http port 4593)...
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: off
Starting mock DynamoDB Streams service (http port 4570)...
Starting mock S3 (http port 4572)...
 * Serving Flask app "ddb_streams_api" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
Starting mock CloudWatch (http port 4582)...
   Use a production WSGI server instead.
 * Debug mode: off
Starting mock DynamoDB (http port 4569)...
Starting mock Kinesis (http port 4568)...
Starting mock SQS (http port 4576)...
Starting mock SSM (http port 4583)...
Starting mock SNS (http port 4575)...
Starting mock API Gateway (http port 4567)...
Starting mock Secrets Manager (http port 4584)...
Starting local Elasticsearch (http port 4571)...
Starting mock STS (http port 4592)...
Starting mock StepFunctions (http port 4585)...
Starting mock Lambda service (http port 4574)...
 * Serving Flask app "lambda_api" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: off
Ready.

Then I deploy using serverless...

$ SLS_DEBUG=* AWS_PROFILE=kevin sls deploy -s local
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command create
Serverless: Load command install
Serverless: Load command package
Serverless: Load command deploy
Serverless: Load command deploy:function
Serverless: Load command deploy:list
Serverless: Load command deploy:list:functions
Serverless: Load command invoke
Serverless: Load command invoke:local
Serverless: Load command info
Serverless: Load command logs
Serverless: Load command metrics
Serverless: Load command print
Serverless: Load command remove
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command slstats
Serverless: Load command plugin
Serverless: Load command plugin
Serverless: Load command plugin:install
Serverless: Load command plugin
Serverless: Load command plugin:uninstall
Serverless: Load command plugin
Serverless: Load command plugin:list
Serverless: Load command plugin
Serverless: Load command plugin:search
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command deploy
Serverless: Invoke deploy
Serverless: Invoke package
Serverless: Invoke aws:common:validate
Serverless: Using serverless-localstack
Serverless: Invoke aws:common:cleanupTempDir
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Invoke aws:package:finalize
Serverless: Invoke aws:common:moveArtifactsToPackage
Serverless: Invoke aws:common:validate
Serverless: Invoke aws:deploy:deploy
Serverless: [AWS cloudformation 400 0.037s 0 retries] describeStacks({ StackName: 'localstack-test-local' })
Serverless: Creating Stack...
Serverless: [AWS cloudformation 200 0.217s 0 retries] createStack({ StackName: 'localstack-test-local',
  OnFailure: 'DELETE',
  Capabilities: [ 'CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM', [length]: 2 ],
  Parameters: [ [length]: 0 ],
  TemplateBody: '{"AWSTemplateFormatVersion":"2010-09-09","Description":"The AWS CloudFormation template for this Serverless application","Resources":{"ServerlessDeploymentBucket":{"Type":"AWS::S3::Bucket","Properties":{"BucketEncryption":{"ServerSideEncryptionConfiguration":[{"ServerSideEncryptionByDefault":{"SSEAlgorithm":"AES256"}}]}}}},"Outputs":{"ServerlessDeploymentBucketName":{"Value":{"Ref":"ServerlessDeploymentBucket"}}}}',
  Tags: [ { Key: 'STAGE', Value: 'local' }, [length]: 1 ] })
Serverless: Checking Stack create progress...
Serverless: [AWS cloudformation 200 0.018s 0 retries] describeStackEvents({ StackName: 'arn:aws:cloudformation:us-east-1:123456789:stack/localstack-test-local/7be56736-5b24-4e24-b81d-8d75c90ab431' })
..
Serverless: Stack create finished...
Serverless: [AWS cloudformation 200 0.012s 0 retries] describeStackResource({ StackName: 'localstack-test-local',
  LogicalResourceId: 'ServerlessDeploymentBucket' })
Serverless: [AWS s3 200 0.012s 0 retries] listObjectsV2({ Bucket: 'localstack-test-local-ServerlessDeploymentBucket-198106565693',
  Prefix: 'serverless/localstack-test/local' })
Serverless: [AWS sts 200 0.02s 0 retries] getCallerIdentity({})
Serverless: Uploading CloudFormation file to S3...
Serverless: [AWS s3 200 0.012s 0 retries] putObject({ Body: <Buffer 7b 22 41 57 53 54 65 6d 70 6c 61 74 65 46 6f 72 6d 61 74 56 65 72 73 69 6f 6e 22 3a 22 32 30 31 30 2d 30 39 2d 30 39 22 2c 22 44 65 73 63 72 69 70 74 ... >,
  Bucket: 'localstack-test-local-ServerlessDeploymentBucket-198106565693',
  Key: 'serverless/localstack-test/local/1559580146081-2019-06-03T16:42:26.081Z/compiled-cloudformation-template.json',
  ContentType: 'application/json',
  Metadata: { filesha256: '1MRMtJWEicu14F9WcDfX++YzpoX0drzR3kS8rddlGJw=' } })
Serverless: Uploading artifacts...
Serverless: Uploading service localstack-test.zip file to S3 (3.97 KB)...
Serverless: [AWS s3 200 0.009s 0 retries] putObject({ Body: <Buffer 50 4b 03 04 14 00 08 00 08 00 00 00 21 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 69 6e 64 65 78 2e 6a 73 05 c1 31 0a 80 30 0c 05 d0 bd a7 c8 ... >,
  Bucket: 'localstack-test-local-ServerlessDeploymentBucket-198106565693',
  Key: 'serverless/localstack-test/local/1559580146081-2019-06-03T16:42:26.081Z/localstack-test.zip',
  ContentType: 'application/zip',
  Metadata: { filesha256: '6PjLP1P1qDCdmIUMY2jei5Spbhn6b8Q4Icx4E4EjtMU=' } })
Serverless: Validating template...
Serverless: Skipping template validation: Unsupported in Localstack
Serverless: Updating Stack...
Serverless: [AWS cloudformation 200 0.343s 0 retries] updateStack({ StackName: 'localstack-test-local',
  Capabilities: [ 'CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM', [length]: 2 ],
  Parameters: [ [length]: 0 ],
  TemplateURL: 'https://s3.amazonaws.com/localstack-test-local-ServerlessDeploymentBucket-198106565693/serverless/localstack-test/local/1559580146081-2019-06-03T16:42:26.081Z/compiled-cloudformation-template.json',
  Tags: [ { Key: 'STAGE', Value: 'local' }, [length]: 1 ] })
Serverless: Checking Stack update progress...
Serverless: [AWS cloudformation 200 0.018s 0 retries] describeStackEvents({ StackName: 'arn:aws:cloudformation:us-east-1:123456789:stack/localstack-test-local/7be56736-5b24-4e24-b81d-8d75c90ab431' })
..
Serverless: Stack update finished...
Serverless: Invoke aws:info
Serverless: [AWS cloudformation 200 0.016s 0 retries] describeStacks({ StackName: 'localstack-test-local' })
Serverless: [AWS cloudformation 200 0.009s 0 retries] listStackResources({ StackName: 'localstack-test-local' })
Service Information
service: localstack-test
stage: local
region: us-east-1
stack: localstack-test-local
resources: 5
api keys:
  None
endpoints:
  None
functions:
  hello: localstack-test-local-hello
layers:
  None
Serverless: Invoke aws:deploy:finalize
Serverless: [AWS s3 200 0.042s 0 retries] listObjectsV2({ Bucket: 'localstack-test-local-ServerlessDeploymentBucket-198106565693',
  Prefix: 'serverless/localstack-test/local' })
Serverless Enterprise: Run `serverless login` and deploy again to explore, monitor, secure your serverless project for free.Finally, I attempt to invoke using serverless...
$ SLS_DEBUG=* AWS_PROFILE=kevin sls invoke -s local -f hello
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command create
Serverless: Load command install
Serverless: Load command package
Serverless: Load command deploy
Serverless: Load command deploy:function
Serverless: Load command deploy:list
Serverless: Load command deploy:list:functions
Serverless: Load command invoke
Serverless: Load command invoke:local
Serverless: Load command info
Serverless: Load command logs
Serverless: Load command metrics
Serverless: Load command print
Serverless: Load command remove
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command slstats
Serverless: Load command plugin
Serverless: Load command plugin
Serverless: Load command plugin:install
Serverless: Load command plugin
Serverless: Load command plugin:uninstall
Serverless: Load command plugin
Serverless: Load command plugin:list
Serverless: Load command plugin
Serverless: Load command plugin:search
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command deploy
Serverless: Invoke invoke
Serverless: [AWS lambda 404 0.311s 0 retries] invoke({ FunctionName: 'localstack-test-local-hello',
  InvocationType: 'RequestResponse',
  LogType: 'None',
  Payload: '***SensitiveInformation***' })

  Serverless Error ---------------------------------------

  Function not found: arn:aws:lambda:us-east-1:902088074489:function:localstack-test-local-hello

  Stack Trace --------------------------------------------

ServerlessError: Function not found: arn:aws:lambda:us-east-1:902088074489:function:localstack-test-local-hello
    at promise.catch.err (/usr/local/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:302:11)
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:228:7)

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information ---------------------------
     OS:                     darwin
     Node Version:           8.10.0
     Serverless Version:     1.44.1

My serverless.yml...

service: localstack-test

provider:
  name: aws
  runtime: nodejs8.10
  stage: ${opt:stage, 'dev'}

plugins:
  - serverless-localstack

custom:
  localstack:
    host: http://localhost
    autostart: false
    stages:
      - local
    lambda:
      mountCode: false

functions:
  hello:
    handler: index.handler

I appreciate any help you can provide. Thanks!

┆Issue is synchronized with this Jira Task by Unito

How do you access API Gateway endpoints?

I've successfully deployed my API to Localstack, however there doesn't seem to be any obvious way of interacting with it.

The Serverless output of course points to URLs that don't exist in AWS, so I've tried variations of that ID paired with the deployment stage, as well as tried to hit endpoints found in http://localhost:4567/restapis using their IDs, and other combinations.

An error occurred (404) when calling the HeadObject operation: Not Found Traceback

While using localstack:0.10.8 , I'm getting an error when trying to put object in the local s3 bucket.
More details:

2020-03-22T11:21:47:ERROR:localstack.services.generic_proxy: Error forwarding request: An error occurred (404) when calling the HeadObject operation: Not Found Traceback (most recent call last):
localstack               |   File "/opt/code/localstack/localstack/services/generic_proxy.py", line 303, in forward
localstack               |     updated_response = self.proxy.update_listener.return_response(**kwargs)
localstack               |   File "/opt/code/localstack/localstack/services/s3/s3_listener.py", line 1000, in return_response
localstack               |     fix_range_content_type(bucket_name, path, headers, response)
localstack               |   File "/opt/code/localstack/localstack/services/s3/s3_listener.py", line 380, in fix_range_content_type
localstack               |     result = s3_client.head_object(Bucket=bucket_name, Key=key_name)
localstack               |   File "/opt/code/localstack/.venv/lib/python3.8/site-packages/botocore/client.py", line 316, in _api_call
localstack               |     return self._make_api_call(operation_name, kwargs)
localstack               |   File "/opt/code/localstack/.venv/lib/python3.8/site-packages/botocore/client.py", line 626, in _make_api_call
localstack               |     raise error_class(parsed_response, operation_name)
localstack               | botocore.exceptions.ClientError: An error occurred (404) when calling the HeadObject operation: Not Found

My code snippet:

file_to_upload = open(file_path, 'rb')
response = s3_client.put_object(
        ACL='public-read-write',
        Body=file_to_upload,
        Bucket=function_s3_bucket,
        Key=function_s3_key
    )

With localstack:0.9.6 I don't get this error and everything works as expected

┆Issue is synchronized with this Jira Task by Unito

An error occurred (404) when calling the HeadObject operation: Not Found Traceback

Dear team,

I have a problem with the command:
SLS_DEBUG=true serverless deploy --stage=local

Could you please help me on trouble shooting it?

The local stack logs is:

2019-12-26T05:01:08:WARNING:moto: No Moto CloudFormation support for AWS::S3::BucketPolicy
2019-12-26T05:01:13:WARNING:localstack.services.awslambda.lambda_api: Function not found: arn:aws:lambda:us-east-1:000000000000:function:publicspam-local-world
2019-12-26T05:01:14:INFO:localstack.services.cloudformation.cloudformation_starter: Updating resource ID from b01a26e9 to ggoazjguas (us-east-1)
2019-12-26T05:01:14:WARNING:localstack.services.cloudformation.cloudformation_starter: Unable to determine physical_resource_id for resource <class 'moto.apigateway.models.RestAPI'>
2019-12-26T05:01:15:INFO:localstack.services.cloudformation.cloudformation_starter: Updating resource ID from f4419f33 to 9cfmluuypy (us-east-1)
2019-12-26T05:01:15:WARNING:localstack.services.cloudformation.cloudformation_starter: Unable to determine physical_resource_id for resource <class 'moto.apigateway.models.Resource'>
2019-12-26T05:01:15:WARNING:localstack.services.awslambda.lambda_api: Function not found: arn:aws:lambda:us-east-1:000000000000:function:publicspam-local-world
2019-12-26T05:01:15:ERROR:localstack.services.generic_proxy: Error forwarding request: An error occurred (404) when calling the HeadObject operation: Not Found Traceback (most recent call last):
  File "/opt/code/localstack/localstack/services/generic_proxy.py", line 297, in forward
    updated_response = self.proxy.update_listener.return_response(**kwargs)
  File "/opt/code/localstack/localstack/services/s3/s3_listener.py", line 938, in return_response
    fix_range_content_type(bucket_name, path, headers, response)
  File "/opt/code/localstack/localstack/services/s3/s3_listener.py", line 364, in fix_range_content_type
    result = s3_client.head_object(Bucket=bucket_name, Key=key_name)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 276, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/opt/code/localstack/.venv/lib/python3.7/site-packages/botocore/client.py", line 586, in _make_api_call
    raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (404) when calling the HeadObject operation: Not Found

SLS logs:

Serverless: [AWS cloudformation 200 0.073s 0 retries] createStack({
  StackName: 'publicspam-local',
  OnFailure: 'DELETE',
  Capabilities: [ 'CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM', [length]: 2 ],
  Parameters: [ [length]: 0 ],
  TemplateBody: '{"AWSTemplateFormatVersion":"2010-09-09","Description":"The AWS CloudFormation template for this Serverless application","Resources":{"ServerlessDeploymentBucket":{"Type":"AWS::S3::Bucket","Properties":{"BucketEncryption":{"ServerSideEncryptionConfiguration":[{"ServerSideEncryptionByDefault":{"SSEAlgorithm":"AES256"}}]}}},"ServerlessDeploymentBucketPolicy":{"Type":"AWS::S3::BucketPolicy","Properties":{"Bucket":{"Ref":"ServerlessDeploymentBucket"},"PolicyDocument":{"Statement":[{"Action":"s3:*","Effect":"Deny","Principal":"*","Resource":[{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":s3:::",{"Ref":"ServerlessDeploymentBucket"},"/*"]]}],"Condition":{"Bool":{"aws:SecureTransport":false}}}]}}}},"Outputs":{"ServerlessDeploymentBucketName":{"Value":{"Ref":"ServerlessDeploymentBucket"}}}}',
  Tags: [ { Key: 'STAGE', Value: 'local' }, [length]: 1 ]
})
Serverless: Checking Stack create progress...
Serverless: [AWS cloudformation 200 0.037s 0 retries] describeStackEvents({
  StackName: 'arn:aws:cloudformation:us-east-1:000000000000:stack/publicspam-local/315372bf-461b-46e1-a3ea-fe534391b067'
})
.
Serverless: Stack create finished...
Serverless: [AWS cloudformation 200 0.017s 0 retries] describeStackResource({
  StackName: 'publicspam-local',
  LogicalResourceId: 'ServerlessDeploymentBucket'
})
Serverless: [AWS s3 200 0.028s 0 retries] listObjectsV2({
  Bucket: 'publicspam-local-ServerlessDeploymentBucket-SCCIDTGR4VAE',
  Prefix: 'serverless/publicspam/local'
})
Serverless: [AWS lambda 404 0.008s 0 retries] getFunction({ FunctionName: 'publicspam-local-world' })
Serverless: [AWS sts 200 0.014s 0 retries] getCallerIdentity({})
Serverless: Uploading CloudFormation file to S3...
Serverless: [AWS s3 200 0.019s 0 retries] putObject({
  Body: <Buffer 7b 22 41 57 53 54 65 6d 70 6c 61 74 65 46 6f 72 6d 61 74 56 65 72 73 69 6f 6e 22 3a 22 32 30 31 30 2d 30 39 2d 30 39 22 2c 22 44 65 73 63 72 69 70 74 ... 4187 more bytes>,
  Bucket: 'publicspam-local-ServerlessDeploymentBucket-SCCIDTGR4VAE',
  Key: 'serverless/publicspam/local/1577336468236-2019-12-26T05:01:08.236Z/compiled-cloudformation-template.json',
  ContentType: 'application/json',
  Metadata: { filesha256: 'ctCUczkUhYEWjH7txOH75N0067Kk4iV4f0bX1bA9jo4=' }
})
Serverless: Uploading artifacts...
Serverless: Uploading service publicspam.zip file to S3 (25.81 MB)...
Serverless: [AWS s3 200 0.073s 0 retries] createMultipartUpload({
  Bucket: 'publicspam-local-ServerlessDeploymentBucket-SCCIDTGR4VAE',
  Key: 'serverless/publicspam/local/1577336468236-2019-12-26T05:01:08.236Z/publicspam.zip',
  ContentType: 'application/zip',
  Metadata: { filesha256: 'wLZIXlm3C/3lpzoLs+vskeWi4mzEsDc2Q/chtBn/uG8=' }
})
Serverless: [AWS s3 200 0.266s 0 retries] uploadPart({
  Body: <Buffer db aa c7 19 64 0a bd 5e a1 e3 07 53 0f 37 ae 87 26 72 6e 4a 85 1a 37 38 a7 c8 78 ad 1a 81 7b 55 18 d9 e9 f8 d0 81 31 52 37 80 f3 89 64 31 13 8c ab 76 ... 5242830 more bytes>,
  ContentLength: 5242880,
  PartNumber: 2,
  Bucket: 'publicspam-local-ServerlessDeploymentBucket-SCCIDTGR4VAE',
  Key: 'serverless/publicspam/local/1577336468236-2019-12-26T05:01:08.236Z/publicspam.zip',
  UploadId: 'FKkFzf9pKRRwlBLvhWfuy5lXGgA0rheeFS3Q9yp8iZjBeDmDSM7ZLfubvw'
})
Serverless: [AWS s3 200 0.32s 0 retries] uploadPart({
  Body: <Buffer 50 4b 03 04 14 00 08 00 08 00 00 00 21 00 00 00 00 00 00 00 00 00 00 00 00 00 0f 00 00 00 62 69 6e 2f 63 6f 6e 66 69 67 2e 6a 73 6f 6e 95 d0 b1 0a 83 ... 5242830 more bytes>,
  ContentLength: 5242880,
  PartNumber: 1,
  Bucket: 'publicspam-local-ServerlessDeploymentBucket-SCCIDTGR4VAE',
  Key: 'serverless/publicspam/local/1577336468236-2019-12-26T05:01:08.236Z/publicspam.zip',
  UploadId: 'FKkFzf9pKRRwlBLvhWfuy5lXGgA0rheeFS3Q9yp8iZjBeDmDSM7ZLfubvw'
})
Serverless: [AWS s3 200 0.293s 0 retries] uploadPart({
  Body: <Buffer bc cf 81 77 34 cb c2 22 d4 f6 56 11 46 4e e5 6e f7 8e 0f 36 d2 32 c4 b8 d4 5f 98 c0 49 53 09 45 8b 1c 84 eb fa 29 81 f3 85 40 ea ff 83 00 97 fa 81 09 ... 5242830 more bytes>,
  ContentLength: 5242880,
  PartNumber: 3,
  Bucket: 'publicspam-local-ServerlessDeploymentBucket-SCCIDTGR4VAE',
  Key: 'serverless/publicspam/local/1577336468236-2019-12-26T05:01:08.236Z/publicspam.zip',
  UploadId: 'FKkFzf9pKRRwlBLvhWfuy5lXGgA0rheeFS3Q9yp8iZjBeDmDSM7ZLfubvw'
})
Serverless: [AWS s3 200 0.073s 0 retries] uploadPart({
  Body: <Buffer 12 f0 69 32 fd b5 5a 6b 20 48 a0 6e 66 8d 89 44 92 25 f0 0e 21 8f c1 6a cd e4 91 8d e8 84 72 0b 42 5a 4a 37 75 5c 31 ba c4 42 f4 d4 76 f0 77 79 e7 a8 ... 852109 more bytes>,
  ContentLength: 852159,
  PartNumber: 6,
  Bucket: 'publicspam-local-ServerlessDeploymentBucket-SCCIDTGR4VAE',
  Key: 'serverless/publicspam/local/1577336468236-2019-12-26T05:01:08.236Z/publicspam.zip',
  UploadId: 'FKkFzf9pKRRwlBLvhWfuy5lXGgA0rheeFS3Q9yp8iZjBeDmDSM7ZLfubvw'
})
Serverless: [AWS s3 200 0.217s 0 retries] uploadPart({
  Body: <Buffer 7d d8 80 fb 6d 97 55 61 99 48 45 54 f1 6a 13 f0 58 20 5c 87 79 b3 db 1d 2e 45 d9 ad f9 15 85 bb 4c 85 64 45 c7 c2 57 12 50 95 7b 0e f3 f0 1b 13 9c a7 ... 5242830 more bytes>,
  ContentLength: 5242880,
  PartNumber: 5,
  Bucket: 'publicspam-local-ServerlessDeploymentBucket-SCCIDTGR4VAE',
  Key: 'serverless/publicspam/local/1577336468236-2019-12-26T05:01:08.236Z/publicspam.zip',
  UploadId: 'FKkFzf9pKRRwlBLvhWfuy5lXGgA0rheeFS3Q9yp8iZjBeDmDSM7ZLfubvw'
})
Serverless: [AWS s3 200 0.247s 0 retries] uploadPart({
  Body: <Buffer da bc c0 c7 a1 29 a0 3c 15 b0 74 3f e8 0e 59 54 da e5 d2 fe 93 27 80 3f a5 1d 11 d7 82 39 15 bf 63 34 81 47 3a 78 2b 3f e7 b8 62 c1 e5 d7 8e 1c 75 e9 ... 5242830 more bytes>,
  ContentLength: 5242880,
  PartNumber: 4,
  Bucket: 'publicspam-local-ServerlessDeploymentBucket-SCCIDTGR4VAE',
  Key: 'serverless/publicspam/local/1577336468236-2019-12-26T05:01:08.236Z/publicspam.zip',
  UploadId: 'FKkFzf9pKRRwlBLvhWfuy5lXGgA0rheeFS3Q9yp8iZjBeDmDSM7ZLfubvw'
})
Serverless: [AWS s3 200 0.085s 0 retries] completeMultipartUpload({
  MultipartUpload: {
    Parts: [
      { ETag: '"b5fb0acdc40a40fb6c479aa183c05cd9"', PartNumber: 1 },
      { ETag: '"e9e6f992a89f5adbadacd9286edaf5fa"', PartNumber: 2 },
      { ETag: '"244ea399d842f18b69f46a6b1ef598d1"', PartNumber: 3 },
      { ETag: '"1100aa4328c3b1e693a8a633f151023b"', PartNumber: 4 },
      { ETag: '"cc841bfff02a9fdc90fd9af42d237555"', PartNumber: 5 },
      { ETag: '"fad837830b7a19e3ee602b18be1507a7"', PartNumber: 6 },
      [length]: 6
    ]
  },
  Bucket: 'publicspam-local-ServerlessDeploymentBucket-SCCIDTGR4VAE',
  Key: 'serverless/publicspam/local/1577336468236-2019-12-26T05:01:08.236Z/publicspam.zip',
  UploadId: 'FKkFzf9pKRRwlBLvhWfuy5lXGgA0rheeFS3Q9yp8iZjBeDmDSM7ZLfubvw'
})
Serverless: Validating template...
Serverless: Skipping template validation: Unsupported in Localstack
Serverless: Updating Stack...
Serverless: [AWS cloudformation 400 14.223s 0 retries] updateStack({
  StackName: 'publicspam-local',
  Capabilities: [ 'CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM', [length]: 2 ],
  Parameters: [ [length]: 0 ],
  TemplateURL: 'https://s3.amazonaws.com/publicspam-local-ServerlessDeploymentBucket-SCCIDTGR4VAE/serverless/publicspam/local/1577336468236-2019-12-26T05:01:08.236Z/compiled-cloudformation-template.json',
  Tags: [ { Key: 'STAGE', Value: 'local' }, [length]: 1 ]
})
 
  Serverless Error ---------------------------------------
 
  ServerlessError: Bad Request
      at /usr/local/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:317:27
      at runMicrotasks (<anonymous>)
      at processTicksAndRejections (internal/process/task_queues.js:93:5)

My Environment information:

     Operating System:          darwin
     Node Version:              12.13.1
     Framework Version:         1.58.0
     Plugin Version:            3.2.5
     SDK Version:               2.2.1
     Components Core Version:   1.1.2
     Components CLI Version:    1.4.0

serverless-localstack: "^0.4.22"

I'm using localstack/localstack@latest

Thanks,

Intermittent Error on Deployment "The specified bucket is not valid."

I am getting an intermittent error when attempting to deploy to localstack using serverless.

First, I start localstack directly...

$ LAMBDA_EXECUTOR=docker SERVICES=lambda,cloudformation,s3,sts localstack start
Starting local dev environment. CTRL-C to quit.
Starting mock CloudWatch Logs (http port 4586)...
Starting mock CloudFormation (http port 4581)...
Starting mock S3 (http port 4572)...
Starting mock STS (http port 4592)...
Starting mock Lambda service (http port 4574)...
 * Serving Flask app "lambda_api" (lazy loading)
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: off
Ready.

Then, very often, I get the following error when attempting to deploy...

kevinwarner ~/Documents/Projects/logicbox/localstack-test $ SLS_DEBUG=* AWS_PROFILE=wcf sls deploy -s local
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command create
Serverless: Load command install
Serverless: Load command package
Serverless: Load command deploy
Serverless: Load command deploy:function
Serverless: Load command deploy:list
Serverless: Load command deploy:list:functions
Serverless: Load command invoke
Serverless: Load command invoke:local
Serverless: Load command info
Serverless: Load command logs
Serverless: Load command metrics
Serverless: Load command print
Serverless: Load command remove
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command slstats
Serverless: Load command plugin
Serverless: Load command plugin
Serverless: Load command plugin:install
Serverless: Load command plugin
Serverless: Load command plugin:uninstall
Serverless: Load command plugin
Serverless: Load command plugin:list
Serverless: Load command plugin
Serverless: Load command plugin:search
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command deploy
Serverless: Invoke deploy
Serverless: Invoke package
Serverless: Invoke aws:common:validate
Serverless: Using serverless-localstack
Serverless: Invoke aws:common:cleanupTempDir
Serverless: Skip plugin function Package.packageService (lambda.mountCode flag is enabled)
Serverless: Invoke aws:package:finalize
Serverless: Invoke aws:common:moveArtifactsToPackage
Serverless: Invoke aws:common:validate
Serverless: Skip plugin function AwsDeploy.extendedValidate (lambda.mountCode flag is enabled)
Serverless: Invoke aws:deploy:deploy
Serverless: [AWS cloudformation 400 0.03s 0 retries] describeStacks({ StackName: 'localstack-test-local' })
Serverless: Creating Stack...
Serverless: [AWS cloudformation 400 0.119s 0 retries] createStack({ StackName: 'localstack-test-local',
  OnFailure: 'DELETE',
  Capabilities: [ 'CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM', [length]: 2 ],
  Parameters: [ [length]: 0 ],
  TemplateBody: '{"AWSTemplateFormatVersion":"2010-09-09","Description":"The AWS CloudFormation template for this Serverless application","Resources":{"ServerlessDeploymentBucket":{"Type":"AWS::S3::Bucket","Properties":{"BucketEncryption":{"ServerSideEncryptionConfiguration":[{"ServerSideEncryptionByDefault":{"SSEAlgorithm":"AES256"}}]}}}},"Outputs":{"ServerlessDeploymentBucketName":{"Value":{"Ref":"ServerlessDeploymentBucket"}}}}',
  Tags: [ { Key: 'STAGE', Value: 'local' }, [length]: 1 ] })

  Serverless Error ---------------------------------------

  The specified bucket is not valid.

  Stack Trace --------------------------------------------

ServerlessError: The specified bucket is not valid.
    at promise.catch.err (/usr/local/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:302:11)
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:228:7)

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information ---------------------------
     OS:                     darwin
     Node Version:           8.10.0
     Serverless Version:     1.44.1

Then, if I simply run the above depoy command again, often, but not always, the deploy works...

$ SLS_DEBUG=* AWS_PROFILE=wcf sls deploy -s local
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command create
Serverless: Load command install
Serverless: Load command package
Serverless: Load command deploy
Serverless: Load command deploy:function
Serverless: Load command deploy:list
Serverless: Load command deploy:list:functions
Serverless: Load command invoke
Serverless: Load command invoke:local
Serverless: Load command info
Serverless: Load command logs
Serverless: Load command metrics
Serverless: Load command print
Serverless: Load command remove
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command slstats
Serverless: Load command plugin
Serverless: Load command plugin
Serverless: Load command plugin:install
Serverless: Load command plugin
Serverless: Load command plugin:uninstall
Serverless: Load command plugin
Serverless: Load command plugin:list
Serverless: Load command plugin
Serverless: Load command plugin:search
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command deploy
Serverless: Invoke deploy
Serverless: Invoke package
Serverless: Invoke aws:common:validate
Serverless: Using serverless-localstack
Serverless: Invoke aws:common:cleanupTempDir
Serverless: Skip plugin function Package.packageService (lambda.mountCode flag is enabled)
Serverless: Invoke aws:package:finalize
Serverless: Invoke aws:common:moveArtifactsToPackage
Serverless: Invoke aws:common:validate
Serverless: Skip plugin function AwsDeploy.extendedValidate (lambda.mountCode flag is enabled)
Serverless: Invoke aws:deploy:deploy
Serverless: [AWS cloudformation 400 0.027s 0 retries] describeStacks({ StackName: 'localstack-test-local' })
Serverless: Creating Stack...
Serverless: [AWS cloudformation 200 0.054s 0 retries] createStack({ StackName: 'localstack-test-local',
  OnFailure: 'DELETE',
  Capabilities: [ 'CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM', [length]: 2 ],
  Parameters: [ [length]: 0 ],
  TemplateBody: '{"AWSTemplateFormatVersion":"2010-09-09","Description":"The AWS CloudFormation template for this Serverless application","Resources":{"ServerlessDeploymentBucket":{"Type":"AWS::S3::Bucket","Properties":{"BucketEncryption":{"ServerSideEncryptionConfiguration":[{"ServerSideEncryptionByDefault":{"SSEAlgorithm":"AES256"}}]}}}},"Outputs":{"ServerlessDeploymentBucketName":{"Value":{"Ref":"ServerlessDeploymentBucket"}}}}',
  Tags: [ { Key: 'STAGE', Value: 'local' }, [length]: 1 ] })
Serverless: Checking Stack create progress...
Serverless: [AWS cloudformation 200 0.017s 0 retries] describeStackEvents({ StackName: 'arn:aws:cloudformation:us-east-1:123456789:stack/localstack-test-local/5b67cb9f-5c6c-4730-a444-00baa75485ac' })
..
Serverless: Stack create finished...
Serverless: [AWS cloudformation 200 0.012s 0 retries] describeStackResource({ StackName: 'localstack-test-local',
  LogicalResourceId: 'ServerlessDeploymentBucket' })
Serverless: [AWS s3 200 0.021s 0 retries] listObjectsV2({ Bucket: 'localstack-test-local-ServerlessDeploymentBucket-038864325861',
  Prefix: 'serverless/localstack-test/local' })
Serverless: [AWS sts 200 0.018s 0 retries] getCallerIdentity({})
Serverless: Uploading CloudFormation file to S3...
Serverless: [AWS s3 200 0.012s 0 retries] putObject({ Body: <Buffer 7b 22 41 57 53 54 65 6d 70 6c 61 74 65 46 6f 72 6d 61 74 56 65 72 73 69 6f 6e 22 3a 22 32 30 31 30 2d 30 39 2d 30 39 22 2c 22 44 65 73 63 72 69 70 74 ... >,
  Bucket: 'localstack-test-local-ServerlessDeploymentBucket-038864325861',
  Key: 'serverless/localstack-test/local/1559653335515-2019-06-04T13:02:15.515Z/compiled-cloudformation-template.json',
  ContentType: 'application/json',
  Metadata: { filesha256: 'YBpmXB/1aNso159t/k2HtYkUpYlTeKsLmNpnwJlAAX0=' } })
Serverless: Skip plugin function AwsDeploy.uploadFunctionsAndLayers (lambda.mountCode flag is enabled)
Serverless: Validating template...
Serverless: Skipping template validation: Unsupported in Localstack
Serverless: Updating Stack...
Serverless: [AWS cloudformation 200 0.222s 0 retries] updateStack({ StackName: 'localstack-test-local',
  Capabilities: [ 'CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM', [length]: 2 ],
  Parameters: [ [length]: 0 ],
  TemplateURL: 'https://s3.amazonaws.com/localstack-test-local-ServerlessDeploymentBucket-038864325861/serverless/localstack-test/local/1559653335515-2019-06-04T13:02:15.515Z/compiled-cloudformation-template.json',
  Tags: [ { Key: 'STAGE', Value: 'local' }, [length]: 1 ] })
Serverless: Checking Stack update progress...
Serverless: [AWS cloudformation 200 0.016s 0 retries] describeStackEvents({ StackName: 'arn:aws:cloudformation:us-east-1:123456789:stack/localstack-test-local/5b67cb9f-5c6c-4730-a444-00baa75485ac' })
..
Serverless: Stack update finished...
Serverless: Invoke aws:info
Serverless: [AWS cloudformation 200 0.021s 0 retries] describeStacks({ StackName: 'localstack-test-local' })
Serverless: [AWS cloudformation 200 0.017s 0 retries] listStackResources({ StackName: 'localstack-test-local' })
Service Information
service: localstack-test
stage: local
region: us-east-1
stack: localstack-test-local
resources: 5
api keys:
  None
endpoints:
  None
functions:
  hello: localstack-test-local-hello
layers:
  None
Serverless: Invoke aws:deploy:finalize
Serverless: [AWS s3 200 0.01s 0 retries] listObjectsV2({ Bucket: 'localstack-test-local-ServerlessDeploymentBucket-038864325861',
  Prefix: 'serverless/localstack-test/local' })
Serverless Enterprise: Run `serverless login` and deploy again to explore, monitor, secure your serverless project for free.Sometimes, the first attempt works, but sometimes it does not. Sometimes, it takes several deploy attempts to get it to work.

I really want to get this set up in my CI process, so this uncertainty is going to cause issues. Is there anything you see that is / could be causing the intermittent issue?

Note: I also get the same intermittent problem when starting localstack with all services.

Thanks!

┆Issue is synchronized with this Jira Task by Unito

Cannot deploy application against localstack

I've started trying to use localstack with serverless using this plugin but am unable to successfully deploy to the local environment.

I've tried updating my localstack docker container to the latest build.

serverless.yml

service: my-app
plugins:
  - serverless-localstack
app: my-app

custom:
  defaultStage: local
  tableName: 'rooms-table-${self:provider.stage}'
  filesBucketName: 'my-app-${self:provider.stage}-files'
  localstack:
    debug: true
    stages: [local]
    host: http://localhost
    autostart: false

provider:
  name: aws
  runtime: nodejs12.x
  stage: ${opt:stage, self:custom.defaultStage}
  iamRoleStatements:
    - Effect: Allow
      Action:
        - dynamodb:Query
        - dynamodb:Scan
        - dynamodb:GetItem
        - dynamodb:PutItem
        - dynamodb:UpdateItem
        - dynamodb:DeleteItem
      Resource:
        - { "Fn::GetAtt": ["RoomsDynamoDBTable", "Arn" ] }
    - Effect: "Allow"
      Action:
        - "s3:ListBucket"
      Resource:
        - { "Fn::GetAtt": ["FileBucket", "Arn" ] }
    - Effect: "Allow"
      Action:
        - "s3:PutObject"
      Resource:
        - { "Fn::GetAtt": ["FileBucket", "Arn" ] }
  environment:
    ROOM_TABLE: ${self:custom.tableName}
    FILE_BUCKET_NAME: ${self:custom.filesBucketName}

functions:
  app:
    handler: index.handler
    events:
      - http:
          path: /
          method: ANY
          private: false
          cors:
            origin: '*' # <-- Specify allowed origin
            headers: # <-- Specify allowed headers
              - Content-Type
              - X-Amz-Date
              - Authorization
              - X-Api-Key
              - X-Amz-Security-Token
              - X-Amz-User-Agent
            allowCredentials: false
      - http:
          path: "{proxy+}"
          method: ANY
          private: false
          cors:
            origin: '*' # <-- Specify allowed origin
            headers: # <-- Specify allowed headers
              - Content-Type
              - X-Amz-Date
              - Authorization
              - X-Api-Key
              - X-Amz-Security-Token
              - X-Amz-User-Agent
            allowCredentials: false
      - websocket:
          route: $default

resources:
  Resources:
    FileBucket:
      Type: AWS::S3::Bucket
      Properties:
        BucketName: ${self:custom.filesBucketName}
    RoomsDynamoDBTable:
      Type: 'AWS::DynamoDB::Table'
      Properties:
        AttributeDefinitions:
          - AttributeName: id
            AttributeType: S
        KeySchema:
          - AttributeName: id
            KeyType: HASH
        ProvisionedThroughput:
          ReadCapacityUnits: 1
          WriteCapacityUnits: 1
        TableName: ${self:custom.tableName}

sls deploy command:

➜ sls deploy --stage local
Serverless: config.options_stage: local
Serverless: serverless.service.custom.stage: undefined
Serverless: serverless.service.provider.stage: ${opt:stage, self:custom.defaultStage}
Serverless: config.stage: local
Serverless: Using serverless-localstack
Serverless: Reconfiguring service apigateway to use http://localhost:4567
Serverless: Reconfiguring service cloudformation to use http://localhost:4581
Serverless: Reconfiguring service cloudwatch to use http://localhost:4582
Serverless: Reconfiguring service lambda to use http://localhost:4574
Serverless: Reconfiguring service dynamodb to use http://localhost:4569
Serverless: Reconfiguring service kinesis to use http://localhost:4568
Serverless: Reconfiguring service route53 to use http://localhost:4580
Serverless: Reconfiguring service firehose to use http://localhost:4573
Serverless: Reconfiguring service stepfunctions to use http://localhost:4585
Serverless: Reconfiguring service es to use http://localhost:4578
Serverless: Reconfiguring service s3 to use http://localhost:4572
Serverless: Reconfiguring service ses to use http://localhost:4579
Serverless: Reconfiguring service sns to use http://localhost:4575
Serverless: Reconfiguring service sqs to use http://localhost:4576
Serverless: Reconfiguring service sts to use http://localhost:4592
Serverless: Reconfiguring service iam to use http://localhost:4593
Serverless: Reconfiguring service ssm to use http://localhost:4583
Serverless: Reconfiguring service rds to use http://localhost:4594
Serverless: Reconfiguring service ec2 to use http://localhost:4597
Serverless: Reconfiguring service elasticache to use http://localhost:4598
Serverless: Reconfiguring service kms to use http://localhost:4599
Serverless: Reconfiguring service secretsmanager to use http://localhost:4584
Serverless: Reconfiguring service logs to use http://localhost:4586
Serverless: Reconfiguring service cloudwatchlogs to use http://localhost:4586
Serverless: Reconfiguring service iot to use http://localhost:4589
Serverless: Reconfiguring service cognito-idp to use http://localhost:4590
Serverless: Reconfiguring service cognito-identity to use http://localhost:4591
Serverless: Reconfiguring service ecs to use http://localhost:4601
Serverless: Reconfiguring service eks to use http://localhost:4602
Serverless: Reconfiguring service xray to use http://localhost:4603
Serverless: Reconfiguring service appsync to use http://localhost:4605
Serverless: Reconfiguring service cloudfront to use http://localhost:4606
Serverless: Reconfiguring service athena to use http://localhost:4607
Serverless: Warning: Unable to find plugin named: TypeScriptPlugin
Serverless: config.options_stage: local
Serverless: serverless.service.custom.stage: undefined
Serverless: serverless.service.provider.stage: local
Serverless: config.stage: local
Serverless: config.options_stage: local
Serverless: serverless.service.custom.stage: undefined
Serverless: serverless.service.provider.stage: local
Serverless: config.stage: local
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Installing dependencies for custom CloudFormation resources...
Serverless: Safeguards Processing...
Serverless: Safeguards Results:

   Summary --------------------------------------------------

   passed - no-secret-env-vars
   passed - allowed-regions
   passed - framework-version
   passed - no-wild-iam-role-statements
   warned - allowed-stages
   passed - require-dlq
   warned - allowed-runtimes
   warned - require-cfn-role

   Details --------------------------------------------------

   1) Warned - Stage name "local" not in list of permitted names: ["dev","qa","prod"]
      details: http://slss.io/sg-allowed-stages
      Limit the stages that can be used.


   2) Warned - Runtime of function app not in list of permitted runtimes: ["nodejs8.10","nodejs10.x","python3.7","python3.6","ruby2.5","java-1.8.0-openjdk","go1.x","dotnetcore2.1","dotnetcore2.0"]
      details: http://slss.io/sg-allowed-runtimes
      Limit the runtimes that can be used.


   3) Warned - no cfnRole set
      details: http://slss.io/sg-require-cfn-role
      Require the cfnRole option, which specifies a particular role for CloudFormation to assume while deploying.


Serverless: Safeguards Summary: 5 passed, 3 warnings, 0 errors
Serverless: Creating Stack...
Serverless: Checking Stack create progress...
.
Serverless: Stack create finished...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service my-app.zip file to S3 (32.36 MB)...
Serverless: Uploading custom CloudFormation resources...
Serverless: Validating template...
Serverless: Skipping template validation: Unsupported in Localstack
Serverless: Updating Stack...
Serverless: Checking Stack update progress...
.
Serverless: Operation failed!
Serverless: View the full error output: https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/stack/detail?stackId=arn%3Aaws%3Acloudformation%3Aus-east-1%3A000000000000%3Astack%2Fmy-app-local%2Ff39403a8-aedd-4cb4-b765-22e136d87b75
Serverless: Publishing service to the Serverless Dashboard...
Serverless: Successfully published your service to the Serverless Dashboard: https://dashboard.serverless.com/tenants/dblencowe/applications/my-app/services/my-app/stage/local/region/us-east-1
 
  Serverless Error ---------------------------------------
 
  An error occurred: my-app-local - undefined.
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     Operating System:          darwin
     Node Version:              12.12.0
     Framework Version:         1.67.0
     Plugin Version:            3.5.0
     SDK Version:               2.3.0
     Components Version:        2.22.3

localstack docker container output:

localstack_1  | 2020-03-22T09:07:15:WARNING:moto: No Moto CloudFormation support for AWS::S3::BucketPolicy
localstack_1  | 2020-03-22T09:07:20:WARNING:localstack.services.awslambda.lambda_api: Function not found: arn:aws:lambda:us-east-1:000000000000:function:lecturn-local-app
localstack_1  | 2020-03-22T09:07:21:WARNING:moto: No Moto CloudFormation support for AWS::ApiGatewayV2::Deployment
localstack_1  | 2020-03-22T09:07:21:WARNING:localstack.services.cloudformation.cloudformation_starter: Unable to determine physical_resource_id for resource <class 'moto.dynamodb2.models.Table'>
localstack_1  | 2020-03-22T09:07:22:WARNING:localstack.services.awslambda.lambda_api: Function not found: arn:aws:lambda:us-east-1:000000000000:function:lecturn-local-app
localstack_1  | 2020-03-22T09:07:47:WARNING:moto: No Moto CloudFormation support for AWS::ApiGatewayV2::Integration
localstack_1  | 2020-03-22T09:07:47:WARNING:moto: No Moto CloudFormation support for AWS::Logs::SubscriptionFilter
localstack_1  | 2020-03-22T09:07:47:WARNING:moto: No Moto CloudFormation support for AWS::Logs::SubscriptionFilter
localstack_1  | 2020-03-22T09:07:47:INFO:localstack.services.cloudformation.cloudformation_starter: Error on moto CF resource creation. Ignoring, as should_be_created=False: 400 Bad Request: {
localstack_1  |     "message": "The specified log group already exists",
localstack_1  |     "__type": "ResourceAlreadyExistsException"
localstack_1  | }
localstack_1  | 2020-03-22T09:07:47:WARNING:moto: No Moto CloudFormation support for AWS::ApiGatewayV2::Route
localstack_1  | 2020-03-22T09:07:47:WARNING:localstack.services.cloudformation.cloudformation_starter: Unable to extract id for resource IamRoleCustomResourcesLambdaExecution: {'Role': {'Path': '/', 'RoleName': 'IamRoleCustomResourcesLambdaExecution', 'RoleId': '6jemco19dzixgupuz1e3', 'Arn': 'arn:aws:iam::000000000000:role/IamRoleCustomResourcesLambdaExecution', 'CreateDate': datetime.datetime(2020, 3, 22, 9, 7, 47, 174000, tzinfo=tzlocal()), 'AssumeRolePolicyDocument': {'Version': '2012-10-17', 'Statement': [{'Effect': 'Allow', 'Principal': {'Service': ['lambda.amazonaws.com']}, 'Action': ['sts:AssumeRole']}]}, 'MaxSessionDuration': 3600}, 'ResponseMetadata': {'RequestId': '4a93ceee-9966-11e1-b624-b1aEXAMPLE7c', 'HTTPStatusCode': 200, 'HTTPHeaders': {'server': 'BaseHTTP/0.6 Python/3.8.2', 'date': 'Sun, 22 Mar 2020 09:07:47 GMT', 'content-type': 'text/html; charset=utf-8', 'content-length': '715', 'access-control-allow-origin': '*', 'access-control-allow-methods': 'HEAD,GET,PUT,POST,DELETE,OPTIONS,PATCH', 'access-control-allow-headers': 'authorization,content-type,content-md5,cache-control,x-amz-content-sha256,x-amz-date,x-amz-security-token,x-amz-user-agent,x-amz-target,x-amz-acl,x-amz-version-id,x-localstack-target,x-amz-tagging', 'access-control-expose-headers': 'x-amz-version-id'}, 'RetryAttempts': 0}}
localstack_1  | 2020-03-22T09:07:47:INFO:localstack.services.cloudformation.cloudformation_starter: Updating resource ID from 73221304 to 4nfj5aqifz (us-east-1)
localstack_1  | 2020-03-22T09:07:47:WARNING:localstack.services.cloudformation.cloudformation_starter: Unable to determine physical_resource_id for resource <class 'moto.apigateway.models.RestAPI'>
localstack_1  | 2020-03-22T09:07:47:WARNING:moto: No Moto CloudFormation support for AWS::S3::BucketPolicy
localstack_1  | 2020-03-22T09:07:47:WARNING:localstack.services.cloudformation.cloudformation_starter: Unable to extract id for resource EnterpriseLogAccessIamRole: {'Role': {'Path': '/', 'RoleName': 'EnterpriseLogAccessIamRole', 'RoleId': 'b4mm8g4bkzyaerlkz0f5', 'Arn': 'arn:aws:iam::000000000000:role/EnterpriseLogAccessIamRole', 'CreateDate': datetime.datetime(2020, 3, 22, 9, 7, 47, 468000, tzinfo=tzlocal()), 'AssumeRolePolicyDocument': {'Version': '2012-10-17', 'Statement': [{'Effect': 'Allow', 'Principal': {'AWS': 'arn:aws:iam::802587217904:root'}, 'Action': 'sts:AssumeRole', 'Condition': {'StringEquals': {'sts:ExternalId': 'ServerlessEnterprise-hZxWthzcJBqg95N8Dy'}}}]}, 'MaxSessionDuration': 3600}, 'ResponseMetadata': {'RequestId': '4a93ceee-9966-11e1-b624-b1aEXAMPLE7c', 'HTTPStatusCode': 200, 'HTTPHeaders': {'server': 'BaseHTTP/0.6 Python/3.8.2', 'date': 'Sun, 22 Mar 2020 09:07:47 GMT', 'content-type': 'text/html; charset=utf-8', 'content-length': '789', 'access-control-allow-origin': '*', 'access-control-allow-methods': 'HEAD,GET,PUT,POST,DELETE,OPTIONS,PATCH', 'access-control-allow-headers': 'authorization,content-type,content-md5,cache-control,x-amz-content-sha256,x-amz-date,x-amz-security-token,x-amz-user-agent,x-amz-target,x-amz-acl,x-amz-version-id,x-localstack-target,x-amz-tagging', 'access-control-expose-headers': 'x-amz-version-id'}, 'RetryAttempts': 0}}
localstack_1  | 2020-03-22T09:07:47:WARNING:moto: No Moto CloudFormation support for AWS::S3::BucketPolicy
localstack_1  | 2020-03-22T09:07:47:WARNING:moto: No Moto CloudFormation support for AWS::S3::BucketPolicy
localstack_1  | 2020-03-22T09:07:47:WARNING:moto: No Moto CloudFormation support for AWS::S3::BucketPolicy
localstack_1  | 2020-03-22T09:07:48:INFO:localstack.services.cloudformation.cloudformation_starter: Resource ApiGatewayDeployment1584868019205 cannot be deployed, found unsatisfied dependencies. {'Type': 'AWS::ApiGateway::Deployment', 'Properties': {'RestApiId': '4nfj5aqifz', 'StageName': 'local'}, 'DependsOn': ['ApiGatewayMethodOptions', 'ApiGatewayMethodProxyVarOptions', 'ApiGatewayMethodAny', 'ApiGatewayMethodProxyVarAny']}
localstack_1  | 2020-03-22T09:07:48:INFO:localstack.services.cloudformation.cloudformation_starter: Updating resource ID from 4fa881b1 to gj3pzr0gfi (us-east-1)
localstack_1  | 2020-03-22T09:07:48:WARNING:localstack.services.cloudformation.cloudformation_starter: Unable to determine physical_resource_id for resource <class 'moto.apigateway.models.Resource'>
localstack_1  | 2020-03-22T09:07:48:WARNING:localstack.services.cloudformation.cloudformation_starter: Unable to determine physical_resource_id for resource <class 'moto.apigateway.models.Method'>
localstack_1  | 2020-03-22T09:07:48:WARNING:localstack.services.cloudformation.cloudformation_starter: Unable to determine physical_resource_id for resource <class 'moto.apigateway.models.Method'>
localstack_1  | 2020-03-22T09:07:48:WARNING:moto: No Moto CloudFormation support for AWS::ApiGatewayV2::Api
localstack_1  | 2020-03-22T09:07:48:WARNING:localstack.utils.cloudformation.template_deployer: Unknown resource type "ApiGatewayV2::Api": {'Type': 'AWS::ApiGatewayV2::Api', 'Properties': {'Name': 'local-lecturn-websockets', 'RouteSelectionExpression': '$request.body.action', 'Description': 'Serverless Websockets', 'ProtocolType': 'WEBSOCKET'}}
localstack_1  | 2020-03-22T09:07:48:WARNING:localstack.services.cloudformation.cloudformation_starter: Unable to determine physical_resource_id for resource <class 'moto.apigateway.models.Method'>
localstack_1  | 2020-03-22T09:07:48:WARNING:localstack.services.awslambda.lambda_api: Function not found: arn:aws:lambda:us-east-1:000000000000:function:lecturn-local-custom-resource-apigw-cw-role
localstack_1  | 2020-03-22T09:07:55:WARNING:localstack.services.cloudformation.cloudformation_starter: Unable to determine physical_resource_id for resource <class 'moto.apigateway.models.Method'>
localstack_1  | 2020-03-22T09:07:55:WARNING:moto: No Moto CloudFormation support for Custom::ApiGatewayAccountRole
localstack_1  | 2020-03-22T09:07:55:WARNING:moto: No Moto CloudFormation support for AWS::ApiGatewayV2::Stage
localstack_1  | 2020-03-22T09:07:55:WARNING:localstack.services.cloudformation.cloudformation_starter: Unable to resolve "Ref" attribute for: {'Ref': 'AppLambdaVersiony0cDtpkn8rzPhUXUAIeZWEg4AW1zUg9oNeBn2gZpd8'} - AppLambdaVersiony0cDtpkn8rzPhUXUAIeZWEg4AW1zUg9oNeBn2gZpd8 - <class 'moto.awslambda.models.LambdaVersion'>
localstack_1  | 2020-03-22T09:07:55:WARNING:moto: No Moto CloudFormation support for AWS::S3::BucketPolicy
localstack_1  | 2020-03-22T09:07:55:WARNING:moto: No Moto CloudFormation support for AWS::S3::BucketPolicy
localstack_1  | 2020-03-22T09:07:55:WARNING:moto: No Moto CloudFormation support for AWS::S3::BucketPolicy
localstack_1  | 2020-03-22T09:07:55:WARNING:moto: No Moto CloudFormation support for AWS::S3::BucketPolicy
localstack_1  | 2020-03-22T09:07:55:INFO:localstack.services.cloudformation.cloudformation_starter: Resource ApiGatewayDeployment1584868019205 cannot be deployed, found unsatisfied dependencies. {'Type': 'AWS::ApiGateway::Deployment', 'Properties': {'RestApiId': '4nfj5aqifz', 'StageName': 'local'}, 'DependsOn': ['ApiGatewayMethodOptions', 'ApiGatewayMethodProxyVarOptions', 'ApiGatewayMethodAny', 'ApiGatewayMethodProxyVarAny']}
localstack_1  | 2020-03-22T09:07:55:WARNING:localstack.services.cloudformation.cloudformation_starter: Unresolvable dependencies, there may be undeployed stack resources: {'ApiGatewayDeployment1584868019205': ['ApiGatewayDeployment1584868019205', {'Type': 'AWS::ApiGateway::Deployment', 'Properties': {'RestApiId': '4nfj5aqifz', 'StageName': 'local'}, 'DependsOn': ['ApiGatewayMethodOptions', 'ApiGatewayMethodProxyVarOptions', 'ApiGatewayMethodAny', 'ApiGatewayMethodProxyVarAny']}, <moto.cloudformation.parsing.ResourceMap object at 0x7fc374e0ae20>, 'us-east-1']}
localstack_1  | 2020-03-22T09:07:55:WARNING:bootstrap.py: Thread run method <function apply_patches.<locals>.run_dependencies_deployment_loop.<locals>.run_loop at 0x7fc37479de50>(None) failed: Traceback (most recent call last):
localstack_1  |   File "/opt/code/localstack/localstack/utils/bootstrap.py", line 442, in run
localstack_1  |     self.func(self.params)
localstack_1  |   File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_starter.py", line 738, in run_loop
localstack_1  |     raise Exception('Unable to resolve all CloudFormation resources after traversing ' +
localstack_1  | Exception: Unable to resolve all CloudFormation resources after traversing dependency tree (maximum depth 40 reached): dict_keys(['ApiGatewayDeployment1584868019205'])
localstack_1  |

Support for external variables reference before deployment

Background

I would like to use external variables like ${ssm:abc} or ${cf:def} in my serverless.yml file so I can reference values per stage. More info here: https://serverless.com/framework/docs/providers/aws/guide/variables/#reference-variables-using-the-ssm-parameter-store

Expected behavior

serverless deploy --stage local command reconfigures all service endpoints, resolves the external variables and then deploys the functions

Actual behavior

serverless deploy --stage local command tries to resolve the external variables and fails before deployment

Serverless Warning --------------------------------------

  A valid SSM parameter to satisfy the declaration 'ssm:abc' could not be found.

deployment of serverless 1.65.0 returns error ECONNREFUSED 127.0.0.1:4567

since updating to the latest version (1.65.0) of serverless I am getting an error message after deploying to Localstack.

Serverless: config.options_stage: development
Serverless: serverless.service.custom.stage: undefined
Serverless: serverless.service.provider.stage: ${opt:stage, 'development'}
Serverless: config.stage: development
Serverless: Using serverless-localstack
Serverless: Reconfiguring service apigateway to use http://localhost:4567
Serverless: Reconfiguring service cloudformation to use http://localhost:4581
Serverless: Reconfiguring service cloudwatch to use http://localhost:4582
Serverless: Reconfiguring service lambda to use http://localhost:4574
Serverless: Reconfiguring service dynamodb to use http://localhost:4569
Serverless: Reconfiguring service kinesis to use http://localhost:4568
Serverless: Reconfiguring service route53 to use http://localhost:4580
Serverless: Reconfiguring service firehose to use http://localhost:4573
Serverless: Reconfiguring service stepfunctions to use http://localhost:4585
Serverless: Reconfiguring service es to use http://localhost:4578
Serverless: Reconfiguring service s3 to use http://localhost:4572
Serverless: Reconfiguring service ses to use http://localhost:4579
Serverless: Reconfiguring service sns to use http://localhost:4575
Serverless: Reconfiguring service sqs to use http://localhost:4576
Serverless: Reconfiguring service sts to use http://localhost:4592
Serverless: Reconfiguring service iam to use http://localhost:4593
Serverless: Reconfiguring service ssm to use http://localhost:4583
Serverless: Reconfiguring service rds to use http://localhost:4594
Serverless: Reconfiguring service ec2 to use http://localhost:4597
Serverless: Reconfiguring service elasticache to use http://localhost:4598
Serverless: Reconfiguring service kms to use http://localhost:4599
Serverless: Reconfiguring service secretsmanager to use http://localhost:4584
Serverless: Reconfiguring service logs to use http://localhost:4586
Serverless: Reconfiguring service cloudwatchlogs to use http://localhost:4586
Serverless: Reconfiguring service iot to use http://localhost:4589
Serverless: Reconfiguring service cognito-idp to use http://localhost:4590
Serverless: Reconfiguring service cognito-identity to use http://localhost:4591
Serverless: Reconfiguring service ecs to use http://localhost:4601
Serverless: Reconfiguring service eks to use http://localhost:4602
Serverless: Reconfiguring service xray to use http://localhost:4603
Serverless: Reconfiguring service appsync to use http://localhost:4605
Serverless: Reconfiguring service cloudfront to use http://localhost:4606
Serverless: Reconfiguring service athena to use http://localhost:4607
Serverless: Warning: Unable to find plugin named: TypeScriptPlugin
Serverless: config.options_stage: development
Serverless: serverless.service.custom.stage: undefined
Serverless: serverless.service.provider.stage: development
Serverless: config.stage: development
Serverless: config.options_stage: development
Serverless: serverless.service.custom.stage: undefined
Serverless: serverless.service.provider.stage: development
Serverless: config.stage: development
Serverless: Using deployment bucket 'shift-planner-asyncjobs'
Serverless: Compiling with Typescript...
Serverless: Using local tsconfig.json
Serverless: Typescript compiled.
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Service files not changed. Skipping deployment...
Service Information
service: shift-planner-asyncjobs
stage: development
region: eu-west-1
stack: shift-planner-asyncjobs-development
resources: 5
api keys:
  None
endpoints:
  None
functions:
  shiftPublishedEmails: shift-planner-asyncjobs-development-shiftPublishedEmails
layers:
  None

Stack Outputs
ServerlessDeploymentBucketName: shift-planner-asyncjobs
ShiftPublishedEmailsLambdaFunctionQualifiedArn: ShiftPublishedEmailsLambdaVersionFBinxqNcQ4hoU4l1I0378dVUKpD30oJdG3FSg4Xf0

Serverless: Recoverable error occurred (connect ECONNREFUSED 127.0.0.1:4567), sleeping for ~6 seconds. Try 1 of 4
Serverless: Recoverable error occurred (connect ECONNREFUSED 127.0.0.1:4567), sleeping for ~7 seconds. Try 2 of 4
Serverless: Recoverable error occurred (connect ECONNREFUSED 127.0.0.1:4567), sleeping for ~4 seconds. Try 3 of 4
Serverless: Recoverable error occurred (connect ECONNREFUSED 127.0.0.1:4567), sleeping for ~7 seconds. Try 4 of 4

  Serverless Error ---------------------------------------

  connect ECONNREFUSED 127.0.0.1:4567

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information ---------------------------
     Operating System:          darwin
     Node Version:              12.16.1
     Framework Version:         1.65.0
     Plugin Version:            3.4.1
     SDK Version:               2.3.0
     Components Version:        2.22.3

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] deploy-localstack: `node --max-old-space-size=4096 node_modules/serverless/bin/serverless --stage development deploy --verbose`
npm ERR! Exit status 1here is the serverless file:
service:
  name: shift-planner-asyncjobs

plugins:
  - serverless-deployment-bucket
  - serverless-localstack
  - serverless-plugin-typescript
  - serverless-offline

provider:
  name: aws
  runtime: nodejs12.x
  region: 'eu-west-1'
  stage: ${opt:stage, 'development'}
  memorySize: 512
  deploymentBucket:
    name: shift-planner-asyncjobs
    serverSideEncryption: AES256
  tracing:
    apiGateway: true
    lambda: true
  environment:
    ENV: ${self:provider.stage, 'development'}
    REGION: 'eu-west-1'

custom:
  localstack:
    stages:
      - development
    debug: true
    host: 'http://localhost'

functions:
  publishedEmails:
    handler: handler.someHandler
    events:
      - sqs:
          arn:
            Fn::Join:
              - ':'
              - - arn
                - aws
                - sqs
                - Ref: AWS::Region
                - Ref: AWS::AccountId
                - queueName

I compared the logs of the two versions and seems like in the version 1.65.0 i am missing this part here :

Serverless: Using custom endpoint for S3: http://localhost:4572
Serverless: Using custom endpoint for CloudFormation: http://localhost:4581
Serverless: Using custom endpoint for S3: http://localhost:4572
Serverless: Using custom endpoint for S3: http://localhost:4572
Serverless: Using custom endpoint for Lambda: http://localhost:4574
Serverless: Using custom endpoint for STS: http://localhost:4592
Serverless: Uploading CloudFormation file to S3...
Serverless: Using custom endpoint for S3: http://localhost:4572
Serverless: Uploading artifacts...
Serverless: Uploading service shift-planner-asyncjobs.zip file to S3 (7.57 MB)...
Serverless: Using custom endpoint for S3: http://localhost:4572
Serverless: Validating template...
Serverless: Skipping template validation: Unsupported in Localstack
Serverless: Creating Stack...
Serverless: Using custom endpoint for CloudFormation: http://localhost:4581
Serverless: Overriding S3 templateUrl to http://localhost:4572
Serverless: Checking Stack create progress...
Serverless: Using custom endpoint for CloudFormation: http://localhost:4581
CloudFormation - CREATE_COMPLETE - AWS::CloudFormation::Stack - shift-planner-asyncjobs-development
Serverless: Stack create finished...
Serverless: Using custom endpoint for CloudFormation: http://localhost:4581
Serverless: Using custom endpoint for CloudFormation: http://localhost:4581

after checking the code in the repo, I noticed that most of these logs come from the function 'interceptRequest(service, method, params)'

the lambda function works as expected, but this error message keeps on popping off after each deploy.
prior I was using serverless 1.53.0 and everything was smooth

┆Issue is synchronized with this Jira Task by Unito

Incorrect Account ID for Lambda on deploy

When deploying Serverless to LocalStack with the command serverless deploy --stage local --verbose and then check the docker logs by doing docker logs -f <CONTAINER ID>, it shows up that the Lambda account id (123456789012) is different than the service account ids (000000000000).

I also get the following warning: 2019-08-25T03:14:13:WARNING:localstack.services.awslambda.lambda_api: Function not found: arn:aws:lambda:us-east-1:000000000000:function:<LAMBDA NAME>, this is due to the fact that the account id is different.

I have a feeling that the issue could by fixed by either changing the the account id to match. I found localstack/localstack#62, which indicates that this has been fixed in the past on the LocalStack side. It also looks like LocalStack explicitly sets 000000000000 as the account id, but there is no way to change it. https://github.com/localstack/localstack/blob/master/localstack/constants.py#L44-L45

I'm not sure if this is an issue on the serverless or localstack stide.

mountCode throwing NoSuchBucket errors

Enabling mountCode within lambda as per the examples, throws the error Error response for CloudFormation action "UpdateStack" (400) POST /: b'Error occurred while GetObject. S3 Error Code: NoSuchBucket. S3 Error Message: The specified bucket does not exist'

Some more useful info might be

File "/opt/code/localstack/.venv/lib/python3.8/site-packages/moto/s3/models.py", line 1199, in get_bucket

return self.buckets[bucket_name]

KeyError: '__local__'

If you'd like more errors or the entire log, let me know.

I do remember setting the s3 bucket name to __local__ when creating a bucket using the CLI but not sure if that makes any difference - I'm new to AWS.

Disabling mountCode works perfectly, its just longer to deploy (locally of course).

     Python 3.8
     Operating System:        darwin
     Node Version:                12.9.0
     Framework Version:      1.67.0
     Plugin Version:               3.6.1
     SDK Version:                  2.3.0
     Components Version:   2.22.3

Any suggestions? Been at this for most of the day now and I'm done.
Thank you

AWS config ignored

The cli_follow_urlparam setting in the AWS config is ignored, causing my scripts that set SSM properties with HTTP values to fail. It fails because the dumb default behavior is to attempt to read values from the HTTP endpoints, instead of just treating the HTTP endpoints as values. I don't see any way to change that for localstack. Is there some other config file I should be setting?

(more on the setting here: aws/aws-cli#3451)

Support localstack LAMBDA_EXECUTOR docker-reuse configuration

Localstack supports LAMBDA_EXECUTOR configuration with the value docker-reuse which creates one Docker container per function and then reuses it across invocations. This configuration will make tests that process batched events run significantly faster.

I would like to request a feature that would let users set this value in the serverless localstack configuration or as an command line option.

At present this value is being set to docker

env.LAMBDA_EXECUTOR = 'docker';

400: The role defined for the function cannot be assumed by Lambda.

Trying to deploy my serverless stack to localstack. This deploys successfully to AWS but fails here.

serverless.yml:

service: smb
package:
  individually: false
  exclude:
    - "**"
    - "!*.py"

provider:
  name: aws
  runtime: python3.6
  region: us-west-2

resources:
  Resources:
    SMBDLQPolicy:
      Type: AWS::IAM::ManagedPolicy
      Properties:
        Path: /smb/
        PolicyDocument:
          Version: '2012-10-17'
          Statement:
            - Effect: Allow
              Action:
                - sqs:ChangeMessageVisibility
                - sqs:GetQueueUrl
                - sqs:ListQueues
                - sqs:SendMessage
              Resource:
                Fn::GetAtt:
                  - SMBDeadLetterQueue
                  - Arn

    SMBIngestInvokePolicy:
      Type: AWS::IAM::ManagedPolicy
      Properties:
        Path: /smb/
        PolicyDocument:
          Version: '2012-10-17'
          Statement:
            - Effect: Allow
              Action:
                - lambda:InvokeFunction
              Resource:
                Fn::GetAtt:
                  - SMBIngestLambdaFunction
                  - Arn

    SMBVPCPolicy:
      Type: AWS::IAM::ManagedPolicy
      Properties:
        Path: /smb/
        PolicyDocument:
          Version: '2012-10-17'
          Statement:
            - Effect: Allow
              Action:
                - ec2:CreateNetworkInterface
                - ec2:DescribeNetworkInterfaces
                - ec2:DeleteNetworkInterface
              Resource: "*"

    SMBIngestRole:
      Type: AWS::IAM::Role
      Properties:
        Path: /smb/
        RoleName: SMBIngestRole
        AssumeRolePolicyDocument:
          Version: '2012-10-17'
          Statement:
            - Effect: Allow
              Principal:
                Service:
                  - lambda.amazonaws.com
              Action: sts:AssumeRole
        ManagedPolicyArns:
          - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
          - Ref: SMBDLQPolicy
          - Ref: SMBVPCPolicy
        Policies:
          - PolicyName: SMBSNSPublishPolicy
            PolicyDocument:
              Version: '2012-10-17'
              Statement:
                - Effect: Allow
                  Action:
                    - sns:CreateTopic
                    - sns:Publish
                    - SNS:ListSubscriptionsByTopic
                  Resource:
                    Ref: SMBSNSTopic

    SMBAPIRole:
      Type: AWS::IAM::Role
      Properties:
        Path: /smb/
        RoleName: SMBAPI
        AssumeRolePolicyDocument:
          Version: '2012-10-17'
          Statement:
            - Effect: Allow
              Principal:
                Service:
                  - lambda.amazonaws.com
              Action: sts:AssumeRole
        ManagedPolicyArns:
          - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
          - Ref: SMBIngestInvokePolicy
          - Ref: SMBDLQPolicy
          - Ref: SMBVPCPolicy

    SMBDeadLetterQueue:
      Type: AWS::SQS::Queue
      Properties:
        QueueName: smb_dlq
        VisibilityTimeout: 0

    SMBSNSTopic:
      Type: AWS::SNS::Topic
      Properties:
        DisplayName: SMB
        TopicName: SMB

functions:
  SMBIngest:
    handler: ingest.lambda_handler
    description: ingest data coming from various sources into the postgres database
    memorySize: 256
    name: SMBIngest
    timeout: 300
    role:
      Fn::GetAtt:
        - SMBIngestRole
        - Arn
    environment:
      DB_HOST: ******
      DB_NAME: ****
      DB_USER: ****
      DB_PASSWORD: ****
  SMBAPI:
    handler: api.lambda_handler
    description: api for sending and receiving raw data into and from the database
    memorySize: 256
    name: SMBAPI
    timeout: 30
    role:
      Fn::GetAtt:
        - SMBAPIRole
        - Arn
    environment:
      DB_HOST: ******
      DB_NAME: ****
      DB_USER: ****
      DB_PASSWORD: ****
    events:
      - http:
          path: /
          method: get
      - http:
          path: /
          method: post


plugins:
  - serverless-python-requirements
  - serverless-pseudo-parameters
  - serverless-localstack

custom:
  pythonRequirements:
    dockerizePip: non-linux
    noDeploy: []
  localstack:
    debug: true
    host: http://localhost
    autostart: true
    stages:
      - local

docker logs (cleaned up a tad for readability). The line Resource SMBAPIRole need not be deployed seems fishy to me:

2020-02-07T00:51:56.955057791Z - Waiting for all LocalStack services to be ready
2020-02-07T00:51:57.122762375Z - 2020-02-07 00:51:57,122 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
2020-02-07T00:51:57.125271265Z - 2020-02-07 00:51:57,125 INFO supervisord started with pid 14
2020-02-07T00:51:58.13173478Z - 2020-02-07 00:51:58,130 INFO spawned: 'dashboard' with pid 20
2020-02-07T00:51:58.138840548Z - 2020-02-07 00:51:58,138 INFO spawned: 'infra' with pid 21
2020-02-07T00:51:58.155339555Z - 2020-02-07 00:51:58,154 INFO success: dashboard entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2020-02-07T00:51:58.15568957Z - 2020-02-07 00:51:58,155 INFO exited: dashboard (exit status 0; expected)
2020-02-07T00:51:58.945694592Z - (. .venv/bin/activate; exec bin/localstack start --host)
2020-02-07T00:51:58.945718202Z - Starting local dev environment. CTRL-C to quit.
2020-02-07T00:51:59.571776808Z - 2020-02-07 00:51:59,571 INFO success: infra entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-02-07T00:52:03.946934372Z - 2020-02-07T00:52:03:INFO:localstack.services.install: Downloading and installing local KMS server. This may take some time.
2020-02-07T00:52:03.957774101Z - Waiting for all LocalStack services to be ready
2020-02-07T00:52:04.947264756Z - 2020-02-07T00:52:04:DEBUG:localstack.utils.common: Starting download from https://s3-eu-west-2.amazonaws.com/local-kms/localstack/v3/local-kms.alpine.bin to /opt/code/localstack/localstack/infra/kms/local-kms.linux.bin (13867077 bytes)
2020-02-07T00:52:05.947614967Z - 2020-02-07T00:52:05:DEBUG:localstack.utils.common: Writing 1048576 bytes (total 1048576) to /opt/code/localstack/localstack/infra/kms/local-kms.linux.bin
2020-02-07T00:52:06.947725344Z - 2020-02-07T00:52:06:DEBUG:localstack.utils.common: Writing 1048576 bytes (total 2097152) to /opt/code/localstack/localstack/infra/kms/local-kms.linux.bin
2020-02-07T00:52:06.94777653Z - 2020-02-07T00:52:06:DEBUG:localstack.utils.common: Writing 1048576 bytes (total 3145728) to /opt/code/localstack/localstack/infra/kms/local-kms.linux.bin
2020-02-07T00:52:06.947790172Z - 2020-02-07T00:52:06:DEBUG:localstack.utils.common: Writing 1048576 bytes (total 4194304) to /opt/code/localstack/localstack/infra/kms/local-kms.linux.bin
2020-02-07T00:52:06.947800829Z - 2020-02-07T00:52:06:DEBUG:localstack.utils.common: Writing 1048576 bytes (total 5242880) to /opt/code/localstack/localstack/infra/kms/local-kms.linux.bin
2020-02-07T00:52:06.947811273Z - 2020-02-07T00:52:06:DEBUG:localstack.utils.common: Writing 1048576 bytes (total 6291456) to /opt/code/localstack/localstack/infra/kms/local-kms.linux.bin
2020-02-07T00:52:06.947821308Z - 2020-02-07T00:52:06:DEBUG:localstack.utils.common: Writing 1048576 bytes (total 7340032) to /opt/code/localstack/localstack/infra/kms/local-kms.linux.bin
2020-02-07T00:52:06.947831425Z - 2020-02-07T00:52:06:DEBUG:localstack.utils.common: Writing 1048576 bytes (total 8388608) to /opt/code/localstack/localstack/infra/kms/local-kms.linux.bin
2020-02-07T00:52:07.948389577Z - Starting mock API Gateway (http port 4567)...
2020-02-07T00:52:07.948512734Z - 2020-02-07T00:52:07:DEBUG:localstack.utils.common: Writing 1048576 bytes (total 9437184) to /opt/code/localstack/localstack/infra/kms/local-kms.linux.bin
2020-02-07T00:52:07.948538449Z - 2020-02-07T00:52:07:DEBUG:localstack.utils.common: Writing 1048576 bytes (total 10485760) to /opt/code/localstack/localstack/infra/kms/local-kms.linux.bin
2020-02-07T00:52:07.948553669Z - 2020-02-07T00:52:07:DEBUG:localstack.utils.common: Writing 1048576 bytes (total 11534336) to /opt/code/localstack/localstack/infra/kms/local-kms.linux.bin
2020-02-07T00:52:07.948567812Z - 2020-02-07T00:52:07:DEBUG:localstack.utils.common: Writing 1048576 bytes (total 12582912) to /opt/code/localstack/localstack/infra/kms/local-kms.linux.bin
2020-02-07T00:52:07.948587222Z - 2020-02-07T00:52:07:DEBUG:localstack.utils.common: Writing 1048576 bytes (total 13631488) to /opt/code/localstack/localstack/infra/kms/local-kms.linux.bin
2020-02-07T00:52:07.948610536Z - 2020-02-07T00:52:07:DEBUG:localstack.utils.common: Writing 235589 bytes (total 13867077) to /opt/code/localstack/localstack/infra/kms/local-kms.linux.bin
2020-02-07T00:52:07.94862615Z - 2020-02-07T00:52:07:DEBUG:localstack.utils.common: Done downloading https://s3-eu-west-2.amazonaws.com/local-kms/localstack/v3/local-kms.alpine.bin, response code 200, total bytes 13867077
2020-02-07T00:52:07.948640574Z - 2020-02-07T00:52:07:DEBUG:localstack.utils.common: Cleaning up file handles for download of https://s3-eu-west-2.amazonaws.com/local-kms/localstack/v3/local-kms.alpine.bin
2020-02-07T00:52:07.948654379Z - 2020-02-07T00:52:07:INFO:localstack.multiserver: Starting multi API server process on port 51492
2020-02-07T00:52:08.948329256Z - Starting mock CloudFormation (http port 4581)...
2020-02-07T00:52:08.948352366Z - Starting mock CloudWatch (http port 4582)...
2020-02-07T00:52:08.948357195Z - Starting mock DynamoDB (http port 4569)...
2020-02-07T00:52:08.94836196Z - Starting mock DynamoDB Streams service (http port 4570)...
2020-02-07T00:52:08.948376091Z - Starting mock EC2 (http port 4597)...
2020-02-07T00:52:08.948380994Z - Starting mock ES service (http port 4578)...
2020-02-07T00:52:08.9483945Z - Starting mock CloudWatch Events (http port 4587)...
2020-02-07T00:52:08.948487345Z - Starting mock Firehose service (http port 4573)...
2020-02-07T00:52:08.948494748Z - Starting mock IAM (http port 4593)...
2020-02-07T00:52:08.948500073Z - Starting mock Kinesis (http port 4568)...
2020-02-07T00:52:08.948503925Z - Starting mock KMS (http port 4599)...
2020-02-07T00:52:08.94850789Z - Starting mock Lambda service (http port 4574)...
2020-02-07T00:52:08.948511969Z - Starting mock CloudWatch Logs (http port 4586)...
2020-02-07T00:52:08.948527436Z - Starting mock Redshift (http port 4577)...
2020-02-07T00:52:08.948532085Z - Starting mock Route53 (http port 4580)...
2020-02-07T00:52:08.948592606Z - Starting mock S3 (http port 4572)...
2020-02-07T00:52:08.948606788Z - Starting mock Secrets Manager (http port 4584)...
2020-02-07T00:52:08.948612146Z - INFO[2020-02-07 00:52:08.763] No file found at path /init/seed.yaml; skipping seeding.
2020-02-07T00:52:08.94865793Z - INFO[2020-02-07 00:52:08.763] Data will be stored in /tmp/local-kms
2020-02-07T00:52:08.948664666Z - INFO[2020-02-07 00:52:08.763] Local KMS started on 0.0.0.0:4555
2020-02-07T00:52:08.948669307Z - Starting mock SES (http port 4579)...
2020-02-07T00:52:08.948698772Z - Starting mock SNS (http port 4575)...
2020-02-07T00:52:08.948704953Z - Listening at http://:::4565
2020-02-07T00:52:08.948709248Z - Starting mock SQS (http port 4576)...
2020-02-07T00:52:08.948737594Z - Starting mock SSM (http port 4583)...
2020-02-07T00:52:08.948743454Z - Initializing DynamoDB Local with the following configuration:
2020-02-07T00:52:08.948771052Z - Port:	4564
2020-02-07T00:52:08.948801202Z - InMemory:	true
2020-02-07T00:52:08.948830198Z - DbPath:	null
2020-02-07T00:52:08.948858487Z - SharedDb:	true
2020-02-07T00:52:08.948910055Z - shouldDelayTransientStatuses:	false
2020-02-07T00:52:08.948942896Z - CorsParams:	*
2020-02-07T00:52:08.948949836Z - Starting mock STS (http port 4592)...
2020-02-07T00:52:08.948980115Z -
2020-02-07T00:52:08.948986123Z - Starting mock StepFunctions (http port 4585)...
2020-02-07T00:52:08.949014625Z - 2020-02-07 00:52:08,611:API:  * Running on http://0.0.0.0:4566/ (Press CTRL+C to quit)
2020-02-07T00:52:08.94904447Z - 2020-02-07 00:52:08,611:API:  * Running on http://0.0.0.0:4566/ (Press CTRL+C to quit)
2020-02-07T00:52:08.949050586Z - 2020-02-07 00:52:08,611:API:  * Running on http://0.0.0.0:4566/ (Press CTRL+C to quit)
2020-02-07T00:52:08.949078611Z - 2020-02-07 00:52:08,619:API:  * Running on http://0.0.0.0:4582/ (Press CTRL+C to quit)
2020-02-07T00:52:08.949084273Z - 2020-02-07 00:52:08,619:API:  * Running on http://0.0.0.0:4582/ (Press CTRL+C to quit)
2020-02-07T00:52:08.949113384Z - 2020-02-07 00:52:08,619:API:  * Running on http://0.0.0.0:4582/ (Press CTRL+C to quit)
2020-02-07T00:52:08.949119276Z - 2020-02-07 00:52:08,637:API:  * Running on http://0.0.0.0:4559/ (Press CTRL+C to quit)
2020-02-07T00:52:08.949148412Z - 2020-02-07 00:52:08,637:API:  * Running on http://0.0.0.0:4559/ (Press CTRL+C to quit)
2020-02-07T00:52:08.949154619Z - 2020-02-07 00:52:08,637:API:  * Running on http://0.0.0.0:4559/ (Press CTRL+C to quit)
2020-02-07T00:52:09.949403542Z - Step Functions Local
2020-02-07T00:52:09.949427861Z - Version: 1.4.0
2020-02-07T00:52:09.949433394Z - Build: 2019-09-18
2020-02-07T00:52:09.949444Z - 2020-02-07 00:52:09.757: Configure [Account] to [000000000000]
2020-02-07T00:52:09.949449429Z - 2020-02-07 00:52:09.759: Configure [Region] to [us-east-1]
2020-02-07T00:52:09.949454249Z - 2020-02-07 00:52:09.765: Configure [Lambda Endpoint] to [http://localhost:4574]
2020-02-07T00:52:09.949516256Z - 2020-02-07 00:52:09.766: Configure [DynamoDB Endpoint] to [http://localhost:4569]
2020-02-07T00:52:09.94954785Z - 2020-02-07 00:52:09.767: Configure [SQS Endpoint] to [http://localhost:4576]
2020-02-07T00:52:09.949552939Z - 2020-02-07 00:52:09.767: Configure [SNS Endpoint] to [http://localhost:4575]
2020-02-07T00:52:09.949557552Z - 2020-02-07 00:52:09.768: Configure [Step Functions Endpoint] to [http://localhost:4585]
2020-02-07T00:52:09.949561317Z - 2020-02-07 00:52:09.797: Loaded credentials from environment
2020-02-07T00:52:09.949565808Z - 2020-02-07 00:52:09.799: Starting server on port 8083 with account 000000000000, region us-east-1
2020-02-07T00:52:10.949860515Z - 00:52:10.603 [main] INFO  org.elasticmq.server.Main$ - Starting ElasticMQ server (0.15.2) ...
2020-02-07T00:52:10.97619659Z - Waiting for all LocalStack services to be ready
2020-02-07T00:52:11.949996403Z - Feb 07, 2020 12:52:11 AM com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory createSocketFactoryRegistry
2020-02-07T00:52:11.950024308Z - WARNING: SSL Certificate checking for endpoints has been explicitly disabled.
2020-02-07T00:52:11.950029886Z - Feb 07, 2020 12:52:11 AM com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory createSocketFactoryRegistry
2020-02-07T00:52:11.950034201Z - WARNING: SSL Certificate checking for endpoints has been explicitly disabled.
2020-02-07T00:52:11.950038104Z - Feb 07, 2020 12:52:11 AM com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory createSocketFactoryRegistry
2020-02-07T00:52:11.950042824Z - WARNING: SSL Certificate checking for endpoints has been explicitly disabled.
2020-02-07T00:52:11.950047022Z - Feb 07, 2020 12:52:11 AM com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory createSocketFactoryRegistry
2020-02-07T00:52:11.950051265Z - WARNING: SSL Certificate checking for endpoints has been explicitly disabled.
2020-02-07T00:52:11.950055235Z - Feb 07, 2020 12:52:11 AM com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory createSocketFactoryRegistry
2020-02-07T00:52:11.95005945Z - WARNING: SSL Certificate checking for endpoints has been explicitly disabled.
2020-02-07T00:52:11.950119822Z - Feb 07, 2020 12:52:11 AM com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory createSocketFactoryRegistry
2020-02-07T00:52:11.950129577Z - WARNING: SSL Certificate checking for endpoints has been explicitly disabled.
2020-02-07T00:52:11.950134144Z - Feb 07, 2020 12:52:11 AM com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory createSocketFactoryRegistry
2020-02-07T00:52:11.950138553Z - WARNING: SSL Certificate checking for endpoints has been explicitly disabled.
2020-02-07T00:52:11.95014265Z - Feb 07, 2020 12:52:11 AM com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory createSocketFactoryRegistry
2020-02-07T00:52:11.95014723Z - WARNING: SSL Certificate checking for endpoints has been explicitly disabled.
2020-02-07T00:52:11.950162016Z - 00:52:11.665 [elasticmq-akka.actor.default-dispatcher-2] INFO  akka.event.slf4j.Slf4jLogger - Slf4jLogger started
2020-02-07T00:52:11.950166803Z - Feb 07, 2020 12:52:11 AM com.amazonaws.http.apache.client.impl.ApacheConnectionManagerFactory createSocketFactoryRegistry
2020-02-07T00:52:11.950170959Z - WARNING: SSL Certificate checking for endpoints has been explicitly disabled.
2020-02-07T00:52:13.966897608Z - 00:52:13.018 [elasticmq-akka.actor.default-dispatcher-2] INFO  o.e.rest.sqs.TheSQSRestServerBuilder - Started SQS rest server, bind address 0.0.0.0:4561, visible server address http://localhost:4576
2020-02-07T00:52:13.966983183Z - 00:52:13.019 [main] INFO  org.elasticmq.server.Main$ - === ElasticMQ server (0.15.2) started in 3819 ms ===
2020-02-07T00:52:17.967530583Z - 2020-02-07 00:52:17,001:API: 127.0.0.1 - - [07/Feb/2020 00:52:17] "GET / HTTP/1.1" 200 -
2020-02-07T00:52:17.967555245Z - Ready.
2020-02-07T00:53:11.97360138Z - 2020-02-07 00:53:11,260:API: 127.0.0.1 - - [07/Feb/2020 00:53:11] "GET /smb-local-serverlessdeploymentbucket-qf5pr0z1zcej?location HTTP/1.1" 404 -
2020-02-07T00:53:11.97366737Z - 2020-02-07 00:53:11,271:API: 127.0.0.1 - - [07/Feb/2020 00:53:11] "HEAD /smb-local-serverlessdeploymentbucket-qf5pr0z1zcej HTTP/1.1" 404 -
2020-02-07T00:53:11.973685232Z - 2020-02-07 00:53:11,285:API: 127.0.0.1 - - [07/Feb/2020 00:53:11] "PUT /smb-local-serverlessdeploymentbucket-qf5pr0z1zcej HTTP/1.1" 200 -
2020-02-07T00:53:11.973698955Z - 2020-02-07T00:53:11:DEBUG:localstack.services.cloudformation.cloudformation_listener: Error response from CloudFormation (400) POST /: b'<ErrorResponse xmlns="http://cloudformation.amazonaws.com/doc/2010-05-15/">\n  <Error>\n    <Type>Sender</Type>\n    <Code>ValidationError</Code>\n    <Message>Stack with id smb-local does not exist</Message>\n  </Error>\n  <RequestId>cf4c737e-5ae2-11e4-a7c9-ad44eEXAMPLE</RequestId>\n</ErrorResponse>'
2020-02-07T00:53:11.973724471Z - 2020-02-07T00:53:11:DEBUG:localstack.services.cloudformation.cloudformation_starter: Currently updating stack resource smb-local/ServerlessDeploymentBucket: None
2020-02-07T00:53:11.973742997Z - 2020-02-07T00:53:11:DEBUG:localstack.services.cloudformation.cloudformation_starter: Deploying CloudFormation resource (update=False, exists=False, updateable=False): {'Type': 'AWS::S3::Bucket', 'Properties': {'BucketEncryption': {'ServerSideEncryptionConfiguration': [{'ServerSideEncryptionByDefault': {'SSEAlgorithm': 'AES256'}}]}, 'BucketName': 'smb-local-ServerlessDeploymentBucket-QF5PR0Z1ZCEJ'}}
2020-02-07T00:53:11.973762275Z - 2020-02-07T00:53:11:DEBUG:localstack.utils.cloudformation.template_deployer: Running action "create" for resource type "S3::Bucket" id "ServerlessDeploymentBucket"
2020-02-07T00:53:11.973775448Z - 2020-02-07T00:53:11:DEBUG:localstack.utils.cloudformation.template_deployer: Request for resource type "S3::Bucket" in region us-east-1: create_bucket {'Bucket': 'smb-local-ServerlessDeploymentBucket-QF5PR0Z1ZCEJ', 'ACL': 'public-read', 'CreateBucketConfiguration': {'LocationConstraint': 'us-east-1'}}
2020-02-07T00:53:11.973790416Z - 2020-02-07T00:53:11:DEBUG:localstack.services.cloudformation.cloudformation_starter: Currently updating stack resource smb-local/ServerlessDeploymentBucketPolicy: None
2020-02-07T00:53:11.973837737Z - 2020-02-07T00:53:11:WARNING:moto: No Moto CloudFormation support for AWS::S3::BucketPolicy
2020-02-07T00:53:16.975021481Z - 2020-02-07 00:53:16,480:API: 127.0.0.1 - - [07/Feb/2020 00:53:16] "GET /smb-local-serverlessdeploymentbucket-qf5pr0z1zcej?list-type=2&prefix=serverless%2Fsmb%2Flocal HTTP/1.1" 200 -
2020-02-07T00:53:16.975053725Z - 2020-02-07 00:53:16,546:API: 127.0.0.1 - - [07/Feb/2020 00:53:16] "PUT /smb-local-serverlessdeploymentbucket-qf5pr0z1zcej/serverless/smb/local/1581036790554-2020-02-07T00%3A53%3A10.554Z/compiled-cloudformation-template.json HTTP/1.1" 200 -
2020-02-07T00:53:16.975074457Z - 2020-02-07 00:53:16,719:API: 127.0.0.1 - - [07/Feb/2020 00:53:16] "POST /smb-local-serverlessdeploymentbucket-qf5pr0z1zcej/serverless/smb/local/1581036790554-2020-02-07T00%3A53%3A10.554Z/smb.zip?uploads HTTP/1.1" 200 -
2020-02-07T00:53:16.97508091Z - 2020-02-07 00:53:16,796:API: 127.0.0.1 - - [07/Feb/2020 00:53:16] "PUT /smb-local-serverlessdeploymentbucket-qf5pr0z1zcej/serverless/smb/local/1581036790554-2020-02-07T00%3A53%3A10.554Z/smb.zip?partNumber=1&uploadId=kQ5FosMNpslzZ4mlZk4qwkJjgy6pGSWUxNG3EWPXCKRsP648J60S%2F4IPA HTTP/1.1" 200 -
2020-02-07T00:53:16.975086633Z - 2020-02-07 00:53:16,808:API: 127.0.0.1 - - [07/Feb/2020 00:53:16] "PUT /smb-local-serverlessdeploymentbucket-qf5pr0z1zcej/serverless/smb/local/1581036790554-2020-02-07T00%3A53%3A10.554Z/smb.zip?partNumber=2&uploadId=kQ5FosMNpslzZ4mlZk4qwkJjgy6pGSWUxNG3EWPXCKRsP648J60S%2F4IPA HTTP/1.1" 200 -
2020-02-07T00:53:16.975092435Z - 2020-02-07 00:53:16,813:API: 127.0.0.1 - - [07/Feb/2020 00:53:16] "PUT /smb-local-serverlessdeploymentbucket-qf5pr0z1zcej/serverless/smb/local/1581036790554-2020-02-07T00%3A53%3A10.554Z/smb.zip?partNumber=3&uploadId=kQ5FosMNpslzZ4mlZk4qwkJjgy6pGSWUxNG3EWPXCKRsP648J60S%2F4IPA HTTP/1.1" 200 -
2020-02-07T00:53:16.975097418Z - 2020-02-07 00:53:16,922:API: 127.0.0.1 - - [07/Feb/2020 00:53:16] "PUT /smb-local-serverlessdeploymentbucket-qf5pr0z1zcej/serverless/smb/local/1581036790554-2020-02-07T00%3A53%3A10.554Z/smb.zip?partNumber=5&uploadId=kQ5FosMNpslzZ4mlZk4qwkJjgy6pGSWUxNG3EWPXCKRsP648J60S%2F4IPA HTTP/1.1" 200 -
2020-02-07T00:53:16.975103796Z - 2020-02-07 00:53:16,939:API: 127.0.0.1 - - [07/Feb/2020 00:53:16] "PUT /smb-local-serverlessdeploymentbucket-qf5pr0z1zcej/serverless/smb/local/1581036790554-2020-02-07T00%3A53%3A10.554Z/smb.zip?partNumber=6&uploadId=kQ5FosMNpslzZ4mlZk4qwkJjgy6pGSWUxNG3EWPXCKRsP648J60S%2F4IPA HTTP/1.1" 200 -
2020-02-07T00:53:16.975109233Z - 2020-02-07 00:53:16,948:API: 127.0.0.1 - - [07/Feb/2020 00:53:16] "PUT /smb-local-serverlessdeploymentbucket-qf5pr0z1zcej/serverless/smb/local/1581036790554-2020-02-07T00%3A53%3A10.554Z/smb.zip?partNumber=4&uploadId=kQ5FosMNpslzZ4mlZk4qwkJjgy6pGSWUxNG3EWPXCKRsP648J60S%2F4IPA HTTP/1.1" 200 -
2020-02-07T00:53:16.975114473Z - 2020-02-07 00:53:16,958:API: 127.0.0.1 - - [07/Feb/2020 00:53:16] "PUT /smb-local-serverlessdeploymentbucket-qf5pr0z1zcej/serverless/smb/local/1581036790554-2020-02-07T00%3A53%3A10.554Z/smb.zip?partNumber=7&uploadId=kQ5FosMNpslzZ4mlZk4qwkJjgy6pGSWUxNG3EWPXCKRsP648J60S%2F4IPA HTTP/1.1" 200 -
2020-02-07T00:53:16.975119231Z - 2020-02-07T00:53:16:WARNING:localstack.services.awslambda.lambda_api: Function not found: arn:aws:lambda:us-east-1:000000000000:function:SMBIngest
2020-02-07T00:53:16.975131981Z - 2020-02-07T00:53:16:WARNING:localstack.services.awslambda.lambda_api: Function not found: arn:aws:lambda:us-east-1:000000000000:function:SMBAPI
2020-02-07T00:53:17.975162862Z - 2020-02-07 00:53:17,000:API: 127.0.0.1 - - [07/Feb/2020 00:53:17] "PUT /smb-local-serverlessdeploymentbucket-qf5pr0z1zcej/serverless/smb/local/1581036790554-2020-02-07T00%3A53%3A10.554Z/smb.zip?partNumber=8&uploadId=kQ5FosMNpslzZ4mlZk4qwkJjgy6pGSWUxNG3EWPXCKRsP648J60S%2F4IPA HTTP/1.1" 200 -
2020-02-07T00:53:17.975241544Z - 2020-02-07 00:53:17,008:API: 127.0.0.1 - - [07/Feb/2020 00:53:17] "PUT /smb-local-serverlessdeploymentbucket-qf5pr0z1zcej/serverless/smb/local/1581036790554-2020-02-07T00%3A53%3A10.554Z/smb.zip?partNumber=9&uploadId=kQ5FosMNpslzZ4mlZk4qwkJjgy6pGSWUxNG3EWPXCKRsP648J60S%2F4IPA HTTP/1.1" 200 -
2020-02-07T00:53:17.975272233Z - 2020-02-07 00:53:17,115:API: 127.0.0.1 - - [07/Feb/2020 00:53:17] "POST /smb-local-serverlessdeploymentbucket-qf5pr0z1zcej/serverless/smb/local/1581036790554-2020-02-07T00%3A53%3A10.554Z/smb.zip?uploadId=kQ5FosMNpslzZ4mlZk4qwkJjgy6pGSWUxNG3EWPXCKRsP648J60S%2F4IPA HTTP/1.1" 200 -
2020-02-07T00:53:17.975295969Z - 2020-02-07 00:53:17,138:API: 127.0.0.1 - - [07/Feb/2020 00:53:17] "GET /smb-local-serverlessdeploymentbucket-qf5pr0z1zcej/serverless/smb/local/1581036790554-2020-02-07T00%3A53%3A10.554Z/compiled-cloudformation-template.json HTTP/1.1" 200 -
2020-02-07T00:53:17.975319053Z - 2020-02-07 00:53:17,225:API: 127.0.0.1 - - [07/Feb/2020 00:53:17] "GET /smb-local-serverlessdeploymentbucket-qf5pr0z1zcej/serverless/smb/local/1581036790554-2020-02-07T00%3A53%3A10.554Z/smb.zip HTTP/1.1" 200 -
2020-02-07T00:53:17.975340738Z - 2020-02-07T00:53:17:DEBUG:localstack.services.cloudformation.cloudformation_starter: Currently updating stack resource smb-local/SMBAPILambdaVersiongpdBKHiKY3R5H134yG1xesIyaczo4pBeK4qyOdk9nQ: None
2020-02-07T00:53:17.975360077Z - 2020-02-07T00:53:17:DEBUG:localstack.services.cloudformation.cloudformation_starter: Currently updating stack resource smb-local/SMBAPILambdaFunction: None
2020-02-07T00:53:17.975377194Z - 2020-02-07T00:53:17:DEBUG:localstack.services.cloudformation.cloudformation_starter: Currently updating stack resource smb-local/SMBAPIRole: None
2020-02-07T00:53:17.975395449Z - 2020-02-07T00:53:17:DEBUG:localstack.services.cloudformation.cloudformation_starter: Currently updating stack resource smb-local/SMBIngestInvokePolicy: None
2020-02-07T00:53:17.975417753Z - 2020-02-07T00:53:17:WARNING:moto: No Moto CloudFormation support for AWS::IAM::ManagedPolicy
2020-02-07T00:53:17.975436321Z - 2020-02-07T00:53:17:DEBUG:localstack.services.cloudformation.cloudformation_starter: Currently updating stack resource smb-local/SMBDLQPolicy: None
2020-02-07T00:53:17.975456416Z - 2020-02-07T00:53:17:WARNING:moto: No Moto CloudFormation support for AWS::IAM::ManagedPolicy
2020-02-07T00:53:17.975473963Z - 2020-02-07T00:53:17:DEBUG:localstack.services.cloudformation.cloudformation_starter: Currently updating stack resource smb-local/SMBVPCPolicy: None
2020-02-07T00:53:17.975493916Z - 2020-02-07T00:53:17:WARNING:moto: No Moto CloudFormation support for AWS::IAM::ManagedPolicy
2020-02-07T00:53:17.975515336Z - 2020-02-07T00:53:17:DEBUG:localstack.services.cloudformation.cloudformation_starter: Resource SMBAPIRole need not be deployed (is_updateable=False): {'Type': 'AWS::IAM::Role', 'Properties': {'Path': '/smb/', 'RoleName': 'SMBAPI', 'AssumeRolePolicyDocument': {'Version': '2012-10-17', 'Statement': [{'Effect': 'Allow', 'Principal': {'Service': ['lambda.amazonaws.com']}, 'Action': 'sts:AssumeRole'}]}, 'ManagedPolicyArns': ['arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole', None, None, None]}} True
2020-02-07T00:53:17.975587555Z - 2020-02-07T00:53:17:WARNING:localstack.services.awslambda.lambda_api: Function not found: arn:aws:lambda:us-east-1:000000000000:function:SMBAPI
2020-02-07T00:53:17.975611363Z - 2020-02-07T00:53:17:ERROR:localstack.services.cloudformation.cloudformation_starter: Unable to parse and create resource "SMBAPILambdaFunction": An error occurred (InvalidParameterValueException) when calling the None operation: The role defined for the function cannot be assumed by Lambda. Traceback (most recent call last):
2020-02-07T00:53:17.975627178Z -   File "/opt/code/localstack/.venv/lib/python3.7/site-packages/moto/awslambda/models.py", line 692, in put_function
2020-02-07T00:53:17.97564002Z -     iam_backend.get_role_by_arn(fn.role)
2020-02-07T00:53:17.975655997Z -   File "/opt/code/localstack/.venv/lib/python3.7/site-packages/moto/iam/models.py", line 1109, in get_role_by_arn
2020-02-07T00:53:17.97567526Z -     raise IAMNotFoundException("Role {0} not found".format(arn))
2020-02-07T00:53:17.975693988Z - moto.iam.exceptions.IAMNotFoundException: 404 Not Found: <?xml version="1.0" encoding="UTF-8"?>
2020-02-07T00:53:17.975708116Z -   <ErrorResponse>
2020-02-07T00:53:17.975719374Z -     <Errors>
2020-02-07T00:53:17.97573051Z -       <Error>
2020-02-07T00:53:17.975743752Z -         <Code>NoSuchEntity</Code>
2020-02-07T00:53:17.975760541Z -         <Message>Role arn:aws:iam::123456789012:role/smb-local-SMBAPIRole-QDF8A0SDADGF not found</Message>
2020-02-07T00:53:17.975781136Z -
2020-02-07T00:53:17.975792977Z -       </Error>
2020-02-07T00:53:17.975803769Z -     </Errors>
2020-02-07T00:53:17.975814638Z -   <RequestID>7a62c49f-347e-4fc4-9331-6e8eEXAMPLE</RequestID>
2020-02-07T00:53:17.975826535Z - </ErrorResponse>
2020-02-07T00:53:17.975837812Z -
2020-02-07T00:53:17.975854547Z - During handling of the above exception, another exception occurred:
2020-02-07T00:53:17.975872538Z -
2020-02-07T00:53:17.975883791Z - Traceback (most recent call last):
2020-02-07T00:53:17.975894602Z -   File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_starter.py", line 181, in parse_and_create_resource
2020-02-07T00:53:17.975906607Z -     return _parse_and_create_resource(logical_id, resource_json, resources_map, region_name)
2020-02-07T00:53:17.975917752Z -   File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_starter.py", line 238, in _parse_and_create_resource
2020-02-07T00:53:17.975947432Z -     resource_json_arns_fixed, resources_map, region_name)
2020-02-07T00:53:17.975965211Z -   File "/opt/code/localstack/.venv/lib/python3.7/site-packages/moto/cloudformation/parsing.py", line 339, in parse_and_create_resource
2020-02-07T00:53:17.975979085Z -     resource_name, resource_json, region_name
2020-02-07T00:53:17.975990062Z -   File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_starter.py", line 515, in Lambda_create_from_cloudformation_json
2020-02-07T00:53:17.97600202Z -     return Lambda_create_from_cloudformation_json_orig(resource_name, cloudformation_json, region_name)
2020-02-07T00:53:17.976013232Z -   File "/opt/code/localstack/.venv/lib/python3.7/site-packages/moto/awslambda/models.py", line 516, in create_from_cloudformation_json
2020-02-07T00:53:17.976029178Z -     fn = backend.create_function(spec)
2020-02-07T00:53:17.976046132Z -   File "/opt/code/localstack/.venv/lib/python3.7/site-packages/moto/awslambda/models.py", line 824, in create_function
2020-02-07T00:53:17.976061294Z -     self._lambdas.put_function(fn)
2020-02-07T00:53:17.976072047Z -   File "/opt/code/localstack/.venv/lib/python3.7/site-packages/moto/awslambda/models.py", line 695, in put_function
2020-02-07T00:53:17.976084112Z -     "The role defined for the function cannot be assumed by Lambda."
2020-02-07T00:53:17.976095713Z - moto.awslambda.exceptions.InvalidParameterValueException: An error occurred (InvalidParameterValueException) when calling the None operation: The role defined for the function cannot be assumed by Lambda.
2020-02-07T00:53:17.976109555Z -
2020-02-07T00:53:17.976128952Z - 2020-02-07T00:53:17:ERROR:localstack.services.cloudformation.cloudformation_starter: Unable to parse and create resource "SMBAPILambdaVersiongpdBKHiKY3R5H134yG1xesIyaczo4pBeK4qyOdk9nQ": An error occurred (InvalidParameterValueException) when calling the None operation: The role defined for the function cannot be assumed by Lambda. Traceback (most recent call last):
2020-02-07T00:53:17.976150878Z -   File "/opt/code/localstack/.venv/lib/python3.7/site-packages/moto/awslambda/models.py", line 692, in put_function
2020-02-07T00:53:17.976163178Z -     iam_backend.get_role_by_arn(fn.role)
2020-02-07T00:53:17.976174477Z -   File "/opt/code/localstack/.venv/lib/python3.7/site-packages/moto/iam/models.py", line 1109, in get_role_by_arn
2020-02-07T00:53:17.976186249Z -     raise IAMNotFoundException("Role {0} not found".format(arn))
2020-02-07T00:53:17.976197685Z - moto.iam.exceptions.IAMNotFoundException: 404 Not Found: <?xml version="1.0" encoding="UTF-8"?>
2020-02-07T00:53:17.976217238Z -   <ErrorResponse>
2020-02-07T00:53:17.97623386Z -     <Errors>
2020-02-07T00:53:17.97624577Z -       <Error>
2020-02-07T00:53:17.976256553Z -         <Code>NoSuchEntity</Code>
2020-02-07T00:53:17.976267744Z -         <Message>Role arn:aws:iam::123456789012:role/smb-local-SMBAPIRole-QDF8A0SDADGF not found</Message>
2020-02-07T00:53:17.976279932Z -
2020-02-07T00:53:17.976304719Z -       </Error>
2020-02-07T00:53:17.976323277Z -     </Errors>
2020-02-07T00:53:17.976335338Z -   <RequestID>7a62c49f-347e-4fc4-9331-6e8eEXAMPLE</RequestID>
2020-02-07T00:53:17.976347354Z - </ErrorResponse>
2020-02-07T00:53:17.97635797Z -
2020-02-07T00:53:17.976368107Z - During handling of the above exception, another exception occurred:
2020-02-07T00:53:17.976379713Z -
2020-02-07T00:53:17.976395827Z - Traceback (most recent call last):
2020-02-07T00:53:17.976413549Z -   File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_starter.py", line 181, in parse_and_create_resource
2020-02-07T00:53:17.976426402Z -     return _parse_and_create_resource(logical_id, resource_json, resources_map, region_name)
2020-02-07T00:53:17.976437577Z -   File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_starter.py", line 207, in _parse_and_create_resource
2020-02-07T00:53:17.976449279Z -     resource_tuple = parsing.parse_resource(logical_id, resource_json, resources_map)
2020-02-07T00:53:17.976461695Z -   File "/opt/code/localstack/.venv/lib/python3.7/site-packages/moto/cloudformation/parsing.py", line 307, in parse_resource
2020-02-07T00:53:17.976475752Z -     resource_json = clean_json(resource_json, resources_map)
2020-02-07T00:53:17.976493216Z -   File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_starter.py", line 160, in clean_json
2020-02-07T00:53:17.976509686Z -     result = clean_json_orig(resource_json, resources_map)
2020-02-07T00:53:17.976522157Z -   File "/opt/code/localstack/.venv/lib/python3.7/site-packages/moto/cloudformation/parsing.py", line 252, in clean_json
2020-02-07T00:53:17.976534229Z -     cleaned_val = clean_json(value, resources_map)
2020-02-07T00:53:17.976544924Z -   File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_starter.py", line 160, in clean_json
2020-02-07T00:53:17.97655641Z -     result = clean_json_orig(resource_json, resources_map)
2020-02-07T00:53:17.976573324Z -   File "/opt/code/localstack/.venv/lib/python3.7/site-packages/moto/cloudformation/parsing.py", line 252, in clean_json
2020-02-07T00:53:17.976591877Z -     cleaned_val = clean_json(value, resources_map)
2020-02-07T00:53:17.976603596Z -   File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_starter.py", line 160, in clean_json
2020-02-07T00:53:17.976615052Z -     result = clean_json_orig(resource_json, resources_map)
2020-02-07T00:53:17.976625593Z -   File "/opt/code/localstack/.venv/lib/python3.7/site-packages/moto/cloudformation/parsing.py", line 148, in clean_json
2020-02-07T00:53:17.976637005Z -     resource = resources_map[resource_json["Ref"]]
2020-02-07T00:53:17.976650029Z -   File "/opt/code/localstack/.venv/lib/python3.7/site-packages/moto/cloudformation/parsing.py", line 465, in __getitem__
2020-02-07T00:53:17.976668744Z -     resource_logical_id, resource_json, self, self._region_name
2020-02-07T00:53:17.976694437Z -   File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_starter.py", line 181, in parse_and_create_resource
2020-02-07T00:53:17.976707513Z -     return _parse_and_create_resource(logical_id, resource_json, resources_map, region_name)
2020-02-07T00:53:17.976718728Z -   File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_starter.py", line 238, in _parse_and_create_resource
2020-02-07T00:53:17.976730446Z -     resource_json_arns_fixed, resources_map, region_name)
2020-02-07T00:53:17.97674494Z -   File "/opt/code/localstack/.venv/lib/python3.7/site-packages/moto/cloudformation/parsing.py", line 339, in parse_and_create_resource
2020-02-07T00:53:17.976764612Z -     resource_name, resource_json, region_name
2020-02-07T00:53:17.976779119Z -   File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_starter.py", line 515, in Lambda_create_from_cloudformation_json
2020-02-07T00:53:17.976791546Z -     return Lambda_create_from_cloudformation_json_orig(resource_name, cloudformation_json, region_name)
2020-02-07T00:53:17.976802588Z -   File "/opt/code/localstack/.venv/lib/python3.7/site-packages/moto/awslambda/models.py", line 516, in create_from_cloudformation_json
2020-02-07T00:53:17.976814099Z -     fn = backend.create_function(spec)
2020-02-07T00:53:17.976827377Z -   File "/opt/code/localstack/.venv/lib/python3.7/site-packages/moto/awslambda/models.py", line 824, in create_function
2020-02-07T00:53:17.976846541Z -     self._lambdas.put_function(fn)
2020-02-07T00:53:17.976863224Z -   File "/opt/code/localstack/.venv/lib/python3.7/site-packages/moto/awslambda/models.py", line 695, in put_function
2020-02-07T00:53:17.976875588Z -     "The role defined for the function cannot be assumed by Lambda."
2020-02-07T00:53:17.976887261Z - moto.awslambda.exceptions.InvalidParameterValueException: An error occurred (InvalidParameterValueException) when calling the None operation: The role defined for the function cannot be assumed by Lambda.
2020-02-07T00:53:17.976899369Z -
2020-02-07T00:53:17.976909586Z - 2020-02-07T00:53:17:DEBUG:localstack.services.cloudformation.cloudformation_listener: Error response from CloudFormation (400) POST /: b'The role defined for the function cannot be assumed by Lambda.'

output from running SLS_DEBUG=true sls deploy --stage=local --region=us-east-1:

Serverless: Load command interactiveCli
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command config:tabcompletion
Serverless: Load command config:tabcompletion:install
Serverless: Load command config:tabcompletion:uninstall
Serverless: Load command create
Serverless: Load command install
Serverless: Load command package
Serverless: Load command deploy
Serverless: Load command deploy:function
Serverless: Load command deploy:list
Serverless: Load command deploy:list:functions
Serverless: Load command invoke
Serverless: Load command invoke:local
Serverless: Load command info
Serverless: Load command logs
Serverless: Load command metrics
Serverless: Load command print
Serverless: Load command remove
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command slstats
Serverless: Load command plugin
Serverless: Load command plugin
Serverless: Load command plugin:install
Serverless: Load command plugin
Serverless: Load command plugin:uninstall
Serverless: Load command plugin
Serverless: Load command plugin:list
Serverless: Load command plugin
Serverless: Load command plugin:search
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command upgrade
Serverless: Load command uninstall
Serverless: Load command requirements
Serverless: Load command requirements:clean
Serverless: Load command requirements:install
Serverless: Load command requirements:cleanCache
Serverless: config.options_stage: local
Serverless: serverless.service.custom.stage: undefined
Serverless: serverless.service.provider.stage: dev
Serverless: config.stage: local
Serverless: Using serverless-localstack
Serverless: Reconfiguring service apigateway to use http://localhost:4567
Serverless: Reconfiguring service cloudformation to use http://localhost:4581
Serverless: Reconfiguring service cloudwatch to use http://localhost:4582
Serverless: Reconfiguring service lambda to use http://localhost:4574
Serverless: Reconfiguring service dynamodb to use http://localhost:4569
Serverless: Reconfiguring service kinesis to use http://localhost:4568
Serverless: Reconfiguring service route53 to use http://localhost:4580
Serverless: Reconfiguring service firehose to use http://localhost:4573
Serverless: Reconfiguring service stepfunctions to use http://localhost:4585
Serverless: Reconfiguring service es to use http://localhost:4578
Serverless: Reconfiguring service s3 to use http://localhost:4572
Serverless: Reconfiguring service ses to use http://localhost:4579
Serverless: Reconfiguring service sns to use http://localhost:4575
Serverless: Reconfiguring service sqs to use http://localhost:4576
Serverless: Reconfiguring service sts to use http://localhost:4592
Serverless: Reconfiguring service iam to use http://localhost:4593
Serverless: Reconfiguring service ssm to use http://localhost:4583
Serverless: Reconfiguring service rds to use http://localhost:4594
Serverless: Reconfiguring service ec2 to use http://localhost:4597
Serverless: Reconfiguring service elasticache to use http://localhost:4598
Serverless: Reconfiguring service kms to use http://localhost:4599
Serverless: Reconfiguring service secretsmanager to use http://localhost:4584
Serverless: Reconfiguring service logs to use http://localhost:4586
Serverless: Reconfiguring service cloudwatchlogs to use http://localhost:4586
Serverless: Reconfiguring service iot to use http://localhost:4589
Serverless: Reconfiguring service cognito-idp to use http://localhost:4590
Serverless: Reconfiguring service cognito-identity to use http://localhost:4591
Serverless: Reconfiguring service ecs to use http://localhost:4601
Serverless: Reconfiguring service eks to use http://localhost:4602
Serverless: Reconfiguring service xray to use http://localhost:4603
Serverless: Reconfiguring service appsync to use http://localhost:4605
Serverless: Reconfiguring service cloudfront to use http://localhost:4606
Serverless: Reconfiguring service athena to use http://localhost:4607
Serverless: Warning: Unable to find plugin named: TypeScriptPlugin
Serverless: Load command deploy
Serverless: Load command login
Serverless: Load command logout
Serverless: Load command generate-event
Serverless: Load command test
Serverless: Load command dashboard
Serverless: Load command output
Serverless: Load command output:get
Serverless: Load command output:list
Serverless: Load command param
Serverless: Load command param:get
Serverless: Load command param:list
Serverless: Invoke deploy
Serverless: Invoke package
Serverless: Invoke aws:common:validate
Serverless: config.options_stage: local
Serverless: serverless.service.custom.stage: undefined
Serverless: serverless.service.provider.stage: dev
Serverless: config.stage: local
Serverless: config.options_stage: local
Serverless: serverless.service.custom.stage: undefined
Serverless: serverless.service.provider.stage: dev
Serverless: config.stage: local
Serverless: Starting LocalStack in Docker. This can take a while.
Serverless: Checking state of LocalStack container 27361dc0c7ee
Serverless: Checking state of LocalStack container 27361dc0c7ee
Serverless: Checking state of LocalStack container 27361dc0c7ee
Serverless: Checking state of LocalStack container 27361dc0c7ee
Serverless: Checking state of LocalStack container 27361dc0c7ee
Serverless: Invoke aws:common:cleanupTempDir
Serverless: Generated requirements from /home/andrew/src/smb/aws/requirements.txt in /home/andrew/src/smb/aws/.serverless/requirements.txt...
Serverless: Using static cache of requirements found at /home/andrew/.cache/serverless-python-requirements/e7ff25d7a35950675ca94b5a47621519e0f7630ca44fde28ffc75bbedceb460f_slspyc ...
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Injecting required Python packages to package...
Serverless: Invoke aws:package:finalize
AWS Pseudo Parameters
Skipping automatic replacement of regions with account region!
Serverless: Invoke aws:common:moveArtifactsToPackage
Serverless: Invoke aws:common:validate
Serverless: Invoke aws:deploy:deploy
Serverless: [AWS cloudformation 400 0.042s 0 retries] describeStacks({ StackName: 'smb-local' })
Serverless: Creating Stack...
Serverless: [AWS cloudformation 200 0.11s 0 retries] createStack({ StackName: 'smb-local',
  OnFailure: 'DELETE',
  Capabilities: [ 'CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM', [length]: 2 ],
  Parameters: [ [length]: 0 ],
  TemplateBody:
   '{"AWSTemplateFormatVersion":"2010-09-09","Description":"The AWS CloudFormation template for this Serverless application","Resources":{"ServerlessDeploymentBucket":{"Type":"AWS::S3::Bucket","Properties":{"BucketEncryption":{"ServerSideEncryptionConfiguration":[{"ServerSideEncryptionByDefault":{"SSEAlgorithm":"AES256"}}]}}},"ServerlessDeploymentBucketPolicy":{"Type":"AWS::S3::BucketPolicy","Properties":{"Bucket":{"Ref":"ServerlessDeploymentBucket"},"PolicyDocument":{"Statement":[{"Action":"s3:*","Effect":"Deny","Principal":"*","Resource":[{"Fn::Join":["",["arn:",{"Ref":"AWS::Partition"},":s3:::",{"Ref":"ServerlessDeploymentBucket"},"/*"]]}],"Condition":{"Bool":{"aws:SecureTransport":false}}}]}}}},"Outputs":{"ServerlessDeploymentBucketName":{"Value":{"Ref":"ServerlessDeploymentBucket"}}}}',
  Tags: [ { Key: 'STAGE', Value: 'local' }, [length]: 1 ] })
Serverless: Checking Stack create progress...
Serverless: [AWS cloudformation 200 0.086s 0 retries] describeStackEvents({ StackName:
   'arn:aws:cloudformation:us-east-1:000000000000:stack/smb-local/949a606e-5d11-4205-87b2-34a0bc8e163d' })
.
Serverless: Stack create finished...
Serverless: [AWS cloudformation 200 0.019s 0 retries] describeStackResource({ StackName: 'smb-local',
  LogicalResourceId: 'ServerlessDeploymentBucket' })
Serverless: [AWS s3 200 0.025s 0 retries] listObjectsV2({ Bucket: 'smb-local-ServerlessDeploymentBucket-QF5PR0Z1ZCEJ',
  Prefix: 'serverless/smb/local' })
Serverless: [AWS lambda 404 0.012s 0 retries] getFunction({ FunctionName: 'SMBAPI' })
Serverless: [AWS lambda 404 0.018s 0 retries] getFunction({ FunctionName: 'SMBIngest' })
Serverless: [AWS sts 200 0.013s 0 retries] getCallerIdentity({})
Serverless: Uploading CloudFormation file to S3...
Serverless: [AWS s3 200 0.018s 0 retries] putObject({ Body:
   <Buffer 7b 22 41 57 53 54 65 6d 70 6c 61 74 65 46 6f 72 6d 61 74 56 65 72 73 69 6f 6e 22 3a 22 32 30 31 30 2d 30 39 2d 30 39 22 2c 22 44 65 73 63 72 69 70 74 ... >,
  Bucket: 'smb-local-ServerlessDeploymentBucket-QF5PR0Z1ZCEJ',
  Key:
   'serverless/smb/local/1581036790554-2020-02-07T00:53:10.554Z/compiled-cloudformation-template.json',
  ContentType: 'application/json',
  Metadata:
   { filesha256: 'J2VaHZ/IGPr15nm3jiVqEQBledUbXHcqOUHf782TRbg=' } })
Serverless: Uploading artifacts...
Serverless: Uploading service smb.zip file to S3 (43.81 MB)...
Serverless: [AWS s3 200 0.063s 0 retries] createMultipartUpload({ Bucket: 'smb-local-ServerlessDeploymentBucket-QF5PR0Z1ZCEJ',
  Key:
   'serverless/smb/local/1581036790554-2020-02-07T00:53:10.554Z/smb.zip',
  ContentType: 'application/zip',
  Metadata:
   { filesha256: 'zqmbRnICyp4PnKNpJNZw+UuPxTaR8c6oF3/Ls45bzjs=' } })
Serverless: [AWS s3 200 0.082s 0 retries] uploadPart({ Body:
   <Buffer 50 4b 03 04 0a 00 00 00 08 00 00 00 21 00 dd e3 32 c7 cf 02 00 00 1d 08 00 00 06 00 00 00 61 70 69 2e 70 79 ed 55 4d 4f 1b 31 10 bd e7 57 8c 90 90 77 ... >,
  ContentLength: 5242880,
  PartNumber: 1,
  Bucket: 'smb-local-ServerlessDeploymentBucket-QF5PR0Z1ZCEJ',
  Key:
   'serverless/smb/local/1581036790554-2020-02-07T00:53:10.554Z/smb.zip',
  UploadId: 'kQ5FosMNpslzZ4mlZk4qwkJjgy6pGSWUxNG3EWPXCKRsP648J60S/4IPA' })
Serverless: [AWS s3 200 0.104s 0 retries] uploadPart({ Body:
   <Buffer a4 05 1f a9 4f 6f 6e 0a b5 c6 63 da fd 57 cc 39 d2 82 79 ad 72 ea 1b 5a 64 74 48 af 13 bf ae dc e5 c0 f8 e5 2b 07 7f 36 4d eb 06 8e 6c 41 8c df 4d 31 ... >,
  ContentLength: 5242880,
  PartNumber: 2,
  Bucket: 'smb-local-ServerlessDeploymentBucket-QF5PR0Z1ZCEJ',
  Key:
   'serverless/smb/local/1581036790554-2020-02-07T00:53:10.554Z/smb.zip',
  UploadId: 'kQ5FosMNpslzZ4mlZk4qwkJjgy6pGSWUxNG3EWPXCKRsP648J60S/4IPA' })
Serverless: [AWS s3 200 0.103s 0 retries] uploadPart({ Body:
   <Buffer a3 c5 de 00 30 2f 9c c0 ef a5 31 18 f9 b0 8a 58 bd 78 e1 84 e3 e0 5c 62 cc f7 30 6f 5b 28 a2 68 92 f9 19 21 49 ef 72 ae 2e aa 8f 60 a3 ff f8 a9 15 26 ... >,
  ContentLength: 5242880,
  PartNumber: 3,
  Bucket: 'smb-local-ServerlessDeploymentBucket-QF5PR0Z1ZCEJ',
  Key:
   'serverless/smb/local/1581036790554-2020-02-07T00:53:10.554Z/smb.zip',
  UploadId: 'kQ5FosMNpslzZ4mlZk4qwkJjgy6pGSWUxNG3EWPXCKRsP648J60S/4IPA' })
Serverless: [AWS s3 200 0.107s 0 retries] uploadPart({ Body:
   <Buffer fc d8 b9 80 01 f2 17 a2 53 82 4d ba 21 90 6e 08 7c 6e a0 66 7a 66 14 98 4a c8 e7 37 cf b8 00 e6 19 97 40 3b b7 4a fe 4d 0a ff 26 85 7f 93 c2 5f ae 47 ... >,
  ContentLength: 5242880,
  PartNumber: 5,
  Bucket: 'smb-local-ServerlessDeploymentBucket-QF5PR0Z1ZCEJ',
  Key:
   'serverless/smb/local/1581036790554-2020-02-07T00:53:10.554Z/smb.zip',
  UploadId: 'kQ5FosMNpslzZ4mlZk4qwkJjgy6pGSWUxNG3EWPXCKRsP648J60S/4IPA' })
Serverless: [AWS s3 200 0.114s 0 retries] uploadPart({ Body:
   <Buffer 8f 65 3e f9 65 f5 7e cd 43 bd 6a e9 16 21 20 8f a0 78 36 83 7c 5d 5e a1 fd f3 f8 3b d9 3d 2e 4c 99 ad cf 0b 60 6c 67 94 18 ef af 74 77 a9 9f ec ee 1f ... >,
  ContentLength: 5242880,
  PartNumber: 6,
  Bucket: 'smb-local-ServerlessDeploymentBucket-QF5PR0Z1ZCEJ',
  Key:
   'serverless/smb/local/1581036790554-2020-02-07T00:53:10.554Z/smb.zip',
  UploadId: 'kQ5FosMNpslzZ4mlZk4qwkJjgy6pGSWUxNG3EWPXCKRsP648J60S/4IPA' })
Serverless: [AWS s3 200 0.163s 0 retries] uploadPart({ Body:
   <Buffer e1 3b 48 27 43 bc 36 aa ac 9b 75 83 93 3f 61 07 49 0b 63 f2 eb 26 da 3c 63 ec 5e b9 7d b0 83 3c cc 10 af 0b 55 e2 95 07 8e 23 66 07 31 b2 cc 17 67 4b ... >,
  ContentLength: 5242880,
  PartNumber: 4,
  Bucket: 'smb-local-ServerlessDeploymentBucket-QF5PR0Z1ZCEJ',
  Key:
   'serverless/smb/local/1581036790554-2020-02-07T00:53:10.554Z/smb.zip',
  UploadId: 'kQ5FosMNpslzZ4mlZk4qwkJjgy6pGSWUxNG3EWPXCKRsP648J60S/4IPA' })
Serverless: [AWS s3 200 0.116s 0 retries] uploadPart({ Body:
   <Buffer 10 5e f2 d3 e9 02 1e 68 4b 0c e6 c6 3f 55 7d 46 b2 97 ac cf d8 79 51 bd 7b 5d e8 25 f4 19 b1 97 55 7d c6 5a 1a c7 80 33 27 e8 b8 6c f7 31 c7 b1 db 7c ... >,
  ContentLength: 5242880,
  PartNumber: 7,
  Bucket: 'smb-local-ServerlessDeploymentBucket-QF5PR0Z1ZCEJ',
  Key:
   'serverless/smb/local/1581036790554-2020-02-07T00:53:10.554Z/smb.zip',
  UploadId: 'kQ5FosMNpslzZ4mlZk4qwkJjgy6pGSWUxNG3EWPXCKRsP648J60S/4IPA' })
Serverless: [AWS s3 200 0.073s 0 retries] uploadPart({ Body:
   <Buffer b4 87 e7 d4 0b 15 e6 25 c3 ef 0b b1 a5 c2 e3 0f 09 f1 98 f2 c0 a2 b7 ea 2d 43 d4 78 ec 34 13 63 31 e0 04 80 b9 7b 5f a6 c1 43 72 90 34 7f 88 54 24 4d ... >,
  ContentLength: 5242880,
  PartNumber: 8,
  Bucket: 'smb-local-ServerlessDeploymentBucket-QF5PR0Z1ZCEJ',
  Key:
   'serverless/smb/local/1581036790554-2020-02-07T00:53:10.554Z/smb.zip',
  UploadId: 'kQ5FosMNpslzZ4mlZk4qwkJjgy6pGSWUxNG3EWPXCKRsP648J60S/4IPA' })
Serverless: [AWS s3 200 0.054s 0 retries] uploadPart({ Body:
   <Buffer db 8f ef 3f 90 1c ec 3d 2d be 50 ae 1f 22 38 69 fa 03 a7 a4 5c 51 12 5e c7 49 5c de 91 32 23 9b 14 3c 3d b9 48 30 b2 de b0 92 5c d3 1a 8a 32 06 62 9d ... >,
  ContentLength: 3993941,
  PartNumber: 9,
  Bucket: 'smb-local-ServerlessDeploymentBucket-QF5PR0Z1ZCEJ',
  Key:
   'serverless/smb/local/1581036790554-2020-02-07T00:53:10.554Z/smb.zip',
  UploadId: 'kQ5FosMNpslzZ4mlZk4qwkJjgy6pGSWUxNG3EWPXCKRsP648J60S/4IPA' })
Serverless: [AWS s3 200 0.108s 0 retries] completeMultipartUpload({ MultipartUpload:
   { Parts:
      [ { ETag: '"03cf443f8963f4478e83a0e6ee2cb9ba"', PartNumber: 1 },
        { ETag: '"caa47e6d7a5877490305188ff5776708"', PartNumber: 2 },
        { ETag: '"a650e102a1604628666cf0dd6f819c63"', PartNumber: 3 },
        { ETag: '"6b9863cc26e1b5a7254380540801f4ee"', PartNumber: 4 },
        { ETag: '"0e8efc81f3732e74d23e72f2be4591be"', PartNumber: 5 },
        { ETag: '"0aaca8b6a4898bc83eeebeae1ee588c7"', PartNumber: 6 },
        { ETag: '"7cc8bed8b86b63310d4867df8f3d0a34"', PartNumber: 7 },
        { ETag: '"9cf52134b4984274bdb14ea8f8ef647b"', PartNumber: 8 },
        { ETag: '"339ab4ad1863523012b0c660153cb1b4"', PartNumber: 9 },
        [length]: 9 ] },
  Bucket: 'smb-local-ServerlessDeploymentBucket-QF5PR0Z1ZCEJ',
  Key:
   'serverless/smb/local/1581036790554-2020-02-07T00:53:10.554Z/smb.zip',
  UploadId: 'kQ5FosMNpslzZ4mlZk4qwkJjgy6pGSWUxNG3EWPXCKRsP648J60S/4IPA' })
Serverless: Validating template...
Serverless: Skipping template validation: Unsupported in Localstack
Serverless: Updating Stack...
Serverless: [AWS cloudformation 400 0.419s 0 retries] updateStack({ StackName: 'smb-local',
  Capabilities: [ 'CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM', [length]: 2 ],
  Parameters: [ [length]: 0 ],
  TemplateURL:
   'https://s3.amazonaws.com/smb-local-ServerlessDeploymentBucket-QF5PR0Z1ZCEJ/serverless/smb/local/1581036790554-2020-02-07T00:53:10.554Z/compiled-cloudformation-template.json',
  Tags: [ { Key: 'STAGE', Value: 'local' }, [length]: 1 ] })
 
  Serverless Error ---------------------------------------
 
  ServerlessError: Bad Request
      at promise.catch.err (/usr/local/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:329:27)
      at process._tickCallback (internal/process/next_tick.js:68:7)
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     Operating System:          linux
     Node Version:              10.16.3
     Framework Version:         1.61.3
     Plugin Version:            3.3.0
     SDK Version:               2.3.0
     Components Core Version:   1.1.2
     Components CLI Version:    1.4.0

[email protected]
docker image digest: dbcb1092a639efaf0b5c236bf81e393008016ef9d86a97d1da765a13a2e20fad

Please let me know if there's any other info I can provide.

security token is invalid

Hi there,

I'm trying to use your plugin with serverless 1.60.0 and I cannot seem to get past serverless checking the security token when deploying. I get this error and can't figure out how to stop it from happening:

Serverless: Using serverless-localstack
Serverless: Invoke aws:deploy:deploy
Serverless: [AWS cloudformation 403 0.29s 0 retries] describeStacks({ StackName: 'sls-sendgrid-local' })

Serverless Error ---------------------------------------

ServerlessError: The security token included in the request is invalid.
at promise.catch.err (/sls_plugins/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:326:27)
at process._tickCallback (internal/process/next_tick.js:68:7)

500 error deploying locally, deploys to AWS just fine

It appears that its failing on the call to updateStack()

AttributeError: 'NoneType' object has no attribute 'value'
2020-03-08T21:03:55:DEBUG:localstack.services.cloudformation.cloudformation_listener: Error response from CloudFormation (500) POST /: b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n'
2020-03-08 21:03:55,380:API: Error on request:
Traceback (most recent call last):
  File "/opt/code/localstack/.venv/lib/python3.8/site-packages/werkzeug/serving.py", line 323, in run_wsgi
    execute(self.server.app)
  File "/opt/code/localstack/.venv/lib/python3.8/site-packages/werkzeug/serving.py", line 312, in execute
    application_iter = app(environ, start_response)
  File "/opt/code/localstack/.venv/lib/python3.8/site-packages/moto/server.py", line 135, in __call__
    return backend_app(environ, start_response)
  File "/opt/code/localstack/.venv/lib/python3.8/site-packages/flask/app.py", line 2309, in __call__
    return self.wsgi_app(environ, start_response)
  File "/opt/code/localstack/.venv/lib/python3.8/site-packages/flask/app.py", line 2295, in wsgi_app
    response = self.handle_exception(e)
  File "/opt/code/localstack/.venv/lib/python3.8/site-packages/flask_cors/extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/opt/code/localstack/.venv/lib/python3.8/site-packages/flask/app.py", line 1741, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/code/localstack/.venv/lib/python3.8/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/opt/code/localstack/.venv/lib/python3.8/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/opt/code/localstack/.venv/lib/python3.8/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/opt/code/localstack/.venv/lib/python3.8/site-packages/flask_cors/extension.py", line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File "/opt/code/localstack/.venv/lib/python3.8/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/code/localstack/.venv/lib/python3.8/site-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/opt/code/localstack/.venv/lib/python3.8/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/code/localstack/.venv/lib/python3.8/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/code/localstack/.venv/lib/python3.8/site-packages/moto/core/utils.py", line 146, in __call__
    result = self.callback(request, request.url, {})
  File "/opt/code/localstack/.venv/lib/python3.8/site-packages/moto/core/responses.py", line 197, in dispatch
    return cls()._dispatch(*args, **kwargs)
  File "/opt/code/localstack/.venv/lib/python3.8/site-packages/moto/core/responses.py", line 295, in _dispatch
    return self.call_action()
  File "/opt/code/localstack/.venv/lib/python3.8/site-packages/moto/core/responses.py", line 380, in call_action
    response = method()
  File "/opt/code/localstack/.venv/lib/python3.8/site-packages/moto/cloudformation/responses.py", line 268, in update_stack
    stack_body = self._get_stack_from_s3_url(template_url)
  File "/opt/code/localstack/.venv/lib/python3.8/site-packages/moto/cloudformation/responses.py", line 40, in _get_stack_from_s3_url
    return key.value.decode("utf-8")

┆Issue is synchronized with this Jira Task by Unito

Usage with Webpack

When using localstack.lambda.mountCode, the handler file is used when the running the lambda inside the localstack container:

docker run -i  -v "/xx/folder":/var/task -e ...  --rm "lambci/lambda:nodejs8.10" "./src/functions/index.handler"

As the ./src/functions/index.handler is the un-transpiled version, as it hasnt gone through webpack yet, it errors.

How would you recommend using localstack.lambda.mountCode with serverless-webpack?

┆Issue is synchronized with this Jira Task by Unito

AttributeError: 'LogGroup' object has no attribute 'get_cfn_attribute'

Hi Team,

I'm trying to use serverless with localstack and ran into an issue when running:
SLS_DEBUG=* sls deploy --stage=local

The localstack docker showed error as below,please check the error_log.txt for more information:

localstack_pktest_main |   File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_starter.py", line 153, in clean_json
localstack_pktest_main |     result = clean_json_orig(resource_json, resources_map)
localstack_pktest_main |   File "/opt/code/localstack/.venv/lib/python3.7/site-packages/moto/cloudformation/parsing.py", line 166, in clean_json
localstack_pktest_main |     return resource.get_cfn_attribute(resource_json["Fn::GetAtt"][1])
localstack_pktest_main | AttributeError: 'LogGroup' object has no attribute 'get_cfn_attribute'

My Environment from sls debug is:

    Operating System:          darwin
     Node Version:              12.13.1
     Framework Version:         1.58.0
     Plugin Version:            3.2.5
     SDK Version:               2.2.1
     Components Core Version:   1.1.2
     Components CLI Version:    1.4.0

my docker-compose is:

version: '2.1'
services:
  localstack:
    container_name: "${LOCALSTACK_DOCKER_NAME-localstack_pktest_main}"
    image: localstack/localstack:latest
    ports:
      - "4567-4597:4567-4597"
      - "${PORT_WEB_UI-8080}:${PORT_WEB_UI-8080}"
    environment:
      - SERVICES=${SERVICES- }
      - DEBUG=${DEBUG- }
      - DATA_DIR=${DATA_DIR- }
      - PORT_WEB_UI=${PORT_WEB_UI- }
      - LAMBDA_EXECUTOR=${LAMBDA_EXECUTOR- }
      - LAMBDA_REMOTE_DOCKER=false
      - KINESIS_ERROR_PROBABILITY=${KINESIS_ERROR_PROBABILITY- }
      - DOCKER_HOST=unix:///var/run/docker.sock
    volumes:
      - "${TMPDIR:-/tmp/localstack}:/tmp/localstack"
      - "/var/run/docker.sock:/var/run/docker.sock"

My serverless.yml is:

service: pktest
app: pktest
org: gotest

plugins:
  - serverless-localstack

frameworkVersion: '>=1.28.0 <2.0.0'

provider:
  name: aws
  runtime: go1.x

package:
  exclude:
    - ./**
  include:
    - ./bin/**

functions:
  hello:
    handler: bin/hello
    environment:
      BUCKET_NAME: ${self:custom.bucket}
  world:
    handler: bin/world
    environment:
      BUCKET_NAME: ${self:custom.bucket}

custom:
  localstack:
    bucket: pktest
    debug: true
    lambda:
      mountCode: true
    stages:
      - local
    host: http://localhost

I have attached error_log, sls_debug log.

Could you please help me on this case?
Thanks,
error_log_localstack.docx
sls_deploy_logs.docx

┆Issue is synchronized with this Jira Task by Unito

Cloudformation error 500 when running: sls deploy

Consistently running into this cloudformation issue when running sls deploy over plain helloworld Serverless example (generated using sls create -t aws-go) with all default settings as described in README

❯ SLS_DEBUG=* sls deploy --stage=local
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command create
Serverless: Load command install
Serverless: Load command package
Serverless: Load command deploy
Serverless: Load command deploy:function
Serverless: Load command deploy:list
Serverless: Load command deploy:list:functions
Serverless: Load command invoke
Serverless: Load command invoke:local
Serverless: Load command info
Serverless: Load command logs
Serverless: Load command metrics
Serverless: Load command print
Serverless: Load command remove
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command slstats
Serverless: Load command plugin
Serverless: Load command plugin
Serverless: Load command plugin:install
Serverless: Load command plugin
Serverless: Load command plugin:uninstall
Serverless: Load command plugin
Serverless: Load command plugin:list
Serverless: Load command plugin
Serverless: Load command plugin:search
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command deploy
Serverless: Invoke deploy
Serverless: Invoke package
Serverless: Invoke aws:common:validate
(node:89480) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
Serverless: Using serverless-localstack
Serverless: Invoke aws:common:cleanupTempDir
Serverless: Skip plugin function Package.packageService (lambda.mountCode flag is enabled)
Serverless: Skip plugin function AwsCompileFunctions.downloadPackageArtifacts (lambda.mountCode flag is enabled)
Serverless: Invoke aws:package:finalize
Serverless: Invoke aws:common:moveArtifactsToPackage
Serverless: Invoke aws:common:validate
Serverless: Skip plugin function AwsDeploy.extendedValidate (lambda.mountCode flag is enabled)
Serverless: Invoke aws:deploy:deploy
Serverless: [AWS cloudformation 400 0.039s 0 retries] describeStacks({ StackName: 'sls-local' })
Serverless: Creating Stack...
Serverless: [AWS cloudformation 200 0.172s 0 retries] createStack({
  StackName: 'sls-local',
  OnFailure: 'DELETE',
  Capabilities: [ 'CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM', [length]: 2 ],
  Parameters: [ [length]: 0 ],
  TemplateBody: '{"AWSTemplateFormatVersion":"2010-09-09","Description":"The AWS CloudFormation template for this Serverless application","Resources":{"ServerlessDeploymentBucket":{"Type":"AWS::S3::Bucket","Properties":{"BucketEncryption":{"ServerSideEncryptionConfiguration":[{"ServerSideEncryptionByDefault":{"SSEAlgorithm":"AES256"}}]}}}},"Outputs":{"ServerlessDeploymentBucketName":{"Value":{"Ref":"ServerlessDeploymentBucket"}}}}',
  Tags: [ { Key: 'STAGE', Value: 'local' }, [length]: 1 ]
})
Serverless: Checking Stack create progress...
Serverless: [AWS cloudformation 200 0.115s 0 retries] describeStackEvents({
  StackName: 'arn:aws:cloudformation:us-east-1:000000000000:stack/sls-local/90777dd6-27f1-4c33-93f4-22e6f8e51065'
})
.
Serverless: Stack create finished...
Serverless: [AWS cloudformation 200 0.015s 0 retries] describeStackResource({
  StackName: 'sls-local',
  LogicalResourceId: 'ServerlessDeploymentBucket'
})
Serverless: [AWS s3 200 0.023s 0 retries] listObjectsV2({
  Bucket: 'sls-local-ServerlessDeploymentBucket-0A-Z6675022236',
  Prefix: 'serverless/sls/local'
})
Serverless: [AWS sts 200 0.02s 0 retries] getCallerIdentity({})
Serverless: Uploading CloudFormation file to S3...
Serverless: [AWS s3 200 0.015s 0 retries] putObject({
  Body: <Buffer 7b 22 41 57 53 54 65 6d 70 6c 61 74 65 46 6f 72 6d 61 74 56 65 72 73 69 6f 6e 22 3a 22 32 30 31 30 2d 30 39 2d 30 39 22 2c 22 44 65 73 63 72 69 70 74 ... 5710 more bytes>,
  Bucket: 'sls-local-ServerlessDeploymentBucket-0A-Z6675022236',
  Key: 'serverless/sls/local/1564692633187-2019-08-01T20:50:33.187Z/compiled-cloudformation-template.json',
  ContentType: 'application/json',
  Metadata: { filesha256: 't/5b63d0vXNIzrMIYQ9BLYzcDbWJU8PWegwZEsNtsjg=' }
})
Serverless: Skip plugin function AwsDeploy.uploadFunctionsAndLayers (lambda.mountCode flag is enabled)
Serverless: Validating template...
Serverless: Skipping template validation: Unsupported in Localstack
Serverless: Updating Stack...
Serverless: [AWS cloudformation 500 0.982s 3 retries] updateStack({
  StackName: 'sls-local',
  Capabilities: [ 'CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM', [length]: 2 ],
  Parameters: [ [length]: 0 ],
  TemplateURL: 'https://s3.amazonaws.com/sls-local-ServerlessDeploymentBucket-0A-Z6675022236/serverless/sls/local/1564692633187-2019-08-01T20:50:33.187Z/compiled-cloudformation-template.json',
  Tags: [ { Key: 'STAGE', Value: 'local' }, [length]: 1 ]
})
Serverless: Recoverable error occurred (500), sleeping for 5 seconds. Try 1 of 4
Serverless: [AWS cloudformation 500 0.823s 3 retries] updateStack({
  StackName: 'sls-local',
  Capabilities: [ 'CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM', [length]: 2 ],
  Parameters: [ [length]: 0 ],
  TemplateURL: 'https://s3.amazonaws.com/sls-local-ServerlessDeploymentBucket-0A-Z6675022236/serverless/sls/local/1564692633187-2019-08-01T20:50:33.187Z/compiled-cloudformation-template.json',
  Tags: [ { Key: 'STAGE', Value: 'local' }, [length]: 1 ]
})
Serverless: Recoverable error occurred (500), sleeping for 5 seconds. Try 2 of 4
Serverless: [AWS cloudformation 500 0.759s 3 retries] updateStack({
  StackName: 'sls-local',
  Capabilities: [ 'CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM', [length]: 2 ],
  Parameters: [ [length]: 0 ],
  TemplateURL: 'https://s3.amazonaws.com/sls-local-ServerlessDeploymentBucket-0A-Z6675022236/serverless/sls/local/1564692633187-2019-08-01T20:50:33.187Z/compiled-cloudformation-template.json',
  Tags: [ { Key: 'STAGE', Value: 'local' }, [length]: 1 ]
})
Serverless: Recoverable error occurred (500), sleeping for 5 seconds. Try 3 of 4
Serverless: [AWS cloudformation 500 1.007s 3 retries] updateStack({
  StackName: 'sls-local',
  Capabilities: [ 'CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM', [length]: 2 ],
  Parameters: [ [length]: 0 ],
  TemplateURL: 'https://s3.amazonaws.com/sls-local-ServerlessDeploymentBucket-0A-Z6675022236/serverless/sls/local/1564692633187-2019-08-01T20:50:33.187Z/compiled-cloudformation-template.json',
  Tags: [ { Key: 'STAGE', Value: 'local' }, [length]: 1 ]
})
Serverless: Recoverable error occurred (500), sleeping for 5 seconds. Try 4 of 4
Serverless: [AWS cloudformation 500 0.961s 3 retries] updateStack({
  StackName: 'sls-local',
  Capabilities: [ 'CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM', [length]: 2 ],
  Parameters: [ [length]: 0 ],
  TemplateURL: 'https://s3.amazonaws.com/sls-local-ServerlessDeploymentBucket-0A-Z6675022236/serverless/sls/local/1564692633187-2019-08-01T20:50:33.187Z/compiled-cloudformation-template.json',
  Tags: [ { Key: 'STAGE', Value: 'local' }, [length]: 1 ]
})

  Serverless Error ---------------------------------------

  500

  Stack Trace --------------------------------------------

ServerlessError: 500
    at /Users/blai/.nvm/versions/node/v12.5.0/lib/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:316:27
    at processTicksAndRejections (internal/process/task_queues.js:82:5)

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information ---------------------------
     OS:                     darwin
     Node Version:           12.5.0
     Serverless Version:     1.47.0

Is this plugin supposed to work on the latest Serverless version?

I downloaded the localstack and this plugin to give it a try, tried to make it work for 2h, but it simply won't work. A lot of random errors keep happening. The health check is showing that all services are running perfectly, so I either assume that there's an incompatibility with the latest serverless framework version, or the README instructions are insufficient.

My config:

service: serverless-blank

provider:
  name: aws
  runtime: nodejs12.x
  region: us-east-1

plugins:
  - serverless-localstack

custom:
  localstack:
    debug: true
    stages:
      - local
    host: http://localhost
    # tried with and without the following enabled
    # lambda:
    #   mountCode: true

functions:
  hello:
    handler: src/handler.hello

I tried to set up both with an ongoing project and one built from scratch (the Hello World template above), none worked.

Below there are some errors I faced, some of them were because I was using custom.localstack.lambda.mountCode, so I disabled it, but then another ones appeared, e.g bucket doesn't exist, so I tried to create the buckets manually using the awslocal CLI, but then it threw an error saying that the function already existed during the deployment—I also tried got riding of everything and creating the stack and the service once again, but in the first deployment it already throws that the function already exists.

20-03-10T12:05:31:DEBUG:localstack.services.cloudformation.cloudformation_listener: Error response from CloudFormation (404) POST /: b'<?xml version="1.0" encoding="UTF-8"?>\n<Error>\n    <Code>NoSuchBucket</Code>\n    <Message>The specified bucket does not exist</Message>\n    <BucketName>todo-local-ServerlessDeploymentBucket-VXACEBLRD0M8</BucketName>\n    <RequestID>7a62c49f-347e-4fc4-9331-6e8eEXAMPLE</RequestID>\n</Error>'
moto.awslambda.exceptions.InvalidParameterValueException: An error occurred (InvalidParameterValueException) when calling the None operation: Error occurred while GetObject. S3 Error Code: NoSuchBucket. S3 Error Message: The specified bucket does not exist

<Error>
    <Code>NoSuchBucket</Code>
    <Message>The specified bucket does not exist</Message>
    <BucketName>__local__</BucketName>
    <RequestID>7a62c49f-347e-4fc4-9331-6e8eEXAMPLE</RequestID>
</Error>
botocore.errorfactory.ResourceConflictException: An error occurred (ResourceConflictException) when calling the CreateFunction operation: Function already exist: serverless-blank-local-graphql
  Serverless Error ---------------------------------------

  ServerlessError: The specified bucket does not exist
      at /Users/rdsedmundo/serverless-blank/node_modules/serverless/lib/plugins/aws/provider/awsProvider.js:329:27
      at processTicksAndRejections (internal/process/task_queues.js:94:5)

CloudFormation fails with 502 on sls deploy

I'm running into issues with 502 errors from LocalStack when running sls deploy on a simple Serverless project. It is failing on the CloudFormation describeStackEvents when checking stack create progress. Extract from log below:

Serverless: Checking Stack create progress...
Serverless: [AWS cloudformation 502 0.969s 3 retries] describeStackEvents({
  StackName: 'arn:aws:cloudformation:us-east-1:000000000000:stack/hello-dev/027791cc-d634-41d4-8629-2eae7d2cd177'
})
Serverless: Recoverable error occurred (502), sleeping for 5 seconds. Try 1 of 4

If I run sls deploy again, it progresses further and deploys the function (although again failing on checking stack progress). So the CloudFormation stack seems to actually be deploying fine in LocalStack, it's just the describeStackEvents operation that fails.

I am running on Mac with serverless-localstack 0.4.19 and Serverless Framework 1.51.0.
Sample project which reproduces issue: https://github.com/fredriv/localstack-example

Output from sls deploy:

$ SLS_DEBUG=* sls deploy
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command create
Serverless: Load command install
Serverless: Load command package
Serverless: Load command deploy
Serverless: Load command deploy:function
Serverless: Load command deploy:list
Serverless: Load command deploy:list:functions
Serverless: Load command invoke
Serverless: Load command invoke:local
Serverless: Load command info
Serverless: Load command logs
Serverless: Load command metrics
Serverless: Load command print
Serverless: Load command remove
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command slstats
Serverless: Load command plugin
Serverless: Load command plugin
Serverless: Load command plugin:install
Serverless: Load command plugin
Serverless: Load command plugin:uninstall
Serverless: Load command plugin
Serverless: Load command plugin:list
Serverless: Load command plugin
Serverless: Load command plugin:search
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Using serverless-localstack
Serverless: Reconfiguring service apigateway to use http://localhost:4567
Serverless: Reconfiguring service cloudformation to use http://localhost:4581
Serverless: Reconfiguring service cloudwatch to use http://localhost:4582
Serverless: Reconfiguring service lambda to use http://localhost:4574
Serverless: Reconfiguring service dynamodb to use http://localhost:4569
Serverless: Reconfiguring service kinesis to use http://localhost:4568
Serverless: Reconfiguring service route53 to use http://localhost:4580
Serverless: Reconfiguring service firehose to use http://localhost:4573
Serverless: Reconfiguring service stepfunctions to use http://localhost:4585
Serverless: Reconfiguring service es to use http://localhost:4578
Serverless: Reconfiguring service s3 to use http://localhost:4572
Serverless: Reconfiguring service ses to use http://localhost:4579
Serverless: Reconfiguring service sns to use http://localhost:4575
Serverless: Reconfiguring service sqs to use http://localhost:4576
Serverless: Reconfiguring service sts to use http://localhost:4592
Serverless: Reconfiguring service iam to use http://localhost:4593
Serverless: Reconfiguring service ssm to use http://localhost:4583
Serverless: Reconfiguring service rds to use http://localhost:4594
Serverless: Reconfiguring service elasticache to use http://localhost:4598
Serverless: Reconfiguring service secretsmanager to use http://localhost:4584
Serverless: Reconfiguring service logs to use http://localhost:4586
Serverless: Reconfiguring service cloudwatchlogs to use http://localhost:4586
Serverless: Load command deploy
Serverless: Load command login
Serverless: Load command logout
Serverless: Load command generate-event
Serverless: Load command test
Serverless: Load command dashboard
Serverless: Invoke deploy
Serverless: Invoke package
Serverless: Invoke aws:common:validate
Serverless: config.options_stage: undefined
Serverless: serverless.service.custom.stage: undefined
Serverless: serverless.service.provider.stage: dev
Serverless: config.stage: dev
Serverless: Invoke aws:common:cleanupTempDir
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless:
User stats error: Request network error: FetchError: network timeout at: https://tracking.serverlessteam.com/v1/track
    at Timeout._onTimeout (/usr/local/lib/node_modules/serverless/node_modules/node-fetch/index.js:126:13)
    at listOnTimeout (internal/timers.js:531:17)
    at processTimers (internal/timers.js:475:7) {
  name: 'FetchError',
  message: 'network timeout at: https://tracking.serverlessteam.com/v1/track',
  type: 'request-timeout'
}
Serverless: Invoke aws:package:finalize
Serverless: Invoke aws:common:moveArtifactsToPackage
Serverless: Invoke aws:common:validate
Serverless: Invoke aws:deploy:deploy
Serverless: [AWS cloudformation 400 0.041s 0 retries] describeStacks({ StackName: 'hello-dev' })
Serverless: Creating Stack...
Serverless: [AWS cloudformation 200 0.07s 0 retries] createStack({
  StackName: 'hello-dev',
  OnFailure: 'DELETE',
  Capabilities: [ 'CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM', [length]: 2 ],
  Parameters: [ [length]: 0 ],
  TemplateBody: '{"AWSTemplateFormatVersion":"2010-09-09","Description":"The AWS CloudFormation template for this Serverless application","Resources":{"ServerlessDeploymentBucket":{"Type":"AWS::S3::Bucket","Properties":{"BucketEncryption":{"ServerSideEncryptionConfiguration":[{"ServerSideEncryptionByDefault":{"SSEAlgorithm":"AES256"}}]}}}},"Outputs":{"ServerlessDeploymentBucketName":{"Value":{"Ref":"ServerlessDeploymentBucket"}}}}',
  Tags: [ { Key: 'STAGE', Value: 'dev' }, [length]: 1 ]
})
Serverless: Checking Stack create progress...
Serverless: [AWS cloudformation 502 0.969s 3 retries] describeStackEvents({
  StackName: 'arn:aws:cloudformation:us-east-1:000000000000:stack/hello-dev/027791cc-d634-41d4-8629-2eae7d2cd177'
})
Serverless: Recoverable error occurred (502), sleeping for 5 seconds. Try 1 of 4
Serverless: [AWS cloudformation 502 0.419s 3 retries] describeStackEvents({
  StackName: 'arn:aws:cloudformation:us-east-1:000000000000:stack/hello-dev/027791cc-d634-41d4-8629-2eae7d2cd177'
})
Serverless: Recoverable error occurred (502), sleeping for 5 seconds. Try 2 of 4
Serverless: [AWS cloudformation 502 0.531s 3 retries] describeStackEvents({
  StackName: 'arn:aws:cloudformation:us-east-1:000000000000:stack/hello-dev/027791cc-d634-41d4-8629-2eae7d2cd177'
})
Serverless: Recoverable error occurred (502), sleeping for 5 seconds. Try 3 of 4
Serverless: [AWS cloudformation 502 0.531s 3 retries] describeStackEvents({
  StackName: 'arn:aws:cloudformation:us-east-1:000000000000:stack/hello-dev/027791cc-d634-41d4-8629-2eae7d2cd177'
})
Serverless: Recoverable error occurred (502), sleeping for 5 seconds. Try 4 of 4
Serverless: [AWS cloudformation 502 0.658s 3 retries] describeStackEvents({
  StackName: 'arn:aws:cloudformation:us-east-1:000000000000:stack/hello-dev/027791cc-d634-41d4-8629-2eae7d2cd177'
})

  Serverless Error ---------------------------------------

  ServerlessError: 502
      at /usr/local/lib/node_modules/serverless/lib/plugins/aws/lib/monitorStack.js:133:26
  From previous event:
      at AwsDeploy.monitorStack (/usr/local/lib/node_modules/serverless/lib/plugins/aws/lib/monitorStack.js:27:12)
      at /usr/local/lib/node_modules/serverless/lib/plugins/aws/deploy/lib/createStack.js:45:28
  From previous event:
      at AwsDeploy.create (/usr/local/lib/node_modules/serverless/lib/plugins/aws/deploy/lib/createStack.js:45:8)
  From previous event:
      at AwsDeploy.<anonymous> (/usr/local/lib/node_modules/serverless/lib/plugins/aws/deploy/lib/createStack.js:89:39)
  From previous event:
      at AwsDeploy.createStack (/usr/local/lib/node_modules/serverless/lib/plugins/aws/deploy/lib/createStack.js:83:13)
  From previous event:
      at Object.aws:deploy:deploy:createStack [as hook] (/usr/local/lib/node_modules/serverless/lib/plugins/aws/deploy/index.js:99:67)
      at /usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:464:55
  From previous event:
      at PluginManager.invoke (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:464:22)
      at PluginManager.spawn (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:484:17)
      at AwsDeploy.<anonymous> (/usr/local/lib/node_modules/serverless/lib/plugins/aws/deploy/index.js:93:48)
  From previous event:
      at Object.deploy:deploy [as hook] (/usr/local/lib/node_modules/serverless/lib/plugins/aws/deploy/index.js:89:30)
      at /usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:464:55
  From previous event:
      at PluginManager.invoke (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:464:22)
      at PluginManager.run (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:496:17)
      at /usr/local/lib/node_modules/serverless/lib/Serverless.js:116:33
      at processImmediate (internal/timers.js:439:21)
      at process.topLevelDomainCallback (domain.js:131:23)
  From previous event:
      at Serverless.run (/usr/local/lib/node_modules/serverless/lib/Serverless.js:103:74)
      at /usr/local/lib/node_modules/serverless/bin/serverless.js:60:28
      at /usr/local/lib/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:136:16
      at /usr/local/lib/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:57:14
      at FSReqCallback.oncomplete (fs.js:154:23)
  From previous event:
      at /usr/local/lib/node_modules/serverless/bin/serverless.js:60:6
      at processImmediate (internal/timers.js:439:21)
      at process.topLevelDomainCallback (domain.js:131:23)
  From previous event:
      at Object.<anonymous> (/usr/local/lib/node_modules/serverless/bin/serverless.js:46:39)
      at Module._compile (internal/modules/cjs/loader.js:936:30)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
      at Module.load (internal/modules/cjs/loader.js:790:32)
      at Function.Module._load (internal/modules/cjs/loader.js:703:12)
      at Function.Module.runMain (internal/modules/cjs/loader.js:999:10)
      at internal/main/run_main_module.js:17:11

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information ---------------------------
     Operating System:          darwin
     Node Version:              12.9.1
     Framework Version:         1.51.0
     Plugin Version:            1.3.10
     SDK Version:               2.1.0

Output from Docker:

$ TMPDIR=/private$TMPDIR docker-compose up
Creating network "localstack-example_default" with the default driver
Creating localstack-example_localstack_1 ... done
Attaching to localstack-example_localstack_1
localstack_1  | Waiting for all LocalStack services to be ready
localstack_1  | 2019-09-04 22:28:00,106 CRIT Supervisor is running as root.  Privileges were not dropped because no user is specified in the config file.  If you intend to run as root, you can set user=root in the config file to avoid this message.
localstack_1  | 2019-09-04 22:28:00,109 INFO supervisord started with pid 12
localstack_1  | 2019-09-04 22:28:01,114 INFO spawned: 'dashboard' with pid 20
localstack_1  | 2019-09-04 22:28:01,118 INFO spawned: 'infra' with pid 21
localstack_1  | 2019-09-04 22:28:01,128 INFO success: dashboard entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
localstack_1  | (. .venv/bin/activate; bin/localstack web)
localstack_1  | (. .venv/bin/activate; exec bin/localstack start --host)
localstack_1  | 2019-09-04 22:28:02,133 INFO success: infra entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
localstack_1  | cannot import name 'dns_server'
localstack_1  |    WARNING: Do not use the development server in a production environment.
localstack_1  |    Use a production WSGI server instead.
localstack_1  | Starting local dev environment. CTRL-C to quit.
localstack_1  | cannot import name 'dns_server'
localstack_1  | Starting mock S3 (http port 4572)...
localstack_1  | Starting mock SNS (http port 4575)...
localstack_1  | 2019-09-04T22:28:05:INFO:localstack.multiserver: Starting multi API server process on port 51492
localstack_1  | Waiting for all LocalStack services to be ready
localstack_1  | Starting mock IAM (http port 4593)...
localstack_1  | Starting mock API Gateway (http port 4567)...
localstack_1  | Starting mock DynamoDB (http port 4569)...
localstack_1  | Starting mock Lambda service (http port 4574)...
localstack_1  | Starting mock CloudFormation (http port 4581)...
localstack_1  | Starting mock CloudWatch Logs (http port 4586)...
localstack_1  | Initializing DynamoDB Local with the following configuration:
localstack_1  | Port:	4564
localstack_1  | InMemory:	true
localstack_1  | DbPath:	null
localstack_1  | SharedDb:	true
localstack_1  | shouldDelayTransientStatuses:	false
localstack_1  | CorsParams:	*
localstack_1  |
localstack_1  | 2019-09-04 22:28:06,321:API:  * Running on http://0.0.0.0:4562/ (Press CTRL+C to quit)
localstack_1  | 2019-09-04 22:28:06,321:API:  * Running on http://0.0.0.0:4562/ (Press CTRL+C to quit)
localstack_1  | 2019-09-04 22:28:06,321:API:  * Running on http://0.0.0.0:4562/ (Press CTRL+C to quit)
localstack_1  | 2019-09-04 22:28:06,330:API:  * Running on http://0.0.0.0:4557/ (Press CTRL+C to quit)
localstack_1  | 2019-09-04 22:28:06,330:API:  * Running on http://0.0.0.0:4557/ (Press CTRL+C to quit)
localstack_1  | 2019-09-04 22:28:06,330:API:  * Running on http://0.0.0.0:4557/ (Press CTRL+C to quit)
localstack_1  | 2019-09-04 22:28:06,345:API:  * Running on http://0.0.0.0:4566/ (Press CTRL+C to quit)
localstack_1  | 2019-09-04 22:28:06,345:API:  * Running on http://0.0.0.0:4566/ (Press CTRL+C to quit)
localstack_1  | 2019-09-04 22:28:06,345:API:  * Running on http://0.0.0.0:4566/ (Press CTRL+C to quit)
localstack_1  | 2019-09-04 22:28:11,545:API: 127.0.0.1 - - [04/Sep/2019 22:28:11] "GET / HTTP/1.1" 200 -
localstack_1  | Ready.
localstack_1  | 2019-09-04 22:28:18,857:API: 127.0.0.1 - - [04/Sep/2019 22:28:18] "GET /hello-dev-ServerlessDeploymentBucket-GYNYDSU53XY9?location HTTP/1.1" 404 -
localstack_1  | 2019-09-04 22:28:18,875:API: 127.0.0.1 - - [04/Sep/2019 22:28:18] "PUT /hello-dev-ServerlessDeploymentBucket-GYNYDSU53XY9 HTTP/1.1" 200 -
localstack_1  | 2019-09-04T22:28:18:DEBUG:localstack.services.cloudformation.cloudformation_listener: Error response from CloudFormation (400) POST /: b'<ErrorResponse xmlns="http://cloudformation.amazonaws.com/doc/2010-05-15/">\n  <Error>\n    <Type>Sender</Type>\n    <Code>ValidationError</Code>\n    <Message>Stack with id hello-dev does not exist</Message>\n  </Error>\n  <RequestId>cf4c737e-5ae2-11e4-a7c9-ad44eEXAMPLE</RequestId>\n</ErrorResponse>'
localstack_1  | 2019-09-04T22:28:18:DEBUG:localstack.services.cloudformation.cloudformation_starter: Currently updating stack resource hello-dev/ServerlessDeploymentBucket: None
localstack_1  | 2019-09-04T22:28:18:DEBUG:localstack.services.cloudformation.cloudformation_starter: Deploying CloudFormation resource: {'Type': 'AWS::S3::Bucket', 'Properties': {'BucketEncryption': {'ServerSideEncryptionConfiguration': [{'ServerSideEncryptionByDefault': {'SSEAlgorithm': 'AES256'}}]}, 'BucketName': 'hello-dev-ServerlessDeploymentBucket-GYNYDSU53XY9'}}
localstack_1  | 2019-09-04T22:28:18:DEBUG:localstack.utils.cloudformation.template_deployer: Deploying resource type "S3::Bucket" id "ServerlessDeploymentBucket"
localstack_1  | 2019-09-04T22:28:18:DEBUG:localstack.utils.cloudformation.template_deployer: Request for creating resource type "S3::Bucket": {'Bucket': 'hello-dev-ServerlessDeploymentBucket-GYNYDSU53XY9', 'ACL': 'public-read'}
localstack_1  | 2019-09-04T22:28:24:DEBUG:localstack.services.cloudformation.cloudformation_listener: Error response from CloudFormation (500) POST /: b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n'
localstack_1  | 2019-09-04T22:28:24:ERROR:localstack.services.generic_proxy: Error forwarding request: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
localstack_1  | b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n' Traceback (most recent call last):
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/botocore/parsers.py", line 432, in _parse_xml_string_to_dom
localstack_1  |     parser.feed(xml_string)
localstack_1  |   File "<string>", line None
localstack_1  | xml.etree.ElementTree.ParseError: syntax error: line 1, column 54
localstack_1  |
localstack_1  | During handling of the above exception, another exception occurred:
localstack_1  |
localstack_1  | Traceback (most recent call last):
localstack_1  |   File "/opt/code/localstack/localstack/services/generic_proxy.py", line 234, in forward
localstack_1  |     path=path, data=data, headers=forward_headers)
localstack_1  |   File "/opt/code/localstack/localstack/services/cloudformation/cloudformation_listener.py", line 85, in forward_request
localstack_1  |     tmp = client.describe_stack_events(StackName=stack_name)['StackEvents'][:1]
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/botocore/client.py", line 357, in _api_call
localstack_1  |     return self._make_api_call(operation_name, kwargs)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/botocore/client.py", line 648, in _make_api_call
localstack_1  |     operation_model, request_dict, request_context)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/botocore/client.py", line 667, in _make_request
localstack_1  |     return self._endpoint.make_request(operation_model, request_dict)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/botocore/endpoint.py", line 102, in make_request
localstack_1  |     return self._send_request(request_dict, operation_model)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/botocore/endpoint.py", line 135, in _send_request
localstack_1  |     request, operation_model, context)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/botocore/endpoint.py", line 167, in _get_response
localstack_1  |     request, operation_model)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/botocore/endpoint.py", line 218, in _do_get_response
localstack_1  |     response_dict, operation_model.output_shape)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/botocore/parsers.py", line 240, in parse
localstack_1  |     parsed = self._do_error_parse(response, shape)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/botocore/parsers.py", line 485, in _do_error_parse
localstack_1  |     root = self._parse_xml_string_to_dom(xml_contents)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/botocore/parsers.py", line 437, in _parse_xml_string_to_dom
localstack_1  |     "invalid XML received:\n%s" % (e, xml_string))
localstack_1  | botocore.parsers.ResponseParserError: Unable to parse response (syntax error: line 1, column 54), invalid XML received:
localstack_1  | b'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">\n<title>500 Internal Server Error</title>\n<h1>Internal Server Error</h1>\n<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>\n'
localstack_1  |
localstack_1  | 2019-09-04 22:28:24,202:API: Error on request:
localstack_1  | Traceback (most recent call last):
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/werkzeug/serving.py", line 303, in run_wsgi
localstack_1  |     execute(self.server.app)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/werkzeug/serving.py", line 291, in execute
localstack_1  |     application_iter = app(environ, start_response)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/moto/server.py", line 132, in __call__
localstack_1  |     return backend_app(environ, start_response)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/app.py", line 2309, in __call__
localstack_1  |     return self.wsgi_app(environ, start_response)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app
localstack_1  |     response = self.handle_exception(e)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/app.py", line 1741, in handle_exception
localstack_1  |     reraise(exc_type, exc_value, tb)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
localstack_1  |     raise value
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
localstack_1  |     response = self.full_dispatch_request()
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
localstack_1  |     rv = self.handle_user_exception(e)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
localstack_1  |     reraise(exc_type, exc_value, tb)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
localstack_1  |     raise value
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
localstack_1  |     rv = self.dispatch_request()
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
localstack_1  |     return self.view_functions[rule.endpoint](**req.view_args)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/moto/core/utils.py", line 140, in __call__
localstack_1  |     result = self.callback(request, request.url, {})
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/moto/core/responses.py", line 168, in dispatch
localstack_1  |     return cls()._dispatch(*args, **kwargs)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/moto/core/responses.py", line 259, in _dispatch
localstack_1  |     return self.call_action()
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/moto/core/responses.py", line 340, in call_action
localstack_1  |     response = method()
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/moto/cloudformation/responses.py", line 213, in describe_stack_events
localstack_1  |     return template.render(stack=stack)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/jinja2/asyncsupport.py", line 76, in render
localstack_1  |     return original_render(self, *args, **kwargs)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/jinja2/environment.py", line 1008, in render
localstack_1  |     return self.environment.handle_exception(exc_info, True)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/jinja2/environment.py", line 780, in handle_exception
localstack_1  |     reraise(exc_type, exc_value, tb)
localstack_1  |   File "/opt/code/localstack/.venv/lib/python3.6/site-packages/jinja2/_compat.py", line 37, in reraise
localstack_1  |     raise value.with_traceback(tb)
localstack_1  |   File "<template>", line 4, in top-level template code
localstack_1  |
localstack_1  | jinja2.exceptions.UndefinedError: 'None' has no attribute 'events'

Docker with sudo

I have docker running on an Arch linux install, but haven't added my user to the docker group due to the security implications that has.

Is there any way to get serverless-localstack to run docker with sudo?

ENOENT: no such file or directory and EPERM: operation not permitted

I'm on OSX 10.13.6 with Docker version 19.03.1. I've been using serverless for deploying my cloudformation script and now I'm attempting to run my stack locally using serverless-localstack.

I'm running the command

serverless deploy --verbose --stage local

error 1

Serverless: Using serverless-localstack
Serverless: Compiling with Typescript...
Serverless: Using local tsconfig.json
Serverless: Typescript compiled.
Serverless: Skip plugin function Package.packageService (lambda.mountCode flag is enabled)

  Error --------------------------------------------------

  ENOENT: no such file or directory, stat 'xxx/lambdas/.build/.serverless'

     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information ---------------------------
     Operating System:          darwin
     Node Version:              8.12.0
     Serverless Version:        1.49.0
     Enterprise Plugin Version: 1.3.5
     Platform SDK Version:      2.1.0

Right after this failure, I try to deploy again using the same command now that there is a .build directory that was created.

error 2 (after running deploy a 2nd time)

Serverless: Using serverless-localstack
Serverless: Compiling with Typescript...
Serverless: Using local tsconfig.json
Serverless: Typescript compiled.

  Error --------------------------------------------------

  EPERM: operation not permitted, unlink 'xxx/lambdas/.build/node_modules'

     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information ---------------------------
     Operating System:          darwin
     Node Version:              8.12.0
     Serverless Version:        1.49.0
     Enterprise Plugin Version: 1.3.5
     Platform SDK Version:      2.1.0

If I deploy a 3rd time, or any more, I keep getting error 2.

If I now delete the .build directory and try the deploy command again, I get back to error 1 again, then 2.

serverless.yml
# For full config options, check the docs: https://serverless.com/framework/docs/providers/aws/guide/serverless.yml/
#    docs.serverless.com

service: name

plugins:
- serverless-plugin-typescript
- serverless-iam-roles-per-function
- serverless-localstack

custom:
localstack:
  host: http:://localhost
  stages: # list of stages for which the plugin should be enabled
    - local
  autostart: true # optional - start LocalStack in Docker on Serverless deploy
  endpoints:
    # This section is optional - can be used for customizing the target endpoints
    S3: http://localhost:4572
    DynamoDB: http://localhost:4570
    CloudFormation: http://localhost:4581
    Lambda: http://localhost:4574
  lambda: # Enable this flag to improve performance
    # https://github.com/localstack/serverless-localstack#mounting-lambda-code-for-better-performance
    mountCode: True
  docker: # Enable this flag to run "docker ..." commands as sudo
    sudo: False
serverless-iam-roles-per-function:
  defaultInherit: true
stageEnv: ${opt:stage, self:provider.stage}
dynamoTableName: name-${opt:stage}-Rooms
dynamoTableArn: !Join [ ':', [ 'arn:aws:dynamodb', !Ref 'AWS::Region', !Ref 'AWS::AccountId', 'table/${self:custom.dynamoTableName}' ] ]
createServerLambda: !Join [ '-', [ !Ref 'AWS::StackName', 'CreateServer' ] ]
clusterName: !Join [ '-', [ !Ref 'AWS::StackName', 'ServerCluster' ] ]
serverServiceName: !Join ['-', [ !Ref 'AWS::StackName', 'NameServerService' ] ]
serverDockerImage: !Join [ '.', [ !Ref 'AWS::AccountId', 'dkr.ecr.us-west-2.amazonaws.com/name_server:${opt:stage}' ] ]
serverTaskDefinitionName: name-${opt:stage}-NameServerTaskDefinition
serverTaskDefinitionArn: !Join [ ':', [ 'arn:aws:ecs', !Ref 'AWS::Region', !Ref 'AWS::AccountId', 'task-definition/${self:custom.serverTaskDefinitionName}' ] ]
fargateSecurityGroupId: !Ref PublicAccessSG
vpcId: vpc-xxx
subnetOneId: subnet-xxx
igwId: igw-xxx
rtbId: !Ref PublicRouteTable

provider:
name: aws
stage: ${opt:stage, 'dev'} # https://serverless.com/framework/docs/providers/aws/guide/variables#recursively-reference-properties
runtime: nodejs10.x
region: us-west-2
memorySize: 256
cfLogs: true
logRetentionInDays: 14
deploymentBucket:
  name: name-deployments
iamRoleStatements: # inherited by all lambda functions
# https://serverless.com/framework/docs/providers/aws/guide/iam/
# https://medium.com/@glicht/serverless-framework-defining-per-function-iam-roles-c678fa09f46d
  - Effect: Allow
    Action:
      - logs:CreateLogGroup
      - logs:CreateLogStream
      - logs:PutLogEvents
    Resource: !Join [ ':', [ 'arn:aws:logs', !Ref 'AWS::Region', !Ref 'AWS::AccountId', 'log-group:/aws/lambda/*:*:*' ] ]
  - Effect: Allow
    Action:
      - s3:PutObject
    Resource: arn:aws:s3:::name-deployments
environment:
  stageEnv: ${self:custom.stageEnv}
  dynamoTableName: ${self:custom.dynamoTableName}
  createServerLambda: ${self:custom.createServerLambda}
  clusterName: ${self:custom.clusterName}
  serverTaskDefinitionArn: ${self:custom.serverTaskDefinitionArn}
  fargateSecurityGroupId: ${self:custom.fargateSecurityGroupId}
  subnetOneId: ${self:custom.subnetOneId}

functions:
AddParticipant:
  handler: handlers/AddParticipant.addParticipant
  events:
    - http:
        path: addParticipant
        method: post
  iamRoleStatements:
    - Effect: Allow
      Action:
        - dynamodb:GetItem
        - dynamodb:Query
      Resource: ${self:custom.dynamoTableArn}
CreateRoom:
  handler: handlers/CreateRoom.createRoom
  events:
    - http:
        path: createRoom
        method: post
  iamRoleStatements:
    - Effect: Allow
      Action:
        - lambda:InvokeFunction
      Resource: !Join [ ':', [ 'arn:aws:lambda', !Ref 'AWS::Region', !Ref 'AWS::AccountId', 'function', '${self:custom.createServerLambda}' ] ]
    - Effect: Allow
      Action:
        - dynamodb:PutItem
        - dynamodb:DeleteItem
        - dynamodb:GetItem
        - dynamodb:Query
        - dynamodb:UpdateItem
      Resource: ${self:custom.dynamoTableArn}
CreateServer:
  handler: handlers/CreateServer.createServer
  events:
    - http:
        path: createServer
        method: post
  iamRoleStatements:
    - Effect: Allow
      Action:
        - ecs:RunTask
      Resource: '*'
    - Effect: Allow
      Action:
        - iam:PassRole
      Resource: '*'
ServerStateChanged:
  handler: handlers/ServerStateChanged.serverStateChanged
  events:
    - cloudwatchEvent: # https://serverless.com/framework/docs/providers/aws/events/cloudwatch-event/
        description: "CloudWatch Event triggered when a server's state changes to Running"
        name: ServerRunning-${opt:stage}
        event:
          source:
            - aws.ecs
          detail-type:
            - 'ECS Task State Change'
          detail:
            clusterArn:
              - !GetAtt 'ECSCluster.Arn'
            lastStatus:
              - RUNNING
            desiredStatus:
              - RUNNING
    - cloudwatchEvent:
        description: "CloudWatch Event triggered when a server's state changes to Stopped"
        name: ServerStopped-${opt:stage}
        event:
          source:
            - aws.ecs
          detail-type:
            - 'ECS Task State Change'
          detail:
            clusterArn:
              - !GetAtt 'ECSCluster.Arn'
            lastStatus:
              - DEPROVISIONING
            desiredStatus:
              - STOPPED
  iamRoleStatements:
    - Effect: Allow
      Action:
        - dynamodb:PutItem
        - dynamodb:DeleteItem
        - dynamodb:Scan
      Resource: ${self:custom.dynamoTableArn}
    - Effect: Allow
      Action:
        - ec2:DescribeNetworkInterfaces
      Resource: '*'

resources:
Resources:
  # fargate task log group
  NameServerLogGroup:
    Type: AWS::Logs::LogGroup
    Properties:
      LogGroupName: !Join [ '-', [ /ecs/, !Ref 'AWS::StackName', 'ZServerTaskDefinition' ] ]
  NameServerTaskDefinition:
    Type: AWS::ECS::TaskDefinition
    DependsOn: NameServerLogGroup # make sure the log group is created before it is used.
    Properties:
      # name of the task definition. Subsequent versions of the task definition are grouped together under this name.
      Family: !Join [ '-', [ !Ref 'AWS::StackName', 'NameServerTaskDefinition' ] ]
      # awsvpc is required for Fargate
      NetworkMode: awsvpc
      RequiresCompatibilities:
        - FARGATE
      # 256 (.25 vCPU) - Available memory values: 0.5GB, 1GB, 2GB
      # 512 (.5 vCPU) - Available memory values: 1GB, 2GB, 3GB, 4GB
      # 1024 (1 vCPU) - Available memory values: 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB
      # 2048 (2 vCPU) - Available memory values: Between 4GB and 16GB in 1GB increments
      # 4096 (4 vCPU) - Available memory values: Between 8GB and 30GB in 1GB increments
      Cpu: 1024
      # 0.5GB, 1GB, 2GB - Available cpu values: 256 (.25 vCPU)
      # 1GB, 2GB, 3GB, 4GB - Available cpu values: 512 (.5 vCPU)
      # 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB - Available cpu values: 1024 (1 vCPU)
      # Between 4GB and 16GB in 1GB increments - Available cpu values: 2048 (2 vCPU)
      # Between 8GB and 30GB in 1GB increments - Available cpu values: 4096 (4 vCPU)
      Memory: 2GB
      # The ARN of the task execution role that containers in this task can assume. 
      # All containers in this task are granted the permissions that are specified in this role.
      ExecutionRoleArn: !GetAtt 'FargateTaskExecutionRole.Arn'
      ContainerDefinitions:
        - Name: ${self:custom.serverServiceName}
          Image: ${self:custom.serverDockerImage}
          PortMappings:
            - ContainerPort: 3000
          # Send logs to CloudWatch Logs
          LogConfiguration:
            LogDriver: awslogs
            Options:
              awslogs-region: !Ref AWS::Region
              awslogs-group: !Ref NameServerLogGroup
              awslogs-stream-prefix: ecs
  # ECS cluster which spins up fargate servers
  ECSCluster:
    Type: AWS::ECS::Cluster
    Properties:
      ClusterName: ${self:custom.clusterName}
      Tags:
        - Key: name
          Value: name-serverless-ecs-cluster
  # role for the fargate task itself
  FargateTaskExecutionRole:
    Type: AWS::IAM::Role
    Properties:
      RoleName: !Join [ '-', [ !Ref 'AWS::StackName', 'FargateTaskExecutionRole' ] ]
      AssumeRolePolicyDocument:
        Statement:
          - Effect: Allow
            Principal:
              Service: ecs-tasks.amazonaws.com
            Action: 'sts:AssumeRole'
      ManagedPolicyArns:
        # allows fargate task to pull ECR image and write to cloudwatch logs
        - 'arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy'
  # security group used by lambda when spinning up a server fargate task (fully open)
  PublicAccessSG:
    Type: AWS::EC2::SecurityGroup
    Properties:
      GroupDescription: Access to and from the public
      VpcId: ${self:custom.vpcId}
      SecurityGroupIngress:
        # Allow inbound access from anywhere on the internet
        - CidrIp: 0.0.0.0/0
          IpProtocol: -1
      SecurityGroupEgress:
        # Allow outbound access from anywhere on the internet
        - CidrIp: 0.0.0.0/0
          IpProtocol: -1
      Tags:
        - Key: name
          Value: name-serverless-public-access-security-group

  # DynamoDB
  Rooms:
    Type: AWS::DynamoDB::Table
    Properties:
      TableName: ${self:custom.dynamoTableName}
      BillingMode: PAY_PER_REQUEST
      AttributeDefinitions:
        - AttributeName: roomId
          AttributeType: S
        - AttributeName: ipAddress
          AttributeType: S
      KeySchema:
        - AttributeName: roomId
          KeyType: HASH # partition key (can be multiple for given partition key, i.e. "available")
        - AttributeName: ipAddress
          KeyType: RANGE # sort key (unique & can be "available")

Outputs:
  ECSClusterArn:
    Description: The ARN of the ECS cluster
    Value: !GetAtt 'ECSCluster.Arn'
  FargateTaskDefinitionArn:
    Description: The ARN of the server task definition
    Value: ${self:custom.serverTaskDefinitionArn}
  RoomsDynamoDBTableArn:
    Description: The ARN of the DynamoDB table for managing room IP addresses
    Value: !GetAtt 'Rooms.Arn'
  DockerArn:
    Description: The ARN of the sever docker image
    Value: ${self:custom.serverDockerImage}

I've tried (unsuccssfully) rm -rf node_module/ && npm install --no-bin-links as suggested here

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.