Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/crazyoptimist/terraform-s3-backend-module
Terraform Flat Module Implementation with AWS S3 Backend Implementation
https://github.com/crazyoptimist/terraform-s3-backend-module
Last synced: 13 days ago
JSON representation
Terraform Flat Module Implementation with AWS S3 Backend Implementation
- Host: GitHub
- URL: https://github.com/crazyoptimist/terraform-s3-backend-module
- Owner: crazyoptimist
- Created: 2021-12-28T06:21:47.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-04T17:30:54.000Z (almost 3 years ago)
- Last Synced: 2024-10-03T21:41:14.636Z (about 1 month ago)
- Language: HCL
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Terraform AWS S3 Backend Module
Flat module implementation for s3 backend
![image](https://user-images.githubusercontent.com/55074937/147535173-76bebe21-696e-4f4a-927c-0ff0c68d6bd6.png)
Detailed architecture diagram showing the four distinct components that make up this module
## Usage
Deploy your terraform backend infra securely to AWS S3 bucket```terraform
provider "aws" {
region = "us-west-2"
}module "s3backend" {
source = "git::github.com/crazyoptimist/terraform-s3-backend-module"
namespace = "crazy-team"
}output "s3backend_cofig" {
value = {
bucket = module.s3backend.config.bucket
region = module.s3backend.config.region
role_arn = module.s3backend.config.role_arn
dynamodb_table = module.s3backend.config.dynamodb_table
}
}
```After that, use the result infra as your terraform backend like so:
```terraform
terraform {
backend "s3" {
bucket = BUCKET_NAME
key = SUB_FOLDER_NAME_YOU_LIKE
region = BUCKET_REGION
encrypt = true
role_arn = ROLE_ARN
dynamodb_table = TABLE_NAME
}
required_version = ">= 1.1.2"
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 3.70"
}
}
}
```## Credits
All the contents used in the repo are from "Terraform in Action" by Winkler S.