Skip to content

Commit a07c1b0

Browse files
committed
2 parents 1d86b57 + 7f65129 commit a07c1b0

7 files changed

Lines changed: 101 additions & 7 deletions

File tree

mmv1/products/compute/MachineImage.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,16 @@ examples:
5858
key_name: '"key" + randomSuffix'
5959
# for backward compatible
6060
keyring_name: '"keyring" + randomSuffix'
61+
- name: machine_image_resource_manager_tags
62+
primary_resource_id: image
63+
vars:
64+
image_name: my-image
65+
vm_name: my-vm
66+
tag_key: tagkey
67+
tag_value: tagvalue
68+
test_vars_overrides:
69+
'tag_key': '"tf-test-key-" + acctest.RandString(t, 10)'
70+
'tag_value': '"tf-test-value-" + acctest.RandString(t, 10)'
6171
properties:
6272
- name: name
6373
type: String
@@ -125,3 +135,20 @@ properties:
125135
The service account used for the encryption request for the given KMS key.
126136
If absent, the Compute Engine Service Agent service account is used.
127137
min_version: beta
138+
- name: 'params'
139+
type: NestedObject
140+
ignore_read: true
141+
immutable: true
142+
min_version: beta
143+
description: |
144+
Additional params passed with the request, but not persisted as part of resource payload.
145+
properties:
146+
- name: 'resourceManagerTags'
147+
type: KeyValuePairs
148+
description: |
149+
Resource manager tags to be bound to the machine image. Tag keys and values have the
150+
same definition as resource manager tags. Keys must be in the format tagKeys/{tag_key_id},
151+
and values are in the format tagValues/456.
152+
api_name: resourceManagerTags
153+
min_version: beta
154+
ignore_read: true

mmv1/products/hypercomputecluster/Cluster.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ properties:
306306
- name: count
307307
type: String
308308
required: true
309+
diff_suppress_func: 'tpgresource.EmptyOrDefaultStringSuppress("0")'
309310
description: Number of login node instances to create.
310311
- name: enableOsLogin
311312
type: Boolean
@@ -441,6 +442,7 @@ properties:
441442
alphanumeric, and at most 63 characters).
442443
- name: maxDynamicNodeCount
443444
type: String
445+
diff_suppress_func: 'tpgresource.EmptyOrDefaultStringSuppress("0")'
444446
description: |-
445447
Controls how many additional nodes a cluster can bring online to handle
446448
workloads. Set this value to enable dynamic node creation and limit the
@@ -449,6 +451,7 @@ properties:
449451
on static nodes.
450452
- name: staticNodeCount
451453
type: String
454+
diff_suppress_func: 'tpgresource.EmptyOrDefaultStringSuppress("0")'
452455
description: |-
453456
Number of nodes to be statically created for this nodeset. The cluster will
454457
attempt to ensure that at least this many nodes exist at all times.

mmv1/templates/terraform/constants/disk.tmpl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -317,10 +317,6 @@ func ExpandStoragePoolUrl(v interface{}, d tpgresource.TerraformResourceData, co
317317
if err != nil {
318318
return "", err
319319
}
320-
zone, err := tpgresource.GetZone(d, config)
321-
if err != nil {
322-
return "", err
323-
}
324320
325321
formattedStr := v.(string)
326322
if strings.HasPrefix(v.(string), "/") {
@@ -338,8 +334,14 @@ func ExpandStoragePoolUrl(v interface{}, d tpgresource.TerraformResourceData, co
338334
// For regional or zonal resources which include their region or zone, just put the project in front.
339335
replacedStr = config.ComputeBasePath + "projects/" + project + "/" + formattedStr
340336
} else {
337+
// Resources like instance template do not have a zone argument.
338+
// In this case, run GetZone when it is strictly necessary.
339+
zone, err := tpgresource.GetZone(d, config)
340+
if err != nil {
341+
return "", err
342+
}
341343
// Anything else is assumed to be a zonal resource, with a partial link that begins with the resource name.
342344
replacedStr = config.ComputeBasePath + "projects/" + project + "/zones/" + zone + "/storagePools/" + formattedStr
343345
}
344346
return replacedStr, nil
345-
}
347+
}

mmv1/templates/terraform/examples/apigee_organization_cloud_basic_data_residency_test.tf.tmpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// For advanced data residency customers: To ensure advanced data residency compliance for data
2+
// in transit, you must use the appropriate regional endpoint for the 'apigee_custom_endpoint'.
13
provider "google" {
24
apigee_custom_endpoint = "https://eu-apigee.googleapis.com/v1/"
35
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
data "google_project" "project" {
2+
provider = google-beta
3+
}
4+
5+
resource "google_tags_tag_key" "tag_key1" {
6+
provider = google-beta
7+
parent = "projects/${data.google_project.project.number}"
8+
short_name = "{{index $.Vars "tag_key"}}"
9+
}
10+
11+
resource "google_tags_tag_value" "tag_value1" {
12+
provider = google-beta
13+
parent = google_tags_tag_key.tag_key1.id
14+
short_name = "{{index $.Vars "tag_value"}}"
15+
}
16+
17+
resource "google_compute_instance" "vm" {
18+
provider = google-beta
19+
name = "{{index $.Vars "vm_name"}}"
20+
machine_type = "e2-medium"
21+
22+
boot_disk {
23+
initialize_params {
24+
image = "debian-cloud/debian-11"
25+
}
26+
}
27+
28+
network_interface {
29+
network = "default"
30+
}
31+
}
32+
33+
resource "google_compute_machine_image" "{{$.PrimaryResourceId}}" {
34+
provider = google-beta
35+
name = "{{index $.Vars "image_name"}}"
36+
source_instance = google_compute_instance.vm.self_link
37+
params {
38+
resource_manager_tags = {
39+
(google_tags_tag_key.tag_key1.id) = (google_tags_tag_value.tag_value1.id)
40+
}
41+
}
42+
}

mmv1/third_party/terraform/services/corebilling/resource_google_billing_project_info_test.go renamed to mmv1/third_party/terraform/services/cloudbilling/resource_google_billing_project_info_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package corebilling_test
1+
package cloudbilling_test
22

33
import (
44
"fmt"
@@ -20,7 +20,7 @@ func TestAccBillingProjectInfo_update(t *testing.T) {
2020
acctest.VcrTest(t, resource.TestCase{
2121
PreCheck: func() { acctest.AccTestPreCheck(t) },
2222
ProtoV5ProviderFactories: acctest.ProtoV5ProviderFactories(t),
23-
CheckDestroy: testAccCheckCoreBillingProjectInfoDestroyProducer(t),
23+
CheckDestroy: testAccCheckCloudBillingProjectInfoDestroyProducer(t),
2424
Steps: []resource.TestStep{
2525
{
2626
Config: testAccBillingProjectInfo_basic(projectId, orgId, billingAccount),

mmv1/third_party/terraform/website/docs/guides/provider_reference.html.markdown

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,24 @@ Support for custom endpoints is on a best-effort basis. The underlying
378378
endpoint and default values for a resource can be changed at any time without
379379
being considered a breaking change.
380380

381+
**Data residency at rest and advanced data residency**
382+
383+
For services that support data residency at rest, you can specify a regional endpoint
384+
to ensure your data is processed and stored in a specific geographic location.
385+
386+
For services offering advanced data residency, it is critical to use the correct regional
387+
endpoint to ensure data remains within the chosen region when at use, in use, and in transit.
388+
389+
Example of Apigee regional endpoint for the European Union:
390+
391+
```
392+
provider "google" {
393+
apigee_custom_endpoint = "https://apigee.eu.rep.googleapis.com/v1/"
394+
}
395+
```
396+
397+
Always consult the specific service documentation for the correct regional or multi-regional endpoint to use.
398+
381399
---
382400

383401
* `universe_domain` - (Optional) Specify the GCP universe to deploy in.

0 commit comments

Comments
 (0)