Skip to content

Commit

Permalink
Passing oidc provider arn as var instead of calculating it
Browse files Browse the repository at this point in the history
  • Loading branch information
mcgin314 committed Sep 6, 2024
1 parent 5432f43 commit bea87e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
15 changes: 1 addition & 14 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
data "aws_caller_identity" "current" {
}

data "aws_eks_cluster" "cluster" {
name = var.cluster_name
}

data "aws_eks_cluster_auth" "cluster_auth" {
name = var.cluster_name
}

locals {
account_id = data.aws_caller_identity.current.account_id
tags = merge({
Expand All @@ -18,12 +10,7 @@ locals {
"boc:created_by" = "terraform"
}, var.additional_tags)

aws_eks_cluster_auth = data.aws_eks_cluster_auth.cluster_auth
aws_eks_cluster = data.aws_eks_cluster.cluster
oidc_url = data.aws_eks_cluster.cluster.identity[0].oidc[0].issuer
oidc_domain = replace(local.oidc_url, "https://", "")
oidc_arn = "arn:aws-us-gov:iam::${local.account_id}:oidc-provider/${local.oidc_domain}"

oidc_arn = var.oidc_provider_arn
}

module "tempo-irsa-role" {
Expand Down
5 changes: 5 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ variable "tempo_tag" {
default = "2.5.0"
}

variable "oidc_provider_arn" {
description = "The ARN in the EKS cluster for the OpenID Connect identity provider."
type = string
}

# Prometheus data for metrics generator
variable "prometheus_svc" {
description = "Prometheus service name."
Expand Down

0 comments on commit bea87e4

Please sign in to comment.