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: 4 months 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 (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-04T17:30:54.000Z (over 3 years ago)
- Last Synced: 2025-02-05T22:59:02.355Z (5 months 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

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.