diff --git a/.changelog/8113.txt b/.changelog/8113.txt new file mode 100644 index 0000000000..b07fb21cd7 --- /dev/null +++ b/.changelog/8113.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +cloudfunctions2: added `url` output field to `google_cloudfunctions2_function` +``` diff --git a/google-beta/services/cloudfunctions2/resource_cloudfunctions2_function.go b/google-beta/services/cloudfunctions2/resource_cloudfunctions2_function.go index 7e525eb4a7..d403b80300 100644 --- a/google-beta/services/cloudfunctions2/resource_cloudfunctions2_function.go +++ b/google-beta/services/cloudfunctions2/resource_cloudfunctions2_function.go @@ -455,6 +455,11 @@ timeout period. Defaults to 60 seconds.`, Computed: true, Description: `The last update timestamp of a Cloud Function.`, }, + "url": { + Type: schema.TypeString, + Computed: true, + Description: `Output only. The deployed url for the function.`, + }, "project": { Type: schema.TypeString, Optional: true, @@ -657,6 +662,9 @@ func resourceCloudfunctions2functionRead(d *schema.ResourceData, meta interface{ if err := d.Set("environment", flattenCloudfunctions2functionEnvironment(res["environment"], d, config)); err != nil { return fmt.Errorf("Error reading function: %s", err) } + if err := d.Set("url", flattenCloudfunctions2functionUrl(res["url"], d, config)); err != nil { + return fmt.Errorf("Error reading function: %s", err) + } if err := d.Set("state", flattenCloudfunctions2functionState(res["state"], d, config)); err != nil { return fmt.Errorf("Error reading function: %s", err) } @@ -880,6 +888,10 @@ func flattenCloudfunctions2functionEnvironment(v interface{}, d *schema.Resource return v } +func flattenCloudfunctions2functionUrl(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} { + return v +} + func flattenCloudfunctions2functionState(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} { return v } diff --git a/website/docs/r/cloudfunctions2_function.html.markdown b/website/docs/r/cloudfunctions2_function.html.markdown index 30c31e1acf..e4fbe7ae7d 100644 --- a/website/docs/r/cloudfunctions2_function.html.markdown +++ b/website/docs/r/cloudfunctions2_function.html.markdown @@ -911,6 +911,9 @@ In addition to the arguments listed above, the following computed attributes are * `environment` - The environment the function is hosted on. +* `url` - + Output only. The deployed url for the function. + * `state` - Describes the current state of the function.