Commit Graph

14 Commits

Author SHA1 Message Date
Miriam Lauter
bc927db71a Add support for Shielded VMs to compute_instance and compute_instance_template (#3209) (#3531) 2019-05-16 10:18:53 -07:00
The Magician
267b37a9b9 Add node_affinities to instance/template (#3553)
Signed-off-by: Modular Magician <magic-modules@google.com>
2019-05-06 13:10:01 -07:00
The Magician
f5af84619c Remove validation in compute_instance expanders (#3236)
<!-- This change is generated by MagicModules. -->
/cc @chrisst
2019-03-13 15:29:56 -07:00
The Magician
0de6d2790c [terraform-conversions] Add compute_instance to conversions library (#3226)
<!-- This change is generated by MagicModules. -->
/cc @nstogner
2019-03-12 15:10:21 -07:00
Chris Stephens
ae09a200c7 deprecate address as originally intended 2018-12-20 17:22:22 -08:00
Chris Stephens
50fe1b6c83 Remove address and create_timeout from instance (#2219) 2018-12-20 17:22:22 -08:00
Riley Karson
41d47ec8bb
Deprecate address in compute_instance family, undeprecate network_ip (#2096)
Also remove a duplicate instance test I noticed for ephemeral ips.
2018-09-26 11:19:25 -07:00
Vincent Roseberry
4f89945cce
Store v1 self_link for network and subnetwork (#1629) 2018-06-08 09:55:21 -07:00
Dana Hoffman
2f5c77cd7f add support for network tiers (#1530)
* add support for network tiers

* Update resource_compute_forwarding_rule.go
2018-06-05 12:35:44 -07:00
Nathan McKinley
0a02d8eaef
Fix failing compute tests which use AccessConfigs (#1383) 2018-04-25 13:26:24 -07:00
Nathan McKinley
d3bbfbd22b
Add DNS PTR record to Compute Instance (#1349) 2018-04-20 11:14:38 -07:00
Vincent Roseberry
3690926170
Support self_link from different project in dataproc network and subnetwork fields (#935) 2018-01-10 11:05:24 -08:00
Dana Hoffman
50afa7b199
compute instance helpers / metadata cleanup (#797)
* get rid of getSubnetworkLink and getProjectAndRegionFromSubnetworkLink

* dedupe metadata flatteners

* update flattenMetadata comment
2017-11-29 09:47:42 -08:00
Nic Cope
94a405d179 Add Alias IP and Guest Accelerator support to Instance Templates (#639)
* Move AliasIpRange helpers into utils

To reflect the fact they'll be used by multiple resources.

* Pass Config to build helpers, not meta

It's the only thing meta is used for.

* Refactor getNetwork util methods to return early for the happy path.

* Update compute APIs

compute.Instance.MinCpuPlatform is now GA.

* Fix panic in TestComputeInstanceMigrateState

This seemed to be a pre-existing issue, i.e. I could repro it in master.

--- FAIL: TestComputeInstanceMigrateState (0.00s)
panic: interface conversion: interface {} is nil, not *google.Config [recovered]
        panic: interface conversion: interface {} is nil, not *google.Config

goroutine 85 [running]:
testing.tRunner.func1(0xc4205d60f0)
        /usr/local/Cellar/go/1.9.1/libexec/src/testing/testing.go:711 +0x2d2
panic(0x203acc0, 0xc4205d2080)
        /usr/local/Cellar/go/1.9.1/libexec/src/runtime/panic.go:491 +0x283
github.com/terraform-providers/terraform-provider-google/google.migrateStateV3toV4(0xc4205f2000, 0x0, 0x0, 0x0, 0x48, 0xc4205f2000)
        /Users/negz/control/go/src/github.com/terraform-providers/terraform-provider-google/google/resource_compute_instance_migrate.go:182 +0x2405
github.com/terraform-providers/terraform-provider-google/google.resourceComputeInstanceMigrateState(0x2, 0xc4205f2000, 0x0, 0x0, 0x0, 0x0, 0xe0000000000)
        /Users/negz/control/go/src/github.com/terraform-providers/terraform-provider-google/google/resource_compute_instance_migrate.go:48 +0x21a
github.com/terraform-providers/terraform-provider-google/google.runInstanceMigrateTest(0xc4205d60f0, 0x2260816, 0x8, 0x227d23a, 0x20, 0x2, 0xc4205ec0f0, 0xc4205ec120, 0x0,
 0x0)
        /Users/negz/control/go/src/github.com/terraform-providers/terraform-provider-google/google/resource_compute_instance_migrate_test.go:803 +0xc1
github.com/terraform-providers/terraform-provider-google/google.TestComputeInstanceMigrateState(0xc4205d60f0)
        /Users/negz/control/go/src/github.com/terraform-providers/terraform-provider-google/google/resource_compute_instance_migrate_test.go:71 +0xc84
testing.tRunner(0xc4205d60f0, 0x22d81c0)
        /usr/local/Cellar/go/1.9.1/libexec/src/testing/testing.go:746 +0xd0
created by testing.(*T).Run
        /usr/local/Cellar/go/1.9.1/libexec/src/testing/testing.go:789 +0x2de
FAIL    github.com/terraform-providers/terraform-provider-google/google 0.035s

* Use only the v1 API for resource_compute_instance

Alias IP ranges, Accelerators, and min CPU platform are now GA.

* Move common instance code into utils.go

Methods used by both resource_compute_instance and
resource_compute_instance_template are currently spread between their respective
files, and utils.go.

This commit moves them all into utils.go for the sake of consistency. It may be
worth considering an instance_common.go file or similar.

* Unify compute_instance and compute_instance_template network_interface and service_account code

This has the side effect of enabling Alias IP range support for
compute_instance_templates.

* Add tests for compute instance template Alias IP ranges

* Mark instance template region as computed

We compute it from the subnet its network interfaces are in. Note this
is not new behaviour - I believe it was erroneously missing the computed
flag.

* Support guest accelerators for instance templates

Since most of the code is already there.

* Add a test for using 'address' rather than 'network_ip' for instance templates

* Don't mark assigned_nat_ip as deprecated

* Remove network_interface schema fields that don't make sense for a compute instance template

* Add newline after count in instance template docs

* Don't try to dedupe guest accelerator expansion code

The API calls to Google to create guest accelerators take different values
for instances and instance templates. Instance templates don't have a zone
and can thus *only* be passed a guest accelerator name.

* Use ParseNetworkFieldValue instead of getNetworkLink

* Add support for parsing regional fields, and subnetworks specifically

Currently unused because subnetworks may have a separate project from that
of the instance using them, which complicates looking up the project field.

* Fall back to provider region when parsing regional field values

Also slightly refactors getXFromSchema field helper functions for readability.

* Revert to assigned_nat_ip in compute instance docs

* Add beta scaffolding to compute instance and compute instance template

Note these resources don't currently use beta features - this is futureproofing.

* Fix indentation in comment about instance template alias IP ranges

* Consolidate metadata helper functions in metadata.go

* Move compute instance (and template) related helpers into their own file
2017-11-28 10:01:27 -08:00