diff --git a/.changelog/3248.txt b/.changelog/3248.txt new file mode 100644 index 0000000000..6f42dd3de9 --- /dev/null +++ b/.changelog/3248.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +compute: Add new attribute reference `current_status` +``` diff --git a/google-beta/resource_compute_instance.go b/google-beta/resource_compute_instance.go index a43f5e260b..2dc1bacdd4 100644 --- a/google-beta/resource_compute_instance.go +++ b/google-beta/resource_compute_instance.go @@ -543,7 +543,10 @@ func resourceComputeInstance() *schema.Resource { Optional: true, ValidateFunc: validation.StringInSlice([]string{"RUNNING", "TERMINATED"}, false), }, - + "current_status": { + Type: schema.TypeString, + Computed: true, + }, "tags": { Type: schema.TypeSet, Optional: true, @@ -1011,6 +1014,7 @@ func resourceComputeInstanceRead(d *schema.ResourceData, meta interface{}) error d.Set("name", instance.Name) d.Set("description", instance.Description) d.Set("hostname", instance.Hostname) + d.Set("current_status", instance.Status) if d.Get("desired_status") != "" { d.Set("desired_status", instance.Status)