This is a simple example of how to use Terraform with LocalStack to create AWS resources locally.
- Clone this repository
git clone https://github.com/leoguilen/terraform-localstack-aws.git terraform-localstack-aws
- Open the project in VSCode
cd terraform-localstack-aws
code .
- Set the
AWS_ACCESS_KEY_ID
,AWS_SECRET_ACCESS_KEY
andAWS_REGION
environment variables in the.devcontainer/devcontainer.json
file
"remoteEnv": {
"AWS_ACCESS_KEY_ID": "<aws-access-key-id>",
"AWS_SECRET_ACCESS_KEY": "<aws-secret-access-key>",
"AWS_REGION": "<aws-region>"
}
-
Reopen the project in the DevContainer
-
Run the
make
command to view the available commands
make
- Run the
make localstack-infra-up
command to initialize the Terraform project and create the infrastructure in LocalStack. Running this command will can see the SQS resources created in LocalStack:
AWS_PROFILE=localstack aws sqs list-queues
- Run the
make localstack-infra-down
command to destroy the infrastructure in LocalStack