Skip to content

Commit

Permalink
Merge pull request #20 from fabito/0.12-upgrade
Browse files Browse the repository at this point in the history
Upgrade to Terraform 0.12
  • Loading branch information
aaron-lane authored Jun 18, 2019
2 parents b596a15 + e844f15 commit 883dee0
Show file tree
Hide file tree
Showing 14 changed files with 73 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ The following dependencies must be installed on the development system:
- [hadolint]
- [make]
- [shellcheck]
- [Terraform][terraform] v0.11
- [Terraform][terraform] v0.12

### Execution

Expand Down
2 changes: 1 addition & 1 deletion terraform-google-{{cookiecutter.module_name}}/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ SHELL := /usr/bin/env bash
# Docker build config variables
CREDENTIALS_PATH ?= /cft/workdir/credentials.json
DOCKER_ORG := gcr.io/cloud-foundation-cicd
DOCKER_TAG_BASE_KITCHEN_TERRAFORM ?= 1.2.0
DOCKER_TAG_BASE_KITCHEN_TERRAFORM ?= 2.0.0
DOCKER_REPO_BASE_KITCHEN_TERRAFORM := ${DOCKER_ORG}/cft/kitchen-terraform:${DOCKER_TAG_BASE_KITCHEN_TERRAFORM}

# All is the first target in the file so it will get picked up when you just run 'make' on its own
Expand Down
2 changes: 1 addition & 1 deletion terraform-google-{{cookiecutter.module_name}}/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ These sections describe requirements for using this module.

The following dependencies must be available:

- [Terraform][terraform] v0.11
- [Terraform][terraform] v0.12
- [Terraform Provider for GCP][terraform-provider-gcp] plugin v2.0

### Service Account
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ provider "google" {
module "{{ cookiecutter.module_name|replace('-', '_') }}" {
source = "../.."

project_id = "${var.project_id}"
bucket_name = "${var.bucket_name}"
project_id = var.project_id
bucket_name = var.bucket_name
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@

output "bucket_name" {
description = "The name of the bucket."
value = "${module.{{ cookiecutter.module_name|replace('-', '_') }}.bucket_name}"
value = module.{{ cookiecutter.module_name|replace('-', '_') }}.bucket_name
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

variable "project_id" {
description = "The ID of the project in which to provision resources."
type = "string"
type = string
}

variable "bucket_name" {
description = "The name of the bucket to create."
type = "string"
type = string
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

terraform {
required_version = ">= 0.12"
}
4 changes: 2 additions & 2 deletions terraform-google-{{cookiecutter.module_name}}/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ terraform {
}

resource "google_storage_bucket" "main" {
project = "${var.project_id}"
name = "${var.bucket_name}"
project = var.project_id
name = var.bucket_name
}
2 changes: 1 addition & 1 deletion terraform-google-{{cookiecutter.module_name}}/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
*/

output "bucket_name" {
value = "${google_storage_bucket.main.name}"
value = google_storage_bucket.main.name
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ resource "random_pet" "main" {
module "example" {
source = "../../../examples/simple_example"

project_id = "${var.project_id}"
bucket_name = "${random_pet.main.id}"
project_id = var.project_id
bucket_name = random_pet.main.id
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

output "bucket_name" {
description = "The name of the bucket."
value = "${module.example.bucket_name}"
value = module.example.bucket_name
}

output "project_id" {
description = "The ID of the project in which resources are provisioned."
value = "${var.project_id}"
value = var.project_id
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@

variable "project_id" {
description = "The ID of the project in which to provision resources."
type = "string"
type = string
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

terraform {
required_version = ">= 0.12"
}
19 changes: 19 additions & 0 deletions terraform-google-{{cookiecutter.module_name}}/versions.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Copyright 2018 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

terraform {
required_version = ">= 0.12"
}

0 comments on commit 883dee0

Please sign in to comment.