module "default_tags" {
  source             = "git@github.com:theorchard/terraform-default-tags.git//?ref=2.0.0"
  environment        = var.environment
  application_family = var.application_family
  team_name          = var.team_name
}

provider "aws" {
  region = var.aws_region

  default_tags {
    tags = module.default_tags.tags
  }
}

# Terraform backends cannot contain interpolations
terraform {
  backend "s3" {
    bucket  = "orcd-terraform-state"
    key     = "prod/iam/groups/d2c/terraform.tfstate"
    region  = "us-east-1"
    encrypt = "true"
  }
}

module "group_with_attachments" {
  source = "git@github.com:theorchard/terraform-iam-policies.git//modules/groups?ref=1.22.4"

  group_name = "d2c"
  users      = [
    "cbeesley",
    "mcedaro",
  ]
  application_families_to_access = []
  iam_roles_to_access = [
    "arn:aws:iam::811473064144:role/d2c-role", # ecommerce-qa
    "arn:aws:iam::997286397029:role/d2c-role", # ecommerce-prod
  ]
}
