Commit Graph

26129 Commits

Author SHA1 Message Date
Petros Kolyvas c2f1033e86
Removing the "future version will...
We fully intend to do this, but this vague statement is no longer helpful. Will update when we have something more concrete.
2020-05-20 20:44:43 -04:00
James Bardin 14ef51bfcd module depends_on test
verify a chain of depends_on references through modules execute in the
correct order
2020-05-20 14:46:30 -04:00
James Bardin e1f607c9eb add depends_on references for modules to graph
Connect references from depends_on in modules calls. This will "just
work" for a lot of cases, but data sources will be read too early in the
case where they require the dependencies to be created. While
data sources will be properly ordered behind the module head node, there
is nothing preventing them from being being evaluated during refresh.
2020-05-20 13:46:13 -04:00
James Bardin 1b8fb4083a allow depends_on in module call 2020-05-20 13:46:13 -04:00
Tom Harvey d73fde47ac
updating to include #24669 2020-05-20 17:29:53 +02:00
Matthew Frahry 481b03c34a
Update azure backend storage sdk (#24669)
* update vendored azure sdk

* vendor giovanni storage sdk

* Add giovanni clients

* go mod vendor

* Swap to new storage sdk

* workable tests

* update .go-version to 1.14.2

* Tests working minus SAS

* Add SAS Token support

* Update vendor

* Passing tests

* Add date randomizer

* Captalize RG

* Remove random bits

* Update client var name

Co-authored-by: kt <kt@katbyte.me>
2020-05-20 17:29:02 +02:00
Kristin Laemmert eead4c49fe command/init: add e2e tests for provider not found messages 2020-05-20 11:04:11 -04:00
Kristin Laemmert 8d28d73de3 getproviders: add a registry-specific error and modify output when a
provider is not found.

Previously a user would see the following error even if terraform was
only searching the local filesystem:

"provider registry registry.terraform.io does not have a provider named
...."

This PR adds a registry-specific error type and modifies the MultiSource
installer to check for registry errors. It will return the
registry-specific error message if there is one, but if not the error
message will list all locations searched.
2020-05-20 11:04:11 -04:00
Kristin Laemmert a33a613703 command/init: add debug messages when -plugin-dir is set 2020-05-20 11:04:11 -04:00
James Bardin e690fa1363
Merge pull request #24904 from hashicorp/jbardin/plan-data-sources
Evaluate data sources in plan when necessary
2020-05-20 10:00:32 -04:00
Paul Leddy 3d17c87698 Example of for_each with list -> set using toset 2020-05-19 16:03:21 -07:00
Kristin Laemmert 0d620018fe
provider cache: log errors and validate dir exists (#24993)
* providercache: add logging for errors from getproviders.SearchLocalDirectory

providercache.fillMetaCache() was silently swallowing errors when
searching the cache directory. This commit logs the error without
changing the behavior otherwise.

* command/cliconfig: validate plugin cache dir exists

The plugin cache directory must exist for terraform to use it, so we
will add a check at the begining.
2020-05-19 15:32:36 -04:00
CJ Horton e1dcae17b7 add sad path tests for the TFP API version check 2020-05-19 11:14:48 -07:00
CJ Horton 68f199fc76 replace status string with go-tfe enum 2020-05-19 11:14:36 -07:00
CJ Horton 0b2a8a5f64 go get github.com/hashicorp/go-tfe@v0.8.1 + vendor 2020-05-19 11:14:27 -07:00
Martin Atkins 92e9428d0e
Update CHANGELOG.md 2020-05-19 09:45:56 -07:00
Martin Atkins 91de838243
Update CHANGELOG.md 2020-05-19 09:26:57 -07:00
Martin Atkins c1f69fba03
backend/remote: Support -target on plan and apply 2020-05-19 09:24:19 -07:00
James Bardin a8e0914d7f attach dependency type name changes 2020-05-18 21:35:37 -04:00
Daniel Dreier 19dc9b7b28
Merge pull request #24938 from hgsgtk/fix/typo_instance
fix typo ResourceInstancChange to ResourceInstanceChange
2020-05-18 18:23:12 -07:00
Martin Atkins 8e1615a802 backend/remote: Handle cost estimation skipped due to targeting
The remote server might choose to skip running cost estimation for a
targeted plan, in which case we'll show a note about it in the UI and then
move on, rather than returning an "invalid status" error.

This new status isn't yet available in the go-tfe library as a constant,
so for now we have the string directly in our switch statement. This is
a pragmatic way to expedite getting the "critical path" of this feature
in place without blocking on changes to ancillary codebases. A subsequent
commit should switch this over to tfe.CostEstimateSkippedDueToTargeting
once that's available in a go-tfe release.
2020-05-18 15:12:44 -07:00
Kristin Laemmert a4c3c1d389
vendor: upgrade go-cty dependency to 1.4.1 (#24983)
* vendor: upgrade go-cty dependency to 1.4.1

This upgrade fixes a panic with inconsistent object element types.
2020-05-18 14:10:19 -04:00
James Bardin 78d8af18c2
Merge pull request #24956 from hashicorp/jbardin/cbd-state
CreateBeforeDestroy inheritence and state serializaton
2020-05-18 11:46:29 -04:00
James Bardin 08128fe775 add omitempty to create_before_destroy
no need to litter the state file with "create_before_destroy":false
2020-05-18 11:31:36 -04:00
Paul Tyng eb4a3cafc6
Merge pull request #24972 from hashicorp/paultyng-patch-1
Remove sumologic from community
2020-05-18 11:02:55 -04:00
Paul Tyng e8f75b55ab
Remove sumologic from community 2020-05-16 12:23:46 -04:00
CJ Horton 0eea4e7c62 prevent targeting for unsupported API versions 2020-05-15 16:57:18 -07:00
Mike Nomitch 650a272a1d Change message sent to remote backend if -target used 2020-05-15 15:58:45 -07:00
Martin Atkins 16f1f3b739 backend/remote: Support -target on plan and apply
Previously we did not allow -target to be used with the remote backend
because there was no way to send the targets to Terraform Cloud/Enterprise
via the API.

There is now an attribute in the request for creating a plan that allows
us to send target addresses, so we'll remove that restriction and copy
the given target addresses into the API request.
2020-05-15 15:58:45 -07:00
Martin Atkins db4f3f8bc5 vendor: go get github.com/hashicorp/go-tfe@v0.8.0
This includes a new TargetAddrs field on both Run and RunCreateOptions
which we'll use to send resource addresses that were specified using
-target on the CLI command line when using the remote backend.

There were some unrelated upstream breaking changes compared to the last
version we had vendored, so this commit also includes some changes to the
backend/remote package to work with this new API, which now requires the
remote backend to be aware of the remote system's opaque workspace id.
2020-05-15 15:58:01 -07:00
Nick Fagerlund e358d6b618
website: Edit text of new TF_IGNORE env var docs (#24788)
* website: Edit text of new TF_IGNORE env var docs

Fixing one broken link, and tidying the sentences a bit.

* typo

Co-authored-by: Pam Selle <pam@hashicorp.com>
2020-05-14 13:35:27 -07:00
James Bardin a286ef6d9c remove depends_on from helper test shims 2020-05-14 15:57:16 -04:00
James Bardin 756e889697 remove unused DependsOn usage in state 2020-05-14 15:46:08 -04:00
James Bardin c052463f62 test for inherited create_before_destroy in state 2020-05-14 15:46:08 -04:00
James Bardin 7731441beb Make sure CBD is correct during apply, and saved
The resource apply nodes need to be GraphNodeDestroyerCBD in order to
correctly inherit create_before_destroy. While the plan will have
recorded this to create the correct deposed nodes, the edges still need
to be transformed correctly.

We also need create_before_destroy to be saved to state for nodes that
inherited it, so that if they are removed from state the destroy will
happen in the correct order.
2020-05-14 15:46:08 -04:00
James Bardin cf9b6de03e force cbd during apply too
We need to run the force CBD transformer during apply too, both to
ensure we can rely on the `CreateBeforeDestroy()` status for dependants
during apply, but also to ensure that the correct status is stored into
state.
2020-05-14 15:46:08 -04:00
James Bardin 9fe87fe520 remove unused depends_on field and add test
The depends_on fields was deprecated during 0.12, and is no longer used.

Add a roundtrip test for the create_before_destroy status.
2020-05-14 15:46:08 -04:00
James Bardin 23f5fc3e5a thread create_before_destroy to the state file 2020-05-14 15:46:08 -04:00
Chris Griggs 6a01c40312
Merge pull request #24953 from hashicorp/cgriggs01-ksyun
[Website] KingsoftCloud provider link
2020-05-14 12:23:33 -07:00
Chris Griggs c29b51b455 [Website] Kingsoft cloud provider link 2020-05-14 09:33:12 -07:00
Alisdair McDiarmid 187f3f561b
Merge pull request #24952 from hashicorp/alisdair/upgrade-hcl
vendor: go get github.com/hashicorp/hcl/v2@v2.5.1
2020-05-14 09:56:56 -04:00
Alisdair McDiarmid b07368eec3 vendor: go get github.com/hashicorp/hcl/v2@v2.5.1
Upgrade hcl for hclwrite bugfixes, which will make 0.13upgrade more
reliable.
2020-05-14 09:36:28 -04:00
Kristin Laemmert 041f4dd8ca
configs: require normalized provider local names (#24945)
* addrs: replace NewLegacyProvider with NewDefaultProvider in ParseProviderSourceString

ParseProviderSourceString was still defaulting to NewLegacyProvider when
encountering single-part strings. This has been fixed.

This commit also adds a new function, IsProviderPartNormalized, which
returns a bool indicating if the string given is the same as a
normalized version (as normalized by ParseProviderPart) or an error.
This is intended for use by the configs package when decoding provider
configurations.

* terraform: fix provider local names in tests

* configs: validate that all provider names are normalized

The addrs package normalizes all source strings, but not the local
names. This caused very odd behavior if for e.g. a provider local name
was capitalized in one place and not another. We considered enabling
case-sensitivity for provider local names, but decided that since this
was not something that worked in previous versions of terraform (and we
have yet to encounter any use cases for this feature) we could generate
an error if the provider local name is not normalized. This error also
provides instructions on how to fix it.

* configs: refactor decodeProviderRequirements to consistently not set an FQN when there are errors
2020-05-14 09:00:58 -04:00
Daniel Dreier c057487997
Merge pull request #24946 from hashicorp/danieldreier/hashibot_config
Remove hashibot panic issue labeler
2020-05-13 18:02:57 -07:00
charlotte.mach 172d6caf04 Add info on dynamodb locking multiple state files as per issue #15303 2020-05-13 15:04:56 -07:00
Daniel Dreier 7aa8e65e16 Remove hashibot panic issue labeler
HashiBot labels issues as "crash" and "bug" when they container "panic:". This causes issues to bypass human triage, which means that provider-specific panics are put in our issue list rather than being labeled correctly. This removes that rule to allow for human labeling.
2020-05-13 11:58:57 -07:00
James Bardin 291110fe78 Don't use plans.Update for data sources
The new data source planning logic no longer needs a separate action,
and the apply status can be determined from whether the After value is
complete or not.
2020-05-13 13:58:11 -04:00
James Bardin 8850d787f4 add evalWriteEmptyState for data source removal 2020-05-13 13:58:11 -04:00
James Bardin 7b8f13862c un-export new data eval nodes 2020-05-13 13:58:11 -04:00
James Bardin 8e3728af54 rename methods for ConfigResource changes 2020-05-13 13:58:11 -04:00