Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
variables.tf 13.4 KiB
Newer Older
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: MIT-0
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this
 * software and associated documentation files (the "Software"), to deal in the Software
 * without restriction, including without limitation the rights to use, copy, modify,
 * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
 * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

variable "terraform_version" {
  type        = string
  default     = "Terraform"
  description = "Terraform Version"
}
variable "org" {
  type        = string
  description = "tenant, which could be your organization name, e.g. aws'"
  default     = "aws"
}
variable "tenant" {
  type        = string
  description = "Account Name or unique account unique id e.g., apps or management or aws007"
  default     = ""
}
variable "environment" {
  type        = string
  default     = "preprod"
  description = "Environment area, e.g. prod or preprod "
}
variable "zone" {
  type        = string
  description = "zone, e.g. dev or qa or load or ops etc..."
  default     = ""
}
variable "attributes" {
  type        = string
  default     = ""
  description = "Additional attributes (e.g. `1`)"
}
variable "tags" {
  type        = map(string)
  default     = {}
  description = "Additional tags (e.g. `map('BusinessUnit`,`XYZ`)"
}
#----------------------------------------------------------
// VPC
#----------------------------------------------------------
variable "create_vpc" {
  description = "Controls if VPC should be created (it affects almost all resources)"
  type        = bool
  default     = false
}
variable "enable_public_subnets" {
  description = "Enable public subnets for EKS Cluster"
  type        = bool
  default     = false
}
variable "enable_nat_gateway" {
  description = "Enable NAT Gateway for public subnets"
  type        = bool
  default     = false
}
variable "single_nat_gateway" {
  description = "Create single NAT gateway for all private subnets"
  type        = bool
  default     = true
}
variable "create_igw" {
  description = "Create internet gateway in public subnets"
  type        = bool
  default     = false
}
variable "enable_private_subnets" {
  description = "Enable private subnets for EKS Cluster"
  type        = bool
  default     = true
}

variable "vpc_id" {
  type        = string
  description = "VPC id"
  default     = ""
}
variable "private_subnet_ids" {
  description = "list of private subnets Id's for the Worker nodes"
  default     = []
}
variable "public_subnet_ids" {
  description = "list of private subnets Id's for the Worker nodes"
  default     = []
}
variable "vpc_cidr_block" {
  type        = string
  default     = ""
  description = "VPC CIDR"
}
variable "public_subnets_cidr" {
  description = "list of Public subnets for the Worker nodes"
  default     = []
}
variable "private_subnets_cidr" {
  description = "list of Private subnets for the Worker nodes"
  default     = []
}

variable "create_vpc_endpoints" {
  type        = bool
  default     = false
  description = "Create VPC endpoints for Private subnets"
}

variable "endpoint_private_access" {
  type        = bool
  default     = true
  description = "Indicates whether or not the Amazon EKS private API server endpoint is enabled. Default to AWS EKS resource and it is false"
}
variable "endpoint_public_access" {
  type        = bool
  default     = true
  description = "Indicates whether or not the Amazon EKS public API server endpoint is enabled. Default to AWS EKS resource and it is true"
}
variable "enable_irsa" {
  type        = bool
  default     = true
  description = "Indicates whether or not the Amazon EKS public API server endpoint is enabled. Default to AWS EKS resource and it is true"
}
#----------------------------------------------------------
// EKS CONTROL PLANE
#----------------------------------------------------------
variable "kubernetes_version" {
  type        = string
  description = "Desired Kubernetes master version. If you do not specify a value, the latest available version is used"
}
variable "enabled_cluster_log_types" {
  type        = list(string)
  default     = ["api", "audit", "authenticator", "controllerManager", "scheduler"]
  description = "A list of the desired control plane logging to enable. Possible values [`api`, `audit`, `authenticator`, `controllerManager`, `scheduler`]"
}
variable "cluster_log_retention_period" {
  type        = number
  default     = 7
  description = "Number of days to retain cluster logs. Requires `enabled_cluster_log_types` to be set. See https://docs.aws.amazon.com/en_us/eks/latest/userguide/control-plane-logs.html."
}

variable "vpc_cni_addon_version" {
  type        = string
  default     = "v1.8.0-eksbuild.1"
  description = "VPC CNI Addon verison"
}
variable "coredns_addon_version" {
  type        = string
  default     = "v1.8.3-eksbuild.1"
  description = "CoreDNS Addon verison"
}
variable "kube_proxy_addon_version" {
  type        = string
  default     = "v1.20.4-eksbuild.2"
  description = "KubeProxy Addon verison"
}
variable "enable_vpc_cni_addon" {
  type    = bool
  default = false
}
variable "enable_coredns_addon" {
  type    = bool
  default = false
}
variable "enable_kube_proxy_addon" {
  type    = bool
  default = false
}

#----------------------------------------------------------
// EKS WORKER NODES
#----------------------------------------------------------

# Self-managed NodeGroup (Worker Group)
variable "enable_self_managed_nodegroups" {
  description = "Enable self-managed worker groups"
  type        = bool
  default     = false
}
variable "enable_windows_support" {
  description = "Enable Windows support in the cluster"
  type        = bool
  default     = false
}
variable "self_managed_nodegroup_name" {
  type        = string
  default     = "ng-linux"
  description = "Self-managed worker node group name"
}
variable "self_managed_node_ami_id" {
  type        = string
  default     = ""
  description = "Self-managed worker node custom AMI ID"
}
variable "self_managed_node_userdata_template_file" {
  type        = string
  default     = ""
  description = "Self-managed worker node custom userdata template file path"
}
variable "self_managed_node_userdata_template_extra_params" {
  type        = map(any)
  default     = {}
  description = "Self-managed worker node custom userdata template extra parameters"
}
variable "self_managed_node_volume_size" {
  type        = number
  default     = 50
  description = "Volume size in GiB for worker nodes. Defaults to 50. Terraform will only perform drift detection if a configuration value is provided"
}
variable "self_managed_node_instance_types" {
  type        = list(string)
  default     = ["m5.large", "m5a.large", "m5n.large"]
  description = "Set of instance types associated with the EKS Node Group"
}
variable "self_managed_node_desired_size" {
  type        = number
  default     = 3
  description = "Desired number of worker nodes"
}
variable "self_managed_node_max_size" {
  type        = number
  default     = 3
  description = "The maximum size of the AutoScaling Group"
}
variable "self_managed_node_min_size" {
  type        = number
  default     = 3
  description = "The minimum size of the AutoScaling Group"
}

variable "metrics_server_enable" {
  type        = bool
  default     = false
  description = "Enabling metrics server on eks cluster"
}
variable "cluster_autoscaler_enable" {
  type        = bool
  default     = false
  description = "Enabling Cluster autoscaler on eks cluster"
}
variable "traefik_ingress_controller_enable" {
  type        = bool
  default     = false
  description = "Enabling Traefik Ingress Controller on eks cluster"
}

variable "lb_ingress_controller_enable" {
  type        = bool
  default     = false
  description = "enabling LB Ingress Controller on eks cluster"
}

variable "nginx_ingress_controller_enable" {
  type        = bool
  default     = false
  description = "enabling Nginx Ingress Controller on eks cluster"
}

variable "aws_for_fluent_bit_enable" {
  type        = bool
  default     = false
  description = "Enabling aws_fluent_bit module on eks cluster"
}

variable "fargate_fluent_bit_enable" {
  type        = bool
  default     = false
  description = "Enabling fargate_fluent_bit module on eks cluster"
}

variable "ekslog_retention_in_days" {
  default     = 90
  description = "Number of days to retain log events. Default retention - 90 days."
  type        = number
}
variable "public_docker_repo" {
  type        = bool
  default     = true
  description = "public docker repo access"
}
variable "agones_enable" {
  type        = bool
  default     = false
  description = "Enabling Agones Gaming Helm Chart"
}
variable "expose_udp" {
  type        = bool
  default     = false
  description = "Enabling Agones Gaming Helm Chart"
}

variable "aws_lb_image_tag" {
  default = "v2.2.1"
}

variable "aws_lb_helm_chart_version" {
  default = "1.2.3"
}

variable "metric_server_image_tag" {
variable "metric_server_helm_chart_version" {
  default = "2.12.1"
}

variable "cluster_autoscaler_image_tag" {
}

variable "cluster_autoscaler_helm_version" {
}

variable "prometheus_helm_chart_version" {
variable "prometheus_image_tag" {
}

variable "alert_manager_image_tag" {
}

variable "configmap_reload_image_tag" {
}

variable "node_exporter_image_tag" {
}

variable "pushgateway_image_tag" {
}

variable "prometheus_enable" {
  default = false
}

variable "aws_managed_prometheus_enable" {
  default = false
}

variable "traefik_helm_chart_version" {
}

variable "traefik_image_tag" {
  default = "v2.4.9"
}

variable "nginx_helm_chart_version" {
  default = "3.33.0"
Jomcy's avatar
Jomcy committed
}
Jomcy's avatar
Jomcy committed
variable "aws_for_fluent_bit_image_tag" {
  default     = "2.13.0"
  description = "Docker image tag for aws_for_fluent_bit"
}

variable "aws_for_fluent_bit_helm_chart_version" {
  default     = "0.1.11"
  description = "Helm chart version for aws_for_fluent_bit"
Vara Bonthu's avatar
Vara Bonthu committed
}

variable "managed_node_groups" {
  type    = any
  default = {}
}

variable "create_eks" {
  type    = bool
  default = false

}

variable "map_accounts" {
  description = "Additional AWS account numbers to add to the aws-auth configmap. "
  type        = list(string)
  default     = []
}

variable "map_roles" {
  description = "Additional IAM roles to add to the aws-auth configmap."
  type = list(object({
    rolearn  = string
    username = string
    groups   = list(string)
  }))
  default = []
}

variable "map_users" {
  description = "Additional IAM users to add to the aws-auth configmap. "
  type = list(object({
    userarn  = string
    username = string
    groups   = list(string)
  }))
  default = []
}
variable "iam_path" {
  description = "If provided, all IAM roles will be created on this path."
  type        = string
  default     = "/"
}

variable "manage_aws_auth" {
  description = "Whether to apply the aws-auth configmap file."
  default     = true
}
variable "aws_auth_additional_labels" {
  description = "Additional kubernetes labels applied on aws-auth ConfigMap"
  default     = {}
  type        = map(string)
}

variable "enable_fargate" {
  default = false
}

variable "fargate_profiles" {
  type    = any
  default = {}
}

# CONFIG MAP AWS-AUTH
variable "aws_auth_yaml_strip_quotes" {
  type        = bool
  default     = true
  description = "If true, remove double quotes from the generated aws-auth ConfigMap YAML to reduce spurious diffs in plans"
}

variable "apply_config_map_aws_auth" {
  type        = bool
  default     = true
  description = "Whether to apply the ConfigMap to allow worker nodes to join the EKS cluster and allow additional users, accounts and roles to acces the cluster"
}

variable "local_exec_interpreter" {
  type        = list(string)
  default     = ["/bin/sh", "-c"]
  description = "shell to use for local_exec"
}

variable "wait_for_cluster_command" {
  type        = string
  default     = "curl --silent --fail --retry 60 --retry-delay 5 --retry-connrefused --insecure --output /dev/null $ENDPOINT/healthz"
  description = "`local-exec` command to execute to determine if the EKS cluster is healthy. Cluster endpoint are available as environment variable `ENDPOINT`"
}

variable "map_additional_iam_roles" {
  description = "Additional IAM roles to add to `config-map-aws-auth` ConfigMap"

  type = list(object({
    rolearn  = string
    username = string
    groups   = list(string)
  }))

  default = []
}

variable "map_additional_iam_users" {
  description = "Additional IAM users to add to `config-map-aws-auth` ConfigMap"

  type = list(object({
    userarn  = string
    username = string
    groups   = list(string)
  }))

  default = []
}

variable "map_additional_aws_accounts" {
  description = "Additional AWS account numbers to add to `config-map-aws-auth` ConfigMap"
  type        = list(string)
  default     = []
}