-
Notifications
You must be signed in to change notification settings - Fork 235
/
main.tf
54 lines (41 loc) · 1.21 KB
/
main.tf
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
terraform {
required_providers {
helm = {
source = "hashicorp/helm"
version = "~> 2.10.1"
}
kubernetes = {
source = "hashicorp/kubernetes"
version = "~> 2.22.0"
}
google = {
source = "hashicorp/google"
version = "~> 4.77.0"
}
}
required_version = ">= 1.1.0"
}
data "tfe_outputs" "cluster" {
organization = var.organization
workspace = var.cluster_workspace
}
# Retrieve GKE cluster information
provider "google" {
project = data.tfe_outputs.cluster.values.project_id
region = data.tfe_outputs.cluster.values.region
}
data "google_client_config" "default" {}
provider "kubernetes" {
host = "https://${data.tfe_outputs.cluster.values.host}"
token = data.google_client_config.default.access_token
cluster_ca_certificate = data.tfe_outputs.cluster.values.cluster_ca_certificate
}
provider "helm" {
kubernetes {
host = data.tfe_outputs.cluster.values.host
token = data.google_client_config.default.access_token
cluster_ca_certificate = data.tfe_outputs.cluster.values.cluster_ca_certificate
}
}