Skip to content

Terraform module for managing EKS workers in AWS

License

Notifications You must be signed in to change notification settings

yetisage/tf-aws-eks-workers

 
 

Repository files navigation

Netic AWS Terraform EKS Workers

Supported Terraform Versions

Terraform 0.12

Usage

module "vpc" {
  source = "github.com/neticdk/tf-aws-vpc"
  [...]
}

module "eks_cluster" {
  source = "github.com/neticdk/tf-aws-eks-cluster"
  [...]
}

module "eks_workers" {
  source = "github.com/neticdk/tf-aws-eks-workers"

  name                  = "my-eks-workers"
  instance_type         = "m5.large"
  instance_profile_name = module.eks_cluster.instance_profile_name
  key_name              = "my-key-name"
  vpc_id                = module.vpc.vpd_id
  subnets               = module.vpc.private_subnets

  cluster_version                    = "1.12"
  cluster_name                       = "my-eks-cluster"
  cluster_endpoint                   = module.eks_cluster.eks_cluster_endpoint
  cluster_certificate_authority_data = module.eks_cluster.eks_cluster_certificate_authority_data
  cluster_security_group_id          = module.eks_cluster.security_group_id
}

Inputs

Name Description Type Default Required
allowed_cidr_blocks List of CIDR blocks allowed to allow traffic from list <list> no
allowed_security_groups List of additoinal security group ids allowed to allow traffic from list <list> no
allowed_security_groups_count Count of allowed security groups string "0" no
associate_public_ip_address Associate a public IP address with an instance in a VPC string "false" no
autoscaling_enabled Sets whether policy and matching tags will be added to allow autoscaling. string "false" no
bootstrap_extra_args Extra arguments passed to the bootstrap.sh. string "" no
cluster_certificate_authority_data The base64 encoded certificate data required to communicate with the cluster string n/a yes
cluster_endpoint EKS cluster endpoint string n/a yes
cluster_name EKS Cluster Name string n/a yes
cluster_security_group_id Security group ID of the EKS Cluster string n/a yes
cluster_version Cluster Version string n/a yes
credit_specification Customize the credit specification of the instances list <list> no
default_cooldown The amount of time, in seconds, after a scaling activity completes before another scaling activity can start string "300" no
desired_capacity The desired size of the autoscale group string "1" no
disable_api_termination If true, enables EC2 Instance Termination Protection string "false" no
ebs_encrypted Enables EBS encryption on the volume string "false" no
ebs_kms_key_id AWS Key Management Service (AWS KMS) customer master key (CMK) to use when creating the encrypted volume string "null" no
ebs_optimized If true, the launched EC2 instance will be EBS-optimized string "false" no
ebs_root_iops The amount of provisioned IOPS string "0" no
ebs_root_volume_size The size of the volume in gigabytes string "100" no
ebs_root_volume_type The type of volume string "gp2" no
elastic_gpu_specifications Specifications of Elastic GPU to attach to the instances list <list> no
enable_monitoring Enable/disable detailed monitoring string "true" no
enabled_metrics A list of metrics to collect. The allowed values are GroupMinSize, GroupMaxSize, GroupDesiredCapacity, GroupInServiceInstances, GroupPendingInstances, GroupStandbyInstances, GroupTerminatingInstances, GroupTotalInstances list <list> no
enable_cloudwatch Enable/disable installation of CloudWatch Agent string false no
force_delete Allows deleting the autoscaling group without waiting for all instances in the pool to terminate. You can force an autoscaling group to delete even if it's in the process of scaling a resource. Normally, Terraform drains all the instances before deleting the group. This bypasses that behavior and potentially leaves resources dangling string "false" no
health_check_grace_period Time (in seconds) after instance comes into service before checking health string "300" no
health_check_type Controls how health checking is done. Valid values are EC2 or ELB string "EC2" no
instance_initiated_shutdown_behavior Shutdown behavior for the instances. Can be stop or terminate string "terminate" no
instance_market_options The market (purchasing) option for the instances list <list> no
instance_profile_name Name of the instance profile to use with the launch template string n/a yes
instance_type Instance type to launch string "m5.large" no
kernel_id The kernel ID string "" no
key_name SSH key name that should be used for the instance string "" no
kubelet_extra_args Passed to the bootstrap.sh script to enable --kublet-extra-args or --use-max-pods. string "" no
load_balancers A list of elastic load balancer names to add to the autoscaling group names. Only valid for classic load balancers. For ALBs, use target_group_arns instead list <list> no
max_size The maximum size of the autoscale group string "1" no
metrics_granularity The granularity to associate with the metrics to collect. The only valid value is 1Minute string "1Minute" no
min_elb_capacity Setting this causes Terraform to wait for this number of instances to show up healthy in the ELB only on creation. Updates will not wait on ELB instance number changes string "0" no
min_size The minimum size of the autoscale group string "1" no
name Name to use for creating resources string n/a yes
on_demand_allocation_strategy Strategy to use when launching on-demand instances. string "prioritized" no
on_demand_base_capacity Absolute minimum amount of desired capacity that must be fulfilled by on-demand instances string "0" no
on_demand_percentage_above_base_capacity Percentage split between on-demand and Spot instances above the base on-demand capacity string "100" no
override_instance_type Instance type to launch string "t3.large" no
placement_group The name of the placement group into which you'll launch your instances, if any string "" no
placement_tenancy The tenancy of the instance (if the instance is running in a VPC). string "default" no
protect_from_scale_in Allows setting instance protection. The autoscaling group will not select instances with this setting for terminination during scale in events string "false" no
service_linked_role_arn The ARN of the service-linked role that the ASG will use to call other AWS services string "" no
spot_allocation_strategy How to allocate capacity across the Spot pools string "lowest-price" no
spot_instance_pools Number of Spot pools per availability zone to allocate capacity. EC2 Auto Scaling selects the cheapest Spot pools and evenly allocates Spot capacity across the number of Spot pools that you specify string "10" no
spot_max_price Maximum price per unit hour that the user is willing to pay for the Spot instances string "" no
subnets List of subnets to launch the cluster in list(string) n/a yes
suspended_processes A list of processes to suspend for the AutoScaling Group. The allowed values are Launch, Terminate, HealthCheck, ReplaceUnhealthy, AZRebalance, AlarmNotification, ScheduledActions, AddToLoadBalancer. Note that if you suspend either the Launch or Terminate process types, it can prevent your autoscaling group from functioning properly. list <list> no
tags A map of tags to add to all resources map <map> no
target_group_arns A list of aws_alb_target_group ARNs, for use with Application Load Balancing list <list> no
termination_policies A list of policies to decide how the instances in the auto scale group should be terminated. The allowed values are OldestInstance, NewestInstance, OldestLaunchConfiguration, ClosestToNextInstanceHour, Default list <list> no
vpc_id VPC ID string n/a yes
wait_for_capacity_timeout A maximum duration that Terraform should wait for ASG instances to be healthy before timing out. Setting this to '0' causes Terraform to skip all Capacity Waiting behavior string "10m" no
wait_for_elb_capacity Setting this will cause Terraform to wait for exactly this number of healthy instances in all attached load balancers on both create and update operations. Takes precedence over min_elb_capacity behavior string "0" no

Outputs

Name Description
security_group_id

Copyright

Copyright (c) 2019 Netic A/S. All rights reserved.

License

MIT Licened. See LICENSE for full details.

About

Terraform module for managing EKS workers in AWS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HCL 95.5%
  • Shell 4.5%