Skip to content

Commit 4b83bed

Browse files
Add url output field to google_cloudfunctions2_function (#8113) (#14851)
Signed-off-by: Modular Magician <[email protected]>
1 parent aff506e commit 4b83bed

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

.changelog/8113.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
cloudfunctions2: added `url` output field to `google_cloudfunctions2_function`
3+
```

google/services/cloudfunctions2/resource_cloudfunctions2_function.go

+12
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,11 @@ timeout period. Defaults to 60 seconds.`,
455455
Computed: true,
456456
Description: `The last update timestamp of a Cloud Function.`,
457457
},
458+
"url": {
459+
Type: schema.TypeString,
460+
Computed: true,
461+
Description: `Output only. The deployed url for the function.`,
462+
},
458463
"project": {
459464
Type: schema.TypeString,
460465
Optional: true,
@@ -657,6 +662,9 @@ func resourceCloudfunctions2functionRead(d *schema.ResourceData, meta interface{
657662
if err := d.Set("environment", flattenCloudfunctions2functionEnvironment(res["environment"], d, config)); err != nil {
658663
return fmt.Errorf("Error reading function: %s", err)
659664
}
665+
if err := d.Set("url", flattenCloudfunctions2functionUrl(res["url"], d, config)); err != nil {
666+
return fmt.Errorf("Error reading function: %s", err)
667+
}
660668
if err := d.Set("state", flattenCloudfunctions2functionState(res["state"], d, config)); err != nil {
661669
return fmt.Errorf("Error reading function: %s", err)
662670
}
@@ -880,6 +888,10 @@ func flattenCloudfunctions2functionEnvironment(v interface{}, d *schema.Resource
880888
return v
881889
}
882890

891+
func flattenCloudfunctions2functionUrl(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
892+
return v
893+
}
894+
883895
func flattenCloudfunctions2functionState(v interface{}, d *schema.ResourceData, config *transport_tpg.Config) interface{} {
884896
return v
885897
}

website/docs/r/cloudfunctions2_function.html.markdown

+3
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,9 @@ In addition to the arguments listed above, the following computed attributes are
911911
* `environment` -
912912
The environment the function is hosted on.
913913

914+
* `url` -
915+
Output only. The deployed url for the function.
916+
914917
* `state` -
915918
Describes the current state of the function.
916919

0 commit comments

Comments
 (0)