From 15475c379fd2a02be09bab602842115dce759efe Mon Sep 17 00:00:00 2001 From: Roberto Jung Drebes Date: Fri, 7 Jun 2019 23:55:54 +0200 Subject: [PATCH 1/2] Terraform Pub/Sub fix, do not send name on topic/subscription creation. --- products/pubsub/terraform.yaml | 3 +++ .../terraform/encoders/pubsub_noname.go.erb | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 templates/terraform/encoders/pubsub_noname.go.erb diff --git a/products/pubsub/terraform.yaml b/products/pubsub/terraform.yaml index 2fd93b3d164a..682ba08da7b8 100644 --- a/products/pubsub/terraform.yaml +++ b/products/pubsub/terraform.yaml @@ -26,6 +26,8 @@ overrides: !ruby/object:Overrides::ResourceOverrides diff_suppress_func: 'compareSelfLinkOrResourceName' custom_expand: templates/terraform/custom_expand/resource_from_self_link.go.erb custom_flatten: templates/terraform/custom_flatten/name_from_self_link.erb + custom_code: !ruby/object:Provider::Terraform::CustomCode + encoder: templates/terraform/encoders/pubsub_noname.go.erb Subscription: !ruby/object:Overrides::Terraform::ResourceOverride id_format: "projects/{{project}}/subscriptions/{{name}}" examples: @@ -71,6 +73,7 @@ overrides: !ruby/object:Overrides::ResourceOverrides custom_code: !ruby/object:Provider::Terraform::CustomCode constants: templates/terraform/constants/subscription.go.erb decoder: templates/terraform/decoders/pubsub_subscription.erb + encoder: templates/terraform/encoders/pubsub_noname.go.erb extra_schema_entry: templates/terraform/extra_schema_entry/pubsub_subscription_path.erb update_encoder: templates/terraform/update_encoder/pubsub_subscription.erb diff --git a/templates/terraform/encoders/pubsub_noname.go.erb b/templates/terraform/encoders/pubsub_noname.go.erb new file mode 100644 index 000000000000..44343e30d86d --- /dev/null +++ b/templates/terraform/encoders/pubsub_noname.go.erb @@ -0,0 +1,16 @@ +<%# The license inside this block applies to this file. + # Copyright 2019 Google Inc. + # 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. +-%> +delete(obj, "name") +return obj, nil From dc797e90f5fa796f813b5759488d7a1b16a23185 Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Mon, 10 Jun 2019 23:33:45 +0000 Subject: [PATCH 2/2] Update tracked submodules -> HEAD on Mon Jun 10 23:33:45 UTC 2019 Tracked submodules are build/terraform-beta build/terraform-mapper build/terraform build/ansible build/inspec. --- build/terraform | 2 +- build/terraform-beta | 2 +- build/terraform-mapper | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build/terraform b/build/terraform index 80df1bf2fb68..8daa72c870b8 160000 --- a/build/terraform +++ b/build/terraform @@ -1 +1 @@ -Subproject commit 80df1bf2fb6819a634d335ac46d23e963c212cbb +Subproject commit 8daa72c870b817487366ebe926eafac57e66a5e8 diff --git a/build/terraform-beta b/build/terraform-beta index 143b4adac238..adee67330f09 160000 --- a/build/terraform-beta +++ b/build/terraform-beta @@ -1 +1 @@ -Subproject commit 143b4adac2386a54acff113a2989df56659411fa +Subproject commit adee67330f0964a9870153a8ebe24762c26d04cb diff --git a/build/terraform-mapper b/build/terraform-mapper index b686c4f17320..f40ac2dc3df7 160000 --- a/build/terraform-mapper +++ b/build/terraform-mapper @@ -1 +1 @@ -Subproject commit b686c4f17320316c806f00b49792ba2959847d86 +Subproject commit f40ac2dc3df70ca24bec44baa9ea950b368d8206