variable "aws_region" {
  description = "Default AWS region to use"
  type        = string
  default     = "us-east-1"
}

variable "inactivate" {
  description = "Inactivate tag for IAM users"
  type        = string
  default     = "True"
}

variable "path" {
  description = "Path for IAM users"
  type        = string
  default     = "/"
}

variable "session_duration" {
  description = "Max session duration for IAM Roles"
  type        = number
  default     = 3600
}

variable "account_id" {
  description = "AWS Account Number For sme-dx3-dev"
  type        = string
  default     = "765134955759"
}

output "account" {
  value = var.account_id
}

variable "cloudops_admin_role_tag" {
  description = "Used to tag an IAM role as CloudOps-owned"
  type        = map(string)

  default = {
    CLOPS_ADM_ROLE = "YES"
  }
}

variable "environment" {
  type    = string
  default = "dev"
}

variable "service_name" {
  type    = string
  default = "shared-atlantis"
}

variable "terrastate_bucket" {
  type    = string
  default = "dev-dx3-terraform-state"
}

variable "lambda_function_arns_to_invoke" {
  type        = list(string)
  description = <<EOT
List of lambda function arns for which to allow Atlantis to lambda:InvokeFunction.
An example reason to grant this if Atlantis needs the ability to use the
lambda function for configuring a Secrets Manager Secret Rotation.

Do not include wildcards; this module will take care of it.
  EOT
  default     = []
}

locals {
  wildcard_lambda_function_arns_to_invoke = [
    for arn in var.lambda_function_arns_to_invoke : "${arn}:*"
  ]

  lambda_function_arns_to_invoke = concat(
    var.lambda_function_arns_to_invoke,
    local.wildcard_lambda_function_arns_to_invoke,
  )
}

variable "application_family" {
  description = "The application family for the account"
  default     = "devops"
}


variable "admin_principals" {
  description = "A list of IAM principals that are allowed to assume the account admin role"
  default = [
    "arn:aws:iam::437795906767:user/jdenniss",
    "arn:aws:iam::437795906767:user/ntursunkul",
    "arn:aws:iam::437795906767:user/rdemoose",
    "arn:aws:iam::437795906767:user/rutra",
    "arn:aws:iam::437795906767:user/tmoin",
    "arn:aws:iam::437795906767:user/bbabiy",
    "arn:aws:iam::437795906767:user/tshagapov",
    "arn:aws:iam::437795906767:user/ikorniienko",
    "arn:aws:iam::437795906767:user/jlim",
    "arn:aws:iam::437795906767:user/dhiggins",
    "arn:aws:iam::437795906767:user/ebegovic",
  ]
}


locals {
  tags = {
    environment        = var.environment
    application_family = var.application_family
    terraformed        = true
  }
}
