1
0
mirror of https://github.com/terraform-aws-modules/terraform-aws-eks.git synced 2025-09-09 19:32:58 +08:00

Replaced all incorrect aws_eks_cluster.this[count.index] references (there will be just one, so using '[0]').

This commit is contained in:
Tibo Beijen
2019-11-26 11:41:31 +01:00
parent 877865718e
commit d8f4dfc764
3 changed files with 23 additions and 23 deletions
+8 -8
View File
@@ -6,7 +6,7 @@ resource "aws_autoscaling_group" "workers_launch_template" {
"-",
compact(
[
aws_eks_cluster.this[count.index].name,
aws_eks_cluster.this[0].name,
lookup(var.worker_groups_launch_template[count.index], "name", count.index),
lookup(var.worker_groups_launch_template[count.index], "asg_recreate_on_change", local.workers_group_defaults["asg_recreate_on_change"]) ? random_pet.workers_launch_template[count.index].id : ""
]
@@ -167,7 +167,7 @@ resource "aws_autoscaling_group" "workers_launch_template" {
[
{
"key" = "Name"
"value" = "${aws_eks_cluster.this[count.index].name}-${lookup(
"value" = "${aws_eks_cluster.this[0].name}-${lookup(
var.worker_groups_launch_template[count.index],
"name",
count.index,
@@ -175,7 +175,7 @@ resource "aws_autoscaling_group" "workers_launch_template" {
"propagate_at_launch" = true
},
{
"key" = "kubernetes.io/cluster/${aws_eks_cluster.this[count.index].name}"
"key" = "kubernetes.io/cluster/${aws_eks_cluster.this[0].name}"
"value" = "owned"
"propagate_at_launch" = true
},
@@ -189,8 +189,8 @@ resource "aws_autoscaling_group" "workers_launch_template" {
"propagate_at_launch" = false
},
{
"key" = "k8s.io/cluster-autoscaler/${aws_eks_cluster.this[count.index].name}"
"value" = aws_eks_cluster.this[count.index].name
"key" = "k8s.io/cluster-autoscaler/${aws_eks_cluster.this[0].name}"
"value" = aws_eks_cluster.this[0].name
"propagate_at_launch" = false
},
{
@@ -219,7 +219,7 @@ resource "aws_autoscaling_group" "workers_launch_template" {
resource "aws_launch_template" "workers_launch_template" {
count = var.create_eks ? (local.worker_group_launch_template_count) : 0
name_prefix = "${aws_eks_cluster.this[count.index].name}-${lookup(
name_prefix = "${aws_eks_cluster.this[0].name}-${lookup(
var.worker_groups_launch_template[count.index],
"name",
count.index,
@@ -364,7 +364,7 @@ resource "aws_launch_template" "workers_launch_template" {
tags = merge(
{
"Name" = "${aws_eks_cluster.this[count.index].name}-${lookup(
"Name" = "${aws_eks_cluster.this[0].name}-${lookup(
var.worker_groups_launch_template[count.index],
"name",
count.index,
@@ -402,7 +402,7 @@ resource "random_pet" "workers_launch_template" {
resource "aws_iam_instance_profile" "workers_launch_template" {
count = var.manage_worker_iam_resources && var.create_eks ? local.worker_group_launch_template_count : 0
name_prefix = aws_eks_cluster.this[count.index].name
name_prefix = aws_eks_cluster.this[0].name
role = lookup(
var.worker_groups_launch_template[count.index],
"iam_role_id",