##################### COMMON VARIABLES #######################
variable "environment" {
  description = "Environment name"
  default     = "dev"
}

variable "account_group" {
  description = "The name of the account group that the account belongs to"
  default     = "aoma-core"
}

variable "account_name" {
  description = "Name of the AWS account"
  type        = string
  default     = "sme-india-dev"
}

variable "region" {
  description = "Default AWS region"
  type        = string
  default     = "eu-central-1"
}

variable "assume_role" {
  description = "The role used for infra changes"
  type        = string
  default     = "arn:aws:iam::969009837416:role/AnsibleAWSServiceAccess-AOMA-D"
}

variable "tags" {
  description = "A map of tags to add to all resources"
  type        = map(string)

  default = {
    Terraform     = "True"
    Business-Unit = "AOMA-Core"
    Environment   = "Dev"
    Name          = "BETABASE-D"
    Owner         = "matt.carpenter.asburymedia@sonymusic.com"
    Project-Code  = "SME-2000-XXXX"
    Project-Name  = "BetaBase"
    POC : "matt.carpenter.asburymedia@sonymusic.com"
    CLOPS_FW  = "NO"
  }
}

variable "https_port" {
  description = "HTTPS Port"
  type        = number
  default     = 443
}

##################### SECURITY GROUPS VARIABLES #######################

variable "sg_use_name_prefix" {
  description = "To use SG prefix"
  type        = bool
  default     = false
}

##################### VPC VARIABLES #######################

variable "vpc_name" {
  description = "VPC Name"
  type        = string
  default     = "BETABASE-D"
}

variable "vpc_cidr" {
  description = "Primary VPC CIDR"
  type        = string
  default     = "10.250.202.0/26"
}

variable "secondary_cidr_blocks" {
  description = "Secondary CIDR blocks"
  type        = list(string)
  default     = ["10.250.202.64/27"]
}

variable "public_subnets" {
  description = "Public Subnets"
  type        = list(string)
  default     = ["10.250.202.64/28", "10.250.202.80/28"]
}

variable "private_subnets" {
  description = "Private Subnets"
  type        = list(string)
  default     = ["10.250.202.0/28", "10.250.202.16/28"]
}

variable "database_subnets" {
  description = "Database Subnets"
  type        = list(string)
  default     = ["10.250.202.32/28", "10.250.202.48/28"]
}

variable "intra_subnets" {
  description = "Intra Subnets"
  type        = list(string)
  default     = []
}

variable "emr_subnets" {
  description = "Elastic cache Subnets"
  type        = list(string)
  default     = []
}

variable "create_redshift_subnet_group" {
  description = "To create redshift subnet group"
  type        = bool
  default     = false
}

variable "dhcp_domain_name_servers" {
  description = "DNS IPS"
  type        = list(string)
  default     = ["162.49.203.44", "10.250.197.130"]
}

variable "local_s3_arn" {
  description = "Flow logs stored in same account S3 bucket"
  type        = string
  default     = "arn:aws:s3:::sme-betabase-dev-s3-euc1-logs"
}

variable "centralised_s3_arn" {
  description = "Flow logs stored in centralised account S3 bucket"
  type        = string
  default     = "arn:aws:s3:::sme-core-cloud-compliance-centralised-vpc-flowlogs"
}

variable "enable_dhcp_options" {
  description = "To enable DHCP options for VPC"
  type        = bool
  default     = true
}

variable "flow_log_max_aggregation_interval" {
  description = "VPC Flow logs interval"
  type        = number
  default     = 600
}

variable "flow_log_cloudwatch_iam_role_arn" {
  description = "IAM role ARN for flow logs"
  type        = string
  default     = "arn:aws:iam::969009837416:role/flowlogsRole"
}

variable "route_zone" {
  description = "Route53 zone name for this VPC"
  type        = string
  default     = "smebetabased"
}

variable "instance_tenancy" {
  description = "Instance Tenancy for this VPC"
  type        = string
  default     = "default"
}

variable "enable_network_address_usage_metrics" {
  description = "enable_network_address_usage_metrics"
  type        = bool
  default     = false
}

variable "enable_dns_support" {
  description = "enable_dns_support"
  type        = bool
  default     = true
}

variable "enable_dns_hostnames" {
  description = "enable_dns_hostnames"
  type        = bool
  default     = true
}

variable "assign_generated_ipv6_cidr_block" {
  description = "assign_generated_ipv6_cidr_block"
  type        = bool
  default     = false
}

variable "assign_ipv6_address_on_creation" {
  description = "assign_ipv6_address_on_creation"
  type        = bool
  default     = false
}

variable "enable_dns64" {
  description = "enable_dns64"
  type        = bool
  default     = false
}

variable "enable_resource_name_dns_a_record_on_launch" {
  description = "enable_resource_name_dns_a_record_on_launch"
  type        = bool
  default     = false
}

variable "enable_resource_name_dns_aaaa_record_on_launch" {
  description = "enable_resource_name_dns_aaaa_record_on_launch"
  type        = bool
  default     = false
}

variable "ipv6_native" {
  description = "ipv6_native"
  type        = bool
  default     = false
}

variable "map_public_ip_on_launch" {
  description = "ipv6_native"
  type        = bool
  default     = false
}

variable "private_dns_hostname_type_on_launch" {
  description = "private_dns_hostname_type_on_launch"
  type        = string
  default     = "ip-name"
}

variable "resource_share_principals" {
  type        = set(string)
  description = "List of principals to share resources with using RAM"
  default = [
    "arn:aws:organizations::970903126758:ou/o-bqioddgr91/ou-ax9e-vu43qt3i", # The Orchard OU
    "arn:aws:organizations::970903126758:ou/o-bqioddgr91/ou-ax9e-ouayejxi", # Data Strategy aka GDB OU
  ]
}

##################### EC2 VARIABLES #######################

variable "default_ami" {
  description = "AMI to use for all instances"
  type        = string
  default     = "ami-00683763038565fe9"
}

variable "instance_type" {
  description = "Default instance type to use"
  type        = string
  default     = "t3.medium"
}

variable "ssh_key_name" {
  description = "Default instance Key to use"
  type        = string
  default     = "aoma-d1-27May2019"
}

variable "ec2_monitoring" {
  description = "EC2 Monitoring"
  type        = bool
  default     = false
}

variable "disable_api_termination" {
  description = "EC2 termination protection"
  type        = bool
  default     = true
}

variable "ec2_tags" {
  description = "A map of tags to add to all resources"
  type        = map(string)

  default = {
    CLOPS_APPROVED : "True"
    Terraform = "True"

    Business-Unit = "AOMA-Core"
    Environment   = "DEV"
    Name          = "BETABASE-D"
    Owner         = "matt.carpenter.asburymedia@sonymusic.com"
    Project-Code  = "SME-2000-XXXX"
    Project-Name  = "BetaBase"
    POC : "matt.carpenter.asburymedia@sonymusic.com"
    OS : "AL2"
    SERVER_TYPE : "EC2"
    OPS : "STND"
    DATA : "NORMAL"
    Patch_Group : "General"
    CLOPS_FW : "NO"
  }
}

##################### ALB VARIABLES #######################

variable "internal" {
  description = "ALB type"
  type        = bool
  default     = true
}

variable "enable_deletion_protection" {
  description = "ALB deletion protection"
  type        = bool
  default     = true
}

variable "enable_waf_fail_open" {
  description = "ALB WAF"
  type        = bool
  default     = true
}

variable "drop_invalid_header_fields" {
  description = "ALB drop invalid headers"
  type        = bool
  default     = true
}

variable "alb_certificate_arn" {
  description = "ALB listener certificate ARN"
  type        = string
  default     = ""
}

variable "alb_ssl_policy" {
  description = "ALB Security Policy"
  type        = string
  default     = "ELBSecurityPolicy-TLS13-1-2-2021-06"
}

variable "alb_logs_bucket" {
  description = "ALB logs bucket"
  type        = string
  default     = "aoma-core-elb-logs"
}
