Skip to content

Commit

Permalink
fix: fixed issue with providers
Browse files Browse the repository at this point in the history
  • Loading branch information
eikc committed Mar 12, 2021
1 parent 05fbdb2 commit d32559b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 2 deletions.
1 change: 0 additions & 1 deletion modules/kubernetes/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ provider "kubernetes" {
host = data.aws_eks_cluster.this.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.this.certificate_authority.0.data)
token = data.aws_eks_cluster_auth.this.token
load_config_file = false
}

resource "kubernetes_namespace" "namespaces" {
Expand Down
2 changes: 1 addition & 1 deletion modules/vault/main.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

resource "aws_kms_key" "vault_key" {
description = "Vault key ${var.name}"
description = "Vault key for ${var.name}"
key_usage = "ENCRYPT_DECRYPT"
tags = var.common_tags
}
Expand Down
21 changes: 21 additions & 0 deletions modules/vault/providers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
data "aws_eks_cluster" "this" {
name = var.cluster_id
}

data "aws_eks_cluster_auth" "this" {
name = var.cluster_id
}

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

provider "helm" {
kubernetes {
host = data.aws_eks_cluster.this.endpoint
cluster_ca_certificate = base64decode(data.aws_eks_cluster.this.certificate_authority.0.data)
token = data.aws_eks_cluster_auth.this.token
}
}
5 changes: 5 additions & 0 deletions modules/vault/variables.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
variable "cluster_id" {
type = string
}

variable "name" {
type = string
}

variable "username" {
type = string
}
Expand Down

0 comments on commit d32559b

Please sign in to comment.