Commit Graph

30239 Commits

Author SHA1 Message Date
Laura Pacilio
5c43afcb0e
Merge pull request #31213 from hashicorp/add-warnings-backends
Revise Backends Config Page
2022-06-13 11:05:51 -04:00
James Bardin
256b113990
Merge pull request #31176 from hashicorp/jbardin/plan-destroy-configure-provider
Configure providers during a destroy plan
2022-06-13 09:05:24 -04:00
Park Choong Ho
7510dc4d47
Update website/docs/language/resources/syntax.mdx
Co-authored-by: Laura Pacilio <83350965+laurapacilio@users.noreply.github.com>
2022-06-13 17:21:37 +09:00
Pierre-Yves Aillet
2fd3da94c7
Fix a wrong usage of sudo in debian install doc
Currently `sudo` is applied to `echo` resulting in:
`/etc/apt/sources.list.d/terraform.list: Permission denied`

Using `echo "..." | sudo tee /etc/apt/sources.list.d/terraform.list` fix the problem
2022-06-11 16:04:10 +02:00
James Bardin
d7238d510a skip already added provider nodes
We can skip providers which already have a node in the graph for their
type.
2022-06-10 10:37:58 -04:00
James Bardin
2581bc93cb Check for duplicate types in required_providers
Adding multiple local names for the same provider type in
required_providers was not prevented, which can lead to ambiguous
behavior in Terraform. Providers are always indexed by the providers
fully qualified name, so duplicate local names cannot be differentiated.
2022-06-10 10:37:21 -04:00
Kagashino
cab6cee385 fix: backend/cos - remove cos object write lock either when unlock state file 2022-06-10 20:14:58 +08:00
Laura Pacilio
c4d7207230
Merge pull request #31191 from IgnacioNMiranda/patch-1
docs: update depends_on.mdx meta-argument
2022-06-09 16:37:32 -04:00
Laura Pacilio
fa76c1dcf0 apply suggestions from PR review 2022-06-09 14:55:12 -04:00
Martin Atkins
543e5f4971 docs: "Resource Instance Change Lifecycle" revised
The previous version of this document was produced in haste in order to
support the development of the new provider framework, and so it focused
only on the most important details and left some of the operations totally
unmentioned.

This new version aims to capture the full set of managed-resource-related
provider operations, documenting when Terraform Core will call them and
what the provider ought to do in order to meet Terraform Core's
expectations for a valid response.

This new version does still assume a certain amount of knowledge on the
part of the reader about broadly what Terraform does from a user
perspective and what role providers play in that process. Perhaps a future
revision will include some additional background context as well, but
this is a snapshot of what I had time to do today between other work and
so for now I focused on presenting the remaining operations in a similar
amount of detail to what was here before.
2022-06-09 10:19:43 -07:00
James Bardin
b4ff641a47
Merge pull request #31215 from hashicorp/jbardin/deprecate-backends
deprecate unmaintained remote state backends
2022-06-09 10:06:04 -04:00
James Bardin
0c7d39aca5 deprecate unmaintained backends 2022-06-08 18:09:25 -04:00
Laura Pacilio
f775e70e80
Update website/README.md 2022-06-08 17:45:49 -04:00
Laura Pacilio
8a5d981084
Merge branch 'main' into laura-update-docs-readme 2022-06-08 17:44:42 -04:00
Laura Pacilio
401e28c7c2
Update README.md 2022-06-08 17:41:49 -04:00
Laura Pacilio
a20e1609c6
Update README.md 2022-06-08 17:41:26 -04:00
Laura Pacilio
1f40a886fe Update readme 2022-06-08 17:40:33 -04:00
Laura Pacilio
53d0661785 Add warning note to each backend page 2022-06-08 16:32:01 -04:00
Laura Pacilio
89dbd6a26b Remove overview backends page; add sensitive credentials warning to config page 2022-06-08 16:17:27 -04:00
hc-github-team-tf-core
2f1a8bbbd8 Cleanup after v1.3.0-alpha20220608 release 2022-06-08 17:31:07 +00:00
hc-github-team-tf-core
da14009ef0
Release v1.3.0-alpha20220608 2022-06-08 17:15:04 +00:00
Laura Pacilio
29435b46ac Edit type constraints docs for style and flow 2022-06-08 12:40:29 -04:00
Laura Pacilio
5bfd746696
Merge pull request #31198 from hashicorp/add-format-function-guidance
Add guidance about using the format function
2022-06-08 11:08:53 -04:00
Park Choong Ho
3513352300
Update syntax.mdx
fix wrong grammar
2022-06-08 18:37:56 +09:00
Laura Pacilio
6aa960c239
Update website/docs/language/expressions/custom-conditions.mdx 2022-06-07 17:09:42 -04:00
Laura Pacilio
9b57fc2964 Add guidance about using the format function 2022-06-07 16:44:25 -04:00
Laura Pacilio
e5658c2478 Explain the the destroy mode is the same as running terraform destroy 2022-06-07 15:27:00 -04:00
Laura Pacilio
3c2685222e Update apply page for style, concision, and clarity 2022-06-07 15:21:40 -04:00
Laura Pacilio
41659a776e
Merge pull request #31185 from paullschock/patch-2
Add details reg. verbosity of debug log level (replace #29641)
2022-06-06 12:25:10 -04:00
Ignacio Miranda Figueroa
68a83e48e7
docs: update depends_on.mdx meta-argument 2022-06-06 11:15:09 -04:00
Alisdair McDiarmid
6c3d50e37f
Update CHANGELOG.md 2022-06-06 11:08:19 -04:00
Alisdair McDiarmid
f8e2b3ada5
Merge pull request #31154 from hashicorp/alisdair/module-variable-optional-default
Add inline defaults to optional object attribute type constraints
2022-06-06 11:06:43 -04:00
James Bardin
82f47ca992
Merge pull request #31184 from hashicorp/bflad-GetProviderSchema-early-diag-return
Return early on GetProviderSchema RPC responses with error diagnostics
2022-06-06 09:00:59 -04:00
Paul Schock
48b06007dd
Add details reg. verbosity of debug log level
Update as a result of https://github.com/hashicorp/terraform/pull/29641
2022-06-03 12:17:52 -07:00
Brian Flad
0b404f4a95 Return early on GetProviderSchema RPC responses with error diagnostics
Reference: https://github.com/hashicorp/terraform/issues/31047

Prevent potential panics and immediately return provider-defined errors diagnostics.

Previously:

```
--- FAIL: TestGRPCProvider_GetSchema_ResponseErrorDiagnostic (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x70 pc=0x17fa752]

goroutine 13 [running]:
testing.tRunner.func1.2({0x191a100, 0x2236330})
	/usr/local/Cellar/go/1.18.2/libexec/src/testing/testing.go:1389 +0x24e
testing.tRunner.func1()
	/usr/local/Cellar/go/1.18.2/libexec/src/testing/testing.go:1392 +0x39f
panic({0x191a100, 0x2236330})
	/usr/local/Cellar/go/1.18.2/libexec/src/runtime/panic.go:838 +0x207
github.com/hashicorp/terraform/internal/plugin6/convert.ProtoToConfigSchema(0x0)
	/Users/bflad/src/github.com/hashicorp/terraform/internal/plugin6/convert/schema.go:110 +0x52
github.com/hashicorp/terraform/internal/plugin6/convert.ProtoToProviderSchema(...)
	/Users/bflad/src/github.com/hashicorp/terraform/internal/plugin6/convert/schema.go:98
github.com/hashicorp/terraform/internal/plugin6.(*GRPCProvider).GetProviderSchema(0xc00004a200)
	/Users/bflad/src/github.com/hashicorp/terraform/internal/plugin6/grpc_provider.go:152 +0x29a
github.com/hashicorp/terraform/internal/plugin6.TestGRPCProvider_GetSchema_ResponseErrorDiagnostic(0x0?)
	/Users/bflad/src/github.com/hashicorp/terraform/internal/plugin6/grpc_provider_test.go:158 +0x265
testing.tRunner(0xc0001031e0, 0x1a733d8)
	/usr/local/Cellar/go/1.18.2/libexec/src/testing/testing.go:1439 +0x102
created by testing.(*T).Run
	/usr/local/Cellar/go/1.18.2/libexec/src/testing/testing.go:1486 +0x35f
```

Previously:

```
--- FAIL: TestGRPCProvider_GetSchema_ResponseErrorDiagnostic (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x70 pc=0x18a2732]

goroutine 7 [running]:
testing.tRunner.func1.2({0x1a5e720, 0x250be50})
	/usr/local/Cellar/go/1.18.2/libexec/src/testing/testing.go:1389 +0x24e
testing.tRunner.func1()
	/usr/local/Cellar/go/1.18.2/libexec/src/testing/testing.go:1392 +0x39f
panic({0x1a5e720, 0x250be50})
	/usr/local/Cellar/go/1.18.2/libexec/src/runtime/panic.go:838 +0x207
github.com/hashicorp/terraform/internal/plugin/convert.ProtoToConfigSchema(0x0)
	/Users/bflad/src/github.com/hashicorp/terraform/internal/plugin/convert/schema.go:104 +0x52
github.com/hashicorp/terraform/internal/plugin/convert.ProtoToProviderSchema(...)
	/Users/bflad/src/github.com/hashicorp/terraform/internal/plugin/convert/schema.go:92
github.com/hashicorp/terraform/internal/plugin.(*GRPCProvider).GetProviderSchema(0xc00004a600)
	/Users/bflad/src/github.com/hashicorp/terraform/internal/plugin/grpc_provider.go:149 +0x29a
github.com/hashicorp/terraform/internal/plugin.TestGRPCProvider_GetSchema_ResponseErrorDiagnostic(0x0?)
	/Users/bflad/src/github.com/hashicorp/terraform/internal/plugin/grpc_provider_test.go:130 +0x265
testing.tRunner(0xc0001031e0, 0x1be9500)
	/usr/local/Cellar/go/1.18.2/libexec/src/testing/testing.go:1439 +0x102
created by testing.(*T).Run
	/usr/local/Cellar/go/1.18.2/libexec/src/testing/testing.go:1486 +0x35f
```
2022-06-03 14:27:55 -04:00
Alisdair McDiarmid
472df9686f
Update CHANGELOG.md
Removing items which shipped in the recent 1.2 patch release.
2022-06-02 16:47:54 -04:00
Martin Atkins
e00f0804ef development docs: Planning Behaviors
For a while now we've had information equivalent to this in various
internal documents that we've referred to when designing features such as
config-driven refactoring, the "replace" planning option, and so forth.

However, so far we've not put that information in any sort of durable
public place that we can easily find and refer to when having design
discussions on GitHub and similar.

This is therefore an attempt to capture a summary of the three main design
patterns we've identified for planning-related behaviors, with a few
motivating examples of each one, in the hope that this will be a good
reference and some helpful inspiration for future design work.

It's intentionally not totally comprehensive of all planning behaviors
both because that would duplicate the end-user-oriented documentation and
because it would be burdensome to keep updating this document each time we
add anything new which might fit into these categories. However, we might
add a later feature to this document if it illustrates a new take or
different perspective on one of these patterns.
2022-06-02 10:56:29 -07:00
Laura Pacilio
6c7db7186a
Merge pull request #31171 from fractos/patch-1
Fix custom conditions example
2022-06-02 10:59:53 -04:00
James Bardin
619fa61f0b have mockProvider always check it was configured
We do this already for other calls, but skipped UpgradeResourceState
since it wasn't previously possible to configure during a destroy plan.
2022-06-01 16:16:20 -04:00
James Bardin
38d70a1c3d configure providers during destroy plan
Now that we can fully evaluate a provider configuration, make sure we
configure the provider before using it during a destroy plan.
2022-06-01 16:03:27 -04:00
James Bardin
93ff27227a
Merge pull request #31163 from hashicorp/jbardin/plan-destroy
Use plan graph builder for destroy
2022-06-01 15:37:13 -04:00
James Bardin
e36ee757a5 minor cleanup from review 2022-06-01 15:29:59 -04:00
James Bardin
4fb8a5a3ec
Merge pull request #31164 from hashicorp/jbardin/go-getter-security-options
add XTerraformGetLimit to prevent redirect loops
2022-06-01 13:04:20 -04:00
James Bardin
47f9850f02 add XTerraformGetLimit to prevent redirect loops 2022-06-01 12:46:22 -04:00
kmoe
229789f60f
Update CHANGELOG.md 2022-06-01 17:08:02 +01:00
kmoe
f341c35819
Update CHANGELOG.md 2022-06-01 16:00:08 +01:00
Adam Christie
50919044d5
Fix custom conditions example
Original code block erroneously references `aws_vpc.example` but appears to actually mean `data.aws_vpc.example`.
2022-06-01 12:41:15 +01:00
Alisdair McDiarmid
e2a3042025 website: Update documentation for optional attrs
Extend the documentation on type constraints to include the new default
functionality, including a detailed example of a nested structure with
multiple levels of defaults.
2022-06-01 06:40:37 -04:00
Alisdair McDiarmid
718b0875ef lang: Remove defaults function
Now that we are able to specify optional object attribute defaults
inline in a type constraint, the separate `defaults` function is no
longer needed.
2022-06-01 06:40:37 -04:00
Luces Huayhuaca
70ddcc7d0d
add url to summary and check for optional values (#30993) 2022-05-31 13:48:07 -07:00