mirror of
https://github.com/ysoftdevs/terraform-aws-eks.git
synced 2026-03-24 18:31:09 +01:00
Allows worker groups to be created using AWS Launch Templates (#222)
This commit is contained in:
11
aws_auth.tf
11
aws_auth.tf
@@ -21,6 +21,15 @@ resource "null_resource" "update_config_map_aws_auth" {
|
||||
|
||||
data "aws_caller_identity" "current" {}
|
||||
|
||||
data "template_file" "launch_template_worker_role_arns" {
|
||||
count = "${var.worker_group_launch_template_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(aws_iam_instance_profile.workers_launch_template.*.role, count.index)}"
|
||||
}
|
||||
}
|
||||
|
||||
data "template_file" "worker_role_arns" {
|
||||
count = "${var.worker_group_count}"
|
||||
template = "${file("${path.module}/templates/worker-role.tpl")}"
|
||||
@@ -34,7 +43,7 @@ data "template_file" "config_map_aws_auth" {
|
||||
template = "${file("${path.module}/templates/config-map-aws-auth.yaml.tpl")}"
|
||||
|
||||
vars {
|
||||
worker_role_arn = "${join("", distinct(data.template_file.worker_role_arns.*.rendered))}"
|
||||
worker_role_arn = "${join("", distinct(concat(data.template_file.launch_template_worker_role_arns.*.rendered, data.template_file.worker_role_arns.*.rendered)))}"
|
||||
map_users = "${join("", data.template_file.map_users.*.rendered)}"
|
||||
map_roles = "${join("", data.template_file.map_roles.*.rendered)}"
|
||||
map_accounts = "${join("", data.template_file.map_accounts.*.rendered)}"
|
||||
|
||||
Reference in New Issue
Block a user