-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcluster-namespace.tf
More file actions
29 lines (25 loc) · 1.01 KB
/
cluster-namespace.tf
File metadata and controls
29 lines (25 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
data "ns_connection" "cluster_namespace" {
name = "cluster-namespace"
contract = "cluster-namespace/aws/k8s:eks"
}
locals {
cluster_id = data.ns_connection.cluster_namespace.outputs.cluster_id
cluster_name = data.ns_connection.cluster_namespace.outputs.cluster_name
cluster_endpoint = data.ns_connection.cluster_namespace.outputs.cluster_endpoint
cluster_ca_certificate = data.ns_connection.cluster_namespace.outputs.cluster_ca_certificate
}
data "aws_eks_cluster_auth" "cluster" {
name = local.cluster_name
}
provider "kubernetes" {
host = local.cluster_endpoint
token = data.aws_eks_cluster_auth.cluster.token
cluster_ca_certificate = base64decode(local.cluster_ca_certificate)
}
provider "helm" {
kubernetes {
host = local.cluster_endpoint
token = data.aws_eks_cluster_auth.cluster.token
cluster_ca_certificate = base64decode(local.cluster_ca_certificate)
}
}