provider "aws" {
  region = var.region
}

terraform {
  backend "s3" {
    bucket  = "prod-songwhip-terraform-state"
    key     = "prod/songwhip-bucket/terraform.tfstate"
    region  = "us-east-1"
    encrypt = "true"
  }
}

module "songwhip_bucket" {
    source = "git@github.com:theorchard/terraform-s3.git//modules/s3_bucket?ref=2.7.0"

    env                   = var.environment
    bucket_name           = "songwhip-bucket"
    custom_logging_bucket = "${var.environment}-songwhip-s3-logs"
    s3_read_only_policy   = true
    application_family    = var.application_family

    apply_server_side_encryption_by_default = {
      se_algorithm = "AES256"
    }
}
