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

variable "account_id" {
  description = "AWS Account Number of sme-digital-systems-dev"
  type        = string
  default     = "718729873097"
}

variable "region" {
  description = "Name of the region"
  type        = string
  default     = "eu-central-1"
}

variable "assume_role" {
  description = "The role used for infra changes"
  type        = string
  default     = "arn:aws:iam::718729873097:role/AnsibleAWSServiceAccess-DIGSYS-S3"
}

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

  default = {
    Terraform     = "True"
    Business-Unit = "DIGITAL SYSTEMS"
    Environment   = "Stage"
    Name          = "DIGSYS-S3"
    Owner         = "steve.leeds@sonymusic.com"
    Project-Code  = "SME-2000-0590D+M"
    Project-Name  = "Digital Systems"
    POC           = "steve.leeds@sonymusic.com"
    aws-migration-project-id = "MPE22602"
    map-migrated = "d-server-02sa4nzuab143a"
  }
}

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

variable "host_header" {
  description = "Host Header"
  type        = string
  default     = "digsys-stage.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     = "DIGSYS-S3"
}

variable "vpc_cidr" {
  description = "Primary VPC CIDR"
  type        = string
  default     = "10.250.70.0/24"
}

variable "vpc_id" {
  type    = string
  default = "vpc-081a4216f852f621b"
}

variable "secondary_cidr_blocks" {
  description = "Secondary CIDR blocks"
  type        = list(string)
  default     = ["10.249.1.48/28", "10.11.187.0/25"]
}

variable "public_subnets" {
  description = "Public Subnets"
  type        = list(string)
  default     = ["10.250.70.0/27", "10.250.70.32/27", "10.249.1.48/28"]
}

variable "private_subnets" {
  description = "Private Subnets"
  type        = list(string)
  default     = ["10.250.70.128/26", "10.250.70.192/26", "10.250.70.96/27", "10.11.187.0/26", "10.11.187.64/26"]
}

variable "database_subnets" {
  description = "Database Subnets"
  type        = list(string)
  default     = ["10.250.70.64/28", "10.250.70.80/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-digital-systems-dev-eu-central-1-s3-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::718729873097:role/flowlogsRole"
}

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

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 = {
    CLOPS_APPROVED : "True"
    Terraform = "True"

    Business-Unit = "DIGITAL SYSTEMS"
    Environment   = "STAGE"
    Name          = "DIGSYS-S3"
    Owner         = "steve.leeds@sonymusic.com"
    Project-Code  = "SME-2000-0590D+M"
    Project-Name  = "Digital Systems"
    POC = "steve.leeds@sonymusic.com"
    OS = "AL3"
    SERVER_TYPE = "EC2"
    OPS = "STND"
    DATA = "NORMAL"
    Patch_Group = "General"
    aws-migration-project-id = "MPE22602"
    map-migrated = "d-server-02sa4nzuab143a"
  }
}

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     = "digital-systems-dev-frankfurt-elb-logs"
}

##################### EFS VARIABLES #######################

variable "posix_uid" {
  description = "POSIX user ID"
  type        = number
  default     = 1184
}

variable "posix_gid" {
  description = "POSIX group ID"
  type        = number
  default     = 2006
}

variable "posix_permissions" {
  description = "POSIX permissions"
  type        = number
  default     = 755
}
