Commit Graph

11073 Commits

Author SHA1 Message Date
stack72 7b482cca9b provider/mysql: Empty Provider Credentials Caused Panic
There are currently no checks on username and endpoint in the provider
schema from being an empty value. This PR adds support to make sure that
endpoint and username are not empty strings as that can cause a panic

Results of the PR:

```
 % terraform apply
There are warnings and/or errors related to your configuration. Please
fix these before continuing.

Errors:

  * provider.mysql: Endpoint must not be an empty string
```
2016-06-17 11:32:30 +01:00
dkalleg 02627e507d vSphere Provider - Updating Virtual Disk doc (#7200)
Resolves https://github.com/hashicorp/terraform/issues/7165
2016-06-17 11:19:20 +01:00
Patrick Sodré cd9b18b961 vendor: joyent/gosign/auth update to master (#7208)
Closes hashicorp/terraform#7155.
2016-06-17 11:18:01 +01:00
clint shryock 9967641c4b core/diff: Fix attribute mismatch with tags.% 2016-06-16 18:22:21 -05:00
James Bardin f4ef16a84b Add a core test for InstanceDiff.Same 2016-06-16 18:43:15 -04:00
James Bardin a3e2c99219 Add a failing acceptance test from GH-2027 2016-06-16 18:43:15 -04:00
James Bardin a5c1bf1b36 Don't check any parts of a computed hash in Same
When checking for "same" values in a computed hash, not only might some
of the values differ between versions changing the hash, but there may be
fields not included at all in the original map, and different overall
counts.

Instead of trying to match individual set fields with different hashes,
remove any hashed key longer than the computed key with the same base
name.
2016-06-16 18:42:48 -04:00
James Bardin f65a898a51 Merge pull request #7188 from hashicorp/jbardin/GH-7017
provider/aws: Check for unassigned AWS Cookie Stickiness Policy
2016-06-16 11:35:05 -04:00
Clint 24bcac42be provider/aws: Retry EIP association (#7186) 2016-06-16 10:03:16 -05:00
James Bardin cfd8254db8 Check for existing but unassigned LB policies
If an AWS Cookie Stickiness Policy is removed from the listener in
the AWS console the policy isn't deleted. Cross reference the policy
name with those assigned to the listener to determine if the policy
is actually being used.
2016-06-16 10:10:52 -04:00
Steven Crossan ca2d230a2c provider/openstack: Change rules type to List
Allows for ordering of rules that are applied to the firewall policy,
including addition and removal of rules in certain positions.
2016-06-16 12:27:01 +01:00
Paul Stack 5fdcf5d16a Update CHANGELOG.md 2016-06-15 18:46:03 +02:00
Brian Edwards d79879dba4 provider/datadog: add timeboard resource. upgrade vendored go-datadog-api to support read-only option. (#6900) 2016-06-15 18:44:49 +02:00
James Nugent 14ff584cc6 Merge pull request #7150 from hashicorp/arm-maxitems
provider/azurerm: Change `azurerm_virtual_machine` to use MaxItems
2016-06-15 18:21:32 +02:00
Seth Vargo a1e0e171d9 Fix broken docs link (#7175) 2016-06-15 09:36:23 -05:00
Martin Atkins b0c0e3cb9d Fix CHANGELOG typo of "GH" as "Gh"
This might've caused the issue link insertion script to get confused when it comes time to cut 0.7.
2016-06-15 06:54:24 -07:00
Martin Atkins ce447e8e2a aws_availability_zones output as "names" rather than "instance" (#7162)
Since this resource produces a list it feels more intuitive to give its
attribute a plural name, and since the noun "instance" already means
something specific in the AWS provider that doesn't apply here we use
"names" to indicate that these are availability zone names.

Also includes updating the docs to not show a dynamic count example for
now, since we don't support that yet.
2016-06-15 15:17:12 +02:00
James Bardin e2d257372a Merge pull request #7166 from hashicorp/jbardin/GH-7065
provider/aws: Check for LoadBalancerNotFound when reading AppCookieStickinessPolicy
2016-06-15 08:59:58 -04:00
James Nugent ccd69eac53 Update CHANGELOG.md 2016-06-15 14:19:32 +02:00
James Nugent 1deff4eaca Merge pull request #7174 from hashicorp/finanzcheck-interpolate_uniq
core: Rebase #7111 and rename unique() to distinct()
2016-06-15 14:18:02 +02:00
James Nugent 4b6a632246 core: Rename uniq -> distinct and add docs 2016-06-15 13:25:17 +02:00
Jan Schumann df3e017f6c fix #7106 2016-06-15 13:25:16 +02:00
James Bardin d4d8a99ba4 Check for LoadBalancerNotFound
When reading an AppCookieStickinessPolicy check for LoadBalancerNotFound
as well as PolicyNotFound. This prevents errors when when destroying a
policy on an ELB that no longer exists.
2016-06-14 17:58:48 -04:00
Clint b7d0bd5db7 Update CHANGELOG.md 2016-06-14 15:40:20 -05:00
Clint 627efa21f4 provider/aws: Retry RouteTable Route/Assocation creation (#7156)
* provider/aws: Retry RouteTable Assocation creation

* provider/aws: retry route creation

* remove extra string check
2016-06-14 15:39:52 -05:00
clint shryock 4796e27d1a provider/aws: Randomize Cluser Param group name to avoid collision 2016-06-14 10:42:36 -05:00
clint shryock 8f216563aa provider/aws: Fix db instance snapshot tests 2016-06-13 10:05:01 -05:00
stack72 e57ee0a067 provider/azurerm: Change `azurerm_virtual_machine` to use MaxItems
There were lots of hacky checks in the ARM VM resource to check for a
length of 1 param block

MaxItems was introduced so this PR updates to use MaxItems
2016-06-13 13:25:32 +02:00
James Nugent 3e8d5eed06 Merge pull request #7148 from hashicorp/b-show-crash-with-tainted
core: Fix crash with tainted resource
2016-06-13 10:38:36 +01:00
James Nugent 75ab4a9970 core: Fix crash with tainted resource
This commit fixes a crash in `terraform show` where there is no primary
resource, but there is a tainted resource, because of the changes made
to tainted resource handling in 0.7.
2016-06-13 09:25:21 +02:00
Paul Hinze ff2a7b0262 Merge pull request #7144 from veselinkantsev/patch-1
corrected "here doc" syntax notes
2016-06-12 15:10:16 -05:00
Paul Hinze 0f92161f82 release: clean up after v0.7.0-rc2 2016-06-12 19:21:46 +00:00
Paul Hinze 46a0709bba
v0.7.0-rc2 2016-06-12 19:07:52 +00:00
Paul Hinze a4b06d6833 Merge pull request #7145 from hashicorp/b-concat-lists-of-maps-panic
core: Fix panic on concat() w/ list of nonprimitives
2016-06-12 13:40:46 -05:00
Paul Hinze 9bc980f569
core: Fix panic on concat() w/ list of nonprimitives
The `concat()` interpolation function does not yet support types other
than strings / lists of strings. Make it an error message instead of a
panic when a list of non-primitives is supplied.

Fixes the panic in #7030
2016-06-12 13:29:06 -05:00
Veselin Kantsev b0a99ce35e corrected "here doc" syntax notes 2016-06-12 18:57:13 +01:00
Paul Hinze 2127466280 Merge pull request #7138 from hashicorp/b-better-dot-index-error
core: Better error for dot indexing on user vars
2016-06-12 11:20:30 -05:00
Paul Hinze ffa29090ec
core: Better error for dot indexing on user vars
Dot indexing worked in the "regexps and strings" world of 0.6.x, but it
no longer works on the 0.7 series w/ proper List / Map types.

There is plenty of dot-indexed config out in the wild, so we need to do
what we can to point users to the new syntax.

Here is one place we can do it for user variables (`var.somemap`). We'll
also need to address Resource Variables and Module Variables in a
separate PR.

This fixes the panic in #7103 - a proper error message is now returned.
2016-06-12 10:45:48 -05:00
James Nugent 5289124b8a Merge pull request #7135 from hashicorp/b-empty-multi-variables
core: Fix empty multi-variable type
2016-06-12 14:37:03 +01:00
James Nugent 052345abfe core: Fix empty multi-variable type
Previously, interpolation of multi-variables was returning an empty
variable if the resource count was 0. The empty variable was defined as
TypeString, Value "". This means that empty resource counts fail type
checking for interpolation functions which operate on lists.

Instead, return an empty list if the count is 0. A context test tests
this against further regression. Also add a regression test covering the
case of a single count multi-variable.

In order to make the context testing framework deal with this change it
was necessary to special case empty lists in the test diff function.

Fixes #7002
2016-06-12 14:00:16 +02:00
James Nugent 2fd4a62cf5 Merge pull request #7134 from hashicorp/hil-update
deps: Update github.com/hashicorp/hil/...
2016-06-12 12:55:22 +01:00
James Nugent ce649ea216 deps: Update github.com/hashicorp/hil/... 2016-06-12 13:54:36 +02:00
James Nugent 8d11e4dd8f Merge pull request #7133 from hashicorp/b-output-empty-list-format
core: Format empty lists and maps in output
2016-06-12 10:59:45 +01:00
James Nugent 7aec98237c core: Format empty lists and maps in output
`terraform output` and it's brethren now consolidate empty maps and
lists on a single line of output instead of the pathological behaviour
of taking three lines previously. The same code paths are used across
all output mechanisms:

```
$ cat main.tf
variable "emptystring" {
    type = "string"
    default = ""
}

variable "emptylist" {
    type = "list"
    default = []
}

variable "emptymap" {
    type = "map"
    default = {}
}

output "emptystring" {
    value = "${var.emptystring}"
}

output "emptylist" {
    value = "${var.emptylist}"
}

output "emptymap" {
    value = "${var.emptymap}"
}

$ terraform apply

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Outputs:

emptylist = []
emptymap = {}
emptystring =

$ terraform output
emptylist = []
emptymap = {}
emptystring =

$ terraform show

Outputs:

emptylist = []
emptymap = {}
emptystring =
```
2016-06-12 11:47:25 +02:00
James Nugent 445cd84f62 Merge pull request #7131 from hashicorp/b-destroy-module-provider-config
core: Fix destroy when module vars used in provider config
2016-06-12 10:38:12 +01:00
James Nugent f35812c475 Merge pull request #7132 from hashicorp/b-empty-variable-types
core: Fix detection of empty list/map defaults
2016-06-12 10:36:19 +01:00
James Nugent 01cd596c60 core: Fix detection of empty list/map defaults
This commit changes config parsing from weak decoding lists and maps
into []string and map[string]string respectively to decode into
[]interface{} and map[string]interface{} respectively. This is in order
to take advantage of the work integrated in #7082 to defeat the backward
compatibility features of the mapstructure library.

Test coverage of loading empty variables and validating their default
types against expectation.
2016-06-12 11:19:03 +02:00
Paul Hinze bf0e7705b1
core: Fix destroy when module vars used in provider config
For `terraform destroy`, we currently build up the same graph we do for
`plan` and `apply` and we do a walk with a special Diff that says
"destroy everything".

We have fought the interpolation subsystem time and again through this
code path. Beginning in #2775 we gained a new feature to selectively
prune out problematic graph nodes. The past chain of destroy fixes I
have been involved with (#6557, #6599, #6753) have attempted to massage
the "noop" definitions to properly handle the edge cases reported.

"Variable is depended on by provider config" is another edge case we add
here and try to fix.

This dive only makes me more convinced that the whole `terraform
destroy` code path needs to be reworked.

For now, I went with a "surgical strike" approach to the problem
expressed in #7047. I found a couple of issues with the existing
Noop and DestroyEdgeInclude logic, especially with regards to
flattening, but I'm explicitly ignoring these for now so we can get this
particular bug fixed ahead of the 0.7 release. My hope is that we can
circle around with a fully specced initiative to refactor `terraform
destroy`'s graph to be more state-derived than config-derived.

Until then, this fixes #7407
2016-06-11 21:21:08 -05:00
James Nugent 3662bfa67a Update CHANGELOG.md 2016-06-11 18:13:54 +01:00
James Nugent 82c729b9ac Merge pull request #7128 from hashicorp/f-interpolation-func-sort
core: Add sort() interpolation function
2016-06-11 18:13:07 +01:00