Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Commit dc5cfc0

Browse files
author
bgeesaman
authored
Merge pull request #31 from wripley/master
Updated tf to 0.12 (patch applied from https://github.com/GoogleCloud…
2 parents 2e90d0a + 1c810cd commit dc5cfc0

File tree

6 files changed

+36
-15
lines changed

6 files changed

+36
-15
lines changed

Jenkinsfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ metadata:
3535
spec:
3636
containers:
3737
- name: ${containerName}
38-
image: gcr.io/pso-helmsman-cicd/jenkins-k8s-node:${env.CONTAINER_VERSION}
38+
image: gcr.io/pso-helmsman-cicd/jenkins-k8s-node:${env.JENKINS_CONTAINER_VERSION}
3939
command: ['cat']
4040
tty: true
4141
volumeMounts:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ gcloud init
7171

7272

7373
### Tools
74-
1. [Terraform >= 0.11.7](https://www.terraform.io/downloads.html)
74+
1. [Terraform >= 0.12](https://www.terraform.io/downloads.html)
7575
2. [Google Cloud SDK version >= 204.0.0](https://cloud.google.com/sdk/docs/downloads-versioned-archives)
7676
3. [kubectl matching the latest GKE version](https://kubernetes.io/docs/tasks/tools/install-kubectl/)
7777
4. bash or bash compatible shell

terraform/main.tf

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ limitations under the License.
2626
// Provides access to available Google Container Engine versions in a zone for a given project.
2727
// https://www.terraform.io/docs/providers/google/d/google_container_engine_versions.html
2828
data "google_container_engine_versions" "on-prem" {
29-
zone = "${var.zone}"
30-
project = "${var.project}"
29+
zone = var.zone
30+
project = var.project
3131
}
3232

3333
///////////////////////////////////////////////////////////////////////////////////////
@@ -55,7 +55,7 @@ resource "google_bigquery_dataset" "gke-bigquery-dataset" {
5555
location = "US"
5656
default_table_expiration_ms = 3600000
5757

58-
labels {
58+
labels = {
5959
env = "default"
6060
}
6161
}
@@ -68,9 +68,9 @@ resource "google_bigquery_dataset" "gke-bigquery-dataset" {
6868
// https://www.terraform.io/docs/providers/google/d/google_container_cluster.html
6969
resource "google_container_cluster" "primary" {
7070
name = "stackdriver-logging"
71-
zone = "${var.zone}"
71+
zone = var.zone
7272
initial_node_count = 2
73-
min_master_version = "${data.google_container_engine_versions.on-prem.latest_master_version}"
73+
min_master_version = data.google_container_engine_versions.on-prem.latest_master_version
7474

7575
node_config {
7676
oauth_scopes = [
@@ -81,6 +81,7 @@ resource "google_container_cluster" "primary" {
8181
]
8282
}
8383

84+
// These local-execs are used to provision the sample service
8485
// These local-execs are used to provision the sample service
8586
provisioner "local-exec" {
8687
command = "gcloud container clusters get-credentials ${google_container_cluster.primary.name} --zone ${google_container_cluster.primary.zone} --project ${var.project}"
@@ -125,7 +126,7 @@ resource "google_project_iam_binding" "log-writer-storage" {
125126
role = "roles/storage.objectCreator"
126127

127128
members = [
128-
"${google_logging_project_sink.storage-sink.writer_identity}",
129+
google_logging_project_sink.storage-sink.writer_identity,
129130
]
130131
}
131132

@@ -134,6 +135,7 @@ resource "google_project_iam_binding" "log-writer-bigquery" {
134135
role = "roles/bigquery.dataEditor"
135136

136137
members = [
137-
"${google_logging_project_sink.bigquery-sink.writer_identity}",
138+
google_logging_project_sink.bigquery-sink.writer_identity,
138139
]
139140
}
141+

terraform/provider.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
1817
// Configles the Google Cloud Provider with default settings
1918
provider "google" {
20-
project = "${var.project}"
21-
version = "~> 1.13"
19+
project = var.project
20+
version = "~> 2.10.0"
2221
}
22+

terraform/variables.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17-
1817
/*
1918
Required Variables
2019
These must be provided at runtime.
2120
*/
2221

2322
variable "zone" {
2423
description = "The zone in which to create the Kubernetes cluster. Must match the region"
25-
type = "string"
24+
type = string
2625
}
2726

2827
variable "project" {
2928
description = "The name of the project in which to create the Kubernetes cluster."
30-
type = "string"
29+
type = string
3130
}
31+

terraform/versions.tf

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/*
2+
Copyright 2018 Google LLC
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
https://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
terraform {
18+
required_version = ">= 0.12"
19+
}

0 commit comments

Comments
 (0)