# General settings
variable "aws_region" {
  default     = "us-east-1"
  description = "Which AWS region to spin up the environment in"
}

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

variable "service_name" {
  default = "orcd-cdn"
}

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

variable "domain_name" {
  description = "Name of domain"
  default     = "theorchard.io"
}

# Cloudfront settings
variable "allowed_methods" {
  description = "Allowed HTTP methods for Cloudfront"
  default     = ["HEAD", "GET", "OPTIONS"]
}

variable "cached_methods" {
  description = "Cached HTTP methods for Cloudfront"
  default     = ["HEAD", "GET"]
}

variable "default_ttl" {
  description = "Default TTL for objects in absence of cache headers"
  default     = "86400"
}

variable "cloudfront_minimum_protocol_version" {
  description = "Minimum SSL protocol"
  default     = "TLSv1.2_2021"
}

variable "cloudfront_logging_bucket" {
  description = "Bucket to use for cloudfront logging"
  default     = "shared-orcd-cloudfront-logs.s3.amazonaws.com"
}

variable "failover_criteria_status_codes" {
  type        = list(number)
  description = "List of status codes that comprise S3 origin failover criteria"
  default = [
    403,
    500,
    502,
    503,
  ]
}

variable "s3_origin_group_name" {
  description = "The name of the S3 origin group for CloudFront"
  default     = "s3_origin_group"
}

variable "frontend_royalties_origin_access_identity_arns" {
  type        = list(string)
  description = "Origin access identity ARNs that can access frontend-royalties"
  default = [
    "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E32OI557S01TCJ", # uat-abacus
  ]
}

variable "frontend_documents_origin_access_identity_arns" {
  type        = list(string)
  description = "Origin access identity ARNs that can access frontend-documents"
  default = [
    "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E3KIMX1F86CZKK", # uat-documents
  ]
}

variable "frontend_documents_awal_origin_access_identity_arns" {
  type        = list(string)
  description = "Origin access identity ARNs that can access frontend-documents"
  default = [
    "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity E3H7OO6TSQV5VQ", # uat-documents awal
  ]
}
