From c4b307ed7b835a8f49eee2e78e0e5fe3805af48c Mon Sep 17 00:00:00 2001 From: Yusuke Kuoka Date: Tue, 28 May 2024 05:03:01 +0000 Subject: [PATCH] Prep node role for karpenter test --- .../testdata/terraform/main.tf | 143 +++++++++++++++++- 1 file changed, 137 insertions(+), 6 deletions(-) diff --git a/cmd/cluster-autoscaler/testdata/terraform/main.tf b/cmd/cluster-autoscaler/testdata/terraform/main.tf index 9b40eec..80c6cb2 100644 --- a/cmd/cluster-autoscaler/testdata/terraform/main.tf +++ b/cmd/cluster-autoscaler/testdata/terraform/main.tf @@ -52,8 +52,10 @@ data "aws_vpc" "vpc" { id = var.vpc_id } +data "aws_caller_identity" "current" {} + resource "aws_eks_cluster" "cluster" { - name = "${var.prefix}-cluster" + name = local.cluster_name role_arn = aws_iam_role.cluster.arn vpc_config { subnet_ids = aws_subnet.public[*].id @@ -166,11 +168,131 @@ resource "aws_iam_role_policy_attachment" "ecr" { policy_arn = "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly" } -// See https://github.com/kubernetes/autoscaler/blob/master/cluster-autoscaler/cloudprovider/aws/README.md#iam-policy -resource "aws_iam_role_policy" "node" { - name = "${var.prefix}-node" - role = aws_iam_role.node.id - policy = <