Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Avoid invalid-index when controllers disabled #44

Merged
merged 1 commit into from
Jul 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ module "emrcontainers" {
role_permissions_boundary_arn = lookup(var.emrcontainers, "role_permissions_boundary_arn", null)
role_description = try(var.emrcontainers.role_description, "IRSA for emrcontainers controller for ACK")
role_policies = lookup(var.emrcontainers, "role_policies", {
AmazonEmrContainers = aws_iam_policy.emrcontainers[0].arn
AmazonEmrContainers = var.enable_emrcontainers ? aws_iam_policy.emrcontainers[0].arn : null
})
create_policy = try(var.emrcontainers.create_policy, false)

Expand Down Expand Up @@ -701,7 +701,7 @@ module "sfn" {
source = "aws-ia/eks-blueprints-addon/aws"
version = "1.1.0"

create = var.enable_emrcontainers
create = var.enable_sfn
askulkarni2 marked this conversation as resolved.
Show resolved Hide resolved

# public.ecr.aws/aws-controllers-k8s/sfn_name-chart:1.0.2
name = try(var.sfn.name, local.sfn_name)
Expand Down Expand Up @@ -770,7 +770,7 @@ module "sfn" {
role_description = try(var.sfn.role_description, "IRSA for sfn controller for ACK")
role_policies = lookup(var.sfn, "role_policies", {
AWSStepFunctionsFullAccess = "${local.iam_role_policy_prefix}/AWSStepFunctionsFullAccess"
AWSStepFunctionsIamPassRole = aws_iam_policy.sfnpasspolicy[0].arn
AWSStepFunctionsIamPassRole = var.enable_sfn ? aws_iam_policy.sfnpasspolicy[0].arn : null
})
create_policy = try(var.sfn.create_policy, false)

Expand Down