From 59c98d9b579ec386ff45a47200ea167c4fbe1f51 Mon Sep 17 00:00:00 2001 From: Ludovico Magnocavallo Date: Sat, 10 Aug 2019 19:48:01 +0200 Subject: [PATCH 1/5] Update module to Terraform 0.12 --- .ruby-version | 1 - Gemfile | 2 +- Makefile | 28 ++--- examples/simple_example/main.tf | 12 +-- examples/simple_example/outputs.tf | 3 +- examples/simple_example/variables.tf | 9 +- examples/simple_example/versions.tf | 4 + kitchen.yml | 5 - main.tf | 100 ++++++++++-------- outputs.tf | 13 +-- test/boilerplate/boilerplate.Dockerfile.txt | 2 +- test/boilerplate/boilerplate.Makefile.txt | 2 +- test/boilerplate/boilerplate.go.txt | 2 +- test/boilerplate/boilerplate.py.txt | 2 +- .../gcp.rb => boilerplate/boilerplate.rb.txt} | 15 +-- test/boilerplate/boilerplate.sh.txt | 2 +- test/boilerplate/boilerplate.tf.txt | 2 +- test/boilerplate/boilerplate.xml.txt | 2 +- test/boilerplate/boilerplate.yaml.txt | 2 +- test/fixtures/simple_example/main.tf | 5 +- test/fixtures/simple_example/outputs.tf | 5 +- test/fixtures/simple_example/variables.tf | 3 +- test/fixtures/simple_example/versions.tf | 4 + .../simple_example/controls/gcloud.rb | 23 ---- test/integration/simple_example/inspec.yml | 4 - test/make.sh | 15 +-- test/test_verify_boilerplate.py | 12 +-- test/verify_boilerplate.py | 50 +++++---- variables.tf | 8 +- versions.tf | 4 + 30 files changed, 163 insertions(+), 178 deletions(-) delete mode 100644 .ruby-version create mode 100644 examples/simple_example/versions.tf rename test/{integration/simple_example/controls/gcp.rb => boilerplate/boilerplate.rb.txt} (66%) create mode 100644 test/fixtures/simple_example/versions.tf delete mode 100644 test/integration/simple_example/controls/gcloud.rb create mode 100644 versions.tf diff --git a/.ruby-version b/.ruby-version deleted file mode 100644 index aedc15b..0000000 --- a/.ruby-version +++ /dev/null @@ -1 +0,0 @@ -2.5.3 diff --git a/Gemfile b/Gemfile index 4dbdea2..6dc7c95 100644 --- a/Gemfile +++ b/Gemfile @@ -15,5 +15,5 @@ ruby '2.5.3' source 'https://rubygems.org/' do - gem 'kitchen-terraform', '~> 4.8' + gem 'kitchen-terraform', '~> 4.9' end diff --git a/Makefile b/Makefile index 7f127c0..bd31e8a 100644 --- a/Makefile +++ b/Makefile @@ -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.0.1 +DOCKER_TAG_BASE_KITCHEN_TERRAFORM ?= 2.3.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 @@ -30,7 +30,7 @@ all: check generate_docs # Run all available linters .PHONY: check -check: check_shell check_python check_golang check_terraform check_docker check_base_files test_check_headers check_headers check_trailing_whitespace +check: check_python check_golang check_terraform check_base_files test_check_headers check_headers check_trailing_whitespace # The .PHONY directive tells make that this isn't a real target and so # the presence of a file named 'check_shell' won't cause this target to stop @@ -93,9 +93,9 @@ docker_run: -e PROJECT_ID \ -e SERVICE_ACCOUNT_JSON \ -e GOOGLE_APPLICATION_CREDENTIALS=${CREDENTIALS_PATH} \ - -v "$(CURDIR)":/cft/workdir \ + -v $(CURDIR):/cft/workdir \ ${DOCKER_REPO_BASE_KITCHEN_TERRAFORM} \ - /bin/bash -c "source test/ci_integration.sh && setup_environment && exec /bin/bash" + /bin/bash -c "cd /cft/workdir && source test/ci_integration.sh && setup_environment && exec /bin/bash" .PHONY: docker_create docker_create: @@ -103,9 +103,9 @@ docker_create: -e PROJECT_ID \ -e SERVICE_ACCOUNT_JSON \ -e GOOGLE_APPLICATION_CREDENTIALS=${CREDENTIALS_PATH} \ - -v "$(CURDIR)":/cft/workdir \ + -v $(CURDIR):/cft/workdir \ ${DOCKER_REPO_BASE_KITCHEN_TERRAFORM} \ - /bin/bash -c "source test/ci_integration.sh && setup_environment && kitchen create" + /bin/bash -c "cd /cft/workdir && source test/ci_integration.sh && setup_environment && kitchen create" .PHONY: docker_converge docker_converge: @@ -113,9 +113,9 @@ docker_converge: -e PROJECT_ID \ -e SERVICE_ACCOUNT_JSON \ -e GOOGLE_APPLICATION_CREDENTIALS=${CREDENTIALS_PATH} \ - -v "$(CURDIR)":/cft/workdir \ + -v $(CURDIR):/cft/workdir \ ${DOCKER_REPO_BASE_KITCHEN_TERRAFORM} \ - /bin/bash -c "source test/ci_integration.sh && setup_environment && kitchen converge" + /bin/bash -c "cd /cft/workdir && source test/ci_integration.sh && setup_environment && kitchen converge" .PHONY: docker_verify docker_verify: @@ -123,9 +123,9 @@ docker_verify: -e PROJECT_ID \ -e SERVICE_ACCOUNT_JSON \ -e GOOGLE_APPLICATION_CREDENTIALS=${CREDENTIALS_PATH} \ - -v "$(CURDIR)":/cft/workdir \ + -v $(CURDIR):/cft/workdir \ ${DOCKER_REPO_BASE_KITCHEN_TERRAFORM} \ - /bin/bash -c "source test/ci_integration.sh && setup_environment && kitchen verify" + /bin/bash -c "cd /cft/workdir && source test/ci_integration.sh && setup_environment && kitchen verify" .PHONY: docker_destroy docker_destroy: @@ -133,9 +133,9 @@ docker_destroy: -e PROJECT_ID \ -e SERVICE_ACCOUNT_JSON \ -e GOOGLE_APPLICATION_CREDENTIALS=${CREDENTIALS_PATH} \ - -v "$(CURDIR)":/cft/workdir \ + -v $(CURDIR):/cft/workdir \ ${DOCKER_REPO_BASE_KITCHEN_TERRAFORM} \ - /bin/bash -c "source test/ci_integration.sh && setup_environment && kitchen destroy" + /bin/bash -c "cd /cft/workdir && source test/ci_integration.sh && setup_environment && kitchen destroy" .PHONY: test_integration_docker test_integration_docker: @@ -143,6 +143,6 @@ test_integration_docker: -e PROJECT_ID \ -e SERVICE_ACCOUNT_JSON \ -e GOOGLE_APPLICATION_CREDENTIALS=${CREDENTIALS_PATH} \ - -v "$(CURDIR)":/cft/workdir \ + -v $(CURDIR):/cft/workdir \ ${DOCKER_REPO_BASE_KITCHEN_TERRAFORM} \ - make test_integration + /bin/bash -c "cd /cft/workdir && source test/ci_integration.sh && setup_environment && make test_integration" diff --git a/examples/simple_example/main.tf b/examples/simple_example/main.tf index 4737a02..540ec04 100644 --- a/examples/simple_example/main.tf +++ b/examples/simple_example/main.tf @@ -19,10 +19,10 @@ provider "google" { } module "cloud_storage" { - source = "../.." - - project_id = "${var.project_id}" - prefix = "${var.prefix}" - names = "${var.names}" - bucket_policy_only = "${var.bucket_policy_only}" + source = "../.." + project_id = var.project_id + prefix = var.prefix + names = var.names + bucket_policy_only = var.bucket_policy_only } + diff --git a/examples/simple_example/outputs.tf b/examples/simple_example/outputs.tf index d050853..de405f6 100644 --- a/examples/simple_example/outputs.tf +++ b/examples/simple_example/outputs.tf @@ -16,5 +16,6 @@ output "names" { description = "Names of the buckets created." - value = "${values(module.cloud_storage.names)}" + value = module.cloud_storage.names } + diff --git a/examples/simple_example/variables.tf b/examples/simple_example/variables.tf index 40784e9..e6d05d5 100644 --- a/examples/simple_example/variables.tf +++ b/examples/simple_example/variables.tf @@ -16,20 +16,21 @@ variable "project_id" { description = "The ID of the project in which to provision resources." - type = "string" + type = string } variable "names" { description = "Names of the buckets to create." - type = "list" + type = list(string) } variable "prefix" { description = "Prefix used to generate bueckt names." - type = "string" + type = string } variable "bucket_policy_only" { description = "Disable ad-hoc ACLs on specified buckets. Defaults to true. Map of lowercase unprefixed name => boolean" - type = "map" + type = map(string) } + diff --git a/examples/simple_example/versions.tf b/examples/simple_example/versions.tf new file mode 100644 index 0000000..ac97c6a --- /dev/null +++ b/examples/simple_example/versions.tf @@ -0,0 +1,4 @@ + +terraform { + required_version = ">= 0.12" +} diff --git a/kitchen.yml b/kitchen.yml index f3c9c35..8b65aa9 100644 --- a/kitchen.yml +++ b/kitchen.yml @@ -35,9 +35,4 @@ suites: - name: simple_example local backend: local controls: - - gcloud - gsutil - - name: simple_example gcp - backend: gcp - controls: - - gcp diff --git a/main.tf b/main.tf index 71a3b8d..10828b8 100644 --- a/main.tf +++ b/main.tf @@ -1,5 +1,5 @@ /** - * Copyright 2018 Google LLC + * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -14,65 +14,77 @@ * limitations under the License. */ -terraform { - required_version = "~> 0.11.0" -} - locals { - prefix = "${var.prefix == "" ? "" : "${var.prefix}-"}${lower(var.location)}" + prefix = var.prefix == "" ? "" : join("-", list(var.prefix, "")) } resource "google_storage_bucket" "buckets" { - count = "${length(var.names)}" - name = "${var.prefix}-${lower(element(var.names, count.index))}" - project = "${var.project_id}" - bucket_policy_only = "${lookup(var.bucket_policy_only, lower(element(var.names, count.index)), true)}" - location = "${var.location}" - storage_class = "${var.storage_class}" - labels = "${var.labels}" - + count = length(var.names) + name = "${local.prefix}${lower(element(var.names, count.index))}" + project = var.project_id + location = var.location + storage_class = var.storage_class + labels = var.labels + force_destroy = lookup( + var.force_destroy, + lower(element(var.names, count.index)), + false, + ) + bucket_policy_only = lookup( + var.bucket_policy_only, + lower(element(var.names, count.index)), + true, + ) versioning { - enabled = "${ - lookup(var.versioning, lower(element(var.names, count.index)), false) - }" + enabled = lookup( + var.versioning, + lower(element(var.names, count.index)), + false, + ) } } resource "google_storage_bucket_iam_binding" "admins" { - count = "${var.set_admin_roles ? length(var.names) : 0}" - bucket = "${element(google_storage_bucket.buckets.*.name, count.index)}" + count = var.set_admin_roles ? length(var.names) : 0 + bucket = element(google_storage_bucket.buckets.*.name, count.index) role = "roles/storage.objectAdmin" - - members = ["${compact(concat( - var.admins, - split(",", - lookup(var.bucket_admins, element(var.names, count.index), "") - ) - ))}"] + members = compact( + concat( + var.admins, + split( + ",", + lookup(var.bucket_admins, element(var.names, count.index), ""), + ), + ), + ) } resource "google_storage_bucket_iam_binding" "creators" { - count = "${var.set_creator_roles ? length(var.names) : 0}" - bucket = "${element(google_storage_bucket.buckets.*.name, count.index)}" + count = var.set_creator_roles ? length(var.names) : 0 + bucket = element(google_storage_bucket.buckets.*.name, count.index) role = "roles/storage.objectCreator" - - members = ["${compact(concat( - var.creators, - split(",", - lookup(var.bucket_creators, element(var.names, count.index), "") - ) - ))}"] + members = compact( + concat( + var.creators, + split( + ",", + lookup(var.bucket_creators, element(var.names, count.index), ""), + ), + ), + ) } resource "google_storage_bucket_iam_binding" "viewers" { - count = "${var.set_viewer_roles ? length(var.names) : 0}" - bucket = "${element(google_storage_bucket.buckets.*.name, count.index)}" + count = var.set_viewer_roles ? length(var.names) : 0 + bucket = element(google_storage_bucket.buckets.*.name, count.index) role = "roles/storage.objectViewer" - - members = ["${compact(concat( - var.viewers, - split(",", - lookup(var.bucket_viewers, element(var.names, count.index), "") - ) - ))}"] + members = compact( + concat( + var.viewers, + split( + ",", + lookup(var.bucket_viewers, element(var.names, count.index), ""), + ), + ), + ) } diff --git a/outputs.tf b/outputs.tf index 96a21b4..270f74c 100644 --- a/outputs.tf +++ b/outputs.tf @@ -16,20 +16,21 @@ output "name" { description = "Bucket name of the first bucket (for single-use cases)." - value = "${element(google_storage_bucket.buckets.*.name, 0)}" + value = google_storage_bucket.buckets[0].name } output "url" { description = "URL of the first bucket (for single-use cases)." - value = "${element(google_storage_bucket.buckets.*.url, 0)}" + value = google_storage_bucket.buckets[0].url } output "names" { - description = "Map of unprefixed names => bucket names." - value = "${zipmap(var.names, google_storage_bucket.buckets.*.name)}" + description = "List of generated bucket names." + value = google_storage_bucket.buckets.*.name } output "urls" { - description = "Map of unprefixed names => bucket URLs." - value = "${zipmap(var.names, google_storage_bucket.buckets.*.url)}" + description = "List of bucket URLs." + value = google_storage_bucket.buckets.*.url } + diff --git a/test/boilerplate/boilerplate.Dockerfile.txt b/test/boilerplate/boilerplate.Dockerfile.txt index b0c7da3..1b99189 100644 --- a/test/boilerplate/boilerplate.Dockerfile.txt +++ b/test/boilerplate/boilerplate.Dockerfile.txt @@ -1,4 +1,4 @@ -# Copyright 2018 Google LLC +# Copyright YEAR Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/test/boilerplate/boilerplate.Makefile.txt b/test/boilerplate/boilerplate.Makefile.txt index b0c7da3..1b99189 100644 --- a/test/boilerplate/boilerplate.Makefile.txt +++ b/test/boilerplate/boilerplate.Makefile.txt @@ -1,4 +1,4 @@ -# Copyright 2018 Google LLC +# Copyright YEAR Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/test/boilerplate/boilerplate.go.txt b/test/boilerplate/boilerplate.go.txt index 557e16f..1af9660 100644 --- a/test/boilerplate/boilerplate.go.txt +++ b/test/boilerplate/boilerplate.go.txt @@ -1,5 +1,5 @@ /* -Copyright 2018 Google LLC +Copyright YEAR Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/test/boilerplate/boilerplate.py.txt b/test/boilerplate/boilerplate.py.txt index b0c7da3..1b99189 100644 --- a/test/boilerplate/boilerplate.py.txt +++ b/test/boilerplate/boilerplate.py.txt @@ -1,4 +1,4 @@ -# Copyright 2018 Google LLC +# Copyright YEAR Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/test/integration/simple_example/controls/gcp.rb b/test/boilerplate/boilerplate.rb.txt similarity index 66% rename from test/integration/simple_example/controls/gcp.rb rename to test/boilerplate/boilerplate.rb.txt index 95f2b76..1b99189 100644 --- a/test/integration/simple_example/controls/gcp.rb +++ b/test/boilerplate/boilerplate.rb.txt @@ -1,24 +1,13 @@ -# Copyright 2018 Google LLC +# Copyright YEAR 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 +# https://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. - -control "gcp" do - title "GCP Resources" - - attribute("names").each do |name| - describe google_storage_bucket(name: name) do - it { should exist } - end - end - -end diff --git a/test/boilerplate/boilerplate.sh.txt b/test/boilerplate/boilerplate.sh.txt index 2e94f3e..9f9c9af 100644 --- a/test/boilerplate/boilerplate.sh.txt +++ b/test/boilerplate/boilerplate.sh.txt @@ -1,4 +1,4 @@ -# Copyright 2018 Google LLC +# Copyright YEAR Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/test/boilerplate/boilerplate.tf.txt b/test/boilerplate/boilerplate.tf.txt index cfccff8..b8eae40 100644 --- a/test/boilerplate/boilerplate.tf.txt +++ b/test/boilerplate/boilerplate.tf.txt @@ -1,5 +1,5 @@ /** - * Copyright 2018 Google LLC + * Copyright YEAR Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/test/boilerplate/boilerplate.xml.txt b/test/boilerplate/boilerplate.xml.txt index 3d98cdc..00a2856 100644 --- a/test/boilerplate/boilerplate.xml.txt +++ b/test/boilerplate/boilerplate.xml.txt @@ -1,5 +1,5 @@ ## Inputs | Name | Description | Type | Default | Required | @@ -67,12 +66,16 @@ Functional examples are included in the | Name | Description | |------|-------------| -| name | Bucket name of the first bucket (for single-use cases). | -| names | List of generated bucket names. | -| url | URL of the first bucket (for single-use cases). | -| urls | List of bucket URLs. | - -[^]: (autogen_docs_end) +| bucket | Bucket resource (for single use). | +| buckets | Bucket resources. | +| name | Bucket name (for single use). | +| names | Bucket names. | +| names\_list | List of bucket names. | +| url | Bucket URL (for single use). | +| urls | Bucket URLs. | +| urls\_list | List of bucket URLs. | + + ## Requirements diff --git a/examples/simple_example/README.md b/examples/simple_example/README.md index e88fafa..ca6d4a3 100644 --- a/examples/simple_example/README.md +++ b/examples/simple_example/README.md @@ -2,14 +2,13 @@ This example illustrates how to use the `cloud-storage` module. -[^]: (autogen_docs_start) - + ## Inputs | Name | Description | Type | Default | Required | |------|-------------|:----:|:-----:|:-----:| -| bucket\_policy\_only | Disable ad-hoc ACLs on specified buckets. Defaults to true. Map of lowercase unprefixed name => boolean | map | n/a | yes | -| names | Names of the buckets to create. | list | n/a | yes | +| bucket\_policy\_only | Disable ad-hoc ACLs on specified buckets. Defaults to true. Map of lowercase unprefixed name => boolean | map(string) | n/a | yes | +| names | Names of the buckets to create. | list(string) | n/a | yes | | prefix | Prefix used to generate bueckt names. | string | n/a | yes | | project\_id | The ID of the project in which to provision resources. | string | n/a | yes | @@ -17,9 +16,10 @@ This example illustrates how to use the `cloud-storage` module. | Name | Description | |------|-------------| -| names | Names of the buckets created. | +| names | Bucket names. | +| names\_list | List of bucket names. | -[^]: (autogen_docs_end) + To provision this example, run the following from within this directory: - `terraform init` to get the plugins diff --git a/examples/simple_example/outputs.tf b/examples/simple_example/outputs.tf index de405f6..18a0211 100644 --- a/examples/simple_example/outputs.tf +++ b/examples/simple_example/outputs.tf @@ -15,7 +15,11 @@ */ output "names" { - description = "Names of the buckets created." + description = "Bucket names." value = module.cloud_storage.names } +output "names_list" { + description = "List of bucket names." + value = module.cloud_storage.names_list +} diff --git a/outputs.tf b/outputs.tf index 5af4b47..e548fba 100644 --- a/outputs.tf +++ b/outputs.tf @@ -14,23 +14,42 @@ * limitations under the License. */ +output "bucket" { + description = "Bucket resource (for single use)." + value = google_storage_bucket.buckets[0] +} + output "name" { - description = "Bucket name of the first bucket (for single-use cases)." + description = "Bucket name (for single use)." value = google_storage_bucket.buckets[0].name } output "url" { - description = "URL of the first bucket (for single-use cases)." + description = "Bucket URL (for single use)." value = google_storage_bucket.buckets[0].url } +output "buckets" { + description = "Bucket resources." + value = google_storage_bucket.buckets +} + output "names" { - description = "List of generated bucket names." - value = google_storage_bucket.buckets[*].name + description = "Bucket names." + value = zipmap(var.names, google_storage_bucket.buckets[*].name) } output "urls" { + description = "Bucket URLs." + value = zipmap(var.names, google_storage_bucket.buckets[*].url) +} + +output "names_list" { + description = "List of bucket names." + value = google_storage_bucket.buckets[*].name +} + +output "urls_list" { description = "List of bucket URLs." value = google_storage_bucket.buckets[*].url } - diff --git a/test/fixtures/simple_example/outputs.tf b/test/fixtures/simple_example/outputs.tf index 0a0f67b..4982ce4 100644 --- a/test/fixtures/simple_example/outputs.tf +++ b/test/fixtures/simple_example/outputs.tf @@ -15,10 +15,15 @@ */ output "names" { - description = "The names of the buckets." + description = "Bucket names." value = module.example.names } +output "names_list" { + description = "List of bucket names." + value = module.example.names_list +} + output "project_id" { description = "The ID of the project in which resources are provisioned." value = var.project_id diff --git a/test/integration/simple_example/controls/gsutil.rb b/test/integration/simple_example/controls/gsutil.rb index 1fbb18f..9699c8c 100644 --- a/test/integration/simple_example/controls/gsutil.rb +++ b/test/integration/simple_example/controls/gsutil.rb @@ -18,17 +18,17 @@ describe command("gsutil ls -p #{attribute("project_id")}") do its(:exit_status) { should eq 0 } its(:stderr) { should eq "" } - its(:stdout) { should include "#{attribute("names")[0]}" } - its(:stdout) { should include "#{attribute("names")[1]}" } + its(:stdout) { should include attribute('names').values[0] } + its(:stdout) { should include attribute('names').values[1] } end - describe command("gsutil bucketpolicyonly get gs://#{attribute("names")[0]}") do + describe command("gsutil bucketpolicyonly get gs://#{attribute("names_list")[0]}") do its(:exit_status) { should eq 0 } its(:stderr) { should eq "" } its(:stdout) { should include "Enabled: True" } end - describe command("gsutil bucketpolicyonly get gs://#{attribute("names")[1]}") do + describe command("gsutil bucketpolicyonly get gs://#{attribute("names_list")[1]}") do its(:exit_status) { should eq 0 } its(:stderr) { should eq "" } its(:stdout) { should include "Enabled: False" } diff --git a/test/integration/simple_example/inspec.yml b/test/integration/simple_example/inspec.yml index 2ae95f4..809ff3a 100644 --- a/test/integration/simple_example/inspec.yml +++ b/test/integration/simple_example/inspec.yml @@ -5,4 +5,6 @@ attributes: type: string - name: names required: true + type: hash + - name: names_list type: array From ab84645a4f674d32ca6ed32e4edb5f41909ea604 Mon Sep 17 00:00:00 2001 From: Ludovico Magnocavallo Date: Thu, 15 Aug 2019 17:31:19 +0200 Subject: [PATCH 5/5] revert change to prefix so it's unchanged vs previous version --- CHANGELOG.md | 1 + main.tf | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 013caf0..b880a9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to ### Changed - Upgraded for usage with terraform-0.12.x [#9] +- Added support for `force_destroy` attribute [#9] ## [0.1.0] - 2019-05-22 diff --git a/main.tf b/main.tf index 10828b8..dd9f8d7 100644 --- a/main.tf +++ b/main.tf @@ -15,7 +15,7 @@ */ locals { - prefix = var.prefix == "" ? "" : join("-", list(var.prefix, "")) + prefix = var.prefix == "" ? "" : join("-", list(var.prefix, lower(var.location), "")) } resource "google_storage_bucket" "buckets" {