https://github.com/devops-360-online/localstack-terraform
Terraform configurations designed to run on LocalStack, providing a local environment for cloud development. By leveraging LocalStack, you can simulate AWS cloud resources on your local machine, offering a cost-effective and efficient way to develop and test your Terraform scripts. This setup allows seamless integration and testing of AWS services.
https://github.com/devops-360-online/localstack-terraform
aws localstack terraform
Last synced: 4 months ago
JSON representation
Terraform configurations designed to run on LocalStack, providing a local environment for cloud development. By leveraging LocalStack, you can simulate AWS cloud resources on your local machine, offering a cost-effective and efficient way to develop and test your Terraform scripts. This setup allows seamless integration and testing of AWS services.
- Host: GitHub
- URL: https://github.com/devops-360-online/localstack-terraform
- Owner: devops-360-online
- Created: 2023-12-13T14:28:54.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-17T09:39:53.000Z (about 2 years ago)
- Last Synced: 2025-06-27T08:42:22.352Z (6 months ago)
- Topics: aws, localstack, terraform
- Language: HCL
- Homepage:
- Size: 139 KB
- Stars: 2
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LocalStack-Terraform Setup
This README provides instructions for setting up and using a LocalStack environment with Terraform to simulate AWS cloud resources locally.
## Prerequisites
Ensure you have the following installed:
- Docker
- Docker Compose
- Terraform
## Getting Started
### Step 1: Start LocalStack
Use Docker Compose to launch LocalStack:
```bash
docker-compose up -d
```
This command starts LocalStack in detached mode.
### Step 2: Terraform
Run the following command to initialize your Terraform workspace, which will download the necessary plugins, Apply your Terraform configuration using mock AWS credentials (since LocalStack doesn't validate them):
```bash
terraform init
AWS_ACCESS_KEY_ID=fake AWS_SECRET_ACCESS_KEY=fake terraform apply
```
This sets the AWS access and secret keys to 'fake' and applies your Terraform configurations to the LocalStack environment.
The `main.tf` in this repository is configured to create an S3 bucket named `devops-360-demo-localstack` and upload the `cat.png` image to it. To view this image, you can access it via the following URL when running LocalStack:
[http://devops-360-demo-localstack.s3.localhost.localstack.cloud:4566/cat.png](http://devops-360-demo-localstack.s3.localhost.localstack.cloud:4566/cat.png)
And you will see this:
