Skip to content

Commit 4b86cb2

Browse files
authored
Merge pull request #11179 from c2thorn/sync-main-FEATURE-BRANCH-6.0.0
Sync main feature branch 6.0.0 - 7/16
2 parents edcfedd + a07d8a1 commit 4b86cb2

File tree

213 files changed

+10546
-785
lines changed

Some content is hidden

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

213 files changed

+10546
-785
lines changed

.ci/magician/github/membership.go

+12-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ var (
6969
},
7070
{
7171
id: "SarahFrench",
72-
startDate: newDate(2024, 5, 17, bstLoc),
73-
endDate: newDate(2024, 5, 19, bstLoc),
72+
startDate: newDate(2024, 7, 10, bstLoc),
73+
endDate: newDate(2024, 7, 28, bstLoc),
7474
},
7575
{
7676
id: "shuyama1",
@@ -87,6 +87,16 @@ var (
8787
startDate: newDate(2024, 7, 5, pdtLoc),
8888
endDate: newDate(2024, 7, 16, pdtLoc),
8989
},
90+
{
91+
id: "c2thorn",
92+
startDate: newDate(2024, 7, 10, pdtLoc),
93+
endDate: newDate(2024, 7, 16, pdtLoc),
94+
},
95+
{
96+
id: "rileykarson",
97+
startDate: newDate(2024, 7, 18, pdtLoc),
98+
endDate: newDate(2024, 8, 10, pdtLoc),
99+
},
90100
}
91101
)
92102

docs/content/best-practices/_index.md

-24
Original file line numberDiff line numberDiff line change
@@ -190,27 +190,3 @@ if err := tpgresource.SetDataSourceAnnotations(d); err != nil {
190190
7. In the handwritten acceptance tests, add `annotations` to `ImportStateVerifyIgnore`.
191191
8. In the corresponding data source, after the resource read method, call the function `tpgresource.SetDataSourceAnnotations(d)` to make `annotations` have all of the labels on the resource.
192192
9. Add the documentation for these annotation-related fields.
193-
194-
## Update `go.mod`
195-
196-
The Magic Modules repository does not contain a complete Go module, preventing the use of automated tooling like `go get` from that repository. To add or update provider dependencies, use standard Go tooling to update an individual provider and copy the results to the upstream files in Magic Modules. The providers share the same go.mod and go.sum contents so either can be used to generate the changes.
197-
198-
Below are the steps you can follow to make the change:
199-
200-
1. Navigate to the local `google` provider directory:
201-
```bash
202-
cd $GOPATH/src/github.com/hashicorp/terraform-provider-google
203-
```
204-
2. Open the [`go.mod`](https://github.com/hashicorp/terraform-provider-google/blob/main/go.mod) file and add the new entries or modify the versions of existing entries as needed
205-
3. Update dependencies using either of the following methods
206-
* run the following commands to update all dependencies:
207-
```bash
208-
go get
209-
go mod tidy
210-
```
211-
* Alternatively, update a specific package to a desired version:
212-
```bash
213-
go get google.golang.org/[email protected]
214-
go mod tidy
215-
```
216-
4. Copy the contents of the updated `go.mod` and `go.sum` file into [`mmv1/third_party/terraform/go.mod.erb`](https://github.com/GoogleCloudPlatform/magic-modules/blob/main/mmv1/third_party/terraform/go.mod.erb) and [`mmv1/third_party/terraform/go.sum`](https://github.com/GoogleCloudPlatform/magic-modules/blob/main/mmv1/third_party/terraform/go.sum) in the `magic-modules` respectively. Ensure `<% autogen_exception -%>` is still at the top of the file afterwards

docs/content/contribute/review-pr.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This page provides guidelines for reviewing a Magic Modules pull request (PR).
1111
* is linked to a GitHub issue or an internal bug
1212
* if not, check the [issue tracker](https://github.com/hashicorp/terraform-provider-google/issues) to see whether the feature has already been requested and add the issues in the description, if any.
1313
* establishes clear context itself via title or description.
14-
2. If the PR adds any new resource, ensure that the resource does not already exists in the [GA provider](https://github.com/hashicorp/terraform-provider-google) or [beta provider](https://github.com/hashicorp/terraform-provider-google-beta)
14+
2. If the PR adds any new resource, ensure that the resource does not already exist in the [GA provider](https://github.com/hashicorp/terraform-provider-google) or [beta provider](https://github.com/hashicorp/terraform-provider-google-beta)
1515
1. Read through all the changes in the PR, generated code in the downstreams and the API documentation to ensure that:
1616
1. the resource schema added in the PR matches the API structure.
1717
1. the features are added in the correct version
@@ -46,4 +46,4 @@ This page provides guidelines for reviewing a Magic Modules pull request (PR).
4646
1. Check documentation to ensure
4747
1. resouce-level and field-level documentation are generated correctly for MMv1-based resource
4848
1. documentation is added manually for handwritten resources.
49-
1. Check if release notes capture all changes in the PR, and are correctly formatted following the guidance in [write release notes]({{< ref "release-notes" >}}) before merge the PR.
49+
1. Check if release notes capture all changes in the PR, and are correctly formatted following the guidance in [write release notes]({{< ref "release-notes" >}}) before merging the PR.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: "Update dependencies"
3+
weight: 300
4+
aliases:
5+
- /docs/update-dependencies
6+
---
7+
8+
# Update `go.mod`
9+
10+
The Magic Modules repository does not contain a complete Go module, preventing the use of automated tooling like `go get` from that repository. To add or update provider dependencies, use standard Go tooling to update an individual provider and copy the results to the upstream files in Magic Modules. The providers share the same go.mod and go.sum contents so either can be used to generate the changes.
11+
12+
Below are the steps you can follow to make the change:
13+
14+
1. Navigate to the local `google` provider directory:
15+
```bash
16+
cd $GOPATH/src/github.com/hashicorp/terraform-provider-google
17+
```
18+
2. Open the [`go.mod`](https://github.com/hashicorp/terraform-provider-google/blob/main/go.mod) file and add the new entries or modify the versions of existing entries as needed
19+
3. Update dependencies using either of the following methods
20+
* run the following commands to update all dependencies:
21+
```bash
22+
go get
23+
go mod tidy
24+
```
25+
* Alternatively, update a specific package to a desired version:
26+
```bash
27+
go get google.golang.org/[email protected]
28+
go mod tidy
29+
```
30+
4. Copy the contents of the updated `go.mod` and `go.sum` file into [`mmv1/third_party/terraform/go.mod.erb`](https://github.com/GoogleCloudPlatform/magic-modules/blob/main/mmv1/third_party/terraform/go.mod.erb) and [`mmv1/third_party/terraform/go.sum`](https://github.com/GoogleCloudPlatform/magic-modules/blob/main/mmv1/third_party/terraform/go.sum) in the `magic-modules` respectively. Ensure `<% autogen_exception -%>` is still at the top of the file afterwards

mmv1/api/resource/examples.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,9 @@ func (e *Examples) UnmarshalYAML(n *yaml.Node) error {
172172
return err
173173
}
174174

175-
e.ConfigPath = fmt.Sprintf("templates/terraform/examples/go/%s.tf.tmpl", e.Name)
175+
if e.ConfigPath == "" {
176+
e.ConfigPath = fmt.Sprintf("templates/terraform/examples/go/%s.tf.tmpl", e.Name)
177+
}
176178
e.SetHCLText()
177179

178180
return nil

mmv1/products/alloydb/Instance.yaml

+30
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,36 @@ properties:
236236
- !ruby/object:Api::Type::Integer
237237
name: 'queryPlansPerMinute'
238238
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.'
239+
- !ruby/object:Api::Type::NestedObject
240+
name: 'observabilityConfig'
241+
description: 'Configuration for enhanced query insights.'
242+
default_from_api: true
243+
min_version: beta
244+
properties:
245+
- !ruby/object:Api::Type::Boolean
246+
name: 'enabled'
247+
description: 'Observability feature status for an instance.'
248+
- !ruby/object:Api::Type::Boolean
249+
name: 'preserveComments'
250+
description: 'Preserve comments in the query string.'
251+
- !ruby/object:Api::Type::Boolean
252+
name: 'trackWaitEvents'
253+
description: 'Record wait events during query execution for an instance.'
254+
- !ruby/object:Api::Type::Boolean
255+
name: 'trackWaitEventTypes'
256+
description: 'Record wait event types during query execution for an instance.'
257+
- !ruby/object:Api::Type::Integer
258+
name: 'maxQueryStringLength'
259+
description: 'Query string length. The default value is 10240. Any integer between 1024 and 100000 is considered valid.'
260+
- !ruby/object:Api::Type::Boolean
261+
name: 'recordApplicationTags'
262+
description: 'Record application tags for an instance. This flag is turned "on" by default.'
263+
- !ruby/object:Api::Type::Integer
264+
name: 'queryPlansPerMinute'
265+
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.'
266+
- !ruby/object:Api::Type::Boolean
267+
name: 'trackActiveQueries'
268+
description: 'Track actively running queries. If not set, default value is "off".'
239269
- !ruby/object:Api::Type::NestedObject
240270
name: 'readPoolConfig'
241271
description: 'Read pool specific config. If the instance type is READ_POOL, this configuration must be provided.'

mmv1/products/alloydb/go_Backup.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ timeouts:
3333
delete_minutes: 10
3434
autogen_async: true
3535
async:
36+
actions: ['create', 'delete', 'update']
3637
type: 'OpAsync'
3738
operation:
3839
base_url: '{{op_id}}'

mmv1/products/alloydb/go_Cluster.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ docs:
2424
Users can promote a secondary cluster to a primary cluster with the help of `cluster_type`.
2525
To promote, users have to set the `cluster_type` property as `PRIMARY` and remove the `secondary_config` field from cluster configuration.
2626
[See Example](https://github.com/hashicorp/terraform-provider-google/pull/16413).
27+
28+
Switchover is supported in terraform by refreshing the state of the terraform configurations.
29+
The switchover operation still needs to be called outside of terraform.
30+
After the switchover operation is completed successfully:
31+
1. Refresh the state of the AlloyDB resources by running `terraform apply -refresh-only --auto-approve` .
32+
2. Manually update the terraform configuration file(s) to match the actual state of the resources by modifying the `cluster_type` and `secondary_config` fields.
33+
3. Verify the sync of terraform state by running `terraform plan` and ensure that the infrastructure matches the configuration and no changes are required.
2734
base_url: 'projects/{{project}}/locations/{{location}}/clusters'
2835
self_link: 'projects/{{project}}/locations/{{location}}/clusters/{{cluster_id}}'
2936
create_url: 'projects/{{project}}/locations/{{location}}/clusters?clusterId={{cluster_id}}'
@@ -38,6 +45,7 @@ timeouts:
3845
delete_minutes: 30
3946
autogen_async: true
4047
async:
48+
actions: ['create', 'delete', 'update']
4149
type: 'OpAsync'
4250
operation:
4351
base_url: '{{op_id}}'

mmv1/products/alloydb/go_Instance.yaml

+31
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ timeouts:
3636
delete_minutes: 120
3737
autogen_async: true
3838
async:
39+
actions: ['create', 'delete', 'update']
3940
type: 'OpAsync'
4041
operation:
4142
base_url: '{{op_id}}'
@@ -234,6 +235,36 @@ properties:
234235
- name: 'queryPlansPerMinute'
235236
type: Integer
236237
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.'
238+
- name: 'observabilityConfig'
239+
type: NestedObject
240+
description: 'Configuration for enhanced query insights.'
241+
default_from_api: true
242+
min_version: beta
243+
properties:
244+
- name: 'enabled'
245+
type: Boolean
246+
description: 'Observability feature status for an instance.'
247+
- name: 'preserveComments'
248+
type: Boolean
249+
description: 'Preserve comments in the query string.'
250+
- name: 'trackWaitEvents'
251+
type: Boolean
252+
description: 'Record wait events during query execution for an instance.'
253+
- name: 'trackWaitEventTypes'
254+
type: Boolean
255+
description: 'Record wait event types during query execution for an instance.'
256+
- name: 'maxQueryStringLength'
257+
type: Integer
258+
description: 'Query string length. The default value is 10240. Any integer between 1024 and 100000 is considered valid.'
259+
- name: 'recordApplicationTags'
260+
type: Boolean
261+
description: 'Record application tags for an instance. This flag is turned "on" by default.'
262+
- name: 'queryPlansPerMinute'
263+
type: Integer
264+
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.'
265+
- name: 'trackActiveQueries'
266+
type: Boolean
267+
description: 'Track actively running queries. If not set, default value is "off".'
237268
- name: 'readPoolConfig'
238269
type: NestedObject
239270
description: 'Read pool specific config. If the instance type is READ_POOL, this configuration must be provided.'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Copyright 2023 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+
--- !ruby/object:Api::Resource
15+
name: 'EnvironmentKeyvaluemaps'
16+
description: |
17+
Collection of key/value string pairs.
18+
references: !ruby/object:Api::Resource::ReferenceLinks
19+
guides:
20+
'Using key value maps': 'https://cloud.google.com/apigee/docs/api-platform/cache/key-value-maps'
21+
api: 'https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.environments.keyvaluemaps/create'
22+
23+
base_url: '{{env_id}}/keyvaluemaps'
24+
create_url: '{{env_id}}/keyvaluemaps'
25+
delete_url: '{{env_id}}/keyvaluemaps/{{name}}'
26+
self_link: '{{env_id}}/keyvaluemaps/{{name}}/entries'
27+
import_format: ['{{env_id}}/keyvaluemaps/{{name}}', '{{env_id}}/{{name}}']
28+
skip_sweeper: true
29+
examples:
30+
- !ruby/object:Provider::Terraform::Examples
31+
name: 'apigee_environment_keyvaluemaps_basic'
32+
primary_resource_id: 'apigee_environment_keyvaluemaps'
33+
test_env_vars:
34+
org_id: :ORG_ID
35+
billing_account: :BILLING_ACCT
36+
skip_test: true
37+
- !ruby/object:Provider::Terraform::Examples
38+
name: 'apigee_environment_keyvaluemaps_test'
39+
primary_resource_id: 'apigee_environment_keyvaluemaps'
40+
test_env_vars:
41+
org_id: :ORG_ID
42+
billing_account: :BILLING_ACCT
43+
skip_docs: true
44+
- !ruby/object:Provider::Terraform::Examples
45+
name: 'apigee_environment_keyvaluemaps_beta_test'
46+
primary_resource_id: 'apigee_environment_keyvaluemaps'
47+
test_env_vars:
48+
org_id: :ORG_ID
49+
billing_account: :BILLING_ACCT
50+
skip_docs: true
51+
min_version: beta
52+
immutable: true
53+
timeouts: !ruby/object:Api::Timeouts
54+
insert_minutes: 1
55+
delete_minutes: 1
56+
autogen_async: true
57+
custom_code: !ruby/object:Provider::Terraform::CustomCode
58+
custom_import: templates/terraform/custom_import/apigee_environment_keyvaluemaps.go.erb
59+
custom_create: 'templates/terraform/custom_create/apigee_environment_keyvaluemaps.go'
60+
decoder: templates/terraform/decoders/apigee_environment_keyvaluemaps.go.erb
61+
parameters:
62+
- !ruby/object:Api::Type::String
63+
name: 'envId'
64+
description: |
65+
The Apigee environment group associated with the Apigee environment,
66+
in the format `organizations/{{org_name}}/environments/{{env_name}}`.
67+
required: true
68+
immutable: true
69+
url_param_only: true
70+
properties:
71+
- !ruby/object:Api::Type::String
72+
name: 'name'
73+
description: |
74+
Required. ID of the key value map.
75+
required: true
76+
immutable: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Copyright 2023 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+
--- !ruby/object:Api::Resource
15+
name: 'EnvironmentKeyvaluemapsEntries'
16+
description: |
17+
Creates key value entries in a key value map scoped to an environment.
18+
references: !ruby/object:Api::Resource::ReferenceLinks
19+
guides:
20+
'Using key value maps': 'https://cloud.google.com/apigee/docs/api-platform/cache/key-value-maps'
21+
api: 'https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.keyvaluemaps.entries/create'
22+
23+
base_url: '{{env_keyvaluemap_id}}/entries'
24+
create_url: '{{env_keyvaluemap_id}}/entries'
25+
delete_url: '{{env_keyvaluemap_id}}/entries/{{name}}'
26+
self_link: '{{env_keyvaluemap_id}}/entries/{{name}}'
27+
import_format:
28+
['{{env_keyvaluemap_id}}/entries/{{name}}', '{{env_keyvaluemap_id}}/{{name}}']
29+
skip_sweeper: true
30+
examples:
31+
- !ruby/object:Provider::Terraform::Examples
32+
name: 'apigee_environment_keyvaluemaps_entries_basic'
33+
primary_resource_id: 'apigee_environment_keyvaluemaps_entries'
34+
test_env_vars:
35+
org_id: :ORG_ID
36+
billing_account: :BILLING_ACCT
37+
skip_test: true
38+
- !ruby/object:Provider::Terraform::Examples
39+
name: 'apigee_environment_keyvaluemaps_entries_test'
40+
primary_resource_id: 'apigee_environment_keyvaluemaps_entries'
41+
test_env_vars:
42+
org_id: :ORG_ID
43+
billing_account: :BILLING_ACCT
44+
skip_docs: true
45+
- !ruby/object:Provider::Terraform::Examples
46+
name: 'apigee_environment_keyvaluemaps_entries_beta_test'
47+
primary_resource_id: 'apigee_environment_keyvaluemaps_entries'
48+
test_env_vars:
49+
org_id: :ORG_ID
50+
billing_account: :BILLING_ACCT
51+
skip_docs: true
52+
min_version: beta
53+
timeouts: !ruby/object:Api::Timeouts
54+
insert_minutes: 1
55+
delete_minutes: 1
56+
immutable: true
57+
autogen_async: true
58+
custom_code: !ruby/object:Provider::Terraform::CustomCode
59+
custom_import: templates/terraform/custom_import/apigee_environment_keyvaluemaps_entries.go.erb
60+
parameters:
61+
- !ruby/object:Api::Type::String
62+
name: 'env_keyvaluemap_id'
63+
description: |
64+
The Apigee environment keyvalumaps Id associated with the Apigee environment,
65+
in the format `organizations/{{org_name}}/environments/{{env_name}}/keyvaluemaps/{{keyvaluemap_name}}`.
66+
required: true
67+
immutable: true
68+
url_param_only: true
69+
properties:
70+
- !ruby/object:Api::Type::String
71+
name: 'name'
72+
description: |
73+
Required. Resource URI that can be used to identify the scope of the key value map entries.
74+
required: true
75+
immutable: true
76+
- !ruby/object:Api::Type::String
77+
name: 'value'
78+
description: |
79+
Required. Data or payload that is being retrieved and associated with the unique key.
80+
required: true
81+
immutable: true

0 commit comments

Comments
 (0)