Open wyardley opened 1 year ago
with storage_source
(whose attributes are all listed as optional) the same thing happens:
source {
storage_source {
bucket = "gs://xyz"
}
}
│ Error: Error creating function: googleapi: Error 400: Could not clone object from gs://xyz to object driftctl-poc/function-source.zip in bucket gcf-v2-sources-yyyyy-us-west2. FIELD_IS_MISSING : object_name is required in source_object_id
Additionally, if the creation or deploy of the function fails for any reason, the item doesn't get added to tf state or removed / destroyed, and so the next time, trying to create will fail with an error like:
│ Error: Error creating function: googleapi: Error 409: Resource 'projects/xxx/locations/us-west2/functions/yyy' already exists
until the function is removed manually
Adding validation is reasonable https://cloud.google.com/functions/docs/reference/rest/v2beta/projects.locations.functions#RepoSource
Community Note
modular-magician
user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned tohashibot
, a community member has claimed the issue already.With
google_cloudfunctions2_function
(I have not tested gen1, but might also affect those resources) validation of thebuild_config
=>source
=>repo_source
attributes does not seem to be completeTerraform Version
Affected Resource(s)
google_cloudfunctions2_function
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
Terraform validation or plan should fail when
repo_source
is used and branch, tag or commit sha are not set.Actual Behavior
Steps to Reproduce
terraform apply
Important Factoids
References