terraform-example-foundation icon indicating copy to clipboard operation
terraform-example-foundation copied to clipboard

1-org deploy with cloudbuild plan error: `specify 'build.logs_bucket' (b) use the CLOUD_LOGGING_ONLY`

Open felipecrescencio-cit opened this issue 3 years ago • 1 comments

TL;DR

At 1-org using Cloud Build on step 17 during the build this error happened:

Your build failed to run: generic::invalid_argument: generic::invalid_argument: if 'build.service_account' is specified, the build must either (a) specify 'build.logs_bucket' (b) use the CLOUD_LOGGING_ONLY logging option, or (c) use the NONE logging option

image

Expected behavior

Build trigger gcp-org---terraform-plan should work.

Observed behavior

Getting this error:

Your build failed to run: generic::invalid_argument: generic::invalid_argument: if 'build.service_account' is specified, the build must either (a) specify 'build.logs_bucket' (b) use the CLOUD_LOGGING_ONLY logging option, or (c) use the NONE logging option

Terraform Configuration

Default 1-org configuration.

Terraform Version

Terraform v1.2.4
on linux_amd64

Additional information

Workaround this issue by updating cloudbuild-tf-apply.yaml and cloudbuild-tf-plan.yaml with the piece of code below after the last step:

options:
  logging: CLOUD_LOGGING_ONLY

felipecrescencio-cit avatar Aug 05 '22 20:08 felipecrescencio-cit

The cloudbuild has a bug which is missing the logbucket. To resolve it the below must be added at the end of the cloudbuild-tf-plan.yaml

logsBucket: '${_LOGS_BUCKET_NAME}'
options:
  logging: GCS_ONL

hadi-alnehlawi avatar Aug 05 '22 22:08 hadi-alnehlawi