Skip to content

Commit 8b4cf33

Browse files
authored
Merge branch 'GoogleCloudPlatform:main' into main
2 parents faa3cb1 + d6a1df8 commit 8b4cf33

96 files changed

Lines changed: 3236 additions & 576 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.ci/infra/terraform/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ module "project-services" {
334334
"resourceviews.googleapis.com",
335335
"run.googleapis.com",
336336
"runtimeconfig.googleapis.com",
337+
"saasservicemgmt.googleapis.com",
337338
"secretmanager.googleapis.com",
338339
"securesourcemanager.googleapis.com",
339340
"securetoken.googleapis.com",

mmv1/api/resource.go

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ type Resource struct {
227227
ExcludeImport bool `yaml:"exclude_import,omitempty"`
228228

229229
// If true, resource should be autogenerated as a data source
230-
GenerateDatasource bool `yaml:"generate_datasource,omitempty"`
230+
Datasource *resource.Datasource `yaml:"datasource,omitempty"`
231231

232232
// If true, skip sweeper generation for this resource
233233
ExcludeSweeper bool `yaml:"exclude_sweeper,omitempty"`
@@ -2078,8 +2078,31 @@ func urlContainsOnlyAllowedKeys(templateURL string, allowedKeys []string) bool {
20782078
return true
20792079
}
20802080

2081-
func (r Resource) ShouldGenerateSingularDataSource() bool {
2082-
return r.GenerateDatasource
2081+
func (r *Resource) ShouldGenerateSingularDataSource() bool {
2082+
2083+
if r.Datasource == nil {
2084+
return false
2085+
}
2086+
2087+
return r.Datasource.Generate
2088+
}
2089+
2090+
func (r Resource) ShouldDatasourceSetLabels() bool {
2091+
for _, p := range r.Properties {
2092+
if p.Name == "labels" && p.Type == "KeyValueLabels" {
2093+
return true
2094+
}
2095+
}
2096+
return false
2097+
}
2098+
2099+
func (r Resource) ShouldDatasourceSetAnnotations() bool {
2100+
for _, p := range r.Properties {
2101+
if p.Name == "annotations" && p.Type == "KeyValueAnnotations" {
2102+
return true
2103+
}
2104+
}
2105+
return false
20832106
}
20842107

20852108
// DatasourceOptionalFields returns a list of fields from the resource's URI

mmv1/api/resource/datasource.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2024 Google Inc.
2+
// Licensed under the Apache License, Version 2.0 (the "License");
3+
// you may not use this file except in compliance with the License.
4+
// You may obtain a copy of the License at
5+
//
6+
// http://www.apache.org/licenses/LICENSE-2.0
7+
//
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
14+
package resource
15+
16+
type Datasource struct {
17+
// boolean to determine whether the datasource file should be generated
18+
Generate bool `yaml:"generate"`
19+
}

mmv1/api/resource/iam_policy.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ type IamPolicy struct {
114114
// [Optional] Check to see if zone value should be replaced with GOOGLE_ZONE in iam tests
115115
// Defaults to true
116116
SubstituteZoneValue bool `yaml:"substitute_zone_value"`
117+
118+
// Add a deprecation message for a resource that's been deprecated in the API.
119+
DeprecationMessage string `yaml:"deprecation_message,omitempty"`
117120
}
118121

119122
func (p *IamPolicy) UnmarshalYAML(unmarshal func(any) error) error {

mmv1/products/alloydb/Instance.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ custom_code:
5252
custom_import: 'templates/terraform/custom_import/alloydb_instance.go.tmpl'
5353
# Skipping the sweeper because instances will be deleted during cluster sweeps
5454
exclude_sweeper: true
55+
include_in_tgc_next_DO_NOT_USE: true
5556
examples:
5657
- name: 'alloydb_instance_basic'
5758
primary_resource_id: 'default'
@@ -248,9 +249,11 @@ properties:
248249
- name: 'recordApplicationTags'
249250
type: Boolean
250251
description: 'Record application tags for an instance. This flag is turned "on" by default.'
252+
include_empty_value_in_cai: true # Default value is false in CAI asset
251253
- name: 'recordClientAddress'
252254
type: Boolean
253255
description: 'Record client address for an instance. Client address is PII information. This flag is turned "on" by default.'
256+
include_empty_value_in_cai: true # Default value is false in CAI asset
254257
- name: 'queryPlansPerMinute'
255258
type: Integer
256259
description: 'Number of query execution plans captured by Insights per minute for all queries combined. The default value is 5. Any integer between 0 and 20 is considered valid.'
@@ -263,9 +266,11 @@ properties:
263266
- name: 'enabled'
264267
type: Boolean
265268
description: 'Observability feature status for an instance.'
269+
include_empty_value_in_cai: true # Default value is false in CAI asset
266270
- name: 'preserveComments'
267271
type: Boolean
268272
description: 'Preserve comments in the query string.'
273+
include_empty_value_in_cai: true # Default value is false in CAI asset
269274
- name: 'trackWaitEvents'
270275
type: Boolean
271276
description: 'Record wait events during query execution for an instance.'
@@ -278,12 +283,14 @@ properties:
278283
- name: 'recordApplicationTags'
279284
type: Boolean
280285
description: 'Record application tags for an instance. This flag is turned "on" by default.'
286+
include_empty_value_in_cai: true # Default value is false in CAI asset
281287
- name: 'queryPlansPerMinute'
282288
type: Integer
283289
description: 'Number of query execution plans captured by Insights per minute for all queries combined. The default value is 5. Any integer between 0 and 200 is considered valid.'
284290
- name: 'trackActiveQueries'
285291
type: Boolean
286292
description: 'Track actively running queries. If not set, default value is "off".'
293+
include_empty_value_in_cai: true # Default value is false in CAI asset
287294
- name: 'assistiveExperiencesEnabled'
288295
type: Boolean
289296
description: 'Whether assistive experiences are enabled for this AlloyDB instance.'

mmv1/products/apphub/Application.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ custom_code:
4141
constants: 'templates/terraform/constants/apphub_application.go.tmpl'
4242
custom_diff:
4343
- 'apphubApplicationCustomizeDiff'
44+
include_in_tgc_next_DO_NOT_USE: true
4445
sweeper:
4546
url_substitutions:
4647
- region: "us-central1"

mmv1/products/apphub/Service.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ async:
4040
result:
4141
resource_inside_response: true
4242
custom_code:
43+
include_in_tgc_next_DO_NOT_USE: true
4344
examples:
4445
- name: 'apphub_service_basic'
4546
primary_resource_id: 'example'

mmv1/products/apphub/Workload.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ async:
4040
result:
4141
resource_inside_response: true
4242
custom_code:
43+
include_in_tgc_next_DO_NOT_USE: true
4344
examples:
4445
- name: 'apphub_workload_basic'
4546
primary_resource_id: 'example'

mmv1/products/beyondcorp/Application.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ iam_policy:
3131
import_format:
3232
- 'projects/{{project}}/locations/global/securityGateways/{{security_gateways_id}}/applications/{{application_id}}'
3333
- '{{application_id}}'
34+
deprecation_message: '`google_beyondcorp_application` and associated IAM resources are deprecated. Use `google_beyondcorp_security_gateway_application` instead.'
3435
examples:
3536
- name: beyondcorp_application_basic
3637
primary_resource_id: example

mmv1/products/bigquery/Job.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,30 @@ properties:
406406
description: |
407407
Whether to run the query as continuous or a regular query.
408408
min_version: beta
409+
- name: 'connectionProperties'
410+
type: Array
411+
description: |
412+
Connection properties to customize query behavior. Under JDBC, these correspond
413+
directly to connection properties passed to the DriverManager. Under ODBC, these
414+
correspond to properties in the connection string.
415+
item_type:
416+
type: NestedObject
417+
properties:
418+
- name: 'key'
419+
type: String
420+
description: |
421+
The key of the property to set. Currently supported connection properties:
422+
* `dataset_project_id`: represents the default project for datasets that are used in the query
423+
* `time_zone`: represents the default timezone used to run the query
424+
* `session_id`: associates the query with a given session
425+
* `query_label`: associates the query with a given job label
426+
* `service_account`: indicates the service account to use to run a continuous query
427+
required: true
428+
- name: 'value'
429+
type: String
430+
description: |
431+
The value of the property to set.
432+
required: true
409433
- name: 'load'
410434
type: NestedObject
411435
description: 'Configures a load job.'

0 commit comments

Comments
 (0)