{% for environment in env_collection.active_environments %}
################################################################################
# VPC
################################################################################
variable "{{ environment.name }}_{{environment.collection.instance_name}}_cidr" {
  description = "(Optional) The IPv4 CIDR block for the VPC. CIDR can be explicitly set or it can be derived from IPAM using `ipv4_netmask_length` & `ipv4_ipam_pool_id`"
  type        = string
  default     = "10.0.0.0/16"
}

variable "{{ environment.name }}_{{environment.collection.instance_name}}_azs" {
  description = "A list of availability zones names or ids in the region"
  type        = list(string)
  default = ["{{ env_collection.region | default('us-east-1') }}a", "{{ env_collection.region | default('us-east-1') }}b", "{{ env_collection.region | default('us-east-1') }}c"]
}

variable "{{ environment.name }}_{{environment.collection.instance_name}}_enable_dns_hostnames" {
  description = "Should be true to enable DNS hostnames in the VPC"
  type        = bool
  default = true
}

variable "{{ environment.name }}_{{environment.collection.instance_name}}_enable_dns_support" {
  description = "Should be true to enable DNS support in the VPC"
  type        = bool
  default = true
}

variable "{{ environment.name }}_{{environment.collection.instance_name}}_vpc_tags" {
  description = "Additional tags for the VPC"
  type        = map(string)
  default = {}
}

################################################################################
# Publiс Subnets
################################################################################

variable "{{ environment.name }}_{{environment.collection.instance_name}}_public_subnets" {
  description = "A list of public subnets inside the VPC"
  type        = list(string)
  default = ["10.0.101.0/24", "10.0.102.0/24", "10.0.103.0/24"]
}

variable "{{ environment.name }}_{{environment.collection.instance_name}}_create_multiple_public_route_tables" {
  description = "Indicates whether to create a separate route table for each public subnet. Default: `false`"
  type        = bool
  default = false
}

variable "{{ environment.name }}_{{environment.collection.instance_name}}_public_subnet_names" {
  description = "Explicit values to use in the Name tag on public subnets. If empty, Name tags are generated"
  type        = list(string)
  default = []
}

variable "{{ environment.name }}_{{environment.collection.instance_name}}_public_subnet_suffix" {
  description = "Suffix to append to public subnets name"
  type        = string
  default     = "public"
}

variable "{{ environment.name }}_{{environment.collection.instance_name}}_public_subnet_tags" {
  description = "Additional tags for the public subnets"
  type        = map(string)
  default = {
    Tier = "public"
  } 
}

variable "{{ environment.name }}_{{environment.collection.instance_name}}_public_subnet_tags_per_az" {
  description = "Additional tags for the public subnets where the primary key is the AZ"
  type        = map(map(string))
  default = {}
}

variable "{{ environment.name }}_{{environment.collection.instance_name}}_public_route_table_tags" {
  description = "Additional tags for the public route tables"
  type        = map(string)
  default = {}
}

################################################################################
# Private Subnets
################################################################################

variable "{{ environment.name }}_{{environment.collection.instance_name}}_private_subnets" {
  description = "A list of private subnets inside the VPC"
  type        = list(string)
  default = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
}

variable "{{ environment.name }}_{{environment.collection.instance_name}}_private_subnet_names" {
  description = "Explicit values to use in the Name tag on private subnets. If empty, Name tags are generated"
  type        = list(string)
  default = []
}

variable "{{ environment.name }}_{{environment.collection.instance_name}}_private_subnet_suffix" {
  description = "Suffix to append to private subnets name"
  type        = string
  default     = "private"
}

variable "{{ environment.name }}_{{environment.collection.instance_name}}_private_subnet_tags" {
  description = "Additional tags for the private subnets"
  type        = map(string)
  default = {
    Tier = "private"
  }
}

variable "{{ environment.name }}_{{environment.collection.instance_name}}_private_subnet_tags_per_az" {
  description = "Additional tags for the private subnets where the primary key is the AZ"
  type        = map(map(string))
  default = {}
}

variable "{{ environment.name }}_{{environment.collection.instance_name}}_private_route_table_tags" {
  description = "Additional tags for the private route tables"
  type        = map(string)
  default = {}
}

################################################################################
# Internet Gateway
################################################################################

variable "{{ environment.name }}_{{environment.collection.instance_name}}_create_igw" {
  description = "Controls if an Internet Gateway is created for public subnets and the related routes that connect them"
  type        = bool
  default = true
}

variable "{{ environment.name }}_{{environment.collection.instance_name}}_igw_tags" {
  description = "Additional tags for the internet gateway"
  type        = map(string)
  default = {}
}

################################################################################
# NAT Gateway
################################################################################

variable "{{ environment.name }}_{{environment.collection.instance_name}}_enable_nat_gateway" {
  description = "Should be true if you want to provision NAT Gateways for each of your private networks"
  type        = bool
  default = true
}

variable "{{ environment.name }}_{{environment.collection.instance_name}}_nat_gateway_destination_cidr_block" {
  description = "Used to pass a custom destination route for private NAT Gateway. If not specified, the default 0.0.0.0/0 is used as a destination route"
  type        = string
  default = "0.0.0.0/0"
}

variable "{{ environment.name }}_{{environment.collection.instance_name}}_single_nat_gateway" {
  description = "Should be true if you want to provision a single shared NAT Gateway across all of your private networks"
  type        = bool
  default = true
}

variable "{{ environment.name }}_{{environment.collection.instance_name}}_one_nat_gateway_per_az" {
  description = "Should be true if you want only one NAT Gateway per availability zone. Requires `var.{{ environment.name }}_{{environment.collection.instance_name}}_azs` to be set, and the number of `public_subnets` created to be greater than or equal to the number of availability zones specified in `var.{{ environment.name }}_{{environment.collection.instance_name}}_azs`"
  type        = bool
  default = false
}

variable "{{ environment.name }}_{{environment.collection.instance_name}}_reuse_nat_ips" {
  description = "Should be true if you don't want EIPs to be created for your NAT Gateways and will instead pass them in via the 'external_nat_ip_ids' variable"
  type        = bool
  default = false
}

variable "{{ environment.name }}_{{environment.collection.instance_name}}_external_nat_ip_ids" {
  description = "List of EIP IDs to be assigned to the NAT Gateways (used in combination with reuse_nat_ips)"
  type        = list(string)
  default = []
}

variable "{{ environment.name }}_{{environment.collection.instance_name}}_nat_gateway_tags" {
  description = "Additional tags for the NAT gateways"
  type        = map(string)
  default = {}
}

variable "{{ environment.name }}_{{environment.collection.instance_name}}_nat_eip_tags" {
  description = "Additional tags for the NAT EIP"
  type        = map(string)
  default = {}
}

variable "{{ environment.name }}_{{environment.collection.instance_name}}_add_security_groups" {
  description = "List of security groups to create"
  type = list(object({
    name        = string
    ingress = list(object({
      from_port   = number
      to_port     = number
      protocol    = string
      cidr_blocks = list(string)
    }))
  }))
  default = [
  # {
  #   name    = "sg-mysql"
  #   ingress = [
  #     {
  #       from_port   = 3306
  #       to_port     = 3306
  #       protocol    = "tcp"
  #       cidr_blocks = ["10.0.0.0/16"]
  #     }
  #   ]
  # },
  ]
}

{% endfor %}