Open pablobuild opened 2 years ago
Something like:
docker-compose.yml
# Local Stack
localstack:
image: localstack/localstack:latest
environment:
- LAMBDA_EXECUTION_ROLE=docker-reuse
- AWS_ACCESS_KEY_ID=test
- AWS_SECRET_ACCESS_KEY=test
- AWS_DEFAULT_REGION=us-west-2
- DOCKER_HOST=unix:///var/run/docker.sock
- SERVICES=lambda,cloudwatch,sqs,iam,events
ports:
- '4566-4583:4566-4583'
terraform/modules/localstack/main.tf
provider "aws" {
region = "us-west-2"
# access_key = "fake"
# secret_key = "fake"
skip_credentials_validation = false
skip_metadata_api_check = true
skip_requesting_account_id = false
endpoints {
lambda = "http://localhost:4566"
iam = "http://localhost:4566"
sqs = "http://localhost:4566"
cloudwatch = "http://localhost:4566"
cloudwatchlogs = "http://localhost:4566"
events = "http://localhost:4566"
}
}
# Modules
module "yourmodule" {
source = "../modules/yourmodule"
environment = "local"
database_url = var.DATABASE_URL
}
Then cd
to the localstack module and run terraform init
then terraform apply
to launch a localstack.
Is there a localstack sample available?