variable "aws_region" {
  default     = "us-east-1"
  description = "All elements of the state machine execution flow have to be placed in the same region."
}

variable "environment" {
  description = "Available values:  dev, qa, prod."
  default     = "shared"
}

variable "service_name" {
  default = "base-amis"
}

variable "application_family" {
  default = "devops"
}

variable "ami_consumer_accounts" {
  default = [
    "437795906767",
    "103233932089",
    "290365479392",
    "619719722105",
    "926734670777",
    "734458723522",
    "989790945997",
    "375914681009",
    "086679231553",
    "031099521156",
    "079637511089",
    "285943604611",
    "737325105821",
    "725764004555",
    "801577982711",
    "745243859288",
    "807702934854",
    "475275892927",
    "323555055331",
    "483193324480",
    "890208661333",
    "313114233826",
    "582412345909",
    "885200931856",
    "703740486246",
    "322697034778",
    "814622134907",
    "009424872958",
    "311141540202",
    "710271914708",
    "682033496752",
    "591204808501",
    "699475937692",
    "635057242373",
    "588827373449",
    "918817604416",
    "613871678587",
    "554998489284",
    "799833541840",
    "765134955759",
    "811473064144",
    "997286397029",
    "969009837416",
    "058029036333",
    "023180329437",
    "793676410512",
    "887829410671",
    "156555176793",
    "280383026186",
    "718729873097",
    "729038418454",
    "107577002119",
    "635220336377",
    "230315258045",
    "104858398257",
    "638682502729",
    "715641587426",
    "844930103112",
    "130080192946",
    "361463692799",
    "981599956623",
    "504436705349",
  ]
}

variable "ami_consumer_accounts_with_autoscaling" {
  default = [
    "437795906767", # prod
    "103233932089", # dev
  ]
}

locals {
  ami_consumer_account_arns = concat(
    [for account in var.ami_consumer_accounts : "arn:aws:iam::${account}:root"],
    [for account in var.ami_consumer_accounts_with_autoscaling : "arn:aws:iam::${account}:role/aws-service-role/autoscaling.amazonaws.com/AWSServiceRoleForAutoScaling"],
  )
}
