Commit Graph

26607 Commits

Author SHA1 Message Date
Pam Selle 73cba31602
Merge pull request #25605 from davidair/patch-1
Tiny typo in an error message
2020-08-28 12:38:55 -04:00
Pam Selle f2d213c461
Merge pull request #25657 from pdecat/typo_hierarchical
Typo: heirarchical => hierarchical
2020-08-28 12:37:49 -04:00
Alisdair McDiarmid 2323e9370a command: Warn instead of error for empty output
When the output subcommand is called with no arguments, and there are no
outputs to show, we previously rendered an error message but returned a
non-error status code. This is confusing.

This commit changes the text UI to use a warning diagnostic, which makes
it clearer that this is a non-error situation. We do not change the exit
code or the text of the warning, so hopefully this is not considered a
breaking change.
2020-08-28 11:05:46 -04:00
Alisdair McDiarmid 27416fba92
Update CHANGELOG.md 2020-08-28 10:30:35 -04:00
Alisdair McDiarmid 8198e9758c
Merge pull request #26028 from hashicorp/alisdair/fix-eval-read-data-panic
terraform: Fix createEmptyBlocks NestingSingle bug
2020-08-28 10:29:28 -04:00
Kristin Laemmert 3e1f741666
webside/docs: add note re: archive subdirectories to http download (#26020)
section
2020-08-28 09:54:43 -04:00
Pam Selle ba461fe0e1
Merge pull request #26004 from bzeitler69/patch-1
chore: Update mirror.html.md
2020-08-28 09:46:45 -04:00
Pam Selle 29af42df81
Merge pull request #25973 from Fabian-Schmidt/provisioner_comment_fix
provisioner comment fix.
2020-08-28 09:46:13 -04:00
Pam Selle 233c7c6793 Run gofmt 2020-08-28 09:41:00 -04:00
Pam Selle 0e93ed4377
Merge pull request #26024 from hashicorp/rberlind-foreach-patch
Fix foreach to for_each
2020-08-27 20:56:55 -04:00
Alisdair McDiarmid 5be772d85a terraform: Fix createEmptyBlocks NestingSingle bug
When calling createEmptyBlocks, we only intend to process legacy SDK
blocks (NestingList or NestingSet), but the function also needs to pass
through NestingSingle block types untouched. To do so we must only look
up the container's element type after we've established that the block
is backed by a container.
2020-08-27 20:29:36 -04:00
Roger Berlind 3070f21241
Fix foreach to for_each
`foreach` on modules should be `for_each`
2020-08-27 14:37:52 -04:00
Alan D. Salewski f63c38d6a1
internal/initwd: allow tests to pass when $PWD contains symlinks (#26015)
Fixes #26014
2020-08-27 10:02:22 -04:00
Martin Atkins 9699479601
Update CHANGELOG.md 2020-08-26 15:27:04 -07:00
Martin Atkins 2bd2a9a923 internal/getproviders: HTTPMirrorSource implementation
We previously had this just stubbed out because it was a stretch goal for
the v0.13.0 release and it ultimately didn't make it in.

Here we fill out the existing stub -- with a minor change to its interface
so it can access credentials -- with a client implementation that is
compatible with the directory structure produced by the
"terraform providers mirror" subcommand, were the result to be published
on a static file server.
2020-08-26 13:18:08 -07:00
Martin Atkins 146e983c36 internal/getproviders: package authenticator for our new-style hashes
Earlier we introduced a new package hashing mechanism that is compatible
with both packed and unpacked packages, because it's a hash of the
contents of the package rather than of the archive it's delivered in.
However, we were using that only for the local selections file and not
for any remote package authentication yet.

The provider network mirrors protocol includes new-style hashes as a step
towards transitioning over to the new hash format in all cases, so this
new authenticator is here in preparation for verifying the checksums of
packages coming from network mirrors, for mirrors that support them.

For now this leaves us in a kinda confusing situation where we have both
NewPackageHashAuthentication for the new style and
NewArchiveChecksumAuthentication for the old style, which for the moment
is represented only by a doc comment on the latter. Hopefully we can
remove NewArchiveChecksumAuthentication in a future commit, if we can
get the registry updated to use the new hashing format.
2020-08-26 13:18:08 -07:00
Kristin Laemmert 23a8bdd522
configs: finish deprecation of the config package by removing the remaining used functions into configs (#25996) 2020-08-26 14:39:18 -04:00
hashicorp-ci 18bdd1a4f0 Cleanup after v0.13.1 release 2020-08-26 18:17:25 +00:00
hashicorp-ci d29b2627b9
Release v0.13.1 2020-08-26 17:59:59 +00:00
Kristin Laemmert 4569a37de4
website/docs: provider source related clarifications 2020-08-26 13:50:07 -04:00
Alisdair McDiarmid c13eba9b9d
Merge pull request #26005 from hashicorp/alisdair/backend-config-schema-fix
command: Fix backend config schema validation
2020-08-26 11:52:04 -04:00
Alisdair McDiarmid 45437721c9 command: Add test for backend config validation 2020-08-26 11:37:11 -04:00
Alisdair McDiarmid f028b0a2bf command: Fix backend config schema validation
When applying a backend config override file, we must not check for the
presence of all required fields, as the override can be a partial
configuration. It is only valid to check for required fields after all
overrides have been merged, which init already does.
2020-08-26 10:50:47 -04:00
Bogdan Tsaitler b738da2f04
Update mirror.html.md 2020-08-26 17:10:45 +03:00
Kristin Laemmert 75e676f2f2
website/docs: remove unclear provider version constraint description (#25998) 2020-08-25 17:03:24 -04:00
Jamie Finnigan 08f593deb8
Merge pull request #25982 from hashicorp/gh_sec_pol
remove local SECURITY.md in favor of org-wide policy
2020-08-25 13:20:01 -07:00
Alisdair McDiarmid 93cd6b1b75
Merge pull request #25989 from pdecat/patch-1
Fix link to "v0.12-Compatible Provider Requirements" section
2020-08-25 15:59:25 -04:00
Alisdair McDiarmid d22a2cd3b2
Merge pull request #25992 from hashicorp/alisdair/upgrade-go
build: Use go 1.14.7
2020-08-25 15:11:05 -04:00
Alisdair McDiarmid 1b9b85115b
Merge pull request #25994 from hashicorp/alisdair/provider-requirements-doc-note
website: Provider requirements are not inherited
2020-08-25 14:33:17 -04:00
Alisdair McDiarmid 5f43934d5f website: Provider requirements are not inherited
Add a note to the provider configuration section explaining that only
config can be inherited by child modules, not source or version
requirements.
2020-08-25 13:02:16 -04:00
Alisdair McDiarmid b273ffe4df build: Use go 1.14.7
From the go release notes:

go1.14.3 (released 2020/05/14) includes fixes to cgo, the compiler, the
runtime, and the go/doc and math/big packages.

go1.14.4 (released 2020/06/01) includes fixes to the go doc command, the
runtime, and the encoding/json and os packages.

go1.14.5 (released 2020/07/14) includes security fixes to the
crypto/x509 and net/http packages.

go1.14.6 (released 2020/07/16) includes fixes to the go command, the
compiler, the linker, vet, and the database/sql, encoding/json,
net/http, reflect, and testing packages.

go1.14.7 (released 2020/08/06) includes security fixes to the
encoding/binary package.

https://golang.org/doc/devel/release.html#go1.14.minor
2020-08-25 12:37:08 -04:00
Paul Tyng 7a34d4d709
Add Terraform Cloud provider requirements (#25991) 2020-08-25 10:45:44 -04:00
Alisdair McDiarmid af2fb8f526
Update CHANGELOG.md 2020-08-25 09:05:07 -04:00
Alisdair McDiarmid aca6ce3c4d
Merge pull request #25990 from hashicorp/alisdair/clean-up-provider-tempfile
internal: Clean up package install temp file
2020-08-25 09:03:59 -04:00
Alisdair McDiarmid 915f53af23 internal: Clean up package install temp file
The installFromHTTPURL function downloads a package to a temporary file,
then delegates to installFromLocalArchive to install it. We were
previously not deleting the temporary file afterwards. This commit fixes
that.
2020-08-25 08:35:32 -04:00
Patrick Decat 84c50f9efb Fix link to "v0.12-Compatible Provider Requirements" section
On the https://www.terraform.io/docs/configuration/provider-requirements.html#requiring-providers page, the link to the `v0.12-Compatible Provider Requirements` section is broken:
* current link: https://www.terraform.io/docs/configuration/provider-requirements.html#v012-compatible-provider-requirements
* correct link: https://www.terraform.io/docs/configuration/provider-requirements.html#v0-12-compatible-provider-requirements
2020-08-25 12:35:07 +02:00
Jamie Finnigan 7eda697978 remove local SECURITY.md in favor of org-wide policy 2020-08-24 15:45:32 -07:00
Martin Atkins b1eec0fbcd core: NodeAbstractResourceInstance.Provider correct implied provider
When we need to select a qualified provider address based on an implied
provider name, we have a special case that the name "terraform" maps to
terraform.io/builtin/terraform instead of
registry.terraform.io/hashicorp/terraform as would be the case for other
prefixes.

However, in order for that to work properly we need to use
addrs.ImpliedProviderForUnqualifiedType instead of
addrs.NewDefaultProvider, because the latter just unconditionally always
produces a "default" provider configuration (belonging to the "hashicorp"
namespace on the public registry).
2020-08-24 11:41:28 -07:00
Martin Atkins 9c246e9a01 addrs: Resource.InModule, similar to Resource.Absolute
The Resource.Absolute function is there to conveniently construct an
AbsResource from a Resource by providing a module instance. Likewise, this
new InModule method allows conveniently constructing a ConfigResource from
a Resource by providing a module.
2020-08-24 11:41:28 -07:00
Alisdair McDiarmid d26ee0ea37
Update CHANGELOG.md 2020-08-24 10:17:06 -04:00
Alisdair McDiarmid c5d9935c0e
Merge pull request #25960 from hashicorp/alisdair/backend-config-override-fix
command: Fix backend config override validation
2020-08-24 10:14:16 -04:00
Alisdair McDiarmid 35125717b2
Merge pull request #25847 from zachwhaley/fix-tf-cli-args-no-color
Fix error when multiple -no-color arguments are used
2020-08-24 10:13:59 -04:00
Alisdair McDiarmid 19efd7bc3b
Merge pull request #25262 from hashicorp/alisdair/always-validate-workspace-name
command: Always validate workspace name
2020-08-24 10:11:13 -04:00
Fabian-Schmidt 0c6790e142 Fix provisioner comment. 2020-08-24 14:05:29 +10:00
James Bardin 058dff44f9
Merge pull request #25922 from hashicorp/jbardin/destroy-pruning
Fix node-pruning during destroy
2020-08-21 16:49:14 -04:00
Alisdair McDiarmid 677aabc767 command: Fix backend config override validation
When loading a backend config override file, init was doing two things
wrong:

- First, if the file failed to parse, we accidentally didn't return,
  which caused a panic due to the parsed body being nil;
- Secondly, we were overzealous with the validation of the file,
  allowing only attributes. While most backend configs are attributes
  only, the enhanced remote backend body also contains a `workspaces`
  block, which we need to support here.

This commit fixes the first bug with an early return and adds test cases
for missing file and intentionally-blank filename (to clear the config).

We also add a schema validation for the backend block, based on the
backend schema itself. This requires constructing an HCL body schema so
that we can call `Content` and check for diagnostic errors.

The result is more useful errors when an invalid backend config override
file is used, while also supporting the enhanced remote backend config
fully.

Does not include tests specific to the remote backend, because the
mocking involved to allow the backend to fully initialize is too
involved to be worth it.
2020-08-21 16:21:13 -04:00
Kristin Laemmert e63093edc8
build: disable github pr annotations (#25942) 2020-08-20 13:06:48 -04:00
Kristin Laemmert 9168abc3e5
website/docs: clarify behavior of -state flag (#25928)
* website: clarify behavior of -state option
2020-08-20 10:23:08 -04:00
Cameron Stitt 2e829a0d54
Merge pull request #25929 from hashicorp/cam-stitt/config-depends-on
Ensure depends_on is in module calls for config
2020-08-20 22:30:49 +10:00
Cameron Stitt 54e32652f7
Ensure depends_on is in module calls for config 2020-08-20 07:49:03 +10:00