diff --git a/google/resource_spanner_instance.go b/google/resource_spanner_instance.go index 5e741e7f357..c83cce44246 100644 --- a/google/resource_spanner_instance.go +++ b/google/resource_spanner_instance.go @@ -91,6 +91,11 @@ func resourceSpannerInstance() *schema.Resource { Optional: true, ForceNew: true, }, + + "state": { + Type: schema.TypeString, + Computed: true, + }, }, } } @@ -163,6 +168,7 @@ func resourceSpannerInstanceRead(d *schema.ResourceData, meta interface{}) error d.Set("labels", instance.Labels) d.Set("display_name", instance.DisplayName) d.Set("num_nodes", instance.NodeCount) + d.Set("state", instance.State) return nil } diff --git a/google/resource_spanner_instance_test.go b/google/resource_spanner_instance_test.go index b834ff28d71..31ea09c0988 100644 --- a/google/resource_spanner_instance_test.go +++ b/google/resource_spanner_instance_test.go @@ -155,6 +155,7 @@ func TestAccSpannerInstance_basic(t *testing.T) { resource.TestCheckResourceAttr("google_spanner_instance.basic", "name", idName), resource.TestCheckResourceAttr("google_spanner_instance.basic", "display_name", idName+"-dname"), resource.TestCheckResourceAttr("google_spanner_instance.basic", "num_nodes", "1"), + resource.TestCheckResourceAttrSet("google_spanner_instance.basic", "state"), ), }, }, diff --git a/website/docs/r/spanner_instance.html.markdown b/website/docs/r/spanner_instance.html.markdown index cbcae19bb55..c6a71f5b290 100644 --- a/website/docs/r/spanner_instance.html.markdown +++ b/website/docs/r/spanner_instance.html.markdown @@ -53,7 +53,10 @@ The following arguments are supported: ## Attributes Reference -No additional attributes are computed other than those defined above. +In addition to the arguments listed above, the following computed attributes are +exported: + +* `state` - The current state of the instance. ## Import