Skip to main content

LocalStack

https://www.localstack.cloud/

LocalStack is a cloud service emulator that runs in a single container on your laptop or in your CI environment. With LocalStack, you can run your AWS applications or Lambdas entirely on your local machine without connecting to a remote cloud provider! Whether you are testing complex CDK applications or Terraform configurations, or just beginning to learn about AWS services, LocalStack helps speed up and simplify your testing and development workflow.

LocalStack supports a growing number of AWS services, like AWS Lambda, S3, Dynamodb, Kinesis, SQS, SNS, and many more! The Pro version of LocalStack supports additional APIs and advanced features. You can find a comprehensive list of supported APIs on our ☑️ Feature Coverage page.

LocalStack also provides additional features to make your life as a cloud developer easier! Check out LocalStack’s User Guides for more information.

Example #1

We will use docker-compose. For that, we download the base version of docker-compose.yml from the GitHub repository of LocalStack and customize it:

Install Docker Image (GitHub repository of LokcalStack)

  • Run:
docker compose -f localstack-compose.yaml up
awslocal s3api create-bucket \
--bucket mybucket

Output:

{
"Location": "/mybucket"
}

awslocal s3api list-buckets

Output:

{
"Buckets": [
{
"Name": "mybucket",
"CreationDate": "2024-08-27T16:43:18+00:00"
}
],
"Owner": {
"DisplayName": "webfile",
"ID": "75aa57f09aa0c8caeab4f8c24e99d10f8e7faeebf76c078efc7c6caea54ba06a"
}
}

Example #2

Install Desktop

Create S3 bucket on LocalStack

  • Run: Docker Desktop
  • Run: localstack start
  • Run: localstack-script/script.sh:
awslocal s3api create-bucket \
--bucket mybucket

Output

localstack-example-s3.png