@@ -47,7 +47,8 @@ async function runInstanceOperations(instanceID, clusterID) {
4747 } ;
4848
4949 // 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 ( ) ;
5152 console . log ( `Created Instance: ${ prodInstance . id } ` ) ;
5253 // [END bigtable_create_prod_instance]
5354 } else {
@@ -105,7 +106,11 @@ async function createDevInstance(instanceID, clusterID) {
105106 } ;
106107
107108 // 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 ( ) ;
109114 console . log ( `Created development instance: ${ instance . id } ` ) ;
110115 // [END bigtable_create_dev_instance]
111116}
@@ -141,7 +146,11 @@ async function addCluster(instanceID, clusterID) {
141146 storage : 'ssd' ,
142147 } ;
143148
144- const [ cluster ] = await instance . createCluster ( clusterID , clusterOptions ) ;
149+ const [ cluster , operation ] = await instance . createCluster (
150+ clusterID ,
151+ clusterOptions
152+ ) ;
153+ await operation . promise ( ) ;
145154 console . log ( `Cluster created: ${ cluster . id } ` ) ;
146155 // [END bigtable_create_cluster]
147156 }
0 commit comments