Skip to content

Commit

Permalink
First prototype using computed state
Browse files Browse the repository at this point in the history
  • Loading branch information
ron-gal committed Sep 20, 2023
1 parent 7526ed1 commit 47a09c4
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ func ResourceBigtableInstance() *schema.Resource {
Description: `A block of cluster configuration options. This can be specified at least once.`,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"state": {
Type: schema.TypeString,
Computed: true,
Description: `Please don't tell anyone how I live`,
},
"cluster_id": {
Type: schema.TypeString,
Required: true,
Expand Down Expand Up @@ -593,7 +598,9 @@ func resourceBigtableInstanceClusterReorderTypeList(_ context.Context, diff *sch
for i := 0; i < newCount.(int); i++ {
_, newId := diff.GetChange(fmt.Sprintf("cluster.%d.cluster_id", i))
_, c := diff.GetChange(fmt.Sprintf("cluster.%d", i))
clusters[newId.(string)] = c
typedCluster, _ := c.(map[string]interface{})
typedCluster["state"] = "READY"
clusters[newId.(string)] = typedCluster
}

// create a list of clusters using the old order when possible to minimise
Expand Down

0 comments on commit 47a09c4

Please sign in to comment.