@@ -47,7 +47,8 @@ async function runInstanceOperations(instanceID, clusterID) {
47
47
} ;
48
48
49
49
// Create production instance with given options
50
- const [ prodInstance ] = await instance . create ( instanceOptions ) ;
50
+ const [ prodInstance , operation ] = await instance . create ( instanceOptions ) ;
51
+ await operation . promise ( ) ;
51
52
console . log ( `Created Instance: ${ prodInstance . id } ` ) ;
52
53
// [END bigtable_create_prod_instance]
53
54
} else {
@@ -105,7 +106,11 @@ async function createDevInstance(instanceID, clusterID) {
105
106
} ;
106
107
107
108
// Create development instance with given options
108
- const [ instance ] = await bigtable . createInstance ( instanceID , options ) ;
109
+ const [ instance , operation ] = await bigtable . createInstance (
110
+ instanceID ,
111
+ options
112
+ ) ;
113
+ await operation . promise ( ) ;
109
114
console . log ( `Created development instance: ${ instance . id } ` ) ;
110
115
// [END bigtable_create_dev_instance]
111
116
}
@@ -141,7 +146,11 @@ async function addCluster(instanceID, clusterID) {
141
146
storage : 'ssd' ,
142
147
} ;
143
148
144
- const [ cluster ] = await instance . createCluster ( clusterID , clusterOptions ) ;
149
+ const [ cluster , operation ] = await instance . createCluster (
150
+ clusterID ,
151
+ clusterOptions
152
+ ) ;
153
+ await operation . promise ( ) ;
145
154
console . log ( `Cluster created: ${ cluster . id } ` ) ;
146
155
// [END bigtable_create_cluster]
147
156
}
0 commit comments