Skip to content

Commit

Permalink
Tflint for aws-karpenter module
Browse files Browse the repository at this point in the history
  • Loading branch information
kvvit committed Dec 30, 2024
1 parent c8aa708 commit 0ae95a9
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions terraform/modules/k8s-karpenter/providers.tf
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
terraform {
required_providers {
kubectl = {
source = "gavinbunney/kubectl"
version = ">= 1.14.0"
}
}
}

provider "aws" {
alias = "ecr"
region = "us-east-1"
}

provider "kubernetes" {
host = data.aws_eks_cluster.main.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.main.certificate_authority.0.data)
cluster_ca_certificate = base64decode(data.aws_eks_cluster.main.certificate_authority[0].data)
token = data.aws_eks_cluster_auth.main.token
}

provider "kubectl" {
host = data.aws_eks_cluster.main.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.main.certificate_authority.0.data)
cluster_ca_certificate = base64decode(data.aws_eks_cluster.main.certificate_authority[0].data)
token = data.aws_eks_cluster_auth.main.token
}

provider "helm" {
kubernetes {
host = data.aws_eks_cluster.main.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.main.certificate_authority.0.data)
cluster_ca_certificate = base64decode(data.aws_eks_cluster.main.certificate_authority[0].data)
token = data.aws_eks_cluster_auth.main.token
}

Expand All @@ -35,8 +44,6 @@ data "aws_eks_cluster_auth" "main" {
name = var.eks_cluster_id
}

data "aws_caller_identity" "current" {}

data "aws_ecrpublic_authorization_token" "token" {
provider = aws.ecr
}

0 comments on commit 0ae95a9

Please sign in to comment.