provider "aws" {
  region = var.aws_region
}

# Terraform backends cannot contain interpolations
terraform {
  backend "s3" {
    bucket  = "qa-fansifter-terraform-state"
    key     = "qa/terraform-bootstrap/terraform.tfstate"
    region  = "us-east-1"
    encrypt = "true"
  }
}

module "terraform_state_bucket" {
  source             = "git@github.com:theorchard/terraform-s3.git//modules/s3_bucket?ref=3.1.5"
  env                = var.environment
  application_family = var.application_family
  bucket_name        = "${var.account_group}-terraform-state"

  apply_server_side_encryption_by_default = {
    sse_algorithm = "AES256"
  }
}
