GitHub - UlisesGascon/sample-terraform-localstack: Sample project to use Terraform, Localstack (AWS Local) and Docker compose with Nodejs (original) (raw)
Navigation Menu
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Sample terraform localstack
Sample project to use Terraform, Localstack (AWS Local) and Docker compose with Nodejs.
Important
As this is a simple example I will use only this references. Please change it 😉
AWS_ACCESS_KEY_ID='123'
AWS_SECRET_KEY='xyz'
AWS_BUCKET_NAME='demo-bucket'
AWS_BUCKET_REGION='us-east-1'
What is this about?
Previous Steps...
- You need to install Docker and Docker Compose to play this game 😉
- You need to simulate AWS in local?.
- I used Localstack as part of the docker compose dependencies. Let's keep it simple and clean 💪
- Just run
docker-compose up - Check
http://localhost:8055/#/infra
Time to play
- You need to run/test Terraform scripts?
- You need to install Terraform in your machine (for mac:
brew install terraform) - Check the example file
main.tf - Initialize the enviroment
terraform init - Execute it
terraform apply - Check
http://localhost:4572/andhttp://localhost:8055/#/infra
- You need to install Terraform in your machine (for mac:
- You need to run AWS Cli commands?
- You need to install AWS CLI (for mac:
brew install awscli) - Example of bucket creation
* Update you configaws configcheck.env
* Create Bucketaws --endpoint-url=http://localhost:4572 s3 mb s3://demo-bucket
* Attach an ACL to the bucket so it is readableaws --endpoint-url=http://localhost:4572 s3api put-bucket-acl --bucket demo-bucket --acl public-read - Check
http://localhost:4572/andhttp://localhost:8055/#/infra
- You need to install AWS CLI (for mac:
- You need to run SDK Scripts?
- Install Node
- Check
aws.jsandupload-demo.js - Install dependencies
npm install - Run the script
node upload-demo - Check
./localstack/datafiles
Context (Please Read)
- How to fake AWS locally with LocalStack by Joseph Thomas (@good-idea)
- System testing: Localstack + Terraform by Rodion Chachura (@RodionChachura)
- Gist | Terraform + Localstack by Diego Pacheco(@diegopacheco)
- Extra: Git Crypt Cheatsheet by @skylander
About
Sample project to use Terraform, Localstack (AWS Local) and Docker compose with Nodejs