Skip to content

Passing oidc provider arn as var instead of calculating it #1

Merged
merged 1 commit into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
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
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