hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.31k stars 1.73k forks source link

Add https_trigger_url attribute to google_workflows_workflow providing workflow execution URI #12821

Open ffeldhaus opened 1 year ago

ffeldhaus commented 1 year ago

Affected Resource(s)

Google Cloud Workflows are usually invoked via the workflow execution URI, e.g. via Cloud Scheduler (see #8832 for an example).

Please add an attribute https_trigger_url to google_workflows_workflow similar to the https_trigger_url attribute in google_cloudfunctions_function .

b/321386065

melinath commented 8 months ago

google_cloudfunctions_function.https_trigger_url maps to a specific API field: https://cloud.google.com/functions/docs/reference/rest/v1/projects.locations.functions#HttpsTrigger Though I'm not sure whether the format is predictable or not.

Based on the linked docs it sounds like the workflow url is entirely predictable: https://workflowexecutions.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION/workflows/WORKFLOW_NAME/executions. This could be built using string interpolation - for example:

"https://workflowexecutions.googleapis.com/v1/${google_workflows_workflow.my_workflow.id}/executions"

I'm marking this as a feature request since it could be implemented on the API side and/or the client side, and does not represent a coverage gap compared to the API.

Is there any particular reason that a field would be more useful than doing string interpolation?

linjie333 commented 8 months ago

+1 to melinath's comment that the url to execute a workflow is always the same, whereas for cloud functions, the url to trigger the function call might be different.

Could you let us know the specific use case that a https_trigger_url attribute will be useful? Thank you!