Commit Graph

23461 Commits

Author SHA1 Message Date
James Bardin 8d17fcea4e make connection host Required
And provide the connection config for validation
2018-12-19 15:22:01 -05:00
Kristin Laemmert 28306b2a1b
Update CHANGELOG.md 2018-12-19 11:39:42 -08:00
Sander van Harmelen 687ba2907d
Merge pull request #19704 from hashicorp/svh/f-versions
backend/remote: compare versions without the prerelease
2018-12-19 20:09:47 +01:00
Kristin Laemmert 126e5f337f
json output of terraform plan (#19687)
* command/show: adding functions to aid refactoring

The planfile -> statefile -> state logic path was getting hard to follow
with blurry human eyes. The getPlan... and getState... functions were
added to help streamline the logic flow. Continued refactoring may follow.

* command/show: use ctx.Config() instead of a config snapshot

As originally written, the jsonconfig marshaller was getting an error
when loading configs that included one or more modules. It's not clear
if that was an error in the function call or in the configloader itself,
  but as a simpler solution existed I did not dig too far.

* command/jsonplan: implement jsonplan.Marshal

Split the `config` portion into a discrete package to aid in naming
sanity (so we could have for example jsonconfig.Resource instead of
jsonplan.ConfigResource) and to enable marshaling the config on it's
own.
2018-12-19 11:08:25 -08:00
Sander van Harmelen 7b51af72b2 backend/remote: compare versions without the prerelease 2018-12-19 19:06:22 +01:00
Martin Atkins 65c0826293 vendor: upgrade github.com/zclconf/go-cty
This includes:
- An additional check in the format stdlib function to fail if there are
  too many arguments given, rather than silently ignoring.
- Refinements for the type unification behavior to allow unification of
  object/tuple types into weaker map/list types when no other unification
  is possible.
- Improvements to the error messages for failed type conversions on
  collection and structural types to talk about mismatching element types
  where possible, rather than the outer value.
2018-12-18 17:29:09 -08:00
James Bardin 149ccd929e missing commits from 19688 2018-12-18 16:54:09 -08:00
James Bardin bbaa8af4f7
Merge pull request #19688 from hashicorp/jbardin/backend-hash
decode backend hash as uint64
2018-12-18 18:38:45 -05:00
James Bardin 9667e06a03 decode backend hash as uint64
Older versions of terraform could save the backend hash number in a
value larger than an int.

While we could conditionally decode the state into an intermediary data
structure for upgrade, or detect the specific decode error and modify
the json, it seems simpler to just decode into the most flexible value
for now, which is a uint64.
2018-12-18 17:57:44 -05:00
James Bardin 9a34f14c60 update CHANGELOG.md 2018-12-18 16:18:10 -05:00
Sander van Harmelen b45fef91ea
Merge pull request #19667 from hashicorp/svh/b-const-check
backend/remote: fix an error that prevents checking constraints
2018-12-18 19:59:03 +01:00
James Bardin 7ce03b5a7e
Merge pull request #19676 from hashicorp/jbardin/ResourceInstanceObject
Ensure we have providers when scaling in counted data sources
2018-12-18 13:23:59 -05:00
James Bardin 87a375d49c rename NodeDestroyableDataResourceInstance
Make this node consistent with the naming if the other instances.
2018-12-18 13:22:21 -05:00
James Bardin e73a8bb627 don't allow EvalWriteState without a provider 2018-12-18 13:09:45 -05:00
James Bardin 06a75b8038 ensure NodeDestroyableDataResource has provider
Make sure that NodeDestroyableDataResource has a ResolvedProvider to
call EvalWriteState. This entails setting the ResolvedProvider in
concreteResourceDestroyable, as well as calling EvalGetProvider in
NodeDestroyableDataResource to load the provider schema.

Even though writing the state for a data destroy node should just be
removing the instance, every instance written sets the Provider for the
entire resource. This means that when scaling back a counted data
source, if the removed instances are written last, the data source will
be missing the provider in the state.
2018-12-18 12:43:58 -05:00
James Bardin a4ab055fbd attach a deep copy of ResourceState 2018-12-17 18:08:53 -05:00
James Bardin 292535820d ResourceInstanceObject needs to return a copy 2018-12-17 16:37:18 -05:00
Brian Flad 4596c44c05
Update CHANGELOG for #19651 2018-12-17 15:43:59 -05:00
Brian Flad 882b6e1daa
Merge pull request #19651 from hashicorp/d-terraform-provider-aws-v1.52.0
deps: github.com/aws/aws-sdk-go@v1.16.4 and github.com/terraform-providers/terraform-provider-aws@v1.52.0
2018-12-17 15:38:41 -05:00
Martin Atkins f964c83abe
Update CHANGELOG.md 2018-12-17 10:56:38 -08:00
Charles Kenney 2dfc3a399d command: allow -no-color option on "providers" command 2018-12-17 10:55:16 -08:00
James Bardin 82f5f50fe7
Merge pull request #19674 from hashicorp/jbardin/count-refs
failing count refs
2018-12-17 12:49:54 -05:00
James Bardin 21d06aac41 don't expand EachMode from state during validation
Validate should not require state or changes to be present. Break out
early when using evaluationStateData during walkValidate before checking
state or changes, to prevent errors when indexing resources that haven't
been expanded.
2018-12-17 12:34:57 -05:00
James Bardin c70be3c328 failing tests when using resources with count
Two different tests failing around resourced with count
2018-12-17 12:15:43 -05:00
Martin Atkins 2be524d6ac core: Validate depends_on and ignore_changes traversals
Both depends_on and ignore_changes contain references to objects that we
can validate.

Historically Terraform has not validated these, instead just ignoring
references to non-existent objects. Since there is no reason to refer to
something that doesn't exist, we'll now verify this and return errors so
that users get explicit feedback on any typos they may have made, rather
than just wondering why what they added seems to have no effect.

This is particularly important for ignore_changes because users have
historically used strange values here to try to exploit the fact that
Terraform was resolving ignore_changes against a flatmap. This will give
them explicit feedback for any odd constructs that the configuration
upgrade tool doesn't know how to detect and fix.
2018-12-17 09:02:25 -08:00
Martin Atkins 109f9c607d vendor: update github.com/hashicorp/hcl2
This includes a fix to hcl.RelTraversalForExpr where it would
inadvertantly modify the internals of a traversal AST node as part of
relativizing the traversal in order to return it.
2018-12-17 09:02:25 -08:00
Sander van Harmelen 8501d1312d
Update CHANGELOG.md 2018-12-15 22:03:52 +01:00
Sander van Harmelen 55b6153b04 backend/remote: fix an error that prevents checking constraints 2018-12-15 21:36:47 +01:00
Sander van Harmelen a8204f4cc9
Update CHANGELOG.md 2018-12-15 20:16:22 +01:00
Martin Atkins b7452a1bf8 vendor: upgrade github.com/hashicorp/hcl2
This includes a number of upstream bug fixes, which in turn fix a number
of issues here in Terraform:

- New-style "full splat" operator now working correctly (#19181)
- The weird HCL1-ish single-line block syntax is now supported (#19153)
- Formatting of single-line blocks adds spaces around the braces (#19154)

This also includes a number of other upstream fixes that were not tracked
as issues in the Terraform repository. The highlights of those are:

- A for expression with the "for" keyword wrapped onto a newline after its
  opening bracket now parses correctly.
- In JSON syntax, interpolation sequences in properties of objects that
  are representing expressions now have their variables properly detected.
- The "flush" heredoc variant is now functional again after being broken
  in some (much-)earlier rework of the template parser.
2018-12-14 16:07:50 -08:00
Sander van Harmelen 93e33477c3
Merge pull request #19661 from hashicorp/svh/f-travis
Add the v0.11 branch to Travis so we can test builds
2018-12-14 21:35:55 +01:00
Sander van Harmelen a67d48c225 Add the v0.11 branch to Travis so we can test builds 2018-12-14 21:29:18 +01:00
Sander van Harmelen 2103b19c8a
Update CHANGELOG.md 2018-12-14 21:27:22 +01:00
Sander van Harmelen 2ef8315885
Merge pull request #19659 from hashicorp/svh/f-check-constraints
backend/remote: return detailed incompatibility info
2018-12-14 21:26:02 +01:00
Sander van Harmelen 8f04e93739 backend/remote: return detailed incompatibility info 2018-12-14 21:11:41 +01:00
Radek Simko e99a41b62e
Update CHANGELOG.md 2018-12-14 13:46:27 +00:00
Radek Simko f64978b64c
backend/local: Render CBD replacement (+/-) correctly (#19642)
* backend/local: Render CBD replacement (+/-) correctly

* command/format: Use IsReplace helper function
2018-12-14 13:45:47 +00:00
Sander van Harmelen 28f2a76ffd
Update CHANGELOG.md 2018-12-14 12:41:01 +01:00
Sander van Harmelen da8e02eb2e
Merge pull request #19647 from hashicorp/svh/f-versions
core:  add a method to the disco package retrieve version constraints
2018-12-14 12:38:52 +01:00
Sander van Harmelen 268c0f85ce Add a method to retrieve version contraints 2018-12-14 12:17:31 +01:00
Martin Atkins 413959406a build: Use Go 1.11.3 in Travis-CI and in environments using "goenv" 2018-12-13 17:30:48 -08:00
Brian Flad 2979c42c68
deps: github.com/aws/aws-sdk-go@v1.16.4 and github.com/terraform-providers/terraform-provider-aws@v1.52.0
Notable changes:

* backend/s3: Automatic validation of `eu-north-1` region
* backend/s3: Support for `credential_process` handling in AWS configuration file

Updated via:

```
go get github.com/aws/aws-sdk-go@v1.16.4
go get github.com/terraform-providers/terraform-provider-aws@v1.52.0
go mod tidy
go mod vendor
```
2018-12-13 20:30:43 -05:00
Sander van Harmelen a4380f7246 go-mod: update go-version 2018-12-13 18:35:23 +01:00
Radek Simko ea1a1a3af5
Update CHANGELOG.md 2018-12-13 15:39:01 +00:00
Radek Simko 76d1161000
Merge pull request #19613 from hashicorp/b-avoid-ds-on-destroy
backend/local: Avoid rendering data sources on destroy
2018-12-13 15:38:25 +00:00
James Bardin 8bd1e4ef61 update CHANGELOG.md 2018-12-12 18:20:53 -05:00
Eamon Hetherton d1c301bc2d Fix winrm default ssl port (#19540)
* Update provisioner.go

Changed the default port used for winrm when https is specified
2018-12-12 18:19:02 -05:00
James Bardin 541143ddce update CHANGELOG.md 2018-12-12 15:03:15 -05:00
James Bardin 49340386d4
Merge pull request #19629 from hashicorp/jbardin/go-plugin
update go-plugin
2018-12-12 15:00:25 -05:00
Radek Simko 3ab4739ba4
backend/local: Avoid rendering data sources on destroy 2018-12-12 18:21:49 +00:00