Commit Graph

24606 Commits

Author SHA1 Message Date
James Bardin 32f7f58345 allow moving resource to new modules not in state
Create the missing modules in the state when moving resources to a
module that doesn't yet exist. This allows for refactoring of
configuration into new modules, without having to create dummy resources
in the module before the "state mv" operations.
2019-08-01 18:54:09 -04:00
Chris Marchesi 4c63187fcd
Update CHANGELOG.md 2019-08-01 13:32:22 -07:00
Kristin Laemmert dcb802d96f
Update CHANGELOG.md 2019-08-01 15:54:02 -04:00
Kristin Laemmert 2b14a6b332
lang/funcs: lookup() can work with maps of lists, maps and objects (#22269)
* lang/funcs: lookup() can work with maps of lists, maps and objects

lookup() can already handle aribtrary objects of (whatever) and should
handle maps of (whatever) similarly.
2019-08-01 15:52:52 -04:00
Chris Marchesi e0329c2e0f
Merge pull request #22248 from hashicorp/v0.12.5-updated-azure-helpers
modules: update go-azure-helpers to v0.5.0
2019-08-01 11:58:10 -07:00
Chris Marchesi d43fc71135
modules: update go-azure-helpers to v0.5.0
To help address the issues posed on #22087 and #22085.
2019-08-01 11:57:34 -07:00
Chris Marchesi 04c5f0ffb2
Merge pull request #22247 from hashicorp/v0.12.5-updated-azure
modules: update Azure deps to latest
2019-08-01 11:57:07 -07:00
Pam Selle ac810a8d0c
Update CHANGELOG.md 2019-08-01 14:25:30 -04:00
Pam Selle c6692c108b
Merge pull request #22291 from hashicorp/pselle/fix-foreach-provisioners
Ensure each references evaluated in provisioners block
2019-08-01 14:24:38 -04:00
Martin Atkins 0f2c4b3b68 httpclient: Create trace logging for outgoing HTTP requests
Sometimes HTTP requests are buried inside third-party libraries where we
can't otherwise access their request method/URL, so this ensures we'll
always have at least a record of the fact that a request happened, even if
there's no other logging for why it did.

We only include the method and URL here under the assumption that
secret keys and other particularly sensitive information will not appear
there, in line with usual best-practices.
2019-08-01 10:57:22 -07:00
Martin Atkins e1590d0a70 command/cliconfig: Factor out CLI config handling
This is just a wholesale move of the CLI configuration types and functions
from the main package into its own package, leaving behind some type
aliases and wrappers for now to keep existing callers working.

This commit alone doesn't really achieve anything, but in future commits
we'll expand the functionality in this package.
2019-08-01 10:56:41 -07:00
Pam Selle 4692ef13aa
Update CHANGELOG.md 2019-08-01 11:24:14 -04:00
Pam Selle 07ee88b73b
Merge pull request #22279 from tmatias/for-each-argument-value-validation
make diagnose on for_each argument more precise
2019-08-01 11:22:23 -04:00
Pam Selle 2015dd293f Fix #22289 2019-08-01 11:04:48 -04:00
tmatias c20c40c9aa
diagnose tuple values being passed as argument to for_each 2019-08-01 11:33:46 -03:00
tmatias e825dd0428
make validation on for_each argument more precise 2019-07-31 19:29:50 -03:00
Martin Atkins 5cb80c43c1 website: example of csvdecode with for_each
We added the csvdecode function originally with the intent of it being
used with for_each, but because csvdecode was released first we had a
section in its documentation warning about the downsides of using it with
"count", since that seemed like something people would be likely to try.

With resource "for_each" now merged, we can replace that scary section
with a more positive example of using these two features together.

We still include a paragraph noting that "count" _could_ be used here, but
with a caution against doing so. This is in the hope of helping users
understand the difference between these two patterns and why for_each is
the superior choice for most situations.
2019-07-31 12:43:16 -07:00
tf-release-bot caf5bc847d Cleanup after v0.12.6 release 2019-07-31 19:32:38 +00:00
tf-release-bot 380226f0aa
v0.12.6 2019-07-31 19:22:05 +00:00
James Bardin 539148ac70 update CHANGELOG.md 2019-07-31 14:59:10 -04:00
Kristin Laemmert 1c556c0aef
Update CHANGELOG.md 2019-07-30 16:29:13 -04:00
The Terraform Team 176f790323
Merge pull request #22262 from hashicorp/mildwonkey/b-deprecation-warnings
helper/schema: don't skip deprecation check during validation
2019-07-30 21:27:51 +01:00
Kristin Laemmert bfd66083de helper/schema: don't skip deprecation check during validation
If an attribute was not wholly known, helper/schema was skipping the
`validateType` function which (among other things) returned deprecation
messages. This PR checks for deprecation before returning when skipping
validateType.
2019-07-30 16:00:43 -04:00
Brian Flad ad8ff53534
Update CHANGELOG for #22253 2019-07-30 15:31:36 -04:00
Brian Flad 710b01a54f
Merge pull request #22253 from hashicorp/v-aws-sdk-go-v1.21.7
deps: github.com/aws/aws-sdk-go@v1.21.7
2019-07-30 15:27:19 -04:00
The Terraform Team 19ae3a797e
Merge pull request #22258 from hashicorp/mildwonkey/yaml
vendor: upgrade go-cty-yaml dependency
2019-07-30 18:43:08 +01:00
Paul Tyng c4e5bcaa4c
Merge pull request #22256 from hashicorp/paultyng-patch-1
Update copy for Exists
2019-07-30 12:38:37 -04:00
Kristin Laemmert 664fb5d51e vendor: upgrade go-cty-yaml dependency
Fixes #22223
2019-07-30 12:27:49 -04:00
Chris Marchesi 92c46c55f4
modules: update Azure deps to latest
The dependencies here are dated and are causing conflicts with the
ACME provider, namely the version of the top-level autorest package.

This explicitly updates the Azure SDK and autorest packages, with the
separately versioned sub-packages being added automatically.
2019-07-30 09:12:14 -07:00
The Terraform Team 7e6b05a95f
Update CHANGELOG.md 2019-07-30 12:01:24 -04:00
The Terraform Team f944b4a6a3
Merge pull request #22186 from xiaozhu36/master
backend/oss: Support for assume role config
2019-07-30 17:00:16 +01:00
He Guimin a490dfa495 backend/oss: Support for assume role config 2019-07-30 23:27:17 +08:00
Pam Selle 447fe62986
Merge pull request #22220 from hashicorp/pselle/0.12upgrade-docs
Docs about comparison behavior change from 0.11 to 0.12
2019-07-30 10:52:35 -04:00
Pam Selle 0a893f8c53 Update to equality vs comparison 2019-07-30 10:51:14 -04:00
Paul Tyng e400c25358
Minor typo 2019-07-30 10:43:46 -04:00
Paul Tyng 366f70a71e
Update copy for Exists
You can signal the same information in `Read` with an empty ID if the object does not exist, Implementing `Exists` is not the only way to do so and in some providers is also not the preferred way.
2019-07-30 10:37:58 -04:00
Brian Flad acf794b07f
deps: github.com/aws/aws-sdk-go@v1.21.7
Notable changes (from Terraform AWS Provider CHANGELOG):

```
NOTES:

* backend/s3: Region validation now automatically supports the new `me-south-1` Middle East (Bahrain) region. For AWS operations to work in the new region, the region must be explicitly enabled as outlined in the [previous new region announcement blog post](https://aws.amazon.com/blogs/aws/now-open-aws-asia-pacific-hong-kong-region/). When the region is not enabled, the Terraform S3 Backend will return errors during credential validation (e.g. `error validating provider credentials: error calling sts:GetCallerIdentity: InvalidClientTokenId: The security token included in the request is invalid`).
* backend/s3: After this update, the AWS Go SDK will prefer credentials found via the `AWS_PROFILE` environment variable when both the `AWS_PROFILE` environment variable and the `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` environment variables are statically defined. Previously the SDK would ignore the `AWS_PROFILE` environment variable, if static environment credentials were also specified. This is listed as a bug fix in the AWS Go SDK release notes.

ENHANCEMENTS:

* backend/s3: Add support for assuming role via web identity token via the `AWS_WEB_IDENTITY_TOKEN_FILE` and `AWS_ROLE_ARN` environment variables
* backend/s3: Support automatic region validation for `me-south-1`

BUG FIXES:

* backend/s3: Load credentials via the `AWS_PROFILE` environment variable (if available) when `AWS_PROFILE` is defined along with `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY`
```

Updated via:

```
go get github.com/aws/aws-sdk-go@v1.21.7
go mod tidy
go mod vendor
```

Verification with this update:

```hcl
terraform {
  backend "s3" {
    bucket = "me-south-1-testing"
    key    = "test"
    region = "me-south-1"
  }
}

output "test" {
  value = timestamp()
}
```

Outputs:

```
$ terraform apply

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

Outputs:

test = 2019-07-30T12:49:19Z
```

If the new region is not properly enabled for the account, errors like the below will be received:

```
$ terraform init

Initializing the backend...

Error: error validating provider credentials: error calling sts:GetCallerIdentity: InvalidClientTokenId: The security token included in the request is invalid.
```

To use this region before this update:

```hcl
terraform {
  # ... potentially other configuration ...

  backend "s3" {
    # ... other configuration ...

    region                 = "me-south-1"
    skip_region_validation = true
  }
}
```
2019-07-30 08:51:39 -04:00
James Bardin 8b2646c2a6
Merge pull request #22149 from hashicorp/jbardin/state-show-deposed
account for deposed in terraform show
2019-07-29 14:25:02 -07:00
James Bardin 7648f99bca
Merge pull request #22236 from hashicorp/jbardin/nil-in-config
don't reflect nil in schema validation
2019-07-29 14:08:37 -07:00
James Bardin 345dfaccb6 Account for deposed instances in show command, adding the details for
each deposed instance.
Prevent crash if the current instance is missing.
2019-07-29 17:02:44 -04:00
James Bardin 5878527732
Merge pull request #22221 from hashicorp/jbardin/min-items
MinItems with dynamic blocks
2019-07-29 09:45:42 -07:00
James Bardin 016c4f782d don't reflect nil in schema validation
Nil values were not previously expected during validation, but they can
appear in some situations with the new protocol. Add checks to prevent
using zero reflect.Values.
2019-07-29 12:38:35 -04:00
Pam Selle 6ed09cbc4d
Merge pull request #22230 from tmccombs/for_each_provision
Support using self in the provisioner of resources that use for_each
2019-07-29 10:43:56 -04:00
Thayne McCombs b9af3cd86b Support using self in the provisioner of resources that use for_each 2019-07-29 01:18:33 -06:00
James Bardin 4bed030d40 don't validate MinItems with unknowns in a block
If there are unknowns, the block may have come from a dynamic
declaration, and we can't validate MinItems. Once the blocks are
expanded, we will get the full config for validation without any unknown
values.
2019-07-27 11:50:28 -07:00
James Bardin 67dbd6d345 don't check MinItems with unknowns in blocks
If a block was defined via "dynamic", there will be only one block value
until the expansion is known. Since we can't detect dynamic blocks at
this point, don't verify MinItems while there are unknown values in the
config.

The decoder spec can also only check for existence of a block, so limit
the check to 0 or 1.
2019-07-27 11:50:28 -07:00
James Bardin 682286e184 test for Required win MinItems > 1 2019-07-26 14:36:19 -07:00
Pam Selle f184d2c62a Docs to assist with #21978 2019-07-26 16:14:23 -04:00
Pam Selle 112b7755c0
Update CHANGELOG.md 2019-07-26 11:44:57 -04:00
Pam Selle 360068b3cb
Merge pull request #21922 from pselle/resource_for_each
Resource for_each
2019-07-26 11:41:56 -04:00