##################### COMMON VARIABLES #######################
variable "account_name" {
  description = "Name of the AWS account"
  type        = string
  default     = "sme-dc-dev"
}

variable "account_id" {
  description = "AWS Account Number of sme-dc-dev"
  type        = string
  default     = "156555176793"
}

variable "region" {
  description = "Name of the region"
  type        = string
  default     = "us-east-1"
}

variable "assume_role" {
  description = "The role used for infra changes"
  type        = string
  default     = "arn:aws:iam::156555176793:role/AnsibleAWSServiceAccess-dc-dev"
}

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

  default = {
    Terraform     = "True"
    Business-Unit = "DATA COLLECTOR"
    Environment   = "DEV"
    Name          = "DC-D"
    Owner         = "tom.koshy@sonymusic.com"
    Project-Code  = "SME-2000-DC"
    Project-Name  = "DATACOLLECT"
  }
}

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

variable "host_header" {
  description = "Host Header"
  type        = string
  default     = "smedcd.smecloudops.com"
}

##################### 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     = "DC-D"
}

variable "vpc_cidr" {
  description = "Primary VPC CIDR"
  type        = string
  default     = "10.251.96.0/19"
}

variable "vpc_id" {
  type    = string
  default = "vpc-00000001"
}

variable "secondary_cidr_blocks" {
  description = "Secondary CIDR blocks"
  type        = list(string)
  default     = ["10.249.5.128/28", "10.12.236.0/26"]
}

variable "public_subnets" {
  description = "Public Subnets"
  type        = list(string)
  default     = ["10.251.120.0/25", "10.251.120.128/25", "10.251.121.0/25", "10.249.5.128/28"]
}

variable "private_subnets" {
  description = "Private Subnets"
  type        = list(string)
  default     = ["10.251.121.128/25", "10.251.122.0/25", "10.251.122.128/25", "10.251.123.0/24", "10.251.124.0/22"]
}

variable "database_subnets" {
  description = "Database Subnets"
  type        = list(string)
  default     = ["10.251.108.0/22", "10.251.112.0/22", "10.251.116.0/22"]
}

variable "intra_subnets" {
  description = "Intra Subnets"
  type        = list(string)
  default     = ["10.12.236.0/27", "10.12.236.32/27"]
}

variable "emr_subnets" {
  description = "Elastic cache Subnets"
  type        = list(string)
  default     = ["10.251.96.0/22", "10.251.100.0/22", "10.251.104.0/22"]
}

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-dc-dev-s3-access-logs-us-east-1"
}

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::156555176793:role/flowlogsRole"
}

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

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"
}

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

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

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     = "digital-systems-d-05MAR2024"
}

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 = {
    "Business-Unit"  = "DATA COLLECTOR",
    "Project-Code"   = "SME-2000-DC",
    "Project-Name"   = "DATACOLLECT",
    "Environment"    = "DEV",
    "SERVER_TYPE"    = "EC2",
    "OS"             = "AL3",
    "Patch Group"    = "General",
    "CLOPS_APPROVED" = "YES",
    "ME_JOINED"      = "NO",
    "OPS"            = "STND",
    "DATA"           = "NORMAL",
    "OWNER"          = "tom.koshy@sonymusic.com",
    "Terraform"      = "True",
    "CLOPS_FW"       = "YES",
  }
}

variable "cloudops_firewall_protected_tag" {
  description = "Used to tag an EC2 instance as being protected by a firewall, either Network Firewall or PaloAlto"
  type        = map(string)

  default = {
    CLOPS_FW = "YES"
  }
}

##################### 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     = "sme-dc-dev-elb-logs-us-east-1"
}

################################################################################
# VPC info
################################################################################

variable "vpc_cidrs" {
  type    = list(any)
  default = ["10.251.96.0/19", "10.249.5.128/28", "10.12.236.0/26"]
}

##################### Launch Template VARIABLES #######################

variable "launch_template_image_id" {
  type    = string
  default = "ami-05b15b76701a3930e"
}

variable "launch_template_instance_type" {
  type    = string
  default = "t3.medium"
}

variable "launch_template_key_name" {
  type    = string
  default = "dc-d-19may2025"
}
