From bb79742255540f6eface4be26c5450ae56712ac7 Mon Sep 17 00:00:00 2001 From: iuri Date: Thu, 5 Dec 2024 10:41:10 +0100 Subject: [PATCH] FIx vpc policy name (#130) Follow the same pattern for all policies --- ...policy-vpc.json => capa-controller-vpc-policy.json} | 0 capa-controller-role/giantswarm-capa-role.tf | 10 +++++----- 2 files changed, 5 insertions(+), 5 deletions(-) rename capa-controller-role/{capa-controller-policy-vpc.json => capa-controller-vpc-policy.json} (100%) diff --git a/capa-controller-role/capa-controller-policy-vpc.json b/capa-controller-role/capa-controller-vpc-policy.json similarity index 100% rename from capa-controller-role/capa-controller-policy-vpc.json rename to capa-controller-role/capa-controller-vpc-policy.json diff --git a/capa-controller-role/giantswarm-capa-role.tf b/capa-controller-role/giantswarm-capa-role.tf index fc36b61..dca0b51 100644 --- a/capa-controller-role/giantswarm-capa-role.tf +++ b/capa-controller-role/giantswarm-capa-role.tf @@ -34,16 +34,16 @@ resource "aws_iam_role_policy_attachment" "giantswarm-capa-controller-policy-att policy_arn = aws_iam_policy.giantswarm-capa-controller-policy.arn } -resource "aws_iam_policy" "giantswarm-capa-controller-policy-vpc" { +resource "aws_iam_policy" "giantswarm-capa-controller-vpc-policy" { count = var.byovpc ? 0 : 1 # This policy is not needed in BYO VPC installations - name = "giantswarm-${var.installation_name}-capa-controller-policy-vpc" - policy = file("${path.module}/capa-controller-policy-vpc.json") + name = "giantswarm-${var.installation_name}-capa-controller-vpc-policy" + policy = file("${path.module}/capa-controller-vpc-policy.json") tags = local.tags } -resource "aws_iam_role_policy_attachment" "giantswarm-capa-controller-policy-vpc-attachment" { +resource "aws_iam_role_policy_attachment" "giantswarm-capa-controller-vpc-policy-attachment" { count = var.byovpc ? 0 : 1 # This policy is not needed in BYO VPC installations role = aws_iam_role.giantswarm-capa-controller-role.name - policy_arn = aws_iam_policy.giantswarm-capa-controller-policy-vpc[0].arn + policy_arn = aws_iam_policy.giantswarm-capa-controller-vpc-policy[0].arn } resource "aws_iam_policy" "giantswarm-dns-controller-policy" {