diff --git a/google/resource_monitoring_uptime_check_config.go b/google/resource_monitoring_uptime_check_config.go index 68d92525147..8e7f1818f3d 100644 --- a/google/resource_monitoring_uptime_check_config.go +++ b/google/resource_monitoring_uptime_check_config.go @@ -218,6 +218,10 @@ func resourceMonitoringUptimeCheckConfig() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "uptime_check_id": { + Type: schema.TypeString, + Computed: true, + }, "project": { Type: schema.TypeString, Optional: true, @@ -354,6 +358,9 @@ func resourceMonitoringUptimeCheckConfigRead(d *schema.ResourceData, meta interf if err := d.Set("name", flattenMonitoringUptimeCheckConfigName(res["name"], d)); err != nil { return fmt.Errorf("Error reading UptimeCheckConfig: %s", err) } + if err := d.Set("uptime_check_id", flattenMonitoringUptimeCheckConfigUptimeCheckId(res["id"], d)); err != nil { + return fmt.Errorf("Error reading UptimeCheckConfig: %s", err) + } if err := d.Set("display_name", flattenMonitoringUptimeCheckConfigDisplayName(res["displayName"], d)); err != nil { return fmt.Errorf("Error reading UptimeCheckConfig: %s", err) } @@ -553,6 +560,11 @@ func flattenMonitoringUptimeCheckConfigName(v interface{}, d *schema.ResourceDat return v } +func flattenMonitoringUptimeCheckConfigUptimeCheckId(v interface{}, d *schema.ResourceData) interface{} { + parts := strings.Split(d.Get("name").(string), "/") + return parts[len(parts)-1] +} + func flattenMonitoringUptimeCheckConfigDisplayName(v interface{}, d *schema.ResourceData) interface{} { return v } diff --git a/website/docs/r/monitoring_uptime_check_config.html.markdown b/website/docs/r/monitoring_uptime_check_config.html.markdown index 94f4eacdfb2..d81e7382c62 100644 --- a/website/docs/r/monitoring_uptime_check_config.html.markdown +++ b/website/docs/r/monitoring_uptime_check_config.html.markdown @@ -246,6 +246,9 @@ In addition to the arguments listed above, the following computed attributes are * `name` - A unique resource name for this UptimeCheckConfig. The format is projects/[PROJECT_ID]/uptimeCheckConfigs/[UPTIME_CHECK_ID]. +* `uptime_check_id` - + The id of the uptime check + ## Timeouts