diff --git a/builder/googlecompute/config_test.go b/builder/googlecompute/config_test.go index 2b450ed9b..5c6ea6334 100644 --- a/builder/googlecompute/config_test.go +++ b/builder/googlecompute/config_test.go @@ -168,6 +168,13 @@ func TestImageName(t *testing.T) { } } +func TestRegion(t *testing.T) { + c, _, _ := NewConfig(testConfig(t)) + if c.Region != "us-east1" { + t.Fatalf("Region should be 'us-east1' given Zone of 'us-east1-a', but is %s", c.Region) + } +} + // Helper stuff below func testConfig(t *testing.T) map[string]interface{} { @@ -175,7 +182,7 @@ func testConfig(t *testing.T) map[string]interface{} { "account_file": testAccountFile(t), "project_id": "hashicorp", "source_image": "foo", - "zone": "us-east-1a", + "zone": "us-east1-a", } } diff --git a/website/source/docs/builders/googlecompute.html.markdown b/website/source/docs/builders/googlecompute.html.markdown index cebb1d484..1e7efde26 100644 --- a/website/source/docs/builders/googlecompute.html.markdown +++ b/website/source/docs/builders/googlecompute.html.markdown @@ -142,6 +142,10 @@ builder. - `state_timeout` (string) - The time to wait for instance state changes. Defaults to `"5m"`. +- `subnetwork` (string) - The Google Compute subnetwork to use for the launced + instance. Only required if the `network` has been created with custom + subnetting. + - `tags` (array of strings) - `use_internal_ip` (boolean) - If true, use the instance's internal IP