Support for Mixed Instances ASG in worker_groups_launch_template variable (#468)

* Create ASG tags via for - utility from terraform 12

* Updated support for mixed ASG in worker_groups_launch_template variable

* Updated launch_template example to include spot and mixed ASG with worker_groups_launch_template variable

* Removed old config

* Removed workers_launch_template_mixed.tf file, added support for mixed/spot in workers_launch_template variable

* Updated examples/spot_instances/main.tf with Mixed Spot and ondemand instances

* Removed launch_template_mixed from relevant files

* Updated README.md file

* Removed workers_launch_template.tf.bkp

* Fixed case with null on_demand_allocation_strategy and Spot allocation

* Fixed workers_launch_template.tf, covered spot instances via Launch Template
This commit is contained in:
Sergiu Plotnicu
2019-09-13 17:50:59 +03:00
committed by Max Williams
parent a47f464221
commit 461cf5482e
12 changed files with 97 additions and 485 deletions

View File

@@ -35,21 +35,6 @@ EOS
data "aws_caller_identity" "current" {
}
data "template_file" "launch_template_mixed_worker_role_arns" {
count = local.worker_group_launch_template_mixed_count
template = file("${path.module}/templates/worker-role.tpl")
vars = {
worker_role_arn = "arn:aws:iam::${data.aws_caller_identity.current.account_id}:role/${element(
coalescelist(
aws_iam_instance_profile.workers_launch_template_mixed.*.role,
data.aws_iam_instance_profile.custom_worker_group_launch_template_mixed_iam_instance_profile.*.role_name,
),
count.index,
)}"
}
}
data "template_file" "launch_template_worker_role_arns" {
count = local.worker_group_launch_template_count
template = file("${path.module}/templates/worker-role.tpl")
@@ -91,7 +76,6 @@ data "template_file" "config_map_aws_auth" {
concat(
data.template_file.launch_template_worker_role_arns.*.rendered,
data.template_file.worker_role_arns.*.rendered,
data.template_file.launch_template_mixed_worker_role_arns.*.rendered,
),
),
)