Commit Graph

19284 Commits

Author SHA1 Message Date
Samuel El-Borai c5bf7a7c60 fix custom providers snippets (#14806) 2017-05-24 20:11:00 +01:00
James Bardin cd7c5cb61d Merge pull request #14801 from hashicorp/jbardin/validate-computed-object
check for IsComputed when validating a schema object
2017-05-24 13:31:05 -04:00
James Bardin e1d9ad40d3 Merge pull request #14680 from hashicorp/jbardin/unlock-s3
Check that a named state in s3 doesn't exist before acquiring a lock
2017-05-24 12:56:00 -04:00
James Bardin 6bc52be0a5 check for IsComputed when validating a schema obj
GH-14784 allowed nested structures to be validate, rather than relying
on the raw value. However this still returns the same validation error
if the structures contain a computed value, since Get will return the
raw string in that case.

This simply skips the validation in the IsComputed case, since there's
nothing that can be checked.
2017-05-24 12:34:53 -04:00
James Bardin d34dee5cc4 Merge pull request #14784 from mattrobenolt/validateobject
helper/schema: fix validating nested objects
2017-05-24 12:27:40 -04:00
Radek Simko ee0b88a788 Update CHANGELOG.md 2017-05-24 17:18:54 +01:00
Radek Simko 2c3e8e3cfb provider/kubernetes: Add support for Horizontal Pod Autoscaler (#14763) 2017-05-24 17:18:02 +01:00
Paul Stack cec3430b33 Update CHANGELOG.md 2017-05-24 17:09:20 +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
Sander van Harmelen 7c6c075640 Update CHANGELOG.md 2017-05-24 15:29:19 +02: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
Paul Stack 17bbdef711 Update CHANGELOG.md 2017-05-24 13:06:19 +01: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
Paul Stack d820ff9ed5 Update CHANGELOG.md 2017-05-24 13:02:02 +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
Seth Rutner c3a76c99da Update sources.html.markdown (#14594)
* Update sources.html.markdown

Moduels not updating was really annoying, should add this documentation in to increase usability of the feature.

* Update sources.html.markdown
2017-05-24 12:29:56 +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
Tom Harvey 8edaa883fb Merge pull request #14789 from tombuildsstuff/website-fixes
Docs: Fixing typo's
2017-05-24 11:58:08 +01:00
Paul Stack ea44c0eb8a Update CHANGELOG.md 2017-05-24 11:42:18 +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
Paul Stack a0ebed8fe2 provider/azurerm: Fix example on azurerm_sql_elasticpool (#14788)
Fixes: #14785
2017-05-24 11:39:48 +01:00
Paul Stack 3eabfa4c4a Update CHANGELOG.md 2017-05-24 11:38:25 +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 e5dcaf7f79 Update CHANGELOG.md 2017-05-24 11:37:34 +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
tombuildsstuff 3242b3c063 Fixing some minor typo's in the docs 2017-05-24 11:31:52 +01:00
Raphael Randschau b52bf2c887 provider/scaleway: clarify scaleway_server volume attribute (#14772)
system volumes on scaleway can't easily be modified - instead one has to create
a new image with the desired system volume size. This is way out of scope of
terraform - see https://community.online.net/t/expanding-lssd/907/2 for steps on
how to build a new image.

the `scaleway_server` `volume` attribute should only be used if you want to
attach additional volumes to a server which will share the lifetime of the
server, e.g. they will be destroyed once the server is shut down.

To have volumes which outlive the attached server one should use
`scaleway_volume` and `scaleway_volume_attachement` instead.
2017-05-24 11:31:27 +01:00
Matt Robenolt b9a3433f6b helper/schema: fix validating nested objects
When interpreting a nested object, we were validating against the "raw"
value, and not the interpolated value, causing incorrect errors.

This affects structures such as:

```tf
tags = "${list(map("foo", "bar"))}"
```

Prior to this, a complaint about "expected object, got string" since the
raw value is obviously a string, when the interpolated value is the
correct shape.
2017-05-24 01:57:13 -07:00
Mat Schaffer 76d4abd12a Fix typo on state migration input error 2017-05-23 20:50:12 -07:00
Paddy 48803f5961 Update CHANGELOG.md 2017-05-23 15:08:11 -07:00
Paddy dd17c1a78c Merge pull request #14651 from hashicorp/paddy_gcp_detach_deleted_disks
provider/google: detach disks before deleting them.
2017-05-23 15:07:19 -07: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 9253a3e0a3 Update CHANGELOG.md 2017-05-23 14:44:35 -07:00
Paddy 8db702938e Merge pull request #14774 from hashicorp/paddy_fix_12278_rebase
provider/google: enable use of URI as snapshot name when creating a disk
2017-05-23 14:43:46 -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 5c85c9cf6c Update CHANGELOG.md 2017-05-23 19:32:00 +01: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 346d34c383 Update CHANGELOG.md 2017-05-23 19:31:10 +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 46f1a33222 Update CHANGELOG.md 2017-05-23 11:26:59 -07: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
Martin Atkins 278fb293ea Update CHANGELOG.md 2017-05-23 11:19:51 -07:00
Martin Atkins 9cda37205d backend/local: create local state file if backend write fails
In the old remote state system we had the idea of a local backup, which
is actually still present for the legacy backends but no longer applies
for the new-style backends like the s3 backend.

It's problematic when an apply runs for long enough that someone's
time-limited AWS STS credentials expire and then Terraform fails and can't
persist state to S3.

To reduce the risk of lost state, here we add some extra fallback code
for the local apply operation in particular. If either state writing
or state persisting fail then we attempt to write the state to a special
backup file errored.tfstate, and produce an error message that guides the
user on how to retry uploading this state.

In the unlikely event that we can't write to local disk either (e.g.
permissions problems) we take a last-ditch attempt to dump the JSON onto
stdout and advise the user to manually copy it into a file for import.
If even that doesn't work for some reason, we assume a critical Terraform
bug (JSON-serialization problem with states?) and bail out with an
apologetic error message.

This is implemented for the apply command in particular because this is
the one command where new objects are created in real APIs that we don't
want to lose track of. For other operations it's less bad to just generate
a simple error message and have the user retry.

This fixes #14298.
2017-05-23 11:18:01 -07:00
Seth Rutner 2037c1eebf Update bitbucket.html.md (#14761)
You left the test domain in the docs :P
2017-05-23 19:04:39 +01:00
Paul Stack e4c2428b83 Update CHANGELOG.md 2017-05-23 18:49:23 +01: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
Dana Hoffman d1308c1fe2 Update CHANGELOG.md 2017-05-22 14:06:07 -07:00