You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment. If the issue is assigned to the "modular-magician" user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If the issue is assigned to a user, that user is claiming responsibility for the issue. If the issue is assigned to "hashibot", a community member has claimed the issue already.
Description
GCP's api exposes the version and update time of a cloud function. Exposing either of these fields on the cloudfunctions_function Terraform resource (as a read-only attribute) would be useful for several reasons.
My use case would be to consume the version or update time field as an argument to replace_triggered_by on a Terraform resource that needs to be (re)created when the Cloud Function changes. In my case, the cloudfunctions_function resource is created inside a Terraform module, and other resources not part of that module cannot reference the entire resource in their meta-arguments. cloudfunctions_function does not currently expose any attributes which change when the function's source code changes. Adding the version or update time field would work around this.
New or Affected Resource(s)
google_cloudfunctions_function
google_cloudfunctions2_function
Potential Terraform Configuration
# lifted from the current docsresource"google_cloudfunctions_function""function" {
name="function-test"description="My function"runtime="nodejs16"available_memory_mb=128source_archive_bucket=google_storage_bucket.bucket.namesource_archive_object=google_storage_bucket_object.archive.nametrigger_http=trueentry_point="helloGET"
}
# demonstrating the requested new field via an outputoutput"function_version" {
value=google_cloudfunctions_function.function.version_id
}
# demonstrating the requested new field via an outputoutput"function_update_time" {
value=google_cloudfunctions_function.function.update_time
}
It looks like updateTime is available on both the v1 and v2 (beta) resources, while versionId is only on the v1 resource. This suggests that updateTime might be a more future-proof choice.
b/274817399
The text was updated successfully, but these errors were encountered:
Community Note
Description
GCP's api exposes the version and update time of a cloud function. Exposing either of these fields on the
cloudfunctions_function
Terraform resource (as a read-only attribute) would be useful for several reasons.My use case would be to consume the version or update time field as an argument to
replace_triggered_by
on a Terraform resource that needs to be (re)created when the Cloud Function changes. In my case, thecloudfunctions_function
resource is created inside a Terraform module, and other resources not part of that module cannot reference the entire resource in their meta-arguments.cloudfunctions_function
does not currently expose any attributes which change when the function's source code changes. Adding the version or update time field would work around this.New or Affected Resource(s)
Potential Terraform Configuration
References
versionId
andupdateTime
fields on the api's CloudFunction resource here: https://cloud.google.com/functions/docs/reference/rest/v1/projects.locations.functions?hl=en_US#CloudFunctionupdateTime
field on the v2 beta api's Function resource here: https://cloud.google.com/functions/docs/reference/rest/v2beta/projects.locations.functions?hl=en_US#Functionreplace_triggered_by
lifecycle meta-argument can sometimes be used as a very blunt hammer to effect useful behaviorAnything Else
It looks like
updateTime
is available on both the v1 and v2 (beta) resources, whileversionId
is only on the v1 resource. This suggests thatupdateTime
might be a more future-proof choice.b/274817399
The text was updated successfully, but these errors were encountered: