https://github.com/angelmadames/terraform-s3-dynamodb-backend
A small Terraform-based script to deploy an S3 bucket for state management and a DynamoDB table for state locking.
https://github.com/angelmadames/terraform-s3-dynamodb-backend
backend dynamodb remote s3 state terraform
Last synced: over 1 year ago
JSON representation
A small Terraform-based script to deploy an S3 bucket for state management and a DynamoDB table for state locking.
- Host: GitHub
- URL: https://github.com/angelmadames/terraform-s3-dynamodb-backend
- Owner: angelmadames
- License: mit
- Created: 2024-04-04T22:25:21.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-16T21:24:21.000Z (over 1 year ago)
- Last Synced: 2025-01-16T22:27:38.078Z (over 1 year ago)
- Topics: backend, dynamodb, remote, s3, state, terraform
- Language: HCL
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Terraform S3 + DynamoDB Backend Module
[](https://github.com/angelmadames/terraform-s3-dynamodb-backend/actions/workflows/test.yml)
[](https://github.com/angelmadames/terraform-s3-dynamodb-backend/actions/workflows/tflint.yml)
## ๐ Contents
- [๐ Overview](#-overview)
- [โ๏ธ Setup](#๏ธ-setup)
- [๐๏ธ Usage](#๏ธ-usage)
- [๐ License](#-license)
## ๐ Overview
This repository contains a small Terraform module that sets up an S3 bucket and DynamoDB table as a backend for Terraform state. It's not meant to be too complex, so the state is local.
Use it to quickly provision backends for your Terraform projects.
The tools/platforms used in this project include:
- **Terraform**: an infrastructure as code tool used to define and provision infrastructure resources.
- **AWS**: the Cloud Service Provider that runs the services S3 and DynamoDB.
The resources it creates are related to the following AWS services:
- **S3**: Amazon Simple Storage Service, a scalable object storage service.
Used for storing and managing the state.
- **DynamoDB**: a fully managed NoSQL database service provided by AWS.
Used for state locking mechanism.
## โ๏ธ Setup
> โน๏ธ I use `asdf` to manage multiple tools versions in my local environment.
> You can choose to install the tools required in your preferred way.
To get started, first install all required tools with `asdf`:
```bash
# Will install all tools defined in the .tool-versions file
asdf install
```
## ๐๏ธ Usage
The usage is simple, simply:
1. Update the variables in the `inputs.tfvars` file, or use `-var` to pass the values to the Terraform CLI.
2. Set up your AWS credentials. I recommend using profiles or assumable roles, but feel free
to choose your preferred method of authentication.
3. Run `terraform plan` and then `terraform apply` if the resources definitions match your expectations.
## ๐ License
This project is licensed under the MIT License.
See the [LICENSE](LICENSE) file for details.