Skip to content

Terraform module to generate a role with IRSA configured

Notifications You must be signed in to change notification settings

dza89/terraform-irsa-role

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Getting Started

See here

Helm example

Run Terraform with the example configuration.

module "aws_load_balancer_controller" {
  source = "dza89/role/irsa"

  policy_body  = tostring(file("${path.module}/aws-policy.json"))
  irsa_name    = "aws-load-balancer-controller"
  cluster_name = var.cluster_name
  namespace    = helm_release.aws_load_balancer_controller.metadata[0].namespace
}

resource "helm_release" "aws_load_balancer_controller" {
  name             = "aws-load-balancer-controller"
  repository       = "https://aws.github.io/eks-charts"
  chart            = "aws-load-balancer-controller"
  namespace        = "kube-system"
  create_namespace = "true"
  wait             = true
  version          = var.aws_load_balancer_controller_version
  values = [
    "${file("values.yaml")}",
  ]
  set {
    name  = "serviceAccount.annotations.eks\\.amazonaws\\.com/role-arn"
    value = tostring(module.aws_load_balancer_controller.iam_role_arn)
  }
  set {
    name  = "serviceAccount.name"
    value = "aws-load-balancer-controller" # needs to match irsa_name
  }
  set {
    name  = "clusterName"
    value = var.cluster_name
  }
}

You need the aws and helm provider.

About

Terraform module to generate a role with IRSA configured

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages