From 6de0825644ded6916c12f24364a5a3c37c469dff Mon Sep 17 00:00:00 2001 From: monsterxx03 Date: Tue, 9 Oct 2018 16:46:58 +0800 Subject: [PATCH] Add option to change worker placement_tenancy. (#142) * Add option to change worker placement_tenancy. * update CHANGELOG.md --- CHANGELOG.md | 1 + local.tf | 1 + workers.tf | 1 + 3 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1134222..53e24e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ project adheres to [Semantic Versioning](http://semver.org/). - A useful addition (slam dunk, @self 🔥) - Worker groups can be created with a specified IAM profile. (from @laverya) - exposed `aws_eks_cluster` create and destroy timeouts (by @RGPosadas) +- exposed `placement_tenancy` for autoscaling group (by @monsterxx03) - Allow port 443 from EKS service to nodes to run `metrics-server`. (by @max-rocket-internet) ### Changed diff --git a/local.tf b/local.tf index 22920ea..89b0d4f 100644 --- a/local.tf +++ b/local.tf @@ -17,6 +17,7 @@ locals { asg_min_size = "1" # Minimum worker capacity in the autoscaling group. instance_type = "m4.large" # Size of the workers instances. spot_price = "" # Cost of spot instance. + placement_tenancy = "" # The tenancy of the instance. Valid values are "default" or "dedicated". root_volume_size = "100" # root volume size of workers instances. root_volume_type = "gp2" # root volume type of workers instances, can be 'standard', 'gp2', or 'io1' root_iops = "0" # The amount of provisioned IOPS. This must be set with a volume_type of "io1". diff --git a/workers.tf b/workers.tf index ebc4f55..9ea7ed4 100644 --- a/workers.tf +++ b/workers.tf @@ -34,6 +34,7 @@ resource "aws_launch_configuration" "workers" { ebs_optimized = "${lookup(var.worker_groups[count.index], "ebs_optimized", lookup(local.ebs_optimized, lookup(var.worker_groups[count.index], "instance_type", local.workers_group_defaults["instance_type"]), false))}" enable_monitoring = "${lookup(var.worker_groups[count.index], "enable_monitoring", local.workers_group_defaults["enable_monitoring"])}" spot_price = "${lookup(var.worker_groups[count.index], "spot_price", local.workers_group_defaults["spot_price"])}" + placement_tenancy = "${lookup(var.worker_groups[count.index], "placement_tenancy", local.workers_group_defaults["placement_tenancy"])}" count = "${var.worker_group_count}" lifecycle {