# General settings.
variable "aws_region" {
  description = "AWS region."
  type        = string
  default     = "us-east-1"
}

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

variable "service_name" {
  description = "Service name for resources."
  type        = string
  default     = "break-glass"
}

variable "application_family" {
  description = "Application family to which this project belongs."
  type        = string
  default     = "devops"
}

# IAM settings.
variable "role_session_duration" {
  description = "Session duration in seconds for break-glass role."
  type        = number
  default     = 7200
}

variable "role_policies" {
  description = "List of existing IAM policies attached to break-glass role."
  type        = list(string)
  default = [
    "orchard-shared-engineering-iam-access-policy",
    "orchard-shared-engineering-read-policy",
  ]
}

locals {
  break_glass_role_name                       = "${var.environment}-${var.service_name}-access-role"
  break_glass_validate_role_name              = "${var.environment}-${var.service_name}-validate-role"
  break_glass_elevate_permissions_policy_name = "${var.environment}-${var.service_name}-elevate-permissions-access-policy"

  tags = {
    environment        = var.environment
    application_family = var.application_family
    project            = var.service_name
    terraformed        = true
  }
}
