Files
terraform-aws-eks/examples/managed_node_groups

Managed groups example

This is EKS example using managed groups feature in two different ways:

  • Using SPOT instances in node group
  • Using ON_DEMAND instance in node group

See the official documentation for more details.

Usage

To run this example you need to execute:

$ terraform init
$ terraform plan
$ terraform apply

Note that this example may create resources which cost money. Run terraform destroy when you don't need these resources.

Requirements

Name Version
terraform >= 0.13.1
aws >= 3.22.0
kubernetes ~> 2.0
local >= 1.4
random >= 2.1

Providers

Name Version
aws >= 3.22.0
random >= 2.1

Modules

Name Source Version
eks ../..
vpc terraform-aws-modules/vpc/aws ~> 3.0

Resources

Name Type
random_string.suffix resource
aws_availability_zones.available data source
aws_eks_cluster.cluster data source
aws_eks_cluster_auth.cluster data source

Inputs

Name Description Type Default Required
map_accounts Additional AWS account numbers to add to the aws-auth configmap. list(string)
[
"777777777777",
"888888888888"
]
no
map_roles Additional IAM roles to add to the aws-auth configmap.
list(object({
rolearn = string
username = string
groups = list(string)
}))
[
{
"groups": [
"system:masters"
],
"rolearn": "arn:aws:iam::66666666666:role/role1",
"username": "role1"
}
]
no
map_users Additional IAM users to add to the aws-auth configmap.
list(object({
userarn = string
username = string
groups = list(string)
}))
[
{
"groups": [
"system:masters"
],
"userarn": "arn:aws:iam::66666666666:user/user1",
"username": "user1"
},
{
"groups": [
"system:masters"
],
"userarn": "arn:aws:iam::66666666666:user/user2",
"username": "user2"
}
]
no

Outputs

Name Description
cluster_endpoint Endpoint for EKS control plane.
cluster_security_group_id Security group ids attached to the cluster control plane.
config_map_aws_auth A kubernetes configuration to authenticate to this EKS cluster.
kubectl_config kubectl config as generated by the module.
node_groups Outputs from node groups