Menu

Getting Started with LocalStack - Testing CloudFormation and S3 Locally
📰

Getting Started with LocalStack - Testing CloudFormation and S3 Locally

DEV Community: aws·kawasaki031677·8 days ago
#dME196dA
#devtoaws#devto#dev#localstack#cloudformation
Reading 0:00
15s threshold

What is LocalStack?

LocalStack is a tool that allows you to simulate AWS services in a local environment. You can test and develop resources like S3 and Lambda without using a cloud environment. This time, I'll demonstrate using CloudFormation to create an S3 bucket with LocalStack.

Running It Locally

Create a docker-compose.yml file with the following content:

version : ' 3.8'

services : localstack : image : localstack/localstack ports : - " 4566:4566" # LocalStack unified endpoint environment : - SERVICES=cloudformation,s3,dynamodb # Specify services to enable as comma-separated values - DEBUG=1 # Enable debug mode

Enter fullscreen mode

Exit fullscreen mode

Next, run the following command to start LocalStack:

$ docker-compose up -d

Enter fullscreen mode

Exit fullscreen mode

Deploying CloudFormation

Let me write a sample CloudFormation template:

AWSTemplateFormatVersion : ' 2010-09-09' Resources : MyBucket : Type : AWS::S3::Bucket Properties : BucketName : my-localstack-bucket

Enter…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.