init
This commit is contained in:
commit
97f9a95415
21 changed files with 2963 additions and 0 deletions
45
infra/backend.tf
Normal file
45
infra/backend.tf
Normal file
|
@ -0,0 +1,45 @@
|
|||
# Backend infrastructure for Terraform state management
|
||||
# This should be run first, before the main configuration
|
||||
|
||||
resource "aws_s3_bucket" "terraform_state" {
|
||||
bucket = "calculator-127local-net-terraform-state"
|
||||
tags = var.tags
|
||||
}
|
||||
|
||||
resource "aws_s3_bucket_versioning" "terraform_state" {
|
||||
bucket = aws_s3_bucket.terraform_state.id
|
||||
versioning_configuration {
|
||||
status = "Enabled"
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_s3_bucket_server_side_encryption_configuration" "terraform_state" {
|
||||
bucket = aws_s3_bucket.terraform_state.id
|
||||
|
||||
rule {
|
||||
apply_server_side_encryption_by_default {
|
||||
sse_algorithm = "AES256"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_s3_bucket_public_access_block" "terraform_state" {
|
||||
bucket = aws_s3_bucket.terraform_state.id
|
||||
block_public_acls = true
|
||||
block_public_policy = true
|
||||
ignore_public_acls = true
|
||||
restrict_public_buckets = true
|
||||
}
|
||||
|
||||
resource "aws_dynamodb_table" "terraform_state_lock" {
|
||||
name = "terraform-state-lock"
|
||||
billing_mode = "PAY_PER_REQUEST"
|
||||
hash_key = "LockID"
|
||||
|
||||
attribute {
|
||||
name = "LockID"
|
||||
type = "S"
|
||||
}
|
||||
|
||||
tags = var.tags
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue