Commit Graph

59 Commits

Author SHA1 Message Date
The Magician
ced540ceca Add hostname field to compute_instance (#2952)
Signed-off-by: Modular Magician <magic-modules@google.com>
2019-01-29 09:44:21 -08:00
The Magician
50af33999e Fix some formatting to be 0.12-ready (#2800)
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
2019-01-04 13:01:39 -08:00
The Magician
082ba50b52 Update config formatting that no longer works in 0.12 (#2756)
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
2018-12-27 10:14:07 -08:00
The Magician
2ab6d1995f Add = to map declarations in examples/tests (#2755)
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
2018-12-27 07:51:23 -08:00
The Magician
c605b0bc4b [Terraform]: Apply gofmt -s to all files managed by MM (#2676)
<!-- This change is generated by MagicModules. -->
/cc @rileykarson
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
The Magician
eafe197070 Remove deprecated raw_key convenience property (#2209)
Removing disk_encryption_key_sha256 and disk_encryption_key_raw and removing the custom diff logic associated with them.

<!-- This change is generated by MagicModules. -->
/cc @chrisst
2018-12-20 17:22:22 -08:00
Riley Karson
a4a453dc1b
Deprecate assigned_nat_ip in compute_instance family (#2155)
Part of #2143
2018-10-02 16:07:28 -07: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
Nathan McKinley
f05d62c89e
Enable multiple alias IP ranges for compute instance. (#2029)
* Enable multiple alias IP ranges for compute instance.
2018-09-11 17:37:35 -07:00
Paddy Carver
be76ffaa78 Fix whitespace, really.
Tabs v spaces strikes again.
2018-08-21 13:36:04 -07:00
Paddy Carver
f9c6993990 Fix whitespace. 2018-08-15 13:23:31 -07:00
Paddy Carver
dd56795f2a Use family, not name, in image data source. 2018-08-14 11:18:39 -07:00
Paddy Carver
5c9ce55172 Continue our deprecation of debian-8. 2018-08-13 16:20:33 -07:00
Dana Hoffman
547245bada allow setting instance scheduling booleans to false 2018-07-16 13:54:47 -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
Dana Hoffman
337a913cac
use correct region for guest accelerator import test (#1461) 2018-05-09 13:01:23 -07:00
Nathan McKinley
d3bbfbd22b
Add DNS PTR record to Compute Instance (#1349) 2018-04-20 11:14:38 -07:00
Dana Hoffman
d786c3b9c4
make all ImportStates have a matching ImportStateVerify (#1327) 2018-04-12 15:45:28 -07:00
Nick Jacques
46a3d2fd47 Add deletion protection to resource_compute_instance (#1205) 2018-03-16 11:57:42 -07:00
Dana Hoffman
313eb0fb89
Check set equality for service account scope changes (#1130)
* add debug printfs

* more logs for debugging

* check set equality for service acct scope changes

* revert changes to region igm

* style things
2018-02-27 14:29:00 -08:00
Dana Hoffman
2e665f2f35
add support for updating alias ips in instances (#1084) 2018-02-14 15:48:47 -05:00
Nathan McKinley
f7851162a4
Don't set metadata_startup_script in some cases. (#1081) 2018-02-13 23:55:37 -08:00
Chase
e1323489ba Feature: select compute instance attached disk mode (#947) 2018-02-12 10:56:06 -08:00
Dana Hoffman
3b753cefa2
Add update support for machine type, min cpu platform, and service accounts (#1005)
* Add update support for compute instance fields that require the machine to be stopped

* add warnings in docs about stopping the instance before updating

* add allow_stopping_for_update field
2018-01-24 12:50:39 -08:00
Jacob Straszynski
939ba6d365 skip guest accelerators if count is 0. (#866)
* skip guest accelerators if count is 0.

Instances in instance groups in google will fail to provision, despite
requesting 0 GPUs. This came up for me when trying to provision
a similar instance group in all available regions, but only asking for
GPU's in those that support them by parameterizing the `count` and
setting it to 0.

This might be a violation of some terraform principles. For example,
testing locally with this change `terraform` did not recognize that
indeed my infra needed to be re-deployed (from it's pov, I assume it
believes this because inputs hadn't changed). Additionally, there may be
valid reasons for creating an instance template with 0 gpu's that can be
tuned upwards.

* Add guest accelerator skip test for instances.

* do not leave empty pointers to guest accelerators.

* attempt to clear guest accelerator diff

* conditionally customize diff for guest accels
2018-01-23 11:51:36 -08:00
Vincent Roseberry
681cc72f38
Read compute instance boot disk initialization params from API (#948)
* read boot disk initialization param from API

* make fmt

* Mark the initialize_params list as computed to support boot source

* Ensure private family test follow naming pattern

* Improve docs
2018-01-17 13:23:24 -08:00
Vincent Roseberry
d0f5fec463
Standardize resource name extraction from self_link/uri (#939)
* Standardize resource name extraction from self_link/uri

* remove rebase artifact

* style improvement

* Fix merge issue
2018-01-17 10:45:28 -08:00
Vincent Roseberry
c1d9bb24c9
Support import in compute instance (#873) 2017-12-19 14:33:30 -08:00
Nathan McKinley
5766f2b107
Remove all instances of GOOGLE_XPN_HOST_PROJECT environment variable. (#815)
Remove all instances of GOOGLE_XPN_HOST_PROJECT environment variable.

Instead of GOOGLE_XPN_HOST_PROJECT being required to run some tests, I added the ability to create and tear down the necessary project structure.
This allows us to remove one environment variable, and use two others which are already widely-required: org and billing ID.
2017-12-11 14:07:52 -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
thomas
ecdb1de297 the XPN_* env. variable is no longer mandatory (#760)
Since this variable is only used for 3 tests, it doesn't make sense
to declare it as mandatory in the test config. Therefore, concerned tests
are now skipped if the variable is absent.
2017-11-17 10:32:46 -08:00
Dana Hoffman
51ed0b74dd
Allow attaching and detaching disks from instances (#636)
* allow updating attached disks

* check for scratch and update comment
2017-11-02 13:08:02 -07:00
Dana Hoffman
c577ad6e8d Allow setting boot and attached disk sources by name or self link (#605)
* disk cleanup

* fix attached disk test

* allow disk sources from name or url

* parse disk source better on read

* update docs

* fix boot disk source url
2017-10-23 13:26:59 -07:00
Dana Hoffman
be0525885e post-migration disk cleanup (#600)
* disk cleanup

* fix attached disk test
2017-10-23 12:53:41 -07:00
Joe Selman
2765290724 Add label support to google_compute_snapshot (#570)
* Add label support to google_compute_snapshot
* Refactor operation polling code to use client directly
2017-10-13 15:36:03 -07:00
Joe Selman
4b77dca918 Revert "Revert "Add t.Parallel to all acceptance tests (#558)""
This reverts commit 8ab9d96d25 and revives
the original commit that adds t.Parallel to all acceptance tests. It
turns out test failures were unrelated to this change (rather, they were
related to quota issues).
2017-10-12 15:07:29 -07:00
Peter Milley
fe01f7fdd6 Copy network_interface attributes to Terraform state. (#536) 2017-10-11 13:33:58 -07:00
Joe Selman
8ab9d96d25 Revert "Add t.Parallel to all acceptance tests (#558)"
This reverts commit 42de44592f. It appears
there might be thread-safety issues as panics have started occuring when
parallism is ramped up. Reverting for now while investigating.
2017-10-10 17:55:34 -07:00
Joe Selman
42de44592f Add t.Parallel to all acceptance tests (#558) 2017-10-10 16:28:00 -07:00
Paddy
b1fa2a4702 AccTest fixes. 2017-09-29 04:54:24 -07:00
Paddy
e4d920b774 Remove disks field. 2017-09-28 17:22:29 -07:00
Paddy
5aca4468ac Update tests that use deprecated resources. 2017-09-28 17:08:55 -07:00
Vincent Roseberry
b5e1bf4a82 Remove alias ip range from beta feature for compute instance 2017-09-28 10:48:28 -07:00
Joe Selman
41248230ef Expose instance_id as a computed field on compute_instance (#427) 2017-09-13 16:18:08 -07:00
Vincent Roseberry
7ceea51dfd Add support for alias_ip_range in google_compute_instance network interface (#375) 2017-09-07 13:43:00 -07:00
Dana Hoffman
333c2f09db Fix bug with CSEK where the key stored in state might be associated with the wrong disk (#327)
* Fix bug with CSEK where the key stored in state might be associated with the wrong disk

* preserve original order of attached disks

* use the disk index to figure out the raw key
2017-09-07 22:04:26 +08:00
Vincent Roseberry
c2399f76fb Add support for min_cpu_platform in google_compute_instance. (#349) 2017-08-30 17:25:31 -04:00
Vincent Roseberry
7a216c40b5 Add support for guest_accelerators (GPU) to google_compute_instance (#330) 2017-08-22 15:49:43 -04:00
Riley Karson
a4e1083fd1 Add a test that multiple nics work in google_compute_instance. (#289)
* Add a test that multiple nics works in google_compute_instance.

* Add note that multiple nics is in Beta.
2017-08-04 14:18:07 -07:00