Commit Graph

28457 Commits

Author SHA1 Message Date
Kristin Laemmert 9cb8456f3d
configs: prevent panic with invalid type name (#25562)
An invalid type name in a resource (or data source) could cause a panic
when determining the implied provider for the resource. This commit adds
verification that the type name is valid. It does not add a diagnostic,
since the invalid type name would have already been caught by the
parser.

Fixes #25560
2020-07-13 09:47:16 -04:00
James Bardin 662ea420d6 update CHANGELOG.md 2020-07-10 14:37:26 -04:00
James Bardin 26fb544e43
Merge pull request #25543 from hashicorp/jbardin/prune-root-temps
ensure root module locals and vars are pruned
2020-07-10 14:31:41 -04:00
James Bardin ee8cc627a0 don't store an entire Resource in each Instance
The AbstractResourceInstance type was storing the entire Resource from
the state, when it only needs the actual instance state. This would
cause resources to consume memory on the order of n^2, where n in the
number of instances of the resource.

Rather than attaching the entire resource state, which includes copying
each individual instance, only attach the ResourceInstance state, and
extract out the provider address from the Resource.
2020-07-10 13:35:13 -04:00
James Bardin a0567458e2 ensure root module locals and vars are pruned
The pruneUnusedNodes transformer was skipping root level locals and
variables, causing them to be left in the graph during a full destroy.
Use the return value from temporaryValue to indicate if the node is
truly temporary or not, rather then keeping the entire root module.
2020-07-10 09:30:03 -04:00
Alisdair McDiarmid 1c7a8c3e43
Update CHANGELOG.md 2020-07-09 14:59:06 -04:00
Alisdair McDiarmid 53e587e1a6
Merge pull request #25504 from hashicorp/alisdair/post-install-cache-validate
Add post-install provider cache validation and error reporting
2020-07-09 14:55:17 -04:00
Kristin Laemmert e639d813ee add test cases and remove no-longer-needed validation 2020-07-08 13:53:54 -04:00
Martin Atkins 0a46ded3e7 addrs: Disallow provider source addresses starting with terraform-
The main motivation here is to produce a helpful error if a user
incorrectly uses the terraform-provider- prefix (which we see on provider
VCS repositories and plugin executables) as part of the source address.

However, this also more broadly blocks "terraform-" as a prefix in
anticipation of whatever instinct causes the phenomenon where e.g.
Python's PyPI has thousands of packages whose names start with "python-",
even though everything on PyPI is for Python by definition. This is
definitely not _necessary_, but it's better to be restrictive at first
and weaken later as needed.
2020-07-08 10:18:55 -07:00
Martin Atkins 7909dd318d command/init: Specialized error message for host that isn't registry
If the user specifies a host that isn't a provider registry in a provider
source address then we'll print out some specialized error messages for
different variants of that situation.

In particular, this includes a special case for when the error is on the
hostname "github.com", in anticipation of folks incorrectly attempting to
use GitHub repository URLs (or Go-style module paths that happen to be
on GitHub) to specify providers, so we can give a more specific hint about
that.

This is just a different presentation of an existing error case that we
are already covering in the installer tests, so there are no new tests
here. We could in principle have a test covering the exact text of these
error messages, but we don't have much precedent for command package tests
covering that level of cosmetic detail.
2020-07-08 10:18:55 -07:00
Martin Atkins 80ab867e57 command/init: Remove special 0.12upgrade heuristic
For Terraform v0.12 we introduced a special loading mode where we would
use the 0.11-syntax-compatible "earlyconfig" package as a heuristic to
identify situations where it was likely that the user was trying to use
0.11-only syntax that the upgrade tool might help with.

However, as the language has moved on that is no longer a suitable
heuristic in Terraform 0.13 and later: other new additions to the
language can cause the main loader to disagree with earlyconfig, which
would lead us to give poor advice about how to respond.

Instead, we'll now return the same generic "there are errors" message in
all syntax error cases. We have an extra message for errors in this
case (as compared to other commands) because "terraform init" is usually
the first command a new user interacts with and so this message gives some
extra explanation about what "terraform init" will do with the
configuration once it's valid.

This also includes a reset control character in the output of the message
as part of our ongoing mission to stop Terraform printing out whole
paragraphs of colored text, which can often be hard to read for various
reasons.
2020-07-08 10:18:55 -07:00
Kristin Laemmert 384cfaacf9 lang/funcs: refactor Subnet and Host functions to support 64-bit systems 2020-07-08 10:58:06 -04:00
Kristin Laemmert 642e3590a2 upgrade go-cidr to v1.1.0 2020-07-08 10:57:57 -04:00
Petros Kolyvas 3877f20e6d
Merge pull request #25515 from magodo/add_outlook_provider
Add community provider to terraform.io: terraform-provider-outlook
2020-07-08 10:21:03 -04:00
James Bardin 8e79611e59
Merge pull request #25500 from hashicorp/jbardin/destroy-output-expand
Do not evaluate output when doing a full destroy
2020-07-08 10:07:20 -04:00
magodo 70e25b6a87 add community provider entry: terraform-provider-outlook 2020-07-08 22:01:47 +08:00
Sune Keller 4438df6131
website: Add cidrsubnets to IP Network Functions index (#25185)
Signed-off-by: Sune Keller <absukl@almbrand.dk>
2020-07-08 08:43:14 -04:00
Tony Carmichael 8245fdcf21
Merge pull request #25505 from hashicorp/cgriggs-website-links
[Website] Update provider links
2020-07-07 14:57:20 -06:00
Chris Griggs bf25bd6e84 [Website] Update provider links 2020-07-07 13:44:32 -07:00
Petros Kolyvas 073fd0d183
Merge pull request #25061 from c-carpenter/patch-1
Update taint.html.markdown
2020-07-07 16:33:12 -04:00
Alisdair McDiarmid 87d1fb4006 command/init: Display provider validation errors
After installing providers, we validate the presence of an executable
file, and generate a selected versions lockfile. If this process fails,
notify the user. One possible cause for this is an invalid provider
package with a missing or misnamed executable file.
2020-07-07 15:20:20 -04:00
Alisdair McDiarmid 3b1347ac1a providercache: Validate provider executable file
At the end of the EnsureProviderVersions process, we generate a lockfile
of the selected and installed provider versions. This includes a hash of
the unpacked provider directory.

When calculating this hash and generating the lockfile, we now also
verify that the provider directory contains a valid executable file. If
not, we return an error for this provider and trigger the installer's
HashPackageFailure event. Note that this event is not yet processed by
terraform init; that comes in the next commit.
2020-07-07 15:20:17 -04:00
Alisdair McDiarmid a18b531b14 getproviders: FakeInstallablePackageMeta filename
Add an optional execFilename argument to the test helper function
FakeInstallablePackageMeta, which allows the creation of invalid
packages.
2020-07-07 15:18:30 -04:00
Alisdair McDiarmid 8e87ccb689 providercache: Lazily detect executable file
Instead of searching the installed provider package directory for a
binary as we install it, we can lazily detect the executable as it is
required. Doing so allows us to separately report an invalid unpacked
package, giving the user more actionable error messages.
2020-07-07 15:18:27 -04:00
Kristin Laemmert c4ce84269a
website/docs: document difference in formatting strings with width and precision (#25499) 2020-07-07 14:09:39 -04:00
James Bardin 2555f6f988 remove root output eval nodes from destroy
If we're adding a node to remove a root output from the state, the
output itself does not need to be re-evaluated. The exception for root
outputs caused them to be missed when we refactored resource destruction
to only use the existing state.
2020-07-07 11:10:15 -04:00
James Bardin b62640d2d5 update output destroy test to reference expander
Have the output reference the expansion of a resource (via the whole
resource object), so that we can be sure we don't attempt to evaluate
that expansion during destroy.
2020-07-07 11:08:14 -04:00
Tony Carmichael 2ff44acecc
Merge pull request #25091 from heroku-miraheze/patch-2
Add CloudSigma Provider
2020-07-07 08:55:07 -06:00
Tony Carmichael 3cd754e9e9
Merge pull request #25446 from barbaluc/patch-1
Update community-index.html.markdown
2020-07-07 08:54:10 -06:00
Lars Lehtonen 3d6a321d59
tools/terraform-bundle: fix dropped error (#25475) 2020-07-06 14:30:36 -04:00
James Bardin b6c409613e make all unnecessary edges dotted
There were a couple missing
2020-07-02 14:22:52 -04:00
Alvin Huang 682440766f
Merge pull request #25456 from hashicorp/use-alpine-latest
use alpine:latest as the base image for terraform docker containers
2020-07-02 10:32:31 -04:00
Petros Kolyvas 1232404ef2
Merge pull request #25457 from hashicorp/jul20_provider_docs_link
website: Fix broken link to /docs/registry/providers/docs.html
2020-07-02 09:40:46 -04:00
Nick Fagerlund 54e34fd9bb website: Fix broken link to /docs/registry/providers/docs.html 2020-07-01 17:06:16 -07:00
James Bardin af20d5404f
Merge pull request #25455 from hashicorp/jbardin/destroy-doc
Update destroy doc
2020-07-01 19:45:53 -04:00
James Bardin 1c1782bb1b add lists of operations 2020-07-01 17:11:55 -04:00
James Bardin dcf62ed378 Fix typo and add more information about CBD
The reason for the interleaved updated in CBD is important.

fix
2020-07-01 17:11:50 -04:00
James Bardin fb9c8261c5 replace the incorrect graph image
The dot in the comment was correct, so it was just the wrong image
saved.
2020-07-01 16:44:17 -04:00
James Bardin c12d0d139d
Merge pull request #25453 from hashicorp/jbardin/destroy-doc
add doc about destroying resources and ordering
2020-07-01 16:16:24 -04:00
James Bardin 16b7541277
Apply suggestions from code review
Co-authored-by: Alisdair McDiarmid <alisdair@users.noreply.github.com>
2020-07-01 16:10:02 -04:00
Alvin Huang b52715a8f7 use alpine:latest as the base image for terraform docker containers 2020-07-01 16:03:06 -04:00
Pam Selle 9cf5a18532
Merge pull request #25238 from HadrienPatte/fix-json-output-format-docs
Fix JSON output format documentation
2020-07-01 15:08:02 -04:00
Pam Selle d1e9172960
Merge pull request #25292 from mschuchard/patch-1
update hcl language markdown to terraform markdown
2020-07-01 15:07:04 -04:00
Martin Atkins fa6ab0c2d7
version: Fix version number for 0.13.0-dev 2020-07-01 11:56:24 -07:00
James Bardin 642dadcd96 add doc about destroying resources and ordering 2020-07-01 14:50:12 -04:00
hashicorp-ci e2d73e78ad Cleanup after v0.13.0-beta3 release 2020-07-01 18:47:35 +00:00
hashicorp-ci ab93bca6c5
Release v0.13.0-beta3 2020-07-01 17:50:24 +00:00
Martin Atkins b47f75b0ef
Update CHANGELOG.md 2020-07-01 10:47:08 -07:00
Kristin Laemmert 906da0e550
Update CHANGELOG.md 2020-07-01 09:45:04 -04:00
Kristin Laemmert f3a1f1a263
terraform console: enable use of impure functions (#25442)
* command/console: allow use of impure functions in terraform console
* add tests for Context Eval
2020-07-01 09:43:07 -04:00