From d9f9410ae52ed3ee92a3a4208c439960e583b823 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wiktor=20Niesiob=C4=99dzki?= Date: Sun, 3 Dec 2023 10:03:22 +0000 Subject: [PATCH 1/2] Use unique names for logging buckets in examples Logging bucket name can be reused only after 7 days (when it is actually deleted). When different tests reuse the same name, the ones that are executed as 2nd and later will fail with message: ``` Error updating Logging Bucket Config [...]: googleapi: Error 400: Buckets must be in an ACTIVE state to be modified ``` As their actual state is: ``` lifecycleState: DELETE_REQUESTED ``` --- modules/folder/README.md | 2 +- modules/organization/README.md | 2 +- modules/project/README.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/folder/README.md b/modules/folder/README.md index 3e13c86a..059fe399 100644 --- a/modules/folder/README.md +++ b/modules/folder/README.md @@ -225,7 +225,7 @@ module "bucket" { source = "./fabric/modules/logging-bucket" parent_type = "project" parent = var.project_id - id = "bucket" + id = "${var.prefix}-bucket" } module "folder-sink" { diff --git a/modules/organization/README.md b/modules/organization/README.md index 737e202b..1d8232cd 100644 --- a/modules/organization/README.md +++ b/modules/organization/README.md @@ -291,7 +291,7 @@ module "bucket" { source = "./fabric/modules/logging-bucket" parent_type = "project" parent = var.project_id - id = "bucket" + id = "${var.prefix}-bucket" } module "org" { diff --git a/modules/project/README.md b/modules/project/README.md index 13f142af..d253e855 100644 --- a/modules/project/README.md +++ b/modules/project/README.md @@ -461,7 +461,7 @@ module "bucket" { source = "./fabric/modules/logging-bucket" parent_type = "project" parent = var.project_id - id = "bucket" + id = "${var.prefix}-bucket" } module "project-host" { @@ -822,7 +822,7 @@ module "bucket" { source = "./fabric/modules/logging-bucket" parent_type = "project" parent = var.project_id - id = "bucket" + id = "${var.prefix}-bucket" } # tftest modules=7 resources=53 inventory=data.yaml e2e ``` From 4668b90e8ab98dc819a013ccc62b39f69cd0e822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wiktor=20Niesiob=C4=99dzki?= Date: Sun, 3 Dec 2023 10:37:23 +0000 Subject: [PATCH 2/2] Fix inventory for project --- tests/modules/project/examples/data.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/modules/project/examples/data.yaml b/tests/modules/project/examples/data.yaml index b7ec3d23..b93eca06 100644 --- a/tests/modules/project/examples/data.yaml +++ b/tests/modules/project/examples/data.yaml @@ -15,7 +15,7 @@ values: module.bucket.google_logging_project_bucket_config.bucket[0]: - bucket_id: bucket + bucket_id: test-bucket project: project-id module.create-project.google_project.project[0]: billing_account: 123456-123456-123456