Commit Graph

24601 Commits

Author SHA1 Message Date
James Bardin d4b0788854 don't append nil elements to a diagnostic cty.Path
If a set element is nil in validateConfigNulls, we don't want to
append that element to the diagnostic path, since it doesn't offer any
useful info to the user.
2019-06-25 18:05:51 -04:00
James Bardin bfa5e7f811 actual value may be unknown in nested list
When checking AssertObjectCompatible, we need to allow for a possible
unkown nested list block, just as we did for a set in 0b2cc62.
2019-06-25 16:43:57 -04:00
James Bardin 0d9f84414a
Merge pull request #21879 from hashicorp/jbardin/sdk-panics
prevent sdk panics in 2 specific cases
2019-06-25 15:38:15 -04:00
James Bardin 2bd86cf8bb update CHANGELOG.md 2019-06-25 15:09:31 -04:00
James Bardin cd3ac50ddb prevent sdk panics in 2 specific cases
Fix 2 specific panics in the sdk when reading nil or computed maps from
various configurations. The legacy sdk code is too dependent on undefined
behavior to attempt to find and fix the root cause at this point.

Since the code is essentially frozen for future development, these
changes are specifically targeted to only prevent panics from within
providers.  Because any code effected by these changes would have
panicked, there cannot be anything depending on the behavior, and these
should be safe to fix.
2019-06-25 14:24:32 -04:00
James Bardin fe11724678 test for panic when readin empty map 2019-06-25 14:24:31 -04:00
James Bardin f362198467
Merge pull request #21806 from hashicorp/jbardin/lost-empty-strings
prevent an empty string from being lost
2019-06-25 12:32:06 -04:00
Pam Selle cf2fb4fe8a release: Cleanup after 0.12.3 2019-06-24 17:29:03 -03:00
tf-release-bot 2e8cb7218d
v0.12.3 2019-06-24 20:09:49 +00:00
Paul Tyng ebea080aca Add missing bool case
Fixes #20572
2019-06-24 15:27:59 -04:00
Kristin Laemmert 8f29e2e11f
Update CHANGELOG.md 2019-06-21 14:31:55 -04:00
Kristin Laemmert 2a457115a3
configs: fix panic when the value is missing from version attribute in a provider block 2019-06-21 14:30:17 -04:00
Lindsey Smith a0f06826ab website: Puppet provisioner docs links fixed (#21843) 2019-06-21 14:11:13 -04:00
Benoit D d4588635f4
Fix typo in environment variable
The correct environment variable corresponding to the `ca_file` variable is `CONSUL_CACERT` and not `CONSUL_CAFILE`.

See `backend/remote-state/consul/backend.go` line 77.
2019-06-21 15:59:13 +02:00
Nick Metz 8eb6086cb2 \#21799 Since Terraform version 0.12 "-module=" is not a valid option for Terraform output aynmore. Also added missing option -no-color to documentation. 2019-06-21 09:31:31 +02:00
Brian Flad 4579dee8d9
Update CHANGELOG for #21815 2019-06-20 18:21:08 -04:00
Brian Flad 5d05349fb0
Merge pull request #21815 from hashicorp/v-aws-sdk-go-v1.20.4
deps: github.com/aws/aws-sdk-go@v1.20.4
2019-06-20 18:19:49 -04:00
Martin Atkins 9997670cb1
Update CHANGELOG.md 2019-06-20 06:26:45 -07:00
Martin Atkins 2fb11271b6
Update CHANGELOG.md 2019-06-20 06:20:03 -07:00
Martin Atkins 85eda8a059 state/remote: Don't persist snapshot for unchanged state
Previously we would write to the backend for every call to PersistState,
even if nothing changed since the last write, but update the serial only
if the state had changed.

The Terraform Cloud & Enterprise state storage have a simple safety check
that any future write with an already-used lineage and serial must be
byte-for-byte identical. StatesMarshalEqual is intended to detect that,
but it only actually detects changes the state itself, and not changes
to the snapshot metadata.

Because we write the current Terraform version into the snapshot metadata
during serialization, we'd previously have an issue where if the first
state write after upgrading Terraform to a new version happened to change
nothing about the state content then we'd write a new snapshot that
differed only by Terraform version, and Terraform Cloud/Enterprise would
then reject it.

The snapshot header is discarded immediately after decoding, so we can't
use information from it when deciding whether to increment the serial.
The next best thing is to skip sending no-op snapshot updates to the state
client in the first place.

These writes are unnecessary anyway, and state storage owners have asked
us in the past to elide these to avoid generating noise in their version
logs, so we'll also finally meet those requests as a nice side-effect of
this change.

We didn't previously have tests for the full flow of retrieving and then
successively updating persisted state snapshots, so this includes a test
which covers that logic and includes an assertion that a no-op update does
not get written to the state client.
2019-06-20 06:18:40 -07:00
Martin Atkins 2124089e14 state/remote: Switch to statemgr interfaces in test
These statemgr interfaces are the new names for the older interfaces in
the "state" package. These types alias each other so it doesn't really
matter which we use, but the "state" package is deprecated and we intend
to eventually remove it, so this is a further step in that direction.
2019-06-20 06:18:40 -07:00
Lindsey Smith dcbdd70385 website: Clarifications to Puppet provisioner docs (#21810) 2019-06-20 09:15:30 -04:00
Kristin Laemmert 0f6b46bd93
website: add puppet provisioner to the sidebar (#21821) 2019-06-20 09:02:23 -04:00
James Bardin e281336121
Merge pull request #21814 from hashicorp/jbardin/private-and-timeout
Private data and timeouts were lost in empty plans
2019-06-20 08:59:20 -04:00
Brian Flad d780cd0f1b
deps: github.com/aws/aws-sdk-go@v1.20.4
Relevant changes:

* backend/s3: Support for chaining assume IAM role from AWS shared configuration files
* backend/s3: Fix AWS shared configuration file credential source not assuming a role with environment and ECS credentials

References:

* https://github.com/aws/aws-sdk-go/releases/tag/v1.20.0
* https://github.com/aws/aws-sdk-go/pull/2579
* https://github.com/aws/aws-sdk-go/issues/2385

Updated via:

```console
$ go get github.com/aws/aws-sdk-go@v1.20.4
$ go mod tidy
$ go mod vendor
```
2019-06-20 00:04:44 -04:00
James Bardin 9365a2d97d private and timeout handling in grpc_provider
Load private data for read, so the resource can get it's configured
timeouts if they exist.

Ensure PlanResourceChange returns the saved private data when there is
an empty diff.

Handle the timeout decoding into Meta in the PlanResourceChange, so that
it's always there for later operations.
2019-06-19 22:48:15 -04:00
James Bardin c4874aa5b3 add more timeout provider tests 2019-06-19 22:48:15 -04:00
James Bardin 2448d1d38b move timeout handling to grpc_provider
simpleDiff is only called from the grpc_provider, and we always need to
make sure the timeouts are encoded in the private data.
2019-06-19 22:48:15 -04:00
appilon 20550743ad
Merge pull request #21765 from hashicorp/appilon/hashibot
capture existing config in new config file/format for hashibot
2019-06-19 20:27:23 -04:00
James Bardin 4dcda04d96 prevent an empty string from being lost
The helper/schema diff process loses empty strings, causing them to show
up as unset (null) during apply. Besides failing to show as set by
GetOk, the absence of the value also triggers the schema to insert a
default value again during apply.

It would also be be preferable if the defaults weren't re-evaluated
again during ApplyResourceChange, but that would require a more invasive
patch to the field readers, and ensuring the empty string is stored in
the plan should block the default.
2019-06-19 17:42:00 -04:00
Tim Sharpe 2ab2796c93 website: Docs for the Puppet provisioner (#21792) 2019-06-19 15:30:04 -04:00
Martin Atkins 1bba574fe9 website: Document ignore_changes for individual map elements
This also includes a previously-missing test that verifies the behavior
described here, implemented as a planning context test for consistency
with how the other ignore_changes tests are handled.
2019-06-18 17:37:24 -07:00
Martin Atkins b1e92b3769 vendor: go get github.com/hashicorp/hcl2@0b64543c968c
This includes a fix to make sure that an expression with a static string
index, like foo["bar"], will be parsed as a traversal rather than as a
dynamic index expression.
2019-06-18 17:37:24 -07:00
Jonathan Buys 96328b1ec8 website: fix terraform_remote_state example for "config" argument (#21728) 2019-06-18 16:25:36 -07:00
Pam Selle 250527d923
Merge pull request #21786 from pselle/fmt_check_test
tests: Normalize in the fmt -check test
2019-06-18 17:50:19 -04:00
john-auld bfd9b552cc website: Correct fmt -check (#21631)
* Correct fmt -check

With `-check=false` the exit status is always zero.
With `-check=true` the exit status is zero when all files are properly formatted and non-zero otherwise.

* update fmt documentation to use short form for -diff and -check
2019-06-18 14:36:45 -07:00
Daniel Mangum 3bc14620c0 backend/remote-state: remove dead code
This remote-state adapter is no longer used, because the old remote state
mechanism was removed in Terraform v0.12.
2019-06-18 14:18:05 -07:00
Pam Selle 82dcd5276e Normalize in the fmt -check test 2019-06-18 17:15:59 -04:00
Martin Atkins 4b6a11701b website: Separate "Module Composition" section for variants
We previously had some notes about handling configuration variants just
tacked on to the "dependency inversion" section as an afterthought, but
this idea is a major use-case for dependency inversion so it deserves its
own section and a specific example.
2019-06-18 14:03:28 -07:00
Chris Griggs f0a9e95198
Merge pull request #21679 from hashicorp/cgriggs01-akamai-links2
[Website] Akamai provider links
2019-06-18 13:42:04 -07:00
Chris Griggs e71e8c05e4
Merge pull request #21780 from hashicorp/cgriggs01-community-listings
[Website] Community providers
2019-06-18 10:42:38 -07:00
cgriggs01 069766fd09 Add 4 new community providers 2019-06-18 10:33:28 -07:00
Yasuhiko Katoh f7f1bb8f31 Fix broken markdown link in CHANGELOG.md (#21767) 2019-06-18 09:53:56 -04:00
James Bardin c7058eaa52
Merge pull request #21764 from hashicorp/jbardin/normalize-import-blocks
normalize empty blocks during import
2019-06-18 07:14:37 -04:00
Alex Pilon 4a080f5ef7
fix slack channel ref 2019-06-17 23:11:53 -04:00
Alex Pilon fd70755b01
add newline 2019-06-17 23:01:10 -04:00
Alex Pilon eadf0fe60a
capture existing config in new config file/format 2019-06-17 22:59:27 -04:00
James Bardin 8ae31aa2db normalize empty blocks during import
Like Upgrade, Import is another case where we don't have the context of
the configuration and need to ensure missing blocks are normalized.
2019-06-17 20:29:01 -04:00
Pam Selle e605b838ac
Update CHANGELOG.md 2019-06-17 10:23:21 -04:00
Pam Selle 63ca536e41
Merge pull request #21734 from pselle/merge-null
Don't allow nulls in calls to merge
2019-06-17 10:19:28 -04:00