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

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

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

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

variable "team_name" {
  description = "Team name for resources."
  type        = string
  default     = "devops"
}

variable "trusted_principals" {
  description = "List of IAM users or roles which can assume the RDS backup role."
  type        = list(string)
  default = [
    "arn:aws:iam::086679231553:role/lambda-shared-lambda-rds-refresh-delete-intermediate-snapshots",
    "arn:aws:iam::086679231553:role/lambda-shared-lambda-rds-refresh-get-db-info",
    "arn:aws:iam::086679231553:role/shared-rds-refresh-create-shareable-snapshot-task-role"
  ]
}

variable "role_session_duration" {
  description = "Session duration in seconds for the backup role."
  type        = number
  default     = 3600
}

variable "external_restore_accounts" {
  description = "External accounts that RDS backups can be restored to."
  type        = list(string)
  default     = ["619719722105"]
}

variable "external_id" {
  description = "External ID for the trust policy."
  type        = string
  default     = "QNUoYXgqXSvhyCN7BzaxJM8fEL313SNz"
}

locals {
  tags = {
    environment        = var.environment
    application_family = var.application_family
    project            = var.service_name
    terraformed        = true
  }
  external_restore_account_arns = [for account in var.external_restore_accounts : "arn:aws:iam::${account}:root"]
}
