Commit Graph

21204 Commits

Author SHA1 Message Date
Martin Atkins 05e3b47ba1 configs: Parser.LoadValuesFile
This method loads a "values file" -- also known as a "tfvars file" -- and
returns the values found inside.

A values file is an HCL file (in either native or JSON syntax) whose
top-level body is treated as a set of arbitrary key/value pairs whose
values may not depend on any variables or functions.

We will load values files through a configs.Parser -- even though values
files are not strictly-speaking part of configuration -- because this
causes them to be registered in our source code cache so that we can
generate source code snippets if we need to report any diagnostics.
2018-02-15 15:56:37 -08:00
Martin Atkins a0f4a313ef configs: Parser type
configs.Parser is the entry-point for this package, providing functions to
load and parse HCL-based configuration files.

We use the library "afero" to decouple the parser from the physical OS
filesystem, which here allows us to easily use an in-memory filesystem
for testing and will, in future, allow us to read files from more unusual
places, such as configuration embedded in a plan file.
2018-02-15 15:56:36 -08:00
Martin Atkins 7987a2fdb2 configs: new package for HCL2-based configuration
There's a lot of complexity in our existing "config" package that results
from our approach to handling configuration with HCL and HIL. A lot of
that functionality is no longer needed -- or must work in a significantly
different way -- for HCL2.

The new package "configs", which is named following the convention of some
Go standard library packages like "strings", is a re-imagination of some
of the functionality from the "config" package for an HCL2-only world.

The scope of this package will be slightly smaller than "config", since
it only deals with config loading and not with expression evaluation.
Another package "lang" (mentioned in the docstring here but not yet added)
will deal with the more dynamic portions of of configuration handling,
including populating an hcl.EvalContext to evaluate expressions.
2018-02-15 15:10:01 -08:00
Martin Atkins 976d85ae92 govendor fetch github.com/spf13/afero/... 2018-02-15 15:10:01 -08:00
Brian Flad b2dae9b06c
Merge pull request #17349 from hashicorp/d-importability
docs/import: Remove out of date listing of importable resources
2018-02-14 17:15:46 -05:00
Brian Flad 5576b889ab docs/import: Remove out of date listing of importable resources and note where to find the information 2018-02-14 12:02:45 -05:00
Clint c2306be0fa
Update CHANGELOG.md 2018-02-13 14:15:24 -06:00
Nolan Davidson f43e592849 [provisioner-habitat] Detect if hab user exists (#17195)
Currently the provisioner will fail if the `hab` user already exists on
the target system.

This adds a check to see if we need to create the user before trying to
add it.

Fixes #17159

Signed-off-by: Nolan Davidson <ndavidson@chef.io>
2018-02-13 14:13:22 -06:00
Nolan Davidson 848375b9a6 [provisioner-habitat] Allow custom service name (#17196)
This change allows the Habitat supervisor service name to be
configurable. Currently it is hard coded to `hab-supervisor`.

Signed-off-by: Nolan Davidson <ndavidson@chef.io>
2018-02-13 14:11:59 -06:00
Joshua Carp 52f6abf47b Document aws_route53_record importable (#17306)
See https://github.com/hashicorp/terraform-website/issues/20
2018-02-13 14:07:05 -06:00
Brian Flad 7475ce669e
Update CHANGELOG for #17216 2018-02-13 11:50:42 -05:00
Brian Flad 69dad6f1cf
Merge pull request #17329 from hashicorp/v-terraform-provider-aws-v1.9.0
deps: Bump terraform-provider-aws@v1.9.0 and aws-sdk-go@v1.12.73
2018-02-13 11:45:19 -05:00
James Bardin a65089fcea
Merge pull request #17323 from hashicorp/jbardin/shutdown
Fix race in writing state during hard cancelation
2018-02-13 10:14:48 -05:00
Brian Flad 74598ff9fe deps: Bump terraform-provider-aws@v1.9.0 and aws-sdk-go@v1.12.73 2018-02-13 06:26:02 -05:00
JeongHoon Byun (aka Outsider) 8566ade0c3 website: fix incorrect anchor links for registry API pagination 2018-02-12 19:36:52 -08:00
Michael Mell 4b598860bb website: document the naming conventions for outputs 2018-02-12 19:33:57 -08:00
James Bardin ef8ed1e275 coalesce the backened interrupt code
Moves the nested select statements for backend operations into a single
function. The only difference in this part was that apply called
PersistState, which should be harmless regardless of the type of
operation being run.
2018-02-12 11:56:54 -05:00
James Bardin ecd9ef0f77 ignore error in plan shutdown test
The error was being silently dropped before.

There is an interpolation error, because the plan is canceled before
some of the resources can be evaluated. There might be a better way to
handle this in the walk cancellation, but the behavior has not changed.

Make the plan and apply shutdown match implementation-wise
2018-02-12 11:56:54 -05:00
James Bardin 67a6152091 move backend operation cancellation into meta
Create a single command method for running and operation with
cancellation.
2018-02-12 11:56:54 -05:00
James Bardin 7cba68326a always wait for a RunningOperation to return
If the user wishes to interrupt the running operation, only the first
interrupt was communicated to the operation by canceling the provided
context. A second interrupt would start the shutdown process, but not
communicate this to the running operation. This order of event could
cause partial writes of state.

What would happen is that once the command returns, the plugin system
would stop the provider processes. Once the provider processes dies, all
pending Eval operations would return return with an error, and quickly
cause the operation to complete. Since the backend code didn't know that
the process was shutting down imminently, it would continue by
attempting to write out the last known state. Under the right
conditions, the process would exit part way through the writing of the
state file.

Add Stop and Cancel CancelFuncs to the RunningOperation, to allow it to
easily differentiate between the two signals. The backend will then be
able to detect a shutdown and abort more gracefully.

In order to ensure that the backend is not in the process of writing the
state out, the command will always attempt to wait for the process to
complete after cancellation.
2018-02-12 11:56:03 -05:00
Alvaro Miranda Aguilera 3821c0b45a
Merge pull request #17321 from hashicorp/kikitux-patch-1
fix CenturyLink typo
2018-02-12 11:29:23 +01:00
Alvaro Miranda Aguilera bf18ad3eb9
Update cloud-index.html.markdown 2018-02-12 11:08:28 +01:00
Ryan Uber a25d98b6d1
Merge pull request #17312 from hashicorp/b-state-uuid
terraform: use hashicorp/go-uuid for lineage generation
2018-02-09 15:21:10 -08:00
Ryan Uber 71ac5034e9 terraform: use hashicorp/go-uuid for lineage generation 2018-02-09 15:02:32 -08:00
Justin Campbell 58840f6588
Merge pull request #17309 from hashicorp/docs-registry-examples
website: Clarify Registry examples behavior
2018-02-09 16:25:48 -05:00
Justin Campbell c3872b42b5 website: Clarify Registry examples behavior 2018-02-09 12:51:19 -05:00
Nick Fagerlund f0a009c573 website: private module registry documentation 2018-02-07 09:15:55 -08:00
Chris Griggs 1e12e49878 Website: Restructure Community providers list (#17286)
* restructure community providers list

* add vRA

* add Gandi provider

* re-organize
2018-02-06 15:35:12 -08:00
Brian Flad ec25a320e1
Merge pull request #17216 from hashicorp/f-aws-cn-northwest-1
deps: Bump AWS provider to support cn-northwest-1 state
2018-02-06 18:01:42 -05:00
Brian Flad b924e8cba5 deps: Bump terraform-provider-aws@v1.8.0 and aws-sdk-go@v1.12.70 2018-02-05 20:06:50 -05:00
Chris Griggs 4f38f4f9eb Website Update provider name (#17270)
* edit prvoider name
2018-02-02 12:17:30 -06:00
Radek Simko bb844504bd
Update CHANGELOG.md 2018-02-01 13:34:08 +00:00
Radek Simko a4388b0ef2
Merge pull request #17261 from hashicorp/b-diff-crash-set
helper/schema: Prevent crash on removal of computed field in CustomizeDiff
2018-02-01 13:33:28 +00:00
Radek Simko 7af1c2b3a4
helper/schema: Prevent crash on removal of computed field in CustomizeDiff 2018-02-01 12:05:22 +00:00
James Bardin 1ba8691f35
Merge pull request #17241 from hashicorp/jbardin/destroy-with-locals
Fix destroy-time handling of outputs and local values
2018-01-31 17:40:19 -05:00
James Bardin 4b617986c8
Merge pull request #17260 from hashicorp/jbardin/plan-shutdown-test
slow down the plan shutdown tests for slow hosts
2018-01-31 17:38:12 -05:00
James Bardin 6f41a80b3a slow down the plan shutdown tests for slow hosts
The plan shutdown test often fail on slow CI hosts, becase the plan
completes befor the main thread can cancel it. Since attempting to make
the MockProvider concurrent proved too invasive for now, just slow the
test down a bit to help ensure Stop gets called.
2018-01-31 17:09:48 -05:00
James Bardin 7217aba5f0 release: clean up after v0.11.3 2018-01-31 21:00:32 +00:00
James Bardin 3802b14260
v0.11.3 2018-01-31 20:48:39 +00:00
Aidan Feldman c9481ab012 website: improve the Module Sources documentation
Better section linking within Module Sources page, and centralize the documentation on Terraform Registry sources.
2018-01-31 11:52:14 -08:00
Blake Stoddard f918fb8583 website: fix ordering of interpolation functions 2018-01-31 11:50:00 -08:00
James Bardin 7fbc35a36c Make sure outputs are removed when targeting
Similar to NodeApplyableOuptut, NodeDestroyableOutputs also need to stay
in the graph if any ancestor nodes

Use the same GraphNodeTargetDownstream method to keep them from being
pruned, since they are dependent on the output node and all its
descendants.
2018-01-31 13:51:40 -05:00
Chris Griggs 3d23a14a7a Website: Provider link (#17246)
* Website: add PANOS links

* fix type

* edit
2018-01-31 10:29:48 -06:00
James Bardin 61fa9a365d
Merge pull request #17252 from jen20/remove-unnecessary-vendor
deps: Remove unnecessary Joyent dependencies
2018-01-31 08:30:53 -05:00
James Nugent 1b97297860 deps: Remove unnecessary Joyent dependencies
github.com/joyent/triton-go replaced a bunch of other dependencies quite
some time ago, but the replaced dependencies were never removed. This
commit removes them from the vendor manifest and the vendor/ directory.
2018-01-30 20:59:10 -06:00
James Bardin ca4178b9ec gofmt bug will be fixed in 1.10 2018-01-30 15:46:24 -05:00
James Bardin a2f8482333 catch missing id attribute during interpolation
The id attribute can be missing during the destroy operation.
While the new destroy-time ordering of outputs and locals should prevent
resources from having their id attributes set to an empty string,
there's no reason to error out if we have the canonical ID field
available.

This still interrogates the attributes map first to retain any previous
behavior, but in the future we should settle on a single ID location.
2018-01-30 15:46:12 -05:00
James Bardin 9a7db39f45
Merge pull request #17245 from cchildress/workspaces_docs
Workspaces are supported locally.
2018-01-30 15:16:16 -05:00
Cameron Childress 5ebb9d818d Workspaces are supported locally. 2018-01-30 10:40:07 -07:00
James Bardin 99867f0082 add PruneUnusedValuesTransformer
Since outputs and local nodes are always evaluated, if the reference a
resource form the configuration that isn't in the state, the
interpolation could fail.

Prune any local or output values that have no references in the graph.
2018-01-30 10:47:17 -05:00