Skip to content

Instantly share code, notes, and snippets.

@ozooxo
Last active August 2, 2021 17:44
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ozooxo/67d17b05dbb254997f4f4333efd3fc1d to your computer and use it in GitHub Desktop.
Save ozooxo/67d17b05dbb254997f4f4333efd3fc1d to your computer and use it in GitHub Desktop.
Install LocalStack (Mac)
pip install --user localstack
brew install nose

Modify ~/.zshrc to add

export PATH="/Users/cynthia/Library/Python/3.6/bin:${PATH}"

Then localstack start should work.


Currently faces a lot of errors from S3 (other people have the same issue):

File "...python/site-packages/localstack/services/s3/s3_starter.py", line 32, in check_s3
    assert isinstance(out['Buckets'], list)
TypeError: 'NoneType' object is not subscriptable

If we are not using S3, it is possible to avoid it if we only start the AWS services we need to work on.

SERVICES=sqs,ec2 localstack start

Use it with Terraform (refer to System testing: Localstack + Terraform)

provider "aws" {
    skip_credentials_validation = true
    skip_metadata_api_check     = true
    s3_force_path_style         = true
    access_key                  = "mock_access_key"
    secret_key                  = "mock_secret_key"
    endpoints {
        dynamodb     = "http://localhost:4569"
        lambda       = "http://localhost:4574"
    }
}
@SteveFromAccounting
Copy link

This helped me figure it out on Catalina (10.15.6). I needed to install localstack using pip3 (via Python 3.8 installed by Homebrew):

$ pip3 install --user localstack

Then modified ~/.zshrc to add:

export PATH="${HOME}/Library/Python/3.8/bin:${PATH}".

Had to remember to make sure and use the proper version of Python in the PATH, which for me was 3.8

@ravithejappl
Copy link

@SteveFromAccounting I am still not able to run, I follwed you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment