Commit Graph

30607 Commits

Author SHA1 Message Date
hashicorp-copywrite[bot]
dcee05d198 [COMPLIANCE] Update MPL 2.0 LICENSE 2022-10-12 17:36:01 +00:00
Tom Bamford
0dac887547
Docs for azurerm generic OIDC 2022-10-12 13:24:49 +01:00
Tom Bamford
82c0b440dc
Fix default values 2022-10-12 13:24:16 +01:00
Joe Harrison
a1a976c720
Document provider registry response property shasum
Add a short summary of the `shasum` property in the Provider Registry Protocol's distribution package response documentation.
The Response Properties section of the provider registry protocol does not mention the `shasum` property, but it is required and shown in the example.
2022-10-11 20:28:28 +01:00
James Bardin
3779dbc2af noop orphan change has nothing to apply
An orphaned resource which plans as a NoOp change will have no config.
This is not an error, but there is nothing to do since there are also
no checks to validate. We still leave the change in the plan to keep the
plan as complete as possible, noting all possible changes.

Preventing the node from being added to the graph is awkward, because
the config is attached separately from the diff transformer. This should
not pose any problems however, because there is no longer any state or
config linking the instance to any dependencies in the graph.
2022-10-11 14:30:29 -04:00
Sarah French
73c3994455
Update CHANGELOG.md 2022-10-11 18:58:26 +01:00
Sarah French
89ef27d3b4
Add Private Service Connect endpoint support to GCS backend (#31967)
* Add support for `storage_custom_endpoint` in `gcs` backend

* Add documentation for new `storage_custom_endpoint` endpoint

* Empty commit to trigger Vercel deployment
2022-10-11 18:57:09 +01:00
Brandon Croft
bc1436af53
Merge pull request #31821 from glennsarti/gs/TF-707-add-pre-apply
Add support for pre-apply task results in the cloud backend
2022-10-10 09:18:15 -06:00
Kevin Schu
bc07a54cfd Fix go.sum 2022-10-07 19:24:02 +02:00
Kevin Schu
5842950291 Added support for generic OIDC authentication (eg. Gitlab) and ensure documentation is more clear about it´s usage. oidc_request_url and oidc_request_token are meant to be used for Github Actions only. 2022-10-07 19:23:01 +02:00
Nick Fagerlund
71f1b12226
Merge pull request #31959 from hashicorp/nf/oct22-updown-comments
Clarify some comments in internal/dag
2022-10-06 15:56:48 -07:00
Nick Fagerlund
ccd7bd017e Clarify some comments in internal/dag
When reading this code to check Terraform's graph sorting behavior, I got very
confused about the direction of traversal for several methods. Although some of
these methods would also probably benefit from renames, this commit only updates
their doc comments to use the same directional terminology that we use in the
`Edge` interface (source/target).
2022-10-06 15:10:33 -07:00
Craig Wright
a8d6d5c913
Correcting a line break visual issue. 2022-10-06 10:00:13 -07:00
Craig Wright
b1c720a633
Update .github/ISSUE_TEMPLATE/documentation_issue.yml
Thanks!

Co-authored-by: Judith Malnick <judith.patudith@gmail.com>
2022-10-06 09:58:44 -07:00
Craig Wright
f058392421
Apply suggestions from code review
Thanks!

Co-authored-by: Judith Malnick <judith.patudith@gmail.com>
2022-10-06 09:58:09 -07:00
Matthew Garrell
03bff99caa
Merge pull request #31954 from hashicorp/mg_no_code_prov_followup
Adding mention of no-code to Creating Modules section of TF Language docs
2022-10-06 12:00:39 -04:00
Laura Pacilio
e60bfc0b57
Merge pull request #31953 from hashicorp/add-cont-valid-callout
Add callout to Continuous Validation
2022-10-06 11:58:29 -04:00
Matthew Garrell
a50d8cfc11 Adding mention of no-code to Modules section of TF Language docs 2022-10-06 11:53:53 -04:00
Liam Cervante
4d7ba14f72
Add skeleton action for equivalence tests (#31940) 2022-10-06 12:11:27 +02:00
Laura Pacilio
c8d8536160 Add callout to Continuous Validation 2022-10-05 22:32:37 -04:00
Craig Wright
3afa9bd08e
Create documentation_issue.yml
Closes https://github.com/hashicorp/terraform/issues/31552. 

Adds a new issue form type for documentation issues. Format discussed with docs team.
2022-10-05 14:45:24 -07:00
Laura Pacilio
1faa05b344
Merge pull request #31945 from hashicorp/fix-backends-link
Update backends.mdx
2022-10-05 14:06:05 -04:00
Laura Pacilio
8258070fd5
Update website/docs/language/state/backends.mdx 2022-10-05 13:43:45 -04:00
Laura Pacilio
97c628044a
Update website/docs/language/state/backends.mdx 2022-10-05 13:42:22 -04:00
Laura Pacilio
bed5650e2f
Update backends.mdx 2022-10-05 13:33:30 -04:00
James Bardin
3047b8c13e
Merge pull request #31878 from hashicorp/jbardin/import-plan-new
evaluation of missing instances during import
2022-10-04 12:45:06 -04:00
James Bardin
041d9d3eec unknown evaluation of missing instances in import
Because import does not yet plan new instances as part of the import
process, we can end up evaluating references to resources which have no
state at all. The fallback for this situation could result in slightly
better values during import. The count and for_each values were
technically incorrect, since the length is not known to be zero, and the
single instance does have a concrete type which we can return.
2022-10-04 11:07:16 -04:00
James Bardin
c1e0b046b8
Merge pull request #31917 from hashicorp/jbardin/destroy-edge-cycles
Extract more exact provider name when checking for destroy cycles
2022-10-04 11:06:25 -04:00
James Bardin
c296172be7 test for cycle around aliased provider 2022-10-04 10:59:51 -04:00
James Bardin
036fb9c1bf check detailed provider for destroy edge cycles
When we checked for cycles with destroy edges around providers, it was
only for providers of a different type, but one can do the same thing
with the same provider under different local aliases. Check to see if
the provider also contains an alias, or is defined absolutely in some
other way. The absolute accuracy here isn't critical, since in most
cases these edges are not required for correct results, but finding a
correct and consistent method for determining when these edges are
needed is going to take more research.

There was also an oversight fixed here where the basic
creator->destroyer edges were added _after_ the cycle checks, limiting
their utility. The ordering of the additions was swapped to make sure
all cycles are noticed.
2022-10-04 10:58:36 -04:00
James Bardin
162b7274fa
Merge pull request #31914 from hashicorp/jbardin/ignore-all-legacy
special handling for legacy `ignore_changes = all`
2022-10-04 10:57:23 -04:00
Sarah French
65b531c416
Update CHANGELOG.md 2022-10-04 10:14:45 +01:00
Sarah French
d43ec0f30f
Add customer-managed encryption key (KMS) support to GCS backend (#31786)
* Add ability to use customer-managed KMS key to encrypt state, add acceptance tests

* Change test names for different encrpytion methods

* Commit files updated by `go mod tidy`

* Add guard against missing ENVs to `setupKmsKey` func

* Update KMS setup function to get credentials from ENVs

* Update tests to not include zero-values in config

This means that default values are supplied later by TF instead of supplied as config from the user

This also avoids issues related to making field conflicts explicit with `ConflictsWith`

* Make `encryption_key` & `kms_encryption_key` conflicting fields

Removing the Default from `encryption_key` does not appear to be a breaking change when tested manually

* Add ability to set `kms_encryption_key` via ENV

* Refactor `encryption_key` to use `DefaultFunc` to access ENV, if set

* Remove comments

* Update `gcs` backend docs & descriptions in schema

* Update `gcs` backend docs to include information on encryption methods

* Apply technical writing suggestions from code review

Co-authored-by: Matthew Garrell <69917312+mgarrell777@users.noreply.github.com>

* Update documentation to remove passive voice

* Change use of context in tests, add inline comment, update logs

* Remove use of `ReadPathOrContents` for new field

Co-authored-by: Matthew Garrell <69917312+mgarrell777@users.noreply.github.com>
2022-10-04 10:10:49 +01:00
Craig Wright
e7fb895c46
Merge pull request #31876 from zisom-hc/patch-1
Update custom-conditions.mdx
2022-10-03 16:28:01 -07:00
James Bardin
fcec9e2c4f
Merge pull request #31902 from hashicorp/jbardin/noop-deposed
Prevent errors from NoOp deposed changes
2022-10-03 12:10:54 -04:00
James Bardin
f78ecef5e7 prevent errors from NoOp deposed changes
If a previously deposed object is deleted outside of Terraform, the
next plan will result in a NoOp change for the deposed object. Fix the
check to verify that the deposed object has an acceptable action rather
than use the `update` flag.
2022-10-03 09:24:23 -04:00
Martin Atkins
0803ea3f4a
Update CHANGELOG.md 2022-09-30 09:57:17 -07:00
Martin Atkins
f260ed1177 website: Remove warning that yamlencode is experimental
We originally included this warning because the go-cty-yaml module wasn't
yet stable and it was also not extensively tested so it wasn't yet clear
if its behavior would need to change in some less common cases we hadn't
tested so far.

However, go-cty-yaml had its v1.0.0 release some time ago and is now
committed to preserving its current Marshal output unless it is found to
be non-compliant with the YAML 1.2 specification. This doc change means
that Terraform's yamlencode is now adopting a similar posture:
 - The exact style details produced by the function for a particular input
   are now frozen. It'll change only if we find that the function is
   producing output that isn't valid per the YAML spec.
 - If someone finds a YAML parser that cannot parse what yamlencode
   produces but what it produces is valid per the YAML 1.2 spec, we'll
   expect the parser to be corrected to better support the spec rather
   than changing the yamlencode output.

There may be pragmatic exceptions if we encounter a situation we cannot
anticipate yet, but the above will be our general rule. This is really
just a specialization of the spirit of the v1.x Compatibility Promises,
tailored specifically to this function.
2022-09-30 09:08:12 -07:00
James Bardin
92f3a83530 special handling for legacy ignore_changes = all
Legacy providers expect Terraform to be able to clean up invalid plans
and computed attributes. Add a special case for the LegacyTypeSystem to
revert `ignore_changes = all` to the complete prior state.
2022-09-30 09:19:29 -04:00
Jamie Finnigan
f133b06dee go get -u golang.org/x/net 2022-09-29 17:28:33 -07:00
Martin Atkins
6b290cf163 core: Don't re-register checkable outputs during the apply step
Once again we're caught out by sharing the same output value node type
between the plan phase and the apply phase. To allow for some slight
variation between plan and apply without drastic refactoring here we just
add a new flag to nodeExpandOutput which is true only during the planning
phase.

This then allows us to register the checkable objects only during the
planning phase and not incorrectly re-register them during the apply phase.
It's incorrect to re-register during apply because we carry over the
planned checkable objects from the plan phase into the apply phase so we
can guarantee that the final state will have all of the same checkable
objects that the plan did.

This avoids a panic during the apply phase from the incorrect duplicate
registration.
2022-09-29 08:23:51 -07:00
kmoe
62d22a9406
Update CHANGELOG.md 2022-09-29 13:39:13 +01:00
Radek Simko
196ff4c5c5
providercache: Improve installation error message (#31898) 2022-09-29 13:37:04 +01:00
James Bardin
8c98e1f4a4
Merge pull request #31747 from hashicorp/jbardin/ignore-changes-all-computed
filter computed attrs from `ignore_changes=all`
2022-09-28 09:27:34 -04:00
Sarah French
a29fefbec7
Update codeowner of gcs backend to include Strategic Integrations team (#31848)
* Update codeowner of gcs backend to SI team

* Update CODEOWNERS of gcs backend
2022-09-27 21:38:52 +01:00
zisom-hc
d08fcd63db
Update custom-conditions.mdx
Made a change to code example within the *Preconditions and Postconditions* section so that it technically makes sense; prior it was missing the data resource that was being called within the precondition lifecycle event on line 135, and the aws_instance resource was not utilizing the ami being provided by the data source in line 129, so i changed that as well.
2022-09-26 14:53:47 -07:00
Martin Atkins
cc964e6b0b core: Document that TransformRoot must produce coalescable node
We use a non-pointer value for this particular node, which means that
there can never be two root nodes in the same graph: the graph
implementation will just coalesce them together when a second one is added.

Our resource expansion code is relying on that coalescing so that it can
subsume together multiple graphs for different modules instances into a
single mega-graph with all instances across all module instances, with
any root nodes coalescing together to produce a single root.

This also updates one of the context tests that exercises resource
expansion so that it will generate multiple resource instance nodes per
module and thus potentially have multiple roots to coalesce together.
However, we aren't currently explicitly validating the return values from
DynamicExpand and so this test doesn't actually fail if the coalescing
doesn't happen. We may choose to validate the DynamicExpand result in a
later commit in order to make it more obvious if future modifications fail
to uphold this invariant.
2022-09-26 13:46:25 -07:00
Martin Atkins
2e177cd632 core: Eliminate NodePlannableResource indirection
We previously did two levels of DynamicExpand to go from ConfigResource to
AbsResource and then from AbsResource to AbsResourceInstance.

We'll now do the full expansion from ConfigResource to AbsResourceInstance
in a single DynamicExpand step inside nodeExpandPlannableResource.

The new approach is essentially functionally equivalent to the old except
that it fixes a bug in the previous implementation: we will now call
checkState.ReportCheckableObjects only once for the entire set of
instances for a particular resource, which is what the checkable objects
infrastructure expects so that it can always mention all of the checkable
objects in the check report even if we bail out partway through due to
a downstream error.

This is essentially the same code but now turned into additional methods
on nodeExpandPlannableResource instead of having the extra graph node
type. This has the further advantage of this now being straight-through
code with standard control flow, instead of the unusual inversion of
control we were doing before bouncing in and out of different Execute and
DynamicExpand implementations to get this done.
2022-09-26 13:46:25 -07:00
Martin Atkins
a9bd4099d3 core: DynamicExpand can return diagnostics
We were previously _trying_ to handle diagnostics here but were not quite
doing it right because we were testing whether the resulting error was
nil rather than appending it to the diagnostics and then seeing if the
result has errors.

The difference here is important because it allows DynamicExpand to return
warnings without associated errors when needed. Previously the graph
walker would treat a warnings-only result as if it were an error.

Ideally we'd change DynamicExpand to return diagnostics directly, but we
previously decided against that because there were so many implementors
to update, and my intent for this change is to be surgical in the update
so we minimize risk of backporting the change into patch releases.
2022-09-26 13:46:25 -07:00
James Bardin
dbaf6d63f3
Merge pull request #31871 from hashicorp/jbardin/remove-planned-during-import
RemovePlannedResourceInstanceObjects during import
2022-09-26 14:24:23 -04:00