Skip to content

Commit

Permalink
Add option to change worker placement_tenancy.
Browse files Browse the repository at this point in the history
  • Loading branch information
monsterxx03 committed Sep 27, 2018
1 parent 3b546a9 commit b40abbd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions local.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,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".
Expand Down
3 changes: 1 addition & 2 deletions workers.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
resource "aws_autoscaling_group" "workers" {


name_prefix = "${aws_eks_cluster.this.name}-${lookup(var.worker_groups[count.index], "name", count.index)}"
desired_capacity = "${lookup(var.worker_groups[count.index], "asg_desired_capacity", local.workers_group_defaults["asg_desired_capacity"])}"
max_size = "${lookup(var.worker_groups[count.index], "asg_max_size", local.workers_group_defaults["asg_max_size"])}"
Expand Down Expand Up @@ -36,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 {
Expand Down

0 comments on commit b40abbd

Please sign in to comment.