variable "aws_region" {
  description = "AWS region to launch servers."
  default     = "us-east-1"
}

variable "vpc_id" {
  description = "ID of existing vpc"
}

variable "vpc_private_subnet_cidr" {
  description = "CIDR for subnets in VPC to create"
}

variable "vpc_route_table" {
  description = "Route table id"
}

variable "aws_key_name" {
  description = "Desired name of AWS key pair"
  default     = "ciscat"
}

variable "asg_max_size" {
  description = "Auto Scaling group max size"
  default     = "1"
}

variable "asg_min_size" {
  description = "Auto Scaling group min size"
  default     = "1"
}

variable "asg_desired_capacity" {
  description = "Auto Scaling group desired capacity"
  default     = "1"
}

variable "service_port" {
  description = "Tomcat service TCP port"
  default     = "8080"
}

variable "aws_stack_name" {
  description = "AWS stack name"
  default     = "ciscat-dashboard"
}

variable "aws_instance_type" {
  description = "AWS instance type"
  default     = "t2.large"
}

variable "aws_volume_type" {
  description = "AWS root volume type"
  default     = "gp2"
}

variable "aws_volume_size" {
  description = "AWS root volume size"
  default     = "128"
}

variable "aws_route53_params" {
  description = "AWS route 53 parameters"
  default = {
    zone_id = "Z21XEY26C989RH"
    type    = "CNAME"
    ttl     = "300"
  }
}

variable "user_data" {
  description = "User data script"
  default     = ""
}

variable "ssl_certificate_arn" {
  description = "ARN of ssl certificate for ELB"
  default     = "arn:aws:acm:us-east-1:103233932089:certificate/61abb4b0-81b5-47f2-90d4-2542b0fdbd1d"
}

variable "aws_asg_name" {
  description = "ARN of auto scaling group"
  default     = ""
}

variable "aws_iam_role_id_output" {
  description = "Id of IAM role for instances under auto scaling group"
  default     = ""
}

variable "health_check_path" {
  default     = "/hello"
  description = "The default health check path"
}

variable "environment" {
  description = "Environment type: dev, qa, prod"
  default     = "dev"
}

variable "s3_bucket" {
  description = "Bucket name"
}

variable "dns_name" {
  description = "Name of Route53 CNAME record"
  default     = ""
}

variable "aws_azs" {
  default = {
    "us-east-1" = "us-east-1a,us-east-1b"
  }
}

# LB listener properties
variable "https_listener_allow_cidr_blocks" {
  description = "CIDR blocks from which to allow HTTPS for multiple environments"
  type        = map(list(string))

  default = {
    dev = [
      "10.131.0.0/29",
      "10.141.0.0/29",
      "10.160.0.0/24",
      "10.161.0.0/29",
      "10.30.0.0/22",
      "10.40.0.0/22",
      "10.10.41.97/32",
      "10.10.61.0/29",
      "10.10.141.0/29",
      "192.168.31.0/24",
      "192.168.32.0/24",
      "192.168.33.0/24",
      "192.168.40.0/22",
    ]

    qa = [
      "10.131.0.0/29",
      "10.141.0.0/29",
      "10.160.0.0/24",
      "10.161.0.0/29",
      "10.30.0.0/22",
      "10.40.0.0/22",
      "192.168.31.0/24",
      "192.168.32.0/24",
      "192.168.33.0/24",
      "192.168.40.0/22",
    ]

    prod = [
      "10.10.141.0/29",
      "10.10.40.0/22",
      "10.10.60.0/22",
      "10.10.61.0/29",
      "10.10.80.0/22",
      "10.131.0.0/29",
      "10.141.0.0/29",
      "10.160.0.0/24",
      "10.161.0.0/29",
      "10.30.0.0/22",
      "10.40.0.0/22",
      "192.168.31.0/24",
    ]
  }
}
