Skip to content

Commit f69ae40

Browse files
Add bigquery connection of type CLOUD_RESOURCE & make other examples GA. (#6020) (#11701)
Signed-off-by: Modular Magician <[email protected]>
1 parent 2f69317 commit f69ae40

9 files changed

+1129
-45
lines changed

.changelog/6020.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
```release-note:enhancement
2+
bigquery connection: Added connection of type cloud_resource for `google_bigquery_connection`
3+
```
4+
```release-note:enhancement
5+
bigquery connection: Made `google_bigquery_connection` part of GA terraform provider.
6+
```

google/config.go

+4
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ type Config struct {
166166
ApigeeBasePath string
167167
AppEngineBasePath string
168168
BigQueryBasePath string
169+
BigqueryConnectionBasePath string
169170
BigqueryDataTransferBasePath string
170171
BigqueryReservationBasePath string
171172
BigtableBasePath string
@@ -267,6 +268,7 @@ const ActiveDirectoryBasePathKey = "ActiveDirectory"
267268
const ApigeeBasePathKey = "Apigee"
268269
const AppEngineBasePathKey = "AppEngine"
269270
const BigQueryBasePathKey = "BigQuery"
271+
const BigqueryConnectionBasePathKey = "BigqueryConnection"
270272
const BigqueryDataTransferBasePathKey = "BigqueryDataTransfer"
271273
const BigqueryReservationBasePathKey = "BigqueryReservation"
272274
const BigtableBasePathKey = "Bigtable"
@@ -350,6 +352,7 @@ var DefaultBasePaths = map[string]string{
350352
ApigeeBasePathKey: "https://apigee.googleapis.com/v1/",
351353
AppEngineBasePathKey: "https://appengine.googleapis.com/v1/",
352354
BigQueryBasePathKey: "https://bigquery.googleapis.com/bigquery/v2/",
355+
BigqueryConnectionBasePathKey: "https://bigqueryconnection.googleapis.com/v1/",
353356
BigqueryDataTransferBasePathKey: "https://bigquerydatatransfer.googleapis.com/v1/",
354357
BigqueryReservationBasePathKey: "https://bigqueryreservation.googleapis.com/v1/",
355358
BigtableBasePathKey: "https://bigtableadmin.googleapis.com/v2/",
@@ -1195,6 +1198,7 @@ func ConfigureBasePaths(c *Config) {
11951198
c.ApigeeBasePath = DefaultBasePaths[ApigeeBasePathKey]
11961199
c.AppEngineBasePath = DefaultBasePaths[AppEngineBasePathKey]
11971200
c.BigQueryBasePath = DefaultBasePaths[BigQueryBasePathKey]
1201+
c.BigqueryConnectionBasePath = DefaultBasePaths[BigqueryConnectionBasePathKey]
11981202
c.BigqueryDataTransferBasePath = DefaultBasePaths[BigqueryDataTransferBasePathKey]
11991203
c.BigqueryReservationBasePath = DefaultBasePaths[BigqueryReservationBasePathKey]
12001204
c.BigtableBasePath = DefaultBasePaths[BigtableBasePathKey]

google/provider.go

+12-2
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,14 @@ func Provider() *schema.Provider {
197197
"GOOGLE_BIG_QUERY_CUSTOM_ENDPOINT",
198198
}, DefaultBasePaths[BigQueryBasePathKey]),
199199
},
200+
"bigquery_connection_custom_endpoint": {
201+
Type: schema.TypeString,
202+
Optional: true,
203+
ValidateFunc: validateCustomEndpoint,
204+
DefaultFunc: schema.MultiEnvDefaultFunc([]string{
205+
"GOOGLE_BIGQUERY_CONNECTION_CUSTOM_ENDPOINT",
206+
}, DefaultBasePaths[BigqueryConnectionBasePathKey]),
207+
},
200208
"bigquery_data_transfer_custom_endpoint": {
201209
Type: schema.TypeString,
202210
Optional: true,
@@ -839,9 +847,9 @@ func Provider() *schema.Provider {
839847
return provider
840848
}
841849

842-
// Generated resources: 219
850+
// Generated resources: 220
843851
// Generated IAM resources: 108
844-
// Total generated resources: 327
852+
// Total generated resources: 328
845853
func ResourceMap() map[string]*schema.Resource {
846854
resourceMap, _ := ResourceMapWithErrors()
847855
return resourceMap
@@ -890,6 +898,7 @@ func ResourceMapWithErrors() (map[string]*schema.Resource, error) {
890898
"google_bigquery_table_iam_member": ResourceIamMember(BigQueryTableIamSchema, BigQueryTableIamUpdaterProducer, BigQueryTableIdParseFunc),
891899
"google_bigquery_table_iam_policy": ResourceIamPolicy(BigQueryTableIamSchema, BigQueryTableIamUpdaterProducer, BigQueryTableIdParseFunc),
892900
"google_bigquery_routine": resourceBigQueryRoutine(),
901+
"google_bigquery_connection": resourceBigqueryConnectionConnection(),
893902
"google_bigquery_data_transfer_config": resourceBigqueryDataTransferConfig(),
894903
"google_bigquery_reservation": resourceBigqueryReservationReservation(),
895904
"google_bigtable_app_profile": resourceBigtableAppProfile(),
@@ -1428,6 +1437,7 @@ func providerConfigure(ctx context.Context, d *schema.ResourceData, p *schema.Pr
14281437
config.ApigeeBasePath = d.Get("apigee_custom_endpoint").(string)
14291438
config.AppEngineBasePath = d.Get("app_engine_custom_endpoint").(string)
14301439
config.BigQueryBasePath = d.Get("big_query_custom_endpoint").(string)
1440+
config.BigqueryConnectionBasePath = d.Get("bigquery_connection_custom_endpoint").(string)
14311441
config.BigqueryDataTransferBasePath = d.Get("bigquery_data_transfer_custom_endpoint").(string)
14321442
config.BigqueryReservationBasePath = d.Get("bigquery_reservation_custom_endpoint").(string)
14331443
config.BigtableBasePath = d.Get("bigtable_custom_endpoint").(string)

0 commit comments

Comments
 (0)