-
Notifications
You must be signed in to change notification settings - Fork 14
/
variables.tf
129 lines (106 loc) · 4.21 KB
/
variables.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: MIT-0
# -----------------------------------------------------------------------------
# Required input variables
# -----------------------------------------------------------------------------
variable "eks_cluster_name" {
type = string
description = "(Required) The name of the Amazon EKS cluster."
}
variable "instance_type" {
type = string
description = "(Required) The EC2 instance type to use for the worker nodes."
}
variable "desired_capacity" {
type = number
description = "(Required) The desired number of nodes to create in the node group."
}
variable "min_size" {
type = number
description = "(Required) The minimum number of nodes to create in the node group."
}
variable "max_size" {
type = number
description = "(Required) The maximum number of nodes to create in the node group."
}
variable "subnets" {
type = list(string)
description = "(Required) A list of subnet IDs to launch nodes in. Subnets automatically determine which availability zones the node group will reside."
}
# -----------------------------------------------------------------------------
# Optional input variables
# -----------------------------------------------------------------------------
variable "name" {
type = string
description = "(Optional) The name to be used for the self-managed node group. By default, the module will generate a unique name."
default = ""
}
variable "name_prefix" {
type = string
description = "(Optional) Creates a unique name beginning with the specified prefix. Conflicts with `name`."
default = "node-group"
}
variable "tags" {
type = map(any)
description = "(Optional) Tags to apply to all tag-able resources."
default = {}
}
variable "node_labels" {
type = map(any)
description = "(Optional) Kubernetes labels to apply to all nodes in the node group."
default = {}
}
variable "key_name" {
type = string
description = "(Optional) The name of the EC2 key pair to configure on the nodes."
default = null
}
variable "security_group_ids" {
type = list(string)
description = "(Optional) A list of security group IDs to associate with the worker nodes. The module automatically associates the EKS cluster security group with the nodes."
default = []
}
variable "ebs_encrypted" {
type = bool
description = "(Optional) Enables EBS encryption on the volume. By default, the module uses the setting from the selected AMI."
default = null
}
variable "ebs_kms_key_arn" {
type = string
description = "(Optional) The ARN of the AWS Key Management Service (AWS KMS) to use when creating the encrypted volume. `encrypted` must be set to true when this is set."
default = null
}
variable "ebs_volume_size" {
type = number
description = "(Optional) The EBS volume size for a worker node. By default, the module uses the setting from the selected AMI."
default = null
}
variable "ebs_volume_type" {
type = string
description = "(Optional) The EBS volume type for a worker node. By default, the module uses the setting from the selected AMI."
default = ""
}
variable "ebs_iops" {
type = number
description = "(Optional) The amount of provisioned IOPS for a worker node. This must be set with an `ebs_volume_type` of `io1` or `io2`."
default = null
}
variable "ebs_throughput" {
type = number
description = "(Optional) The throughput to provision for a `gp3` volume in MiB/s (specified as an integer)."
default = null
}
variable "ebs_delete_on_termination" {
type = number
description = "(Optional) Whether the worker node EBS volumes should be destroyed on instance termination. By default, the module uses the setting from the selected AMI."
default = null
}
# -----------------------------------------------------------------------------
# Local variables
# -----------------------------------------------------------------------------
resource "random_id" "name_suffix" {
byte_length = 8
}
locals {
node_group_name = coalesce(var.name, "${var.name_prefix}-${random_id.name_suffix.hex}")
}