Skip to content

Commit c0b8700

Browse files
add support for partner metadata field on instance and instance template (#10753) (#18305)
[upstream:5449997c69a891356f1f417da5cc895703474955] Signed-off-by: Modular Magician <magic-modules@google.com>
1 parent 39b6756 commit c0b8700

6 files changed

+10
-3
lines changed

google/services/compute/resource_compute_instance.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,6 +1358,7 @@ func resourceComputeInstanceRead(d *schema.ResourceData, meta interface{}) error
13581358
if err := d.Set("metadata_fingerprint", instance.Metadata.Fingerprint); err != nil {
13591359
return fmt.Errorf("Error setting metadata_fingerprint: %s", err)
13601360
}
1361+
13611362
if err := d.Set("can_ip_forward", instance.CanIpForward); err != nil {
13621363
return fmt.Errorf("Error setting can_ip_forward: %s", err)
13631364
}

google/services/compute/resource_compute_instance_template_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1266,6 +1266,7 @@ func testAccCheckComputeInstanceTemplateExistsInProject(t *testing.T, n, p strin
12661266
templateName := splits[len(splits)-1]
12671267
found, err := config.NewComputeClient(config.UserAgent).InstanceTemplates.Get(
12681268
p, templateName).Do()
1269+
12691270
if err != nil {
12701271
return err
12711272
}

google/services/compute/resource_compute_instance_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,7 +1592,7 @@ func TestAccComputeInstance_guestAccelerator(t *testing.T) {
15921592
Config: testAccComputeInstance_guestAccelerator(instanceName, 1),
15931593
Check: resource.ComposeTestCheckFunc(
15941594
testAccCheckComputeInstanceExists(t, "google_compute_instance.foobar", &instance),
1595-
testAccCheckComputeInstanceHasGuestAccelerator(&instance, "nvidia-tesla-k80", 1),
1595+
testAccCheckComputeInstanceHasGuestAccelerator(&instance, "nvidia-tesla-t4", 1),
15961596
),
15971597
},
15981598
computeInstanceImportStep("us-east1-d", instanceName, []string{"metadata.baz", "metadata.foo"}),
@@ -2881,7 +2881,6 @@ func testAccCheckComputeInstanceExistsInProject(t *testing.T, n, p string, insta
28812881
}
28822882

28832883
config := acctest.GoogleProviderConfig(t)
2884-
28852884
found, err := config.NewComputeClient(config.UserAgent).Instances.Get(
28862885
p, rs.Primary.Attributes["zone"], rs.Primary.Attributes["name"]).Do()
28872886
if err != nil {
@@ -6001,7 +6000,7 @@ resource "google_compute_instance" "foobar" {
60016000
60026001
guest_accelerator {
60036002
count = %d
6004-
type = "nvidia-tesla-k80"
6003+
type = "nvidia-tesla-t4"
60056004
}
60066005
}
60076006
`, instance, count)

website/docs/r/compute_instance.html.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ is desired, you will need to modify your state file manually using
196196
in `guest-os-features`, and `network_interface.0.nic-type` must be `GVNIC`
197197
in order for this setting to take effect.
198198

199+
* `partner_metadata` - (optional) [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html) key/value pair represents partner metadata assigned to instance where key represent a defined namespace and value is a json string represent the entries associted with the namespace.
200+
199201
---
200202

201203
<a name="nested_boot_disk"></a>The `boot_disk` block supports:

website/docs/r/compute_instance_template.html.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,8 @@ The following arguments are supported:
375375

376376
* `advanced_machine_features` (Optional) - Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM. Structure is [documented below](#nested_advanced_machine_features)
377377

378+
* `partner_metadata` - (optional) [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html) key/value pair represents partner metadata assigned to instance template where key represent a defined namespace and value is a json string represent the entries associted with the namespace.
379+
378380
<a name="nested_disk"></a>The `disk` block supports:
379381

380382
* `auto_delete` - (Optional) Whether or not the disk should be auto-deleted.

website/docs/r/compute_region_instance_template.html.markdown

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,8 @@ The following arguments are supported:
384384

385385
* `advanced_machine_features` (Optional) - Configure Nested Virtualisation and Simultaneous Hyper Threading on this VM. Structure is [documented below](#nested_advanced_machine_features)
386386

387+
* `partner_metadata` - (optional) [Beta](https://terraform.io/docs/providers/google/guides/provider_versions.html) key/value pair represents partner metadata assigned to instance template where key represent a defined namespace and value is a json string represent the entries associted with the namespace.
388+
387389
<a name="nested_disk"></a>The `disk` block supports:
388390

389391
* `auto_delete` - (Optional) Whether or not the disk should be auto-deleted.

0 commit comments

Comments
 (0)