Commit Graph

7607 Commits

Author SHA1 Message Date
Chris Johnson 002c9985d3 Enable CRUD of metrics 2017-05-25 14:09:46 -04:00
Joe Topjian db47721e15 provider/openstack: Enable Security Group Updates (#14815)
* vendor: Updating Gophercloud for OpenStack Provider

* provider/openstack: Enable Security Group Updates

This commit enables security group names and descriptions to
be updated without causing a recreate.
2017-05-25 07:53:26 +01:00
jrperritt e1c8d760d3 provider/openstack: Add DNS V2 RecordSet resource (#14813)
* vendor gophercloud dns v2 recordset deps

* openstack dns v2 recordset resource

* fix type assertion panic condition

* address pr review feedback
2017-05-24 22:58:44 -06:00
Paddy 63ce0dae98 Merge pull request #12411 from drebes/cloud_router
provider/google: Cloud router resource
2017-05-24 21:36:17 -07:00
Paddy c675b9e3f8 Merge pull request #14643 from hashicorp/pr-8180
provider/google: New Datasource: Google Storage Object Signed URL (supersedes #8180)
2017-05-24 16:46:14 -07:00
Riley Karson 0ea0d86de4 Change google_compute_target_pool's session_affinity field default to NONE. (#14807) 2017-05-24 16:24:45 -07:00
Paddy d59d0a0673 Fix some style things, handle errors.
Fix a typo, follow our acceptance test naming guidelines, simplify some
logic, and handle an unhandled error.
2017-05-24 15:55:01 -07:00
cmorent e676813eaa providers/heroku: import heroku_addon resource (#14508) 2017-05-24 14:19:46 -05:00
Radek Simko 2c3e8e3cfb provider/kubernetes: Add support for Horizontal Pod Autoscaler (#14763) 2017-05-24 17:18:02 +01:00
Sandeep Sidhu 4c6404d012 provider/vsphere: Exposing moid value from vm resource (#14793)
* Exposing moid value from vm resource

moid value is needed by NSX resources, like security tag, when we attached security tags to a VMs, so needed before we commit NSX provider.

* fixing gofmt issue

* Updating docs regarding new exported moid attribute.
2017-05-24 17:08:40 +01:00
Mickaël Canévet e4bd7e2430 Load Cloudstack configuration from file (#13926)
* Load Cloudstack configuration from file

* Add ConflictsWith
2017-05-24 15:23:32 +02:00
Łukasz Jan Niemier 18f2edf729 Add namespcace ID attribute (#14483)
* Add namespcace ID attribute

This commit also introduce `id` comouted value which is numeric value
used by GitLab to iteract with repository. This should simplify use of
`gitlab_project_hook` usage and would allow to introduce other resources
as described in #14471

* Fixes requested by @richardc

* Handle optional `namespace_id`
2017-05-24 13:05:27 +01:00
Richard Clamp 9e90e77be4 provider/gitlab: Add `gitlab_group` resource (#14490)
* vendor: Update go-gitlab to master@e6c11e

Update go-gitlab to master@e6c11e.  This brings in UpdateGroup in
addition to fuller management of other attributes.

* provider/gitlab:  Add `gitlab_group` resource

This adds a gitlab_group resource.

This combined with #14483 will allow you to create projects in a
group.
2017-05-24 13:01:24 +01:00
cmorent c08253e8d5 providers/heroku: upgrade vendored cyberdelia/heroku-go client (#14672)
* Update vendored github.com/cyberdelia/heroku-go/v3

* Update heroku provider code to work with the newly generated heroku-go API
2017-05-24 12:04:17 +01:00
Richard Clamp 395f1d5bbf provider/gitlab: add `gitlab_deploy_key` (#14734)
* provider/gitlab: add `gitlab_deploy_key`

Here we extend the gitlab provider further by adding a `gitlab_deploy_key`
resource.  This resource allows management of a projects deploy
keys.

* provider/gitlab: Do not test `gitlab_deploy_key` `can_push`

Here we remove the testing of the `can_push` attribute.  This makes the
tests less comprehensive, but will allow them to work with the current
release of gitlab-ce.

This change is staged as a distinct commit so it can be easily
dropped/reverted once gitlab MR !11607 has reached a released state.

https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11607

* provider/gitlab: Update docs for gitlab_deploy_key/can_push

Note that the can_push attribute of gitlab_deploy_key doesn't currently
work.  This note can be removed once
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11607 is merged
and in general circulation.
2017-05-24 11:41:40 +01:00
Joe Topjian da8f71d4c2 provider/openstack: Add support for updating Subnet Allocation Pools (#14782)
* vendor: Updating Gophercloud for OpenStack Provider

* provider/openstack: Add support for updating Subnet Allocation Pools

This commit adds the ability to update a subnet's allocation pool.
2017-05-24 11:38:05 +01:00
Paul Stack be58c809b6 provider/aws: Add support for X-Ray tracing to aws_lambda_function (#14728)
Fixes: #13801
2017-05-24 11:37:04 +01:00
Paddy 1f2dff6a50 Fix fmt. 2017-05-23 14:47:46 -07:00
Paddy 7976a03a2d Merge branch 'master' into paddy_gcp_detach_deleted_disks 2017-05-23 14:45:27 -07:00
Paddy be17d7ac12 Remove required env var, fix test names.
We no longer need to set an env var (yaaay!) and our test names use
camelCase not snake_case, though that confusion is understandable.
2017-05-23 14:28:06 -07:00
Paddy f5ff3b987d Merge commit '96a67766bf94fdba15f607a9f620cc7df3675a9b' into paddy_fix_12278_rebase 2017-05-23 14:11:38 -07:00
Paul Stack 88d9254661 provider/aws: Add ability to define timeouts for DMS replication instance (#14729)
Fixes: #13996
2017-05-23 19:31:26 +01:00
Paul Stack cb5b5c034e provider/aws: Provider ability to enable snapshotting on ElastiCache RG (#14757)
Fixes: #10581

When a cluster was originally created, you could not enable snapshotting
on it. An error message like this was found:

```
* aws_elasticache_replication_group.bar: Error updating Elasticache replication group: InvalidParameterCombination: Must specify both SnapshotRetentionLimit and SnapshottingClusterId to turn on snapshots
    status code: 400, request id: 98d2ea4e-3fb1-11e7-b077-5967719aeab4
```

There is no guidance from AWS on which is the preferred Cluster in the RG to use for snapshotting. Therefore, I decided to set it to be the first cluster. We can now enable snapshotting

```
% make testacc TEST=./builtin/providers/aws/ TESTARGS='-run=TestAccAWSElasticacheReplicationGroup_enableSnapshotting'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/05/23 15:02:21 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/aws/ -v -run=TestAccAWSElasticacheReplicationGroup_enableSnapshotting -timeout 120m
=== RUN   TestAccAWSElasticacheReplicationGroup_enableSnapshotting
--- PASS: TestAccAWSElasticacheReplicationGroup_enableSnapshotting (1261.47s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/aws	1261.496s
```
2017-05-23 19:30:34 +01:00
Martin Atkins 410b60cb7f Stop requiring multi-vars (splats) to be in array brackets
Prior to Terraform 0.7, lists in Terraform were just a shallow abstraction
on top of strings with a magic delimiter between items. Wrapping a single
string in brackets in the configuration was Terraform's prompt that it
needed to split the string on that delimiter during interpolation.

In 0.7, when first-class lists were added, this convention was preserved
by flattening lists-of-lists by one level when they were encountered in
configuration. However, there was an oversight in that change where it
did not correctly handle the case where the inner list was unknown.

In #14135 we removed some code that was flattening partially-unknown lists
into fully-unknown (untyped) values. This inadvertently exposed the missed
case from the previous paragraph, causing issues for list-wrapped splat
expressions with unknown members. While this worked fine for resources,
due to some fixup done inside helper/schema, this did not work for other
interpolation contexts such as module blocks.

Various attempts to fix this up and restore the flattening behavior
selectively were unsuccessful, due to a proliferation of assumptions all
over the core code that would be too risky to change just to fix this bug.

This change, then, takes the different approach of removing the
requirement that splats be presented inside list brackets. This
requirement didn't make much sense anymore anyway, since no other
list-returning expression had this constraint and so the rest of Terraform
was already successfully dealing with both cases.

This leaves us with two different scenarios:

- For resource arguments, existing normalization code in helper/schema
  does its own flattening that preserves compatibility with the common
  practice of using bracketed splats. This change proves this with a test
  within the "test" provider that exercises the whole Terraform core and
  helper/schema stack that assigns bracketed splats to list and set
  attributes.

- For arguments in other blocks, such as in module callsites, the
  interpolator's own flattening behavior applies to known lists,
  preserving compatibility with configurations from before
  partially-computed splats were possible, but those wishing to use
  partially-computed splats are required to drop the surrounding brackets.
  This is less concerning because this scenario was introduced only in
  0.9.5, so the scope for breakage is limited to those who adopted this
  new feature quickly after upgrading.

As of this commit, the recommendation is to stop using brackets around
splats but the old form continues to be supported for backward
compatibility. In a future _major_ version of Terraform we will probably
phase out this legacy form to improve consistency, but for now both
forms are acceptable at the expense of some (pre-existing) weird behavior
when _actual_ lists-of-lists are used.

This addresses #14521 by officially adopting the suggested workaround of
dropping the brackets around the splat. However, it doesn't yet allow
passing of a partially-unknown list between modules: that still violates
assumptions in Terraform's core, so for the moment partially-unknown lists
work only within a _single_ interpolation expression, and cannot be
passed around between expressions. Until more holistic work is done to
improve Terraform's type handling, passing a partially-unknown splat
through to a module will result in a fully-unknown list emerging on
the other side, just as was the case before #14135; this change just
addresses the fact that this was failing with an error in 0.9.5.
2017-05-23 11:22:37 -07:00
Techbrunch 170533c026 Fixes #14765 Handle migration when restoring db cluster from snapshot (#14766)
Add `migrating` to the list of pending statuses when creating a cluster from a snapshot using a different engine.
2017-05-23 18:48:15 +01:00
Thomas Poindessous 96a67766bf Corrected test for generating disk from a snapshot URI from another project 2017-05-22 23:36:53 +02:00
Riley Karson dbeb7fde98 Updated debug message in compute_firewall_migrate. (#14743) 2017-05-22 14:05:31 -07:00
Dana Hoffman 5d05b0b7fe provider/google: stop trying to set mysqlReplicaConfiguration on read (#14373) 2017-05-22 14:04:28 -07:00
Thomas Poindessous 4df07f2ed9 Added a test acceptance for the new functionality.
GOOGLE_COMPUTE_DISK_SNAPSHOT_URI must be set to a valid snapshot's uri like one of the output of
gcloud compute snapshots list --uri

GOOGLE_COMPUTE_DISK_SNAPSHOT_URI should be replaced by a proper snapshot made by TF (#11690)
2017-05-22 22:51:31 +02:00
Thomas Poindessous 674d635926 Golint from Atom 2017-05-22 22:51:31 +02:00
Thomas Poindessous deb9dae35c Be more specific on the regexp used to detect URI 2017-05-22 22:51:31 +02:00
Thomas Poindessous e510289d2b Enable use of URI for snapshot name 2017-05-22 22:51:30 +02:00
Dana Hoffman 3df593315f provider/google: add failover parameter to sql database instance (#14336)
* provider/google: add failover parameter to sql database instance

* provider/google: update sql database instance docs
2017-05-22 13:44:25 -07:00
Riley Karson 56f89e20d7 provider/google: Add import support to google_sql_user (#14457)
* Support importing google_sql_user

* Updated documentation to reflect that passwords are not retrieved.

* Added additional documentation detailing use.

* Removed unneeded d.setId() line from GoogleSqlUser Read method.

* Changed an errors.New() call to fmt.Errorf().

* Migrate schemas of existing GoogleSqlUser resources.

* Remove explicitly setting 'id' property

* Added google_sql_user to importability page.

* Changed separator to '/' from '.' and updated tests + debug messages.
2017-05-22 13:43:10 -07:00
Riley Karson 6ac78404e0 provider/google: Refactor google_storage_bucket tests (#14694) 2017-05-22 12:38:21 -07:00
Jake Champlin 9a7a243c5c Merge pull request #14733 from hashicorp/f-env-var-prerelease-string
core: Use environment variables to set VersionPrerelease at compile time
2017-05-22 14:55:00 -04:00
smasue bc3075c48b Missing short name in the service scope (Google compute instance) (#14633)
* Missing short name in the service scope (Google compute instance ). The missing short name is for Stackdriver Trace append.

* Missing short name in the service scope (Google compute instance ). The missing short name is for Stackdriver Trace readonly.
2017-05-22 12:21:59 -05:00
Joe Topjian cfb83f9d87 Merge pull request #14704 from jtopjian/openstack-instance-tenantnet-fix
provider/openstack: Catch error during instance network parsing
2017-05-22 09:29:11 -06:00
Joe Topjian a8bf3d8ab0 Merge pull request #14721 from jtopjian/os-dns
provider/openstack: Add openstack_dns_zone_v2 resource
2017-05-22 09:27:28 -06:00
Jake Champlin bd68789006
core: Use environment variables to set VersionPrerelease at compile time
Instead of using a hardcoded version prerelease string, which makes release automation difficult, set the version prerelease string from an environment variable via the go linker tool during compile time.

The environment variable `TF_RELEASE` should only be set via the `make bin` target, and thus leaves the version prerelease string unset. Otherwise, when running a local compile of terraform via the `make dev` makefile target, the version prerelease string is set to `"dev"`, as usual.

This also requires some changes to both the circonus and postgresql providers, as they directly used the `VersionPrerelease` constant. We now simply call the `VersionString()` function, which returns the proper interpolated version string with the prerelease string populated correctly.

`TF_RELEASE` is unset:

```sh
$ make dev
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/05/22 10:38:19 Generated command/internal_plugin_list.go
==> Removing old directory...
==> Building...
Number of parallel builds: 3

-->     linux/amd64: github.com/hashicorp/terraform

==> Results:
total 209M
-rwxr-xr-x 1 jake jake 209M May 22 10:39 terraform

$ terraform version
Terraform v0.9.6-dev (fd472e4a86500606b03c314f70d11f2bc4bc84e5+CHANGES)
```

`TF_RELEASE` is set (mimicking the `make bin` target):

```sh
$ TF_RELEASE=1 make dev
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/05/22 10:40:39 Generated command/internal_plugin_list.go
==> Removing old directory...
==> Building...
Number of parallel builds: 3

-->     linux/amd64: github.com/hashicorp/terraform

==> Results:
total 121M
-rwxr-xr-x 1 jake jake 121M May 22 10:42 terraform

$ terraform version
Terraform v0.9.6
```
2017-05-22 10:49:15 -04:00
Jake Champlin 722436a880 Merge pull request #14727 from hashicorp/b-fix-instance-panic
provider/aws: Fix panic on instance shutdown
2017-05-22 09:53:04 -04:00
Kit Ewbank 8e130b15e4 Add 'aws_kms_ciphertext' data source. (#14691) 2017-05-22 16:46:18 +03:00
Máximo Cuadros b8fb1b5ed9 ignition: tests as unit test (#14703) 2017-05-22 16:40:41 +03:00
Raphaël Pinson e7bfdea274 Add github_team data source (#14614)
* Add github_team data source

* github_team: add doc

* github_team data source: fix acceptance test
2017-05-22 16:29:18 +03:00
Januar cf8568fe55 provider/docker network alias (#14710)
* Add Network Alias configuration with network options

* Handle case where there's no network option

* Handle use case where network option is not available

* Handle use case where network option is not available

* Network alias only on user defined network

* Update documentation for docker provider on network aliases

* Remove unused variable

* Update documentation

* add unit test for docker container network

* fix unit test for docker container network
2017-05-22 09:20:32 -04:00
Radek Simko b90ad412d5 provider/aws: Increase timeout for creating security group (#14724) 2017-05-22 15:12:39 +02:00
Jake Champlin c1f4a6e9f8
provider/aws: Fix panic on instance shutdown
During an instance shut-down network interfaces may be detached during the `READ` method of a Terraform run.

This protects the case where a network interface was detached, and is now `nil` at the time of the Terraform run, fixing nil pointer dereferences.
2017-05-22 09:02:35 -04:00
Jake Champlin d85b8f0613 Merge pull request #14669 from hashicorp/b-add-validation-iam-role-policy
provider/aws: validation: Add validation function for IAM Policies
2017-05-22 08:26:24 -04:00
Paul Stack 542640c953 provider/aws: Do not dereference source_Dest_check in aws_instance (#14723)
Fixes: #14718

source_dest_check may not be set so we should pass the pointer to d.Set
func and allow it to dereference it safely
2017-05-22 10:44:30 +03:00
Radek Simko 600e587430 provider/aws: Configurable timeouts for EC2 instance + spot instance (#14711) 2017-05-22 09:27:06 +02:00