Commit Graph

25438 Commits

Author SHA1 Message Date
Steve Burns 43b855743b Uniformity for module manifest dir read/write 2020-01-14 21:13:36 -07:00
Steven Burns 98e612ee50 Add condition for conversion of module path in manifest 2020-01-14 21:06:42 -07:00
Steve Burns 8bc0ef8fdc Attempt to change the output of module manifest 2020-01-14 20:42:00 -07:00
Kristin Laemmert 01036e7b31
Update CHANGELOG.md 2020-01-14 08:30:41 -05:00
Kristin Laemmert 4c221cbcb9
website: document optional syntax for required_providers setting (#23854) 2020-01-14 07:59:18 -05:00
Pam Selle da67d86d7f
Merge pull request #23855 from hashicorp/pselle/deletion
Deletion of unused code in backend and config.go
2020-01-13 17:03:43 -05:00
Pam Selle 78b1220558 Remove config.go and update things using its aliases 2020-01-13 16:50:05 -05:00
James Bardin c376905adc it's safe for destroy provisioners to access path
The path values are statically loaded, and do not create any
dependencies that could cause problems with destroy provisioners.
2020-01-13 16:44:44 -05:00
Martin Atkins 57158df4b3
Update CHANGELOG.md
De-emphasize the "experiments" section in favor of the non-experimental changes in the same release.
2020-01-13 13:43:42 -08:00
Chris Griggs 56cd7859e0
Merge pull request #23857 from hashicorp/cgriggs01-stable
[cherry-pick]add checkpoint links
2020-01-13 13:19:09 -08:00
Chris Griggs 6d00e8dc28
Merge pull request #23856 from hashicorp/cgriggs01-checkpoint
[Website]add checkpoint links
2020-01-13 13:19:04 -08:00
Chris Griggs ffbcf55817 [Website]add checkpoint links 2020-01-13 13:14:38 -08:00
Chris Griggs 1a2ea70027 [Website]add checkpoint links 2020-01-13 13:13:34 -08:00
Pam Selle 37d16b2f79 Deletions from backend local 2020-01-13 15:30:46 -05:00
Pam Selle bb3d513c4f Some deletions from static analysis 2020-01-13 15:22:34 -05:00
Kristin Laemmert 726a74ef65
Update CHANGELOG.md 2020-01-13 15:11:31 -05:00
Kristin Laemmert 92f427779d
command/show: fix issue with show and aliased provider (#23848)
The formatter in `command/format/state.go`, when formatting a resource
with an aliased provider, was looking for a schema with the alias (ie,
test.foo), but the schemas are only listed by provider type (test).
Update the state formatter to lookup schemas by provider type only.

Some of the show tests (and a couple others) were not properly cleaning
up the created tmpdirs, so I fixed those. Also, the show tests are using
a statefile named `state.tfstate`, but were not passing that path to the
show command, so we were getting some false positives (a `show` command
that returns `no state` exits 0).

Fixes #21462
2020-01-13 15:10:00 -05:00
Kristin Laemmert 272cb44d3d
configs: extend module.ProviderRequirements to include the addrs.Provider instead of just version constraints. (#23843)
Renamed file.ProviderRequirements to file.RequiredProviders to match the
name of the block in the configuration. file.RequiredProviders contains
the contents of the file(s); module.ProviderRequirements contains the
parsed and merged provider requirements.

Extended decodeRequiredProvidersBlock to parse the new provider source
syntax (version only, it will ignore any other attributes).

Added some tests; swapped deep.Equal with cmp.Equal in the
terraform/module_dependencies_test.go because deep was not catching
incorrect constraints.
2020-01-13 11:31:47 -05:00
Paul Tyng 0ca6f743a4
Merge pull request #23845 from hashicorp/paultyng-patch-1
Add unifi and airtable community providers
2020-01-13 10:58:25 -05:00
James Bardin c69267ea72 update CHANGELOG.md 2020-01-13 10:45:13 -05:00
Paul Tyng a53832badd
Shameless self promotion 2020-01-13 09:58:01 -05:00
ZMI-RyanMann 66411b5ca0 website/docs: Updated documentation for range function pseudocode (#23823) 2020-01-13 09:17:47 -05:00
Martin Atkins 9333b19bd7
Update CHANGELOG.md 2020-01-10 15:32:40 -08:00
Martin Atkins ff4ea042c2 config: Allow module authors to specify validation rules for variables
The existing "type" argument allows specifying a type constraint that
allows for some basic validation, but often there are more constraints on
a variable value than just its type.

This new feature (requiring an experiment opt-in for now, while we refine
it) allows specifying arbitrary validation rules for any variable which
can then cause custom error messages to be returned when a caller provides
an inappropriate value.

    variable "example" {
      validation {
        condition = var.example != "nope"
        error_message = "Example value must not be \"nope\"."
      }
    }

The core parts of this are designed to do as little new work as possible
when no validations are specified, and thus the main new checking codepath
here can therefore only run when the experiment is enabled in order to
permit having validations.
2020-01-10 15:23:25 -08:00
Martin Atkins 02576988c1 lang: "try" and "can" functions
These are intended to make it easier to work with arbitrary data
structures whose shape might not be known statically, such as the result
of jsondecode(...) or yamldecode(...) of data from a separate system.

For example, in an object value which has attributes that may or may not
be set we can concisely provide a fallback value to use when the attribute
isn't set:

    try(local.example.foo, "fallback-foo")

Using a "try to evaluate" model rather than explicit testing fits better
with the usual programming model of the Terraform language where values
are normally automatically converted to the necessary type where possible:
the given expression is subject to all of the same normal type conversions,
which avoids inadvertently creating a more restrictive evaluation model
as might happen if this were handled using checks like a hypothetical
isobject(...) function, etc.
2020-01-10 15:23:25 -08:00
Martin Atkins 5771db6696 addrs: Fix infinite recursion in AbsInputVariableInstance.String 2020-01-10 15:23:25 -08:00
Martin Atkins b62e9a7227 vendor: go get github.com/hashicorp/hcl/v2@v2.3.0
This brings in the new HCL extension functions "try", "can", and
"convert", along with the underlying HCL and cty infrastructure that allow
them to work.
2020-01-10 15:23:25 -08:00
James Bardin 7500fa7a39
Merge pull request #23822 from hashicorp/jbardin/destroy-resource-deps
NodeDestroyResource needs to be referencable
2020-01-10 17:15:29 -05:00
James Bardin 4aa8a1cece Add GraphNodeNoProvider to skip adding a providers
While the NodeDestroyResource type should not be a
GraphNodeProviderConsumer, we're going to avoid uncovering more hidden
behavior by explicitly skipping provider creation and connections in the
provider transformers.

This should be removed when more in-depth testing can be done during a
major release cycle.
2020-01-10 16:28:44 -05:00
James Bardin a6cdfad590 NodeDestroyResource needs to be referencable
The change in #23696 removed the NodeAbstractResource methods from the
NodeDestroyResource type, in order to prevent other resource behaviors,
like requesting a provider.

While this node type is not directly referenced, it was implicitly
ordered against the module cleanup by virtue of being a resource node.

Since there's no good entry point to test this ordering at the moment,
2020-01-10 12:52:01 -05:00
Martin Atkins 2aac8cf812 internal/getproviders: Distinguished packed vs. unpacked local packages
Our local filesystem mirror mechanism will allow provider packages to be
given either in packed form as an archive directly downloaded to disk or
in an unpacked form where the archive is extracted.

Distinguishing these two cases in the concrete Location types will allow
callers to reliably select the mode chosen by the selected installation
source and handle it appropriately, rather than resorting to out-of-band
heuristics like checking whether the object is a directory or a file.
2020-01-10 09:41:27 -08:00
Martin Atkins 92a58ec438 internal/getproviders: Stub out the two mirror sources
In a future commit, these implementations of Source will allow finding
and retrieving provider packages via local mirrors, both in the local
filesystem and over the network using an HTTP-based protocol.
2020-01-10 09:41:27 -08:00
Martin Atkins 773e38b49c internal/getproviders: Stub of MultiSource
This is an API stub for a component that will be added in a future commit
to support considering a number of different installation sources for each
provider. These will eventually be configurable in the CLI configuration,
allowing users to e.g. mirror certain providers within their own
infrastructure while still being able to go upstream for those that aren't
mirrored, or permit locally-mirrored providers only, etc.
2020-01-10 09:41:27 -08:00
Martin Atkins d695956061 internal/getproviders: MemoizeSource for local caching of source responses
Some sources make network requests that are likely to be slow, so this
wrapper type can cache previous responses for its lifetime in order to
speed up repeated requests for the same information.
2020-01-10 09:41:27 -08:00
Martin Atkins a77bc59c44 internal/getproviders: Package URL should always be absolute
Registries backed by static files are likely to use relative paths to
their archives for simplicity's sake, but we'll normalize them to be
absolute before returning because the caller wouldn't otherwise know what
to resolve the URLs relative to.
2020-01-10 09:41:27 -08:00
Martin Atkins c8f7223adb internal/getproviders: Source interface for generalization
We intend to support installation both directly from origin registries and
from mirrors in the local filesystem or over the network. This Source
interface will serve as our abstraction over those three options, allowing
calling code to treat them all the same.
2020-01-10 09:41:27 -08:00
Martin Atkins c76260e957 internal/getproviders: Query a provider registry
Our existing provider installer was originally built to work with
releases.hashicorp.com and later retrofitted to talk to the official
Terraform Registry. It also assumes a flat namespace of providers.

We're starting a new one here, copying and adapting code from the old one
as necessary, so that we can build out this new API while retaining all
of the existing functionality and then cut over to this new implementation
in a later step.

Here we're creating a foundational component for the new installer, which
is a mechanism to query for the available versions and download locations
of a particular provider.

Subsequent commits in this package will introduce other Source
implementations for installing from network and filesystem mirrors.
2020-01-10 09:41:27 -08:00
Martin Atkins eda57670ce go get github.com/apparentlymart/go-versions@master 2020-01-10 09:41:27 -08:00
Kristin Laemmert 18dd1bb4d6
Mildwonkey/tfconfig upgrade (#23670)
* deps: bump terraform-config-inspect library
* configs: parse `version` in new required_providers block

With the latest version of `terraform-config-inspect`, the
required_providers attribute can now be a string or an object with
attributes "source" and "version". This change allows parsing the
version constraint from the new object while ignoring any given source attribute.
2020-01-10 11:54:53 -05:00
Pam Selle 94ab6d00ae
Merge pull request #23815 from pselle/docs/module-depth
(docs) Update docs to reflect current behavior for module-depth
2020-01-09 10:10:00 -05:00
tf-release-bot 9df05b4813 Cleanup after v0.12.19 release 2020-01-08 22:55:24 +00:00
tf-release-bot 58dcac4b79
v0.12.19 2020-01-08 22:38:48 +00:00
Martin Atkins 472d958b10
Update CHANGELOG.md 2020-01-08 14:27:39 -08:00
Pam Selle cd6c93774a Update docs to reflect current behavior 2020-01-08 16:51:42 -05:00
kmoe 58ef73814e
Merge pull request #23563 from hashicorp/kmoe/automtls
Allow disabling plugin AutoMTLS with TF_DISABLE_AUTOMTLS env var
2020-01-08 15:03:11 +00:00
Katy Moe dae1efe62a
allow disabling AutoMTLS with env var 2020-01-08 15:02:23 +00:00
James Bardin b6a041af2b update CHANGELOG.md 2020-01-07 17:10:02 -05:00
James Bardin 8b0888798f
Merge pull request #23717 from hashicorp/jbardin/destroy-plan-values
Always prune unused values
2020-01-07 17:06:20 -05:00
James Bardin c5300dc46d
Merge pull request #23792 from hashicorp/jbardin/update-go-getter
update go-getter
2020-01-07 17:05:30 -05:00
Martin Atkins e184b9edb9
Update CHANGELOG.md 2020-01-07 13:52:46 -08:00