variable "region" {
  description = "The AWS resources region"
  default     = "us-east-1"
}

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

variable "service_name" {
  description = "The name of the associated application."
  default     = "rds-backup"
}

variable "application_family" {
  description = "The name of the application family."
  default     = "devops"
}

variable "account_ids_to_back_up" {
  type = list(object(
    {
      account_id = string
      kms_key_id = string
    }
  ))
  description = "List of AWS account IDs to back up"
  default = [
    {
      "account_id" : "437795906767",
      "kms_key_id" : "0a6fc45b-0bf9-43a9-b73f-d1d02564aca4",
    },
    {
      "account_id" : "737325105821",
      "kms_key_id" : "1c0d040a-de16-41d8-a36a-ee20f7115757",
    },
    {
      "account_id" : "086679231553",
      "kms_key_id" : "b49c4d72-4246-41d9-9224-d6d5da468ded",
    },
    {
      "account_id" : "682033496752",
      "kms_key_id" : "bc78fcb9-a979-48e1-9433-6517a8fed815",
    },
    {
      "account_id" : "588827373449",
      "kms_key_id" : "16aa69b5-22fb-4c3b-8df2-0e577f6ebb13",
    },
    {
      "account_id" : "997286397029",
      "kms_key_id" : "5fed73fe-415d-43f4-a89e-16abfc940847",
    },
  ]
}

variable "cross_account_backup_role_name" {
  description = "Name of IAM role to assume in each AWS account. Should be the same across accounts"
  default     = "prod-rds-backup-role"
}

variable "recovery_account_ids" {
  type        = list(string)
  description = "List of AWS account IDs that can use recovery KMS key"
  default     = []
}

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

variable "create_shareable_snapshot_task_revision" {
  default = "102"
}

variable "manage_backup_snapshots_task_revision" {
  default = "100"
}

variable "external_id" {
  type        = string
  description = "The external ID to use when assuming roles in other accounts"
  default     = "Yx20tijzVMwQ9eVYvdMv7nbTJijU4RBB"
}

variable "shared_account_id" {
  type        = string
  description = "AWS account ID for shared resources where extract_native_configuration lambda lives"
  default     = "086679231553"
}
