Open sandygvs opened 1 week ago
Hi @sandygvs!
According to terraform registry there is no argument called default_log_bucket_behavior
for the options
block of the google_cloudbuild_trigger
resource. Likewise in the API documentation there is nothing similar. If this is an enhancement proposal you need to argue the purpose of this new argument with solid bases and we can review the proposal. Otherwise if you have an official documentation link which supports the existence of this argument please share it with us.
@ggtisc Thanks for looking into it. I'm trying to configure cloud build to store the build logs in a regionalized, user-managed bucket instead of storing in the Google managed bucket as defined here https://cloud.google.com/build/docs/securing-builds/store-manage-build-logs#store_build_logs_in_a_user-owned_and_regionalized_bucket to have more control over the build logs of my projects. I'm finding a way to apply this change to the 100+ build triggers which I'm managing via terraform. This doc says the cloud schema does support it, https://cloud.google.com/build/docs/build-config-file-schema#structure_of_a_build_config_file. However not finding an option to do it via terraform, it would be good to have this supported as part of google_cloudbuild_trigger
resource.
Thanks for clarifying @sandygvs!
I'm forwarding this issue for a more in-depth review and taking actions as soon as possible to improve our terraform resources with the objective of provide you with better configuration options according to your needs
Community Note
Terraform Version & Provider Version(s)
terraform version: 1.8.4 GCP provider version : 6.3.0
The build is running, and logs are being written to the default logs bucket. However I'm trying to configure the cloud build to store the logs in user-owned and and regionalized bucket as per https://cloud.google.com/build/docs/securing-builds/store-manage-build-logs#store_build_logs_in_a_user-owned_and_regionalized_bucket
Affected Resource(s)
google_cloudbuild_trigger
Terraform Configuration
Debug Output
Error: Unsupported argument │ │ on inf_trigger/main.tf line 93, in resource "google_cloudbuild_trigger" "inf_build_trigger": │ 93: default_log_bucket_behavior = "REGIONAL_USER_OWNED_BUCKET" │ │ An argument named "default_log_bucket_behavior" is not expected here.
Expected Behavior
Tf should execute and update the cloud build trigger with options as below,
Actual Behavior
Error: Unsupported argument │ │ on inf_trigger/main.tf line 93, in resource "google_cloudbuild_trigger" "inf_build_trigger": │ 93: default_log_bucket_behavior = "REGIONAL_USER_OWNED_BUCKET" │ │ An argument named "default_log_bucket_behavior" is not expected here.
Steps to reproduce
terraform apply
Important Factoids
No response
References
https://cloud.google.com/build/docs/securing-builds/store-manage-build-logs#store_build_logs_in_a_user-owned_and_regionalized_bucket
b/376524368