diff --git a/examples/factories/project-factory/main.tf b/examples/factories/project-factory/main.tf index 4efdaeac0..774fc1d64 100644 --- a/examples/factories/project-factory/main.tf +++ b/examples/factories/project-factory/main.tf @@ -24,10 +24,11 @@ locals { } _group_iam_bindings = distinct(flatten(values(var.group_iam))) # internal structures for project service accounts IAM bindings + _project_id = var.prefix == null || var.prefix == "" ? var.project_id : "${var.prefix}-${var.project_id}" _service_accounts_iam = { for r in local._service_accounts_iam_bindings : r => [ for k, v in var.service_accounts : - "serviceAccount:${k}@${var.project_id}.iam.gserviceaccount.com" + "serviceAccount:${k}@${local._project_id}.iam.gserviceaccount.com" if try(index(v, r), null) != null ] } diff --git a/tests/doc_examples/__init__.py b/tests/doc_examples/__init__.py index e69de29bb..6d6d1266c 100644 --- a/tests/doc_examples/__init__.py +++ b/tests/doc_examples/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2022 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.