Commit Graph

24888 Commits

Author SHA1 Message Date
Pam Selle 90ecd17bd5 Fix err test 2019-10-23 14:04:39 -04:00
Pam Selle 8f04ab3eaf
Merge pull request #23157 from pselle/each-err
Add a special error when each.value is nil in for_each resources
2019-10-23 11:19:39 -04:00
Pam Selle 86d69bbe18 Tweak the message mildly 2019-10-23 11:18:10 -04:00
Pam Selle 13ff341447 Add a special error for each.value 2019-10-22 15:44:28 -04:00
Chris Griggs d7bce857cf
Merge pull request #23125 from hashicorp/cgriggs01-launchdarkly
[Website] LaunchDarkly provider links
2019-10-21 11:48:56 -07:00
Chris Griggs d7df6ce642
Merge pull request #23123 from hashicorp/cgriggs01-community
[Website] Update community providers
2019-10-21 11:48:02 -07:00
Martin Atkins baa49f43c8
go.mod: We only expect Go 1.12
This was erroneously updated by some earlier operation, but
Terraform Core is still targeting only Go 1.12 for the moment.
2019-10-18 16:37:34 -07:00
cgriggs01 5452844c58 [Website] LaunchDarkly provider links 2019-10-18 14:07:36 -07:00
tf-release-bot bac0577c70 Cleanup after v0.12.12 release 2019-10-18 18:50:39 +00:00
tf-release-bot ade49ebca7
v0.12.12 2019-10-18 18:39:16 +00:00
Martin Atkins 4e787a2ade
Update CHANGELOG.md 2019-10-18 11:33:19 -07:00
Martin Atkins b10f058cbb backend/remote: Only load variables if we're going to use them
Some commands don't use variables at all or use them in a way that doesn't
require them to all be fully valid and consistent. For those, we don't
want to fetch variable values from the remote system and try to validate
them because that's wasteful and likely to cause unnecessary error
messages.

Furthermore, the variables endpoint in Terraform Cloud and Enterprise only
works for personal access tokens, so it's important that we don't assume
we can _always_ use it. If we do, then we'll see problems when commands
are run inside Terraform Cloud and Enterprise remote execution contexts,
where the variables map always comes back as empty.
2019-10-18 11:31:19 -07:00
Martin Atkins a8d01e3940 backend/remote: Report invalid variables only remotely
The remote backend uses backend.ParseVariableValues locally only to decide
if the user seems to be trying to use -var or -var-file options locally,
since those are not supported for the remote backend.

Other than detecting those, we don't actually have any need to use the
results of backend.ParseVariableValues, and so it's better for us to
ignore any errors it produces itself and prefer to just send a
potentially-invalid request to the remote system and let the remote system
be responsible for validating it.

This then avoids issues caused by the fact that when remote operations are
in use the local system does not have all of the required context: it
can't see which environment variables will be set in the remote execution
context nor which variables the remote system will set using its own
generated -var-file based on the workspace stored variables.
2019-10-18 11:31:19 -07:00
cgriggs01 8b3c0dd66b [Website] Update community providers 2019-10-18 11:26:05 -07:00
Martin Atkins 71e4468e09 contrib: Remove api-coverage tool
This tool is intended for analysis on Terraform's AWS provider, but that
provider is no longer developed in this repository and so this tool is
no longer functional.
2019-10-18 11:22:30 -07:00
Radek Simko ec90bed62d
Merge pull request #22643 from hashicorp/version-tools
Version tools per Go convention under tools.go
2019-10-18 19:01:23 +02:00
Pam Selle 91b5343d2f
Merge pull request #22626 from mixmatch/patch-1
Update output
2019-10-18 10:21:57 -04:00
tf-release-bot 3085da3dd5 Cleanup after v0.12.11 release 2019-10-17 20:41:46 +00:00
tf-release-bot 690f1c51cb
v0.12.11 2019-10-17 20:30:11 +00:00
Radek Simko 7860f55e4f
Version tools per Go convention under tools.go 2019-10-17 22:23:39 +02:00
James Bardin e32be4ef3e update CHANGELOG.md 2019-10-17 16:19:11 -04:00
Pam Selle 64f7f2c052
Update CHANGELOG.md 2019-10-17 13:45:43 -04:00
Pam Selle 3f359032ae
Update CHANGELOG.md
.terraformignore notes
2019-10-17 13:44:23 -04:00
Pam Selle d08daa2001
Merge pull request #23105 from hashicorp/f-tfignore
.terraformignore support
2019-10-17 11:49:18 -04:00
Kristin Laemmert 47aa543731
Update CHANGELOG.md 2019-10-17 11:47:52 -04:00
Alex Harvey cbeedfca35 provisioner/puppet: fix bug when connection type was not set in config (#23057)
Before this, the Terraform Puppet provisioner would error out in a
confusing way if the type attribute in a connection block was not given.

Apparently an omitted type leads to type having a value "" which must be
then assumed to mean "ssh".

Fixes #23004
2019-10-17 11:46:55 -04:00
Kristin Laemmert ee854261c5
Update CHANGELOG.md 2019-10-17 11:35:47 -04:00
Kristin Laemmert 4b10a6e1bf
command/jsonplan: fix bug with nested modules output (#23092)
`marshalPlannedValues` builds a map of modules to their children in
order to output the resource changes in a tree. The map was built from
the list of resource changes. However if a module had no resources
itself, and only called another module (a very normal case), that module
would not get added to the map causing none of its children to be
output in `planned_values`.

This PR adds a walk up through a given module's ancestors to ensure that
each module, even those without resources, would be added.
2019-10-17 11:33:04 -04:00
Pam Selle a8dcd0cab2 go mod vendor; go mod tidy 2019-10-17 11:14:30 -04:00
Pam Selle 210b3aff0a Upgrade go-slug 2019-10-17 11:12:00 -04:00
Pam Selle 2a292340d9 Add website docs 2019-10-17 11:12:00 -04:00
Pam Selle a5f2f4cbba Update messaging for .terraformignore 2019-10-17 11:12:00 -04:00
Pam Selle 57cf6d74ce Point to tfignore branch of go-tfe 2019-10-17 11:12:00 -04:00
Radek Simko c1ea09141f
Merge pull request #23063 from hashicorp/svchost-migration
Replace svchost package with hashicorp/terraform-svchost
2019-10-17 16:43:43 +02:00
Chris Griggs a7af2a4034
Merge pull request #23082 from hashicorp/cgriggs01-okta-links
[Website] Provider links
2019-10-16 08:30:11 -07:00
cgriggs01 83e97fdbb5 Okta links + move venafi 2019-10-15 12:54:06 -07:00
Martin Atkins f96edbb113 Revise our contributing/development documentation
Our documentation for how to contribute was in quite a state of disrepair,
with some documents still describing things as they were before moving
providers into separate repositories, others making assumptions about
Go development that are no longer true in modules mode, and so forth.

This is an attempt at a reset to a good state that should work with the
codebase as it currently stands, and should hopefully serve as a basis
for iterative improvement from here.

These new instructions lean primarily on standard Go toolchain usage and
instruct using the Makefile only for some Terraform-specific situations
that the Go toolchain does not automatically handle. The idea here is that
this direct usage of primary commands in the Go toolchain is less likely
to be broken by changes in future Go releases, and should be immediately
familiar to anyone who has experience with Go development.
2019-10-15 08:39:36 -07:00
Kristin Laemmert 96af863065
command/validate: warn if unused flags are set on the command line (#22989)
* command/validate: output a warning if unused flags are set

The -var and -var-file command line flags are accepted, but not used,
in `terraform validate`. This PR adds a warning for users who set either
of those flags, so they know that setting them has no effect.
2019-10-14 15:35:33 -04:00
Radek Simko 9051591899
go mod tidy & go mod vendor 2019-10-11 22:41:27 +01:00
Radek Simko cd21a3859d
Remove svchost package 2019-10-11 22:40:57 +01:00
Radek Simko 32f9722d9d
Replace import paths & set UA string where necessary 2019-10-11 22:40:54 +01:00
Martin Atkins 047733d20c website: Full examples for for_each with flatten and setproduct
A very common question since we launched the two repetition constructs
is how to deal with situations where the input data structure doesn't
match one-to-one with the desired configuration.

This adds some full worked examples of two common situations that have
come up in questions. To avoid adding a lot of extra content to the
already-large "expressions" and "resources" pages, the main bulk of this
new content lives with the relevant functions themselves as a full example
of one thing they are good for, and then we'll link to them from the two
general documentation sections where folks are likely to be reading when
they encounter the problem.
2019-10-11 13:41:58 -07:00
Kristin Laemmert 0d27e8ca7d
Update CHANGELOG.md 2019-10-11 13:02:16 -04:00
Stas Alekseev 6656104f8f deps: github.com/hashicorp/aws-sdk-go-base@v0.4.0 (#22994) 2019-10-11 12:50:12 -04:00
Martin Atkins cf16b42135
Update CHANGELOG.md 2019-10-10 10:08:45 -07:00
Martin Atkins 8664749b59 backend: Allow certain commands to opt out of required variable checks
Terraform Core expects all variables to be set, but for some ancillary
commands it's fine for them to just be set to placeholders because the
variable values themselves are not key to the command's functionality
as long as the terraform.Context is still self-consistent.

For such commands, rather than prompting for interactive input for
required variables we'll just stub them out as unknowns to reflect that
they are placeholders for values that a user would normally need to
provide.

This achieves a similar effect to how these commands behaved before, but
without the tendency to produce a slightly invalid terraform.Context that
would fail in strange ways when asked to run certain operations.
2019-10-10 10:07:01 -07:00
Martin Atkins e21f0fa61e backend/local: Handle interactive prompts for variables in UI layer
During the 0.12 work we intended to move all of the variable value
collection logic into the UI layer (command package and backend packages)
and present them all together as a unified data structure to Terraform
Core. However, we didn't quite succeed because the interactive prompts
for unset required variables were still being handled _after_ calling
into Terraform Core.

Here we complete that earlier work by moving the interactive prompts for
variables out into the UI layer too, thus allowing us to handle final
validation of the variables all together in one place and do so in the UI
layer where we have the most context still available about where all of
these values are coming from.

This allows us to fix a problem where previously disabling input with
-input=false on the command line could cause Terraform Core to receive an
incomplete set of variable values, and fail with a bad error message.

As a consequence of this refactoring, the scope of terraform.Context.Input
is now reduced to only gathering provider configuration arguments. Ideally
that too would move into the UI layer somehow in a future commit, but
that's a problem for another day.
2019-10-10 10:07:01 -07:00
Martin Atkins 564b57b1f6 core: Require variables correctly set during NewContext
We previously deferred this to Validate, but all of our operations require
a valid set of variables and so checking this up front makes it more
obvious when a call into Terraform Core from the CLI layer isn't
populating variables correctly, instead of having it fail downstream
somewhere.

It's the caller's responsibility to ensure that it has collected values
for all of the variables in some way before calling NewContext, because
in the main case driven by the CLI there are many different places that
variable values can be collected from and so handling the main user-facing
validation in the CLI allows us to return better error messages that take
into account which way a variable is (or is not) being set.
2019-10-10 10:07:01 -07:00
Jeff Green e505845a63 command/apply: remove duplicate statement (#23011) 2019-10-08 16:11:36 -04:00
Chris Griggs b6257a3e26
Merge pull request #22997 from hashicorp/cgriggs01-venafi
[Website] Add links to provider documentation
2019-10-08 12:57:17 -07:00