Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merging latest #14

Merged
merged 39 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
e6b70dc
Add http_target field to google_cloud_tasks_queue (#11544)
toga4 Aug 26, 2024
6d8da0f
Update google.golang.org/api to v0.193.0 (#11520)
amacaskill Aug 26, 2024
a45d1cb
Update compute_instance_group_manager version doc (#11546)
pjotrekk Aug 26, 2024
7e63ae6
Update data_source_artifact_registry_docker_image_test.go (#11492)
brandonmichigangithub Aug 26, 2024
2d949b2
Fix google_bigquery_data_transfer salesforce test parameter values (#…
wj-chen Aug 26, 2024
d821caa
Add the source-regions examples to the HealthCheck yaml file. (#11459)
pournami-rajan Aug 26, 2024
c1bcaf1
Handle email casing in google_bigquery_dataset_access (#11477)
wj-chen Aug 26, 2024
172ee30
ResourceManager : Update error messages for resource `google_project_…
shahmedhaCorp Aug 26, 2024
5f652ac
fix typo in compute_instance (#11508)
kyoppii13 Aug 26, 2024
8e79c4b
TF changes for AlloyDB Free trials (#11207)
girdharchirag Aug 26, 2024
dd67281
Remove require_ssl (#11549)
c2thorn Aug 26, 2024
8778ef8
`BigQuery`: support `encryptionConfiguration` in `google_bigquery_dat…
BBBmau Aug 26, 2024
a86489e
added test covereage for SslPolicy in google_compute_target_https_pro…
pawelJas Aug 27, 2024
05d40a9
docs: add a missing quote for `google_project_iam_member_remove` exam…
sgatewood-da Aug 27, 2024
a6206ac
Stop passing version as an argument when making a new PF provider (#1…
SarahFrench Aug 27, 2024
fffa9cf
[discoveryengine] Added `chunking_config` and `layout_parsing_config`…
btkelly Aug 27, 2024
dfea4cd
Make missing test detector handle more fmt expressions (#11529)
trodge Aug 27, 2024
d2534a2
feat(bigtable): Update bigtable dependency to 1.30.0 (#11551)
ron-gal Aug 27, 2024
72f1a3e
Fix some TGC issues related to goog-terraform-provisioned label (#11554)
SarahFrench Aug 27, 2024
9b3cad5
Update docs for `google_compute_firewall` resource - Remove quotes fo…
air3ijai Aug 27, 2024
8742aeb
Add InspectTemplateModifiedCadence to BigQueryTarget and CloudSqlTarg…
patrickmoy Aug 27, 2024
f5ae22e
`pubsub`: allow empty filter definition (#11556)
prauc Aug 27, 2024
3a0f98c
Adding manual sweepers for resources in netapp (#11467)
Mehul3217 Aug 27, 2024
f5655ce
Fix how `data.google_client_config` handles errors from invalid crede…
SarahFrench Aug 27, 2024
f625ca5
Remove testing of 6.0.0 feature branch, resume testing main branch al…
SarahFrench Aug 27, 2024
97f8d1a
Terraform Support for Secret Manager CSI addon GA Version (#11468)
dargudear-google Aug 27, 2024
ed196e3
Add "goog-terraform-provisioned": "true" to all TGC JSON files that a…
SarahFrench Aug 27, 2024
5354c6c
Made virtual fields get generated with the same template as non-virtu…
melinath Aug 27, 2024
c7d11a8
Support creating Database Migration Service connection profiles conne…
owaismawasy Aug 27, 2024
269a946
Adding accelerators[] for NodeTemplate (#11511)
matthewhuie Aug 27, 2024
61f619e
Promote Client Tls Policy to V1 (#11547)
pawelJas Aug 27, 2024
12fcf34
Mark VcrTest() as a test helper function (#11453)
SirGitsalot Aug 27, 2024
049127c
Update enrolled teams yaml (#11559)
roaks3 Aug 28, 2024
b0849f0
Add diff suppress for time format to `google_compute_resource_policie…
karolgorc Aug 28, 2024
c76ca4c
Revert change to .ruby-version (#11565)
SarahFrench Aug 28, 2024
5c149d7
Add type support (#11252)
ron-gal Aug 28, 2024
b25f26a
Add Resource V2 SCC Findings Export to BQ Project Config (#11534)
vijaykanthm Aug 28, 2024
fcc529c
container: add support for kubelet read only port (#11272)
wyardley Aug 28, 2024
b7538e9
container: bump `additive_vpc_scope_dns_domain` to GA (#11545)
DrFaust92 Aug 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions mmv1/api/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,12 @@ func (r *Resource) UnmarshalYAML(n *yaml.Node) error {
r.CollectionUrlKey = google.Camelize(google.Plural(r.Name), "lower")
}

if len(r.VirtualFields) > 0 {
for _, f := range r.VirtualFields {
f.ClientSide = true
}
}

return nil
}

Expand Down
2 changes: 2 additions & 0 deletions mmv1/api/resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,8 @@ def validate
type: Array,
default: []

@virtual_fields&.each { |field| field.client_side = true }

check :custom_code, type: Provider::Terraform::CustomCode,
default: Provider::Terraform::CustomCode.new
check :sweeper, type: Provider::Terraform::Sweeper, default: Provider::Terraform::Sweeper.new
Expand Down
14 changes: 14 additions & 0 deletions mmv1/api/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ type Type struct {
// behavior.
Immutable bool

// Indicates that this field is client-side only (aka virtual.)
ClientSide bool `yaml:"client_side"`

// url_param_only will not send the field in the resource body and will
// not attempt to read the field from the API response.
// NOTE - this doesn't work for nested fields
Expand Down Expand Up @@ -1100,6 +1103,12 @@ func propertyWithImmutable(immutable bool) func(*Type) {
}
}

func propertyWithClientSide(clientSide bool) func(*Type) {
return func(p *Type) {
p.ClientSide = clientSide
}
}

func propertyWithIgnoreWrite(ignoreWrite bool) func(*Type) {
return func(p *Type) {
p.IgnoreWrite = ignoreWrite
Expand Down Expand Up @@ -1347,6 +1356,11 @@ func (t *Type) IsForceNew() bool {
return true
}

// Client-side fields don't inherit immutability
if t.ClientSide {
return t.Immutable
}

parent := t.Parent()
return (!t.Output || t.IsA("KeyValueEffectiveLabels")) &&
(t.Immutable ||
Expand Down
4 changes: 4 additions & 0 deletions mmv1/api/type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ module Fields
# behavior.
attr_accessor :immutable

# Indicates that this field is client-side only (aka virtual.)
attr_accessor :client_side

# url_param_only will not send the field in the resource body and will
# not attempt to read the field from the API response.
# NOTE - this doesn't work for nested fields
Expand Down Expand Up @@ -228,6 +231,7 @@ def validate
check :url_param_only, type: :boolean
check :read_query_params, type: ::String
check :immutable, type: :boolean
check :client_side, type: :boolean

raise 'Property cannot be output and required at the same time.' \
if @output && @required
Expand Down
38 changes: 33 additions & 5 deletions mmv1/products/alloydb/Cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,14 @@ custom_code: !ruby/object:Provider::Terraform::CustomCode
pre_update: templates/terraform/pre_update/alloydb_cluster.go.erb
pre_delete: templates/terraform/pre_delete/alloydb_cluster.go.erb
virtual_fields:
- !ruby/object:Api::Type::Enum
- !ruby/object:Api::Type::String
name: 'deletion_policy'
description: |
Policy to determine if the cluster should be deleted forcefully.
Deleting a cluster forcefully, deletes the cluster and all its associated instances within the cluster.
Deleting a Secondary cluster with a secondary instance REQUIRES setting deletion_policy = "FORCE" otherwise an error is returned. This is needed as there is no support to delete just the secondary instance, and the only way to delete secondary instance is to delete the associated secondary cluster forcefully which also deletes the secondary instance.
values:
- :DEFAULT
- :FORCE
default_value: :DEFAULT
Possible values: DEFAULT, FORCE
default_value: DEFAULT
parameters:
- !ruby/object:Api::Type::String
name: 'clusterId'
Expand Down Expand Up @@ -559,3 +557,33 @@ properties:
name: nanos
description: |
Fractions of seconds in nanoseconds. Currently, only the value 0 is supported.
- !ruby/object:Api::Type::Enum
name: 'subscriptionType'
values:
- :TRIAL
- :STANDARD
default_from_api: true
description: |
The subscrition type of cluster.
- !ruby/object:Api::Type::NestedObject
name: 'trialMetadata'
description: |
Contains information and all metadata related to TRIAL clusters.
output: true
properties:
- !ruby/object:Api::Type::String
name: startTime
description: |
Start time of the trial cluster.
- !ruby/object:Api::Type::String
name: endTime
description: |
End time of the trial cluster.
- !ruby/object:Api::Type::String
name: upgradeTime
description: |
Upgrade time of the trial cluster to standard cluster.
- !ruby/object:Api::Type::String
name: graceEndTime
description: |
Grace end time of the trial cluster.
3 changes: 2 additions & 1 deletion mmv1/products/alloydb/go_Cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ virtual_fields:
Policy to determine if the cluster should be deleted forcefully.
Deleting a cluster forcefully, deletes the cluster and all its associated instances within the cluster.
Deleting a Secondary cluster with a secondary instance REQUIRES setting deletion_policy = "FORCE" otherwise an error is returned. This is needed as there is no support to delete just the secondary instance, and the only way to delete secondary instance is to delete the associated secondary cluster forcefully which also deletes the secondary instance.
type: Enum
Possible values: DEFAULT, FORCE
type: String
default_value: "DEFAULT"
parameters:
- name: 'clusterId'
Expand Down
2 changes: 2 additions & 0 deletions mmv1/products/bigquery/DatasetAccess.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ properties:
- view
- dataset
- routine
custom_expand: 'templates/terraform/custom_expand/string_to_lower_case.go.erb'
diff_suppress_func: resourceBigQueryDatasetAccessIamMemberDiffSuppress
- !ruby/object:Api::Type::String
name: 'groupByEmail'
Expand All @@ -138,6 +139,7 @@ properties:
- view
- dataset
- routine
custom_expand: 'templates/terraform/custom_expand/string_to_lower_case.go.erb'
diff_suppress_func: resourceBigQueryDatasetAccessIamMemberDiffSuppress
- !ruby/object:Api::Type::String
name: 'domain'
Expand Down
19 changes: 19 additions & 0 deletions mmv1/products/bigquerydatatransfer/Config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,22 @@ examples:
vars:
display_name: 'my-query'
dataset_id: 'my_dataset'
- !ruby/object:Provider::Terraform::Examples
name: 'bigquerydatatransfer_config_cmek'
skip_test: true
primary_resource_id: 'query_config_cmek'
vars:
dataset_id: 'example_dataset'
key_name: 'example-key'
keyring_name: 'example-keyring'
- !ruby/object:Provider::Terraform::Examples
skip_test: true
name: 'bigquerydatatransfer_config_salesforce'
primary_resource_id: 'salesforce_config'
vars:
display_name: 'my-salesforce-config'
dataset_id: 'my_dataset'

parameters:
- !ruby/object:Api::Type::String
name: 'location'
Expand Down Expand Up @@ -172,6 +181,16 @@ properties:
reingests data for [today-10, today-1], rather than ingesting data for
just [today-1]. Only valid if the data source supports the feature.
Set the value to 0 to use the default value.
- !ruby/object:Api::Type::NestedObject
name: 'encryptionConfiguration'
description: |
Represents the encryption configuration for a transfer.
properties:
- !ruby/object:Api::Type::String
name: 'kmsKeyName'
required: true
description: |
The name of the KMS key used for encrypting BigQuery data.
- !ruby/object:Api::Type::Boolean
name: 'disabled'
description: |
Expand Down
174 changes: 174 additions & 0 deletions mmv1/products/cloudtasks/Queue.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ examples:
- 'app_engine_routing_override.0.instance'
vars:
name: 'instance-name'
- !ruby/object:Provider::Terraform::Examples
name: 'cloud_tasks_queue_http_target_oidc'
primary_resource_id: 'http_target_oidc'
vars:
name: 'cloud-tasks-queue-http-target-oidc'
- !ruby/object:Provider::Terraform::Examples
name: 'cloud_tasks_queue_http_target_oauth'
primary_resource_id: 'http_target_oauth'
vars:
name: 'cloud-tasks-queue-http-target-oauth'
parameters:
- !ruby/object:Api::Type::String
name: 'location'
Expand Down Expand Up @@ -195,3 +205,167 @@ properties:
Specifies the fraction of operations to write to Stackdriver Logging.
This field may contain any value between 0.0 and 1.0, inclusive. 0.0 is the
default and means that no operations are logged.
- !ruby/object:Api::Type::NestedObject
name: 'httpTarget'
description: Modifies HTTP target for HTTP tasks.
properties:
- !ruby/object:Api::Type::Enum
name: 'httpMethod'
description: |
The HTTP method to use for the request.

When specified, it overrides HttpRequest for the task.
Note that if the value is set to GET the body of the task will be ignored at execution time.
values:
- HTTP_METHOD_UNSPECIFIED
- POST
- GET
- HEAD
- PUT
- DELETE
- PATCH
- OPTIONS
default_from_api: true
- !ruby/object:Api::Type::NestedObject
name: 'uriOverride'
description: |
URI override.

When specified, overrides the execution URI for all the tasks in the queue.
properties:
- !ruby/object:Api::Type::Enum
name: 'scheme'
description: |
Scheme override.

When specified, the task URI scheme is replaced by the provided value (HTTP or HTTPS).
values:
- 'HTTP'
- 'HTTPS'
default_from_api: true
- !ruby/object:Api::Type::String
name: 'host'
description: |
Host override.

When specified, replaces the host part of the task URL.
For example, if the task URL is "https://www.google.com", and host value
is set to "example.net", the overridden URI will be changed to "https://example.net".
Host value cannot be an empty string (INVALID_ARGUMENT).
- !ruby/object:Api::Type::String
name: 'port'
description: |
Port override.

When specified, replaces the port part of the task URI.
For instance, for a URI http://www.google.com/foo and port=123, the overridden URI becomes http://www.google.com:123/foo.
Note that the port value must be a positive integer.
Setting the port to 0 (Zero) clears the URI port.
- !ruby/object:Api::Type::NestedObject
name: 'pathOverride'
description: |
URI path.

When specified, replaces the existing path of the task URL.
Setting the path value to an empty string clears the URI path segment.
properties:
- !ruby/object:Api::Type::String
name: 'path'
description: The URI path (e.g., /users/1234). Default is an empty string.
default_from_api: true
- !ruby/object:Api::Type::NestedObject
name: 'queryOverride'
description: |
URI query.

When specified, replaces the query part of the task URI. Setting the query value to an empty string clears the URI query segment.
properties:
- !ruby/object:Api::Type::String
name: 'queryParams'
description: The query parameters (e.g., qparam1=123&qparam2=456). Default is an empty string.
default_from_api: true
- !ruby/object:Api::Type::Enum
name: 'uriOverrideEnforceMode'
description: |
URI Override Enforce Mode

When specified, determines the Target UriOverride mode. If not specified, it defaults to ALWAYS.
values:
- ALWAYS
- IF_NOT_EXISTS
default_from_api: true
- !ruby/object:Api::Type::Array
name: 'headerOverrides'
description: |
HTTP target headers.

This map contains the header field names and values.
Headers will be set when running the CreateTask and/or BufferTask.

These headers represent a subset of the headers that will be configured for the task's HTTP request.
Some HTTP request headers will be ignored or replaced.

Headers which can have multiple values (according to RFC2616) can be specified using comma-separated values.

The size of the headers must be less than 80KB. Queue-level headers to override headers of all the tasks in the queue.
item_type: !ruby/object:Api::Type::NestedObject
properties:
- !ruby/object:Api::Type::NestedObject
name: 'header'
description: |
Header embodying a key and a value.
required: true
properties:
- !ruby/object:Api::Type::String
name: 'key'
required: true
description: The Key of the header.
- !ruby/object:Api::Type::String
name: 'value'
required: true
description: The Value of the header.
- !ruby/object:Api::Type::NestedObject
name: 'oauthToken'
description: |
If specified, an OAuth token is generated and attached as the Authorization header in the HTTP request.

This type of authorization should generally be used only when calling Google APIs hosted on *.googleapis.com.
Note that both the service account email and the scope MUST be specified when using the queue-level authorization override.
conflicts:
- 'oidcToken'
properties:
- !ruby/object:Api::Type::String
name: 'serviceAccountEmail'
description: |
Service account email to be used for generating OAuth token.
The service account must be within the same project as the queue.
The caller must have iam.serviceAccounts.actAs permission for the service account.
required: true
- !ruby/object:Api::Type::String
name: 'scope'
description: |
OAuth scope to be used for generating OAuth access token.
If not specified, "https://www.googleapis.com/auth/cloud-platform" will be used.
default_from_api: true
- !ruby/object:Api::Type::NestedObject
name: 'oidcToken'
description: |
If specified, an OIDC token is generated and attached as an Authorization header in the HTTP request.

This type of authorization can be used for many scenarios, including calling Cloud Run, or endpoints where you intend to validate the token yourself.
Note that both the service account email and the audience MUST be specified when using the queue-level authorization override.
conflicts:
- 'oauthToken'
properties:
- !ruby/object:Api::Type::String
name: 'serviceAccountEmail'
description: |
Service account email to be used for generating OIDC token.
The service account must be within the same project as the queue.
The caller must have iam.serviceAccounts.actAs permission for the service account.
required: true
- !ruby/object:Api::Type::String
name: 'audience'
description: |
Audience to be used when generating OIDC token. If not specified, the URI specified in target will be used.
default_from_api: true
4 changes: 2 additions & 2 deletions mmv1/products/compute/Firewall.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ properties:
either an integer or a range. If not specified, this rule
applies to connections through any port.

Example inputs include: ["22"], ["80","443"], and
Example inputs include: [22], [80, 443], and
["12345-12349"].
- !ruby/object:Api::Type::Time
name: 'creationTimestamp'
Expand Down Expand Up @@ -160,7 +160,7 @@ properties:
either an integer or a range. If not specified, this rule
applies to connections through any port.

Example inputs include: ["22"], ["80","443"], and
Example inputs include: [22], [80, 443], and
["12345-12349"].
- !ruby/object:Api::Type::String
name: 'description'
Expand Down
Loading
Loading