Skip to content

Instantly share code, notes, and snippets.

@shreeegupta
Created May 26, 2023 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shreeegupta/74ef088342a19bfd7d6a1dffde2badae to your computer and use it in GitHub Desktop.
Save shreeegupta/74ef088342a19bfd7d6a1dffde2badae to your computer and use it in GitHub Desktop.
backend.tf
# Backend Variables
variable "state_bucket_name" {
default = "2-tier-state-bucket"
}
variable "state_table_name" {
default = "2-tier-state-table"
}
# backend resources
resource "aws_dynamodb_table" "my_state_table" {
name = var.state_table_name
billing_mode = "PAY_PER_REQUEST"
hash_key = "LockID"
attribute {
name = "LockID"
type = "S"
}
tags = {
Name = var.state_table_name
}
}
resource "aws_s3_bucket" "my_state_bucket" {
bucket = var.state_bucket_name
tags = {
Name = var.state_bucket_name
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment