@@ -59,6 +59,16 @@ func resourceDatastreamConnectionProfile() *schema.Resource {
59
59
ForceNew : true ,
60
60
Description : `The name of the location this repository is located in.` ,
61
61
},
62
+ "bigquery_profile" : {
63
+ Type : schema .TypeList ,
64
+ Optional : true ,
65
+ Description : `BigQuery warehouse profile.` ,
66
+ MaxItems : 1 ,
67
+ Elem : & schema.Resource {
68
+ Schema : map [string ]* schema.Schema {},
69
+ },
70
+ ExactlyOneOf : []string {"oracle_profile" , "gcs_profile" , "mysql_profile" , "bigquery_profile" , "postgresql_profile" },
71
+ },
62
72
"forward_ssh_connectivity" : {
63
73
Type : schema .TypeList ,
64
74
Optional : true ,
@@ -120,7 +130,7 @@ func resourceDatastreamConnectionProfile() *schema.Resource {
120
130
},
121
131
},
122
132
},
123
- ExactlyOneOf : []string {"oracle_profile" , "gcs_profile" , "mysql_profile" , "postgresql_profile" },
133
+ ExactlyOneOf : []string {"oracle_profile" , "gcs_profile" , "mysql_profile" , "bigquery_profile" , " postgresql_profile" },
124
134
},
125
135
"labels" : {
126
136
Type : schema .TypeMap ,
@@ -212,7 +222,7 @@ If this field is used then the 'client_certificate' and the
212
222
},
213
223
},
214
224
},
215
- ExactlyOneOf : []string {"oracle_profile" , "gcs_profile" , "mysql_profile" , "postgresql_profile" },
225
+ ExactlyOneOf : []string {"oracle_profile" , "gcs_profile" , "mysql_profile" , "bigquery_profile" , " postgresql_profile" },
216
226
},
217
227
"oracle_profile" : {
218
228
Type : schema .TypeList ,
@@ -256,7 +266,7 @@ If this field is used then the 'client_certificate' and the
256
266
},
257
267
},
258
268
},
259
- ExactlyOneOf : []string {"oracle_profile" , "gcs_profile" , "mysql_profile" , "postgresql_profile" },
269
+ ExactlyOneOf : []string {"oracle_profile" , "gcs_profile" , "mysql_profile" , "bigquery_profile" , " postgresql_profile" },
260
270
},
261
271
"postgresql_profile" : {
262
272
Type : schema .TypeList ,
@@ -294,7 +304,7 @@ If this field is used then the 'client_certificate' and the
294
304
},
295
305
},
296
306
},
297
- ExactlyOneOf : []string {"oracle_profile" , "gcs_profile" , "mysql_profile" , "postgresql_profile" },
307
+ ExactlyOneOf : []string {"oracle_profile" , "gcs_profile" , "mysql_profile" , "bigquery_profile" , " postgresql_profile" },
298
308
},
299
309
"name" : {
300
310
Type : schema .TypeString ,
@@ -350,6 +360,12 @@ func resourceDatastreamConnectionProfileCreate(d *schema.ResourceData, meta inte
350
360
} else if v , ok := d .GetOkExists ("mysql_profile" ); ! isEmptyValue (reflect .ValueOf (mysqlProfileProp )) && (ok || ! reflect .DeepEqual (v , mysqlProfileProp )) {
351
361
obj ["mysqlProfile" ] = mysqlProfileProp
352
362
}
363
+ bigqueryProfileProp , err := expandDatastreamConnectionProfileBigqueryProfile (d .Get ("bigquery_profile" ), d , config )
364
+ if err != nil {
365
+ return err
366
+ } else if v , ok := d .GetOkExists ("bigquery_profile" ); ok || ! reflect .DeepEqual (v , bigqueryProfileProp ) {
367
+ obj ["bigqueryProfile" ] = bigqueryProfileProp
368
+ }
353
369
postgresqlProfileProp , err := expandDatastreamConnectionProfilePostgresqlProfile (d .Get ("postgresql_profile" ), d , config )
354
370
if err != nil {
355
371
return err
@@ -474,6 +490,9 @@ func resourceDatastreamConnectionProfileRead(d *schema.ResourceData, meta interf
474
490
if err := d .Set ("mysql_profile" , flattenDatastreamConnectionProfileMysqlProfile (res ["mysqlProfile" ], d , config )); err != nil {
475
491
return fmt .Errorf ("Error reading ConnectionProfile: %s" , err )
476
492
}
493
+ if err := d .Set ("bigquery_profile" , flattenDatastreamConnectionProfileBigqueryProfile (res ["bigqueryProfile" ], d , config )); err != nil {
494
+ return fmt .Errorf ("Error reading ConnectionProfile: %s" , err )
495
+ }
477
496
if err := d .Set ("postgresql_profile" , flattenDatastreamConnectionProfilePostgresqlProfile (res ["postgresqlProfile" ], d , config )); err != nil {
478
497
return fmt .Errorf ("Error reading ConnectionProfile: %s" , err )
479
498
}
@@ -530,6 +549,12 @@ func resourceDatastreamConnectionProfileUpdate(d *schema.ResourceData, meta inte
530
549
} else if v , ok := d .GetOkExists ("mysql_profile" ); ! isEmptyValue (reflect .ValueOf (v )) && (ok || ! reflect .DeepEqual (v , mysqlProfileProp )) {
531
550
obj ["mysqlProfile" ] = mysqlProfileProp
532
551
}
552
+ bigqueryProfileProp , err := expandDatastreamConnectionProfileBigqueryProfile (d .Get ("bigquery_profile" ), d , config )
553
+ if err != nil {
554
+ return err
555
+ } else if v , ok := d .GetOkExists ("bigquery_profile" ); ok || ! reflect .DeepEqual (v , bigqueryProfileProp ) {
556
+ obj ["bigqueryProfile" ] = bigqueryProfileProp
557
+ }
533
558
postgresqlProfileProp , err := expandDatastreamConnectionProfilePostgresqlProfile (d .Get ("postgresql_profile" ), d , config )
534
559
if err != nil {
535
560
return err
@@ -571,6 +596,10 @@ func resourceDatastreamConnectionProfileUpdate(d *schema.ResourceData, meta inte
571
596
updateMask = append (updateMask , "mysqlProfile" )
572
597
}
573
598
599
+ if d .HasChange ("bigquery_profile" ) {
600
+ updateMask = append (updateMask , "bigqueryProfile" )
601
+ }
602
+
574
603
if d .HasChange ("postgresql_profile" ) {
575
604
updateMask = append (updateMask , "postgresqlProfile" )
576
605
}
@@ -867,6 +896,14 @@ func flattenDatastreamConnectionProfileMysqlProfileSslConfigCaCertificateSet(v i
867
896
return v
868
897
}
869
898
899
+ func flattenDatastreamConnectionProfileBigqueryProfile (v interface {}, d * schema.ResourceData , config * Config ) interface {} {
900
+ if v == nil {
901
+ return nil
902
+ }
903
+ transformed := make (map [string ]interface {})
904
+ return []interface {}{transformed }
905
+ }
906
+
870
907
func flattenDatastreamConnectionProfilePostgresqlProfile (v interface {}, d * schema.ResourceData , config * Config ) interface {} {
871
908
if v == nil {
872
909
return nil
@@ -1250,6 +1287,21 @@ func expandDatastreamConnectionProfileMysqlProfileSslConfigCaCertificateSet(v in
1250
1287
return v , nil
1251
1288
}
1252
1289
1290
+ func expandDatastreamConnectionProfileBigqueryProfile (v interface {}, d TerraformResourceData , config * Config ) (interface {}, error ) {
1291
+ l := v .([]interface {})
1292
+ if len (l ) == 0 {
1293
+ return nil , nil
1294
+ }
1295
+
1296
+ if l [0 ] == nil {
1297
+ transformed := make (map [string ]interface {})
1298
+ return transformed , nil
1299
+ }
1300
+ transformed := make (map [string ]interface {})
1301
+
1302
+ return transformed , nil
1303
+ }
1304
+
1253
1305
func expandDatastreamConnectionProfilePostgresqlProfile (v interface {}, d TerraformResourceData , config * Config ) (interface {}, error ) {
1254
1306
l := v .([]interface {})
1255
1307
if len (l ) == 0 || l [0 ] == nil {
0 commit comments