Skip to content

Commit

Permalink
Merge pull request #9 from iqz-systems/module-upgrade
Browse files Browse the repository at this point in the history
Switch module to use implied providers
  • Loading branch information
rajshrimohanks authored Aug 21, 2024
2 parents 6f4c967 + 8b8aaae commit 14d3e5e
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 55 deletions.
12 changes: 1 addition & 11 deletions gke.tf
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ resource "google_container_node_pool" "node_pool" {

name = var.node_pools[count.index].name
project = data.google_project.current.project_id
location = var.project_region
location = var.cluster_region
cluster = google_container_cluster.cluster.name
node_locations = var.node_pools[count.index].node_pool_node_zones

Expand Down Expand Up @@ -144,13 +144,3 @@ resource "google_container_node_pool" "node_pool" {
]
}
}

# https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/tree/master/modules/auth
module "gke_auth" {
source = "terraform-google-modules/kubernetes-engine/google//modules/auth"
project_id = data.google_project.current.project_id

cluster_name = google_container_cluster.cluster.name
location = var.project_region
depends_on = [google_container_cluster.cluster]
}
6 changes: 0 additions & 6 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ terraform {
}
}

provider "google" {
project = var.project_id
region = var.project_region
zone = var.project_zone
}

data "google_project" "current" {
}

Expand Down
23 changes: 0 additions & 23 deletions outputs.tf
Original file line number Diff line number Diff line change
@@ -1,26 +1,3 @@
output "k8s_host" {
value = module.gke_auth.host
description = "The host address of the Kubernetes cluster."
}

output "k8s_token" {
value = module.gke_auth.token
sensitive = true
description = "The OAuth token which can be used to authenticate with the cluster."
}

output "k8s_cluster_ca_certificate" {
value = module.gke_auth.cluster_ca_certificate
sensitive = true
description = "The kubernetes cluster CA certificate."
}

output "k8s_kubeconfig" {
value = module.gke_auth.kubeconfig_raw
sensitive = true
description = "The raw kubeconfig file for the cluster."
}

output "service_account_email" {
value = google_service_account.k8s_sa.email
sensitive = false
Expand Down
15 changes: 0 additions & 15 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
variable "project_id" {
type = string
description = "The id of the project where the cluster has to be created."
}

variable "project_region" {
type = string
description = "The region where the resources will be created."
}

variable "project_zone" {
type = string
description = "The zone where the resources will be created."
}

variable "cluster_region" {
type = string
description = "The region where the cluster master has to be created."
Expand Down

0 comments on commit 14d3e5e

Please sign in to comment.