In order to ensure that transitive dependencies are connected even when
there are no instances for a resource, we need to route the references
through the config ("expand") node. This happens naturally by having the
expand node report its config references, however legacy configs can
contain self-referenced without the "self" identifier, so those need to
be filtered out.
* Add test structure to views package for rendering test output
* Add test file HCL configuration and parser functionality
* Adds a TestContext structure for evaluating assertions against the state and plan
* Add test command to Terraform CLI
* Add test structure to views package for rendering test output
* Add test file HCL configuration and parser functionality
* Adds a TestContext structure for evaluating assertions against the state and plan
Several parts of the objchange logic incorrectly use cty.Value.RawEquals
for value comparison, instead of more appropriate comparison methods like
cty.Value.Equals or c.Value.Range().Includes. That makes them incorrectly
consider two unknown values with the same type but different refinements
as always non-equal, rather than evaluating based on the overlap between
the refinements (if any).
As a short-term fix for that we previously added this unrefinedValue shim
that just strips away the refinements for comparison, thus allowing
callers to continue using RawEquals as long as they've already taken care
of all of the other things that can make that go wrong, such as value
marks.
Unfortunately the shim was too simplistic and only supported direct
unknown values. Unknown values with refinements can also appear nested
inside known container values such as collections, so the shim needs to
recursively un-refine the entire data structure in that case.
This is still intended only as a temporary fix until we have time to
revisit all of the callers and make them use cty's own logic for
comparison. Using cty's own logic will make the results more precise,
because e.g. it can notice if two unknown strings have different known
prefixes and therefore cannot possibly be equal despite not being fully
known. For now this shim will accept any pair of unknown values of the
same type as equal, regardless of refinement.
* Reinstate the accidentally deleted experimental testing page
* try removing nav reference as it is hidden anyway
* try nesting the nav reference?
* try nesting with the other module pages
Create a pending state version followed by a separate state upload
When this version of the endpoint fails (It is not yet generally available, or when using with Terraform Enterprise) Fall back to the original call with state content included in the request.
This strategy will reduce the amount of save failures due to network latency and gateway timeouts.
If a set contains partially known values the length is unknown which
causes assertPlannedObjectValid to fail valid plans.
Revert to the old method if using LengthInt for the set lengths, which
returns the maximum number of possible elements, with a guard for
entirely unknown set values.
* website: plannable import docs
* website: config gen docs
* Update website/docs/cli/commands/plan.mdx
Co-authored-by: Rose M Koron <32436232+rkoron007@users.noreply.github.com>
* Update website/docs/cli/import/index.mdx
Co-authored-by: Rose M Koron <32436232+rkoron007@users.noreply.github.com>
* Update website/docs/language/import/index.mdx
Co-authored-by: Rose M Koron <32436232+rkoron007@users.noreply.github.com>
* Update website/docs/language/import/index.mdx
Co-authored-by: Rose M Koron <32436232+rkoron007@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: Rose M Koron <32436232+rkoron007@users.noreply.github.com>
* fix docs rendering
* Apply suggestions from code review
Co-authored-by: Rose M Koron <32436232+rkoron007@users.noreply.github.com>
* link again to import blocks
* fix genconfig example plan output
* Update website/docs/language/import/index.mdx
Co-authored-by: Rose M Koron <32436232+rkoron007@users.noreply.github.com>
* add import resource config example
* Apply suggestions from code review
Co-authored-by: Rose M Koron <32436232+rkoron007@users.noreply.github.com>
* attempt to fix nav
* more explicit
* fix build?
* remove pseudo tutorial
* add advice on when to gen
* add note on idempotency
* Apply suggestions from code review
Co-authored-by: Rose M Koron <32436232+rkoron007@users.noreply.github.com>
Co-authored-by: Alan Szlosek Jr <alan.szlosek@hashicorp.com>
* refer to cli cmd in usual way
* more explanation for genconfig
* remove unnecessary sentence
* add heading
* update help text
* Apply suggestions from code review
Co-authored-by: Rose M Koron <32436232+rkoron007@users.noreply.github.com>
* update link
* add import ID section
* Apply suggestions from code review
Co-authored-by: rita <8647768+ritsok@users.noreply.github.com>
Co-authored-by: Rose M Koron <32436232+rkoron007@users.noreply.github.com>
* Apply suggestions from code review
Co-authored-by: rita <8647768+ritsok@users.noreply.github.com>
Co-authored-by: Rose M Koron <32436232+rkoron007@users.noreply.github.com>
* dial back didacticism
* clarify genconfig instructions
* explicit explanation of arg conflict
* Apply suggestions from code review
Co-authored-by: rita <8647768+ritsok@users.noreply.github.com>
Co-authored-by: Rose M Koron <32436232+rkoron007@users.noreply.github.com>
* clarify import block required for genconfig
---------
Co-authored-by: Rose M Koron <32436232+rkoron007@users.noreply.github.com>
Co-authored-by: Alan Szlosek Jr <alan.szlosek@hashicorp.com>
Co-authored-by: rita <8647768+ritsok@users.noreply.github.com>