Commit Graph

26339 Commits

Author SHA1 Message Date
Kristin Laemmert a42ffb46db
Update CHANGELOG.md 2020-06-11 14:12:08 -04:00
Kristin Laemmert 5450e8515d
command/013upgrade: detect builtin terraform provider (#25215)
* command/013upgrade: detect builtin terraform provider
2020-06-11 14:10:47 -04:00
Alisdair McDiarmid 9303b9f8fc
Merge pull request #25216 from hashicorp/alisdair/upgrade-deps
Upgrade hcl and go-cty
2020-06-11 13:41:34 -04:00
Alisdair McDiarmid 3fe8a7f76a vendor: go get github.com/hashicorp/hcl/v2@v2.6.0 2020-06-11 12:39:35 -04:00
Alisdair McDiarmid 9ef84801a8 vendor: go get github.com/zclconf/go-cty@v1.5.0 2020-06-11 12:39:11 -04:00
Martin Atkins 80a4bfbf27 website: New navigation items for the module and provider registry specs 2020-06-11 09:32:39 -07:00
Martin Atkins 63639defe9 website: Separate docs for the module registry protocol
We previously had the module registry protocol documented only as an
undefined subset of the full API of the official registry implementation.
However, the vast majority of endpoints documented in the official API
docs are not needed for a headless third-party module registry that only
intends to make modules available to Terraform CLI.

To make this clearer to potential third-party implementors, and also for
consistency with how the provider registry protocol is now documented,
here we create a new page to describe the subset required for all
registries, and then explain in the docs for the offical API that
potential third-party implementors should refer to the new page instead.

The longer page describing the full API of the official implementations
remains for those who wish to write clients for that API, because it is
part of the API surface area for Terraform Cloud and Terraform Enterprise.

I also took this opportunity to address the fact that module addresses
don't really contain "provider names" at all, but rather than the fourth
field in the address is _conventionally_ an official provider name but
can really be any string that serves to differentiate multiple
implementations of the same abstraction. The new docs therefore refer to
this field as "system" rather than "provider".
2020-06-11 09:32:39 -07:00
Martin Atkins deb8257fa5 website: Specification for the provider registry protocol 2020-06-11 09:32:39 -07:00
Kristin Laemmert e5bfa1930a
Update CHANGELOG.md 2020-06-11 11:36:04 -04:00
Kristin Laemmert 8673c197aa init: fix issue loading local plugin directory 2020-06-11 11:30:44 -04:00
Alisdair McDiarmid 06344e4540
Merge pull request #25207 from hashicorp/alisdair/remove-dead-code-source-addr-helpers
configs/configload: Remove unused SourceAddr funcs
2020-06-11 11:02:25 -04:00
James Bardin c0a5214aec do not look for all descendants from root outputs
The output destroy node only needs to connect to each of the output's
up-edges in order to be connected transitively to all of the outputs
dependencies. In large, highly-connected graphs, this may save
considerable time for each output.
2020-06-11 09:53:09 -04:00
James Bardin 8e4bd669e8 test Set.Copy, Graph.UpEdges, Graph.DownEdges 2020-06-11 09:53:09 -04:00
James Bardin 268959f4be make UpEdges and DownEdges return a copy
The public functions for the graph UpEdges and DownEdges is returning
the internal Set from the graph, meaning that callers could
inadvertently corrupt the graph structure by editing the returned Sets.

Make UpEdges and DownEdges return a copy of the set, while retaining the
efficient no-copy behavior for internal callers.
2020-06-11 09:53:09 -04:00
Petros Kolyvas 831fd2b842
Merge pull request #25212 from Redeux/kubernetes-backened-doc
backend/kubernetes: Kubernetes supports multiple workspaces
2020-06-11 09:49:50 -04:00
Phil Sautter fa3fe37684 backend/kubernetes: Kubernetes supports multiple workspaces 2020-06-11 08:35:22 -04:00
James Bardin 8f4395a1e9 ensure modules are expanded during import
In order to import into a module, we have to make sure that module has
registered the expansion data.
2020-06-10 17:02:41 -04:00
Alisdair McDiarmid 9204498fe5 configs/configload: Remove unused SourceAddr funcs
isLocalSourceAddr and isRegistrySourceAddr are also present in
internal/initwd/getter.go, and they are unused in this package.
2020-06-10 16:26:04 -04:00
Alisdair McDiarmid abedfd3a0f
Update CHANGELOG.md 2020-06-10 16:23:15 -04:00
Alisdair McDiarmid 652d4e40f4
Merge pull request #25190 from hashicorp/alisdair/providers-tree
command/providers: Show provider requirements tree
2020-06-10 16:21:49 -04:00
James Bardin 13c6b83e29 expanded module targeting test 2020-06-10 16:11:05 -04:00
James Bardin 98b323d815 ignore module indices in pre-expansion targeting
The TargetsTransformer ignored resource indices before expansion could
happen, but was not handling module indices. Ensure that we collapse all
pre-expansion addresses to "configuration" addresses, with no module or
resource keys.
2020-06-10 15:39:29 -04:00
James Bardin a2d8376eeb TransformTargets cannot depends on knowing Destroy
There is no reliable way to know if `destroy` was called from the cli.
2020-06-10 15:38:35 -04:00
James Bardin aa7e6f8d86 nodeCloseModule needs to be kept for downstream 2020-06-10 15:37:55 -04:00
James Bardin 7022345b8f Targets was being dropped in data source nodes 2020-06-10 15:36:44 -04:00
John Houston ec3612c3d0
Fix errors in kubernetes backend documentation 2020-06-10 14:00:01 -04:00
James Bardin b861f5a4d7 unkeyed target ModulesInstance can be Modules
If the last step in a module target is an unkeyed instance, and it's
being compared against keyed instances, we have to assume it was
intended to be used as a Module rather than a ModuleInstance.
2020-06-09 21:58:58 -04:00
Alisdair McDiarmid 1c1e4a4de0 command/providers: Show provider requirements tree
Providers can be required from multiple sources. The previous
implementation of the providers sub-command displayed only a flat list
of provider requirements, which made it difficult to see which modules
required each provider.

This commit reintroduces the tree display of provider requirements, and
adds a separate output block for providers required by existing state.
2020-06-09 14:21:53 -04:00
James Bardin 299aa31b43 update CHANGELOG.md 2020-06-08 21:20:58 -04:00
James Bardin 7800ef63d4
Merge pull request #19525 from dramich/k8sback
backend/kubernetes: Add Kubernetes as a backend
2020-06-08 15:59:32 -04:00
Masayuki Morita ee913a1c87
command/0.13upgrade: make confirmation more user-friendly (#25142)
I feel the current confirmation prompt for 0.13upgrade command is
ambiguous what is expected. Actually, when I used it for the first time,
I cancelled it by typing `y` instead of `yes`.

I believe it would be great if the 0.13upgrade command tell us the
expected value for confirmation like 0.12upgrade.
2020-06-08 13:36:19 -04:00
Alisdair McDiarmid f2beafd348
Update CHANGELOG.md 2020-06-08 10:45:16 -04:00
Alisdair McDiarmid b18d35e258
Merge pull request #25156 from hashicorp/alisdair/fix-empty-overlap-diagnostic-format
command/format: Fix empty overlap diagnostics
2020-06-08 10:44:02 -04:00
James Bardin b829de086f update CHANGELOG.md 2020-06-08 10:24:23 -04:00
James Bardin ea0b4df96f
Merge pull request #25144 from sharkyze/configs/fix-looksLikeSentences-index-out-of-range
config/name_values: fix index out of range in looksLikeSentences
2020-06-08 10:22:48 -04:00
James Bardin fdfe7e5cb7 update CHANGELOG.md 2020-06-08 10:21:18 -04:00
James Bardin 0b5746b6bb
Merge pull request #25176 from hashicorp/jbardin/module-expansion-transformer
Incorrect early return in module expansion transformer
2020-06-08 10:19:05 -04:00
Kristin Laemmert 30ab95fb55
Update CHANGELOG.md 2020-06-08 08:29:15 -04:00
Kristin Laemmert 58bcc2e9bb
addrs: detect builtin provider when parsing legacy provider string (#25154)
* addrs: detect builtin provider when parsing legacy provider string

The ParseLegacyAbsProviderConfig was not detecting builtin providers
("terraform"), which caused issues for all users with 0.12 state and
the "terraform_remote_state" data source. Since "terraform" is the only
built-in provider this adds a very simple check to the parser so it
properly returns the builtin FQN.

* add tests to the addrs package
2020-06-08 08:27:36 -04:00
Alisdair McDiarmid d741c3f917
Update CHANGELOG.md 2020-06-08 07:21:47 -04:00
Alisdair McDiarmid 3f62e4686b
Merge pull request #25146 from hashicorp/alisdair/simplify-makefile
Makefile: remove unused targets
2020-06-08 07:17:54 -04:00
Alisdair McDiarmid ba374baef0 Makefile: remove unused targets
Most of the targets in the Makefile have not been used in either CI or
the normal development workflow for some time. Removing them clarifies
that the expected way to build Terraform locally is simple: go install.

Remaining targets:

- fmtcheck, generate: these are used in CI to verify that the code is
  correctly formatted and that generate has been run appropriately
- protobuf: referenced in CONTRIBUTING.md as the simplest way to build
  the proto files
- website, website-test: used to compile and test the local website in
  isolation from the terraform-website repo
2020-06-08 07:02:54 -04:00
James Bardin 198c632e04 incorrect early return during module transformer
The recursive call should only return immediately on error.

The switch statement to find the current path should not use
ReferenceOutside, as we are getting the path for configuration, not for
references. This case would not have been taken currently, since all
GraphNodeReferenceOutside are also GraphNodeModulePath.
2020-06-06 21:45:05 -04:00
James Bardin 242a916a17 variable ModulePath must return configured path
The parent path case is handled ReferenceOutside
2020-06-06 21:45:05 -04:00
James Bardin 9722686b62 validation test with multiple nested modules 2020-06-06 21:44:41 -04:00
John Houston 01ebdd27f2 Rework soak test to error on unlock failure 2020-06-05 18:27:30 -04:00
John Houston b0f7e273e8 Add errors for lock disappearing 2020-06-05 18:10:24 -04:00
Chris Griggs 4b99c9a88d [Website] provider links 2020-06-05 14:27:22 -07:00
Brian Flad 5e3c02ba27
Update CHANGELOG for #25134 2020-06-05 16:43:20 -04:00
Brian Flad ba081aa10a
backend/s3: Updates for Terraform v0.13.0 (#25134)
* deps: Update github.com/hashicorp/aws-sdk-go-base@v0.5.0

Updated via:

```
$ go get github.com/hashicorp/aws-sdk-go-base@v0.5.0
$ go mod tidy
$ go mod vendor
```

* backend/s3: Updates for Terraform v0.13.0

Reference: https://github.com/hashicorp/terraform/issues/13410
Reference: https://github.com/hashicorp/terraform/issues/18774
Reference: https://github.com/hashicorp/terraform/issues/19482
Reference: https://github.com/hashicorp/terraform/issues/20062
Reference: https://github.com/hashicorp/terraform/issues/20599
Reference: https://github.com/hashicorp/terraform/issues/22103
Reference: https://github.com/hashicorp/terraform/issues/22161
Reference: https://github.com/hashicorp/terraform/issues/22601
Reference: https://github.com/hashicorp/terraform/issues/22992
Reference: https://github.com/hashicorp/terraform/issues/24252
Reference: https://github.com/hashicorp/terraform/issues/24253
Reference: https://github.com/hashicorp/terraform/issues/24480
Reference: https://github.com/hashicorp/terraform/issues/25056

Changes:

```
NOTES

* backend/s3: Deprecated `lock_table`, `skip_get_ec2_platforms`, `skip_requesting_account_id` arguments have been removed
* backend/s3: Credential ordering has changed from static, environment, shared credentials, EC2 metadata, default AWS Go SDK (shared configuration, web identity, ECS, EC2 Metadata) to static, environment, shared credentials, default AWS Go SDK (shared configuration, web identity, ECS, EC2 Metadata)
* The `AWS_METADATA_TIMEOUT` environment variable no longer has any effect as we now depend on the default AWS Go SDK EC2 Metadata client timeout of one second with two retries

ENHANCEMENTS

* backend/s3: Always enable shared configuration file support (no longer require `AWS_SDK_LOAD_CONFIG` environment variable)
* backend/s3: Automatically expand `~` prefix for home directories in `shared_credentials_file` argument
* backend/s3: Add `assume_role_duration_seconds`, `assume_role_policy_arns`, `assume_role_tags`, and `assume_role_transitive_tag_keys` arguments

BUG FIXES

* backend/s3: Ensure configured profile is used
* backend/s3: Ensure configured STS endpoint is used during AssumeRole API calls
* backend/s3: Prefer AWS shared configuration over EC2 metadata credentials
* backend/s3: Prefer ECS credentials over EC2 metadata credentials
* backend/s3: Remove hardcoded AWS Provider messaging
```

Output from acceptance testing:

```
--- PASS: TestBackend (16.32s)
--- PASS: TestBackendConfig (0.58s)
--- PASS: TestBackendConfig_AssumeRole (0.02s)
--- PASS: TestBackendConfig_conflictingEncryptionSchema (0.00s)
--- PASS: TestBackendConfig_invalidKey (0.00s)
--- PASS: TestBackendConfig_invalidSSECustomerKeyEncoding (0.00s)
--- PASS: TestBackendConfig_invalidSSECustomerKeyLength (0.00s)
--- PASS: TestBackendExtraPaths (13.21s)
--- PASS: TestBackendLocked (28.98s)
--- PASS: TestBackendPrefixInWorkspace (5.65s)
--- PASS: TestBackendSSECustomerKey (17.60s)
--- PASS: TestBackend_impl (0.00s)
--- PASS: TestForceUnlock (17.50s)
--- PASS: TestKeyEnv (50.25s)
--- PASS: TestRemoteClient (4.78s)
--- PASS: TestRemoteClientLocks (16.85s)
--- PASS: TestRemoteClient_clientMD5 (12.08s)
--- PASS: TestRemoteClient_impl (0.00s)
--- PASS: TestRemoteClient_stateChecksum (17.92s)
```
2020-06-05 16:41:32 -04:00