provider "aws" {
  region = var.aws_region
}
# Terraform backends cannot contain interpolations
terraform {
  backend "s3" {
    bucket  = "dev-orcd-terraform-state"
    key     = "dev/terraform-aws-waf/terraform.tfstate"
    region  = "us-east-1"
    encrypt = "true"
  }
}

module "environment_web_acls" {
  source            = "git@github.com:theorchard/terraform-aws-waf.git//?ref=2.0.2"
  environment       = var.environment
  aws_region        = var.aws_region
  count_waf_enabled = true
  block_waf_enabled = true
  excluded_rules = [
    "NoUserAgent_HEADER",
    "SizeRestrictions_BODY",
  ]

  geoip_blocked_countries = ["AQ"] # Antarctica
}

module "gsirt_blocking_rule_group" {
  source      = "git@github.com:theorchard/terraform-gsirt-waf-ip-block-rule.git//?ref=1.1.1"
  environment = var.environment
}
