Skip to content

Commit 533af84

Browse files
Add current status on compute instance (#3248) (#1857)
Co-authored-by: Sébastien GLON <[email protected]> Signed-off-by: Modular Magician <[email protected]> Co-authored-by: Sébastien GLON <[email protected]>
1 parent d76d23e commit 533af84

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changelog/3248.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:enhancement
2+
compute: Add new attribute reference `current_status`
3+
```

google-beta/resource_compute_instance.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,10 @@ func resourceComputeInstance() *schema.Resource {
543543
Optional: true,
544544
ValidateFunc: validation.StringInSlice([]string{"RUNNING", "TERMINATED"}, false),
545545
},
546-
546+
"current_status": {
547+
Type: schema.TypeString,
548+
Computed: true,
549+
},
547550
"tags": {
548551
Type: schema.TypeSet,
549552
Optional: true,
@@ -1011,6 +1014,7 @@ func resourceComputeInstanceRead(d *schema.ResourceData, meta interface{}) error
10111014
d.Set("name", instance.Name)
10121015
d.Set("description", instance.Description)
10131016
d.Set("hostname", instance.Hostname)
1017+
d.Set("current_status", instance.Status)
10141018

10151019
if d.Get("desired_status") != "" {
10161020
d.Set("desired_status", instance.Status)

0 commit comments

Comments
 (0)