Commit Graph

47 Commits

Author SHA1 Message Date
Alisdair McDiarmid f9fc47c22e website: Add documentation for machine readable UI
Terraform 0.15.3 added support for a `-json` flag to the plan, apply,
and refresh commands, which renders the Terraform UI output in a
structured machine readable format. This commit adds documentation for
this interface.
2021-05-25 16:01:32 -04:00
Alisdair McDiarmid a5b7394f9a command/jsonplan: Add replace_paths
The set of paths which caused a resource update to require replacement
has been stored in the plan since 0.15.0 (#28201). This commit adds a
simple JSON representation of these paths, allowing consumers of this
format to determine exactly which paths caused the resource to be
replaced.

This representation is intentionally more loosely encoded than the JSON
state serialization of paths used for sensitive attributes. Instead of a
path step being represented by an object with type and value, we use a
more-JavaScripty heterogenous array of numbers and strings. Any
practical consumer of this format will likely traverse an object tree
using the index operator, which should work more easily with this
format. It also allows easy prefix comparison for consumers which are
tracking paths.

While updating the documentation to include this new field, I noticed
that some others were missing, so added them too.
2021-05-04 16:51:51 -04:00
Martin Atkins b802237e03 plans: Track an optional extra "reason" for some planned actions
Previously we were repeating some logic in the UI layer in order to
recover relevant additional context about a change to report to a user.
In order to help keep things consistent, and to have a clearer path for
adding more such things in the future, here we capture this user-facing
idea of an "action reason" within the plan model, and then use that
directly in order to decide how to describe the change to the user.

For the moment the "tainted" situation is the only one that gets a special
message, matching what we had before, but we can expand on this in future
in order to give better feedback about the other replace situations too.

This also preemptively includes the "replacing by request" reason, which
is currently not reachable but will be used in the near future as part of
implementing the -replace=... plan command line option to allow forcing
a particular object to be replaced.

So far we don't have any special reasons for anything other than replacing,
which makes sense because replacing is the only one that is in a sense
a special case of another action (Update), but this could expand to
other kinds of reasons in the future, such as explaining which of the
few different reasons a data source read might be deferred until the
apply step.
2021-04-29 17:50:46 -07:00
Rachel Sharp 56483d10d2
Update debugging.html.md 2021-04-19 12:18:02 -04:00
Paddy 0b5c4a6a2c
Accept TF_LOG=json to enable TRACE logs in JSON format
This is not currently a supported interface, but we plan to release
tool(s) that consume parts of it that are more dependable later,
separately from Terraform CLI itself.
2021-03-16 14:59:15 -07:00
Nick Fagerlund d1e8537b33 website: CLI: Update links to moved docs pages 2021-01-22 12:22:21 -08:00
Nick Fagerlund a8332703c9 website: CLI: Move docs files to match new URLs 2021-01-22 12:22:21 -08:00
Nick Fagerlund 7a8dd326c6 website: Language: Update links to moved pages 2021-01-22 12:22:21 -08:00
Nick Fagerlund 85d477aee9 website: Fix numerous links with redirects or broken anchors
These links largely still go somewhere useful, but they have some kind of issue
revealed by our new link checker:

- Some of them point to a stale URL that redirects, and can be updated to the
  new destination.
- Some of them point to anchors that don't exist (anymore?) in the destination.
- Some of them end up redirecting unnecessarily due to how the server handles
  directory URLs without trailing slashes. Sorry, I know that's pointless, just,
  humor me for the time being so we can get our CI green. 😭

In a couple cases, I've added invisible anchors to destination pages, either to
preserve an old habit or because the current anchors kind of suck due to being
particularly long or meandering.
2020-12-17 12:23:50 -08:00
Martin Atkins 7ccaee1018 website: Fix inconsistencies in the registry protocol page
Some hasty, incorrect merge conflict fixing caused this page to have a
strange mix of terminology between "system" and "provider". Along with
that, there were also several editorial errors caused by text on this
page having originally been derived from the provider registry
documentation.

This documentation will now consistently talk about being a module
registry protocol rather than a provider registry protocol, and it will
consistently use the term "system" as a generic term for the final part
of the module source address, aside from noting that there is an optional
convention to name it after the "type" part of an official provider when
possible.
2020-11-16 10:06:27 -08:00
Andrew Fitzgerald 8c82b3f6a0 Remove 'system' references from module registry protocol docs. 2020-11-16 10:01:03 -08:00
alevinetx 66393bb62e
website: Update module-registry-protocol.html.md (#26639)
* Update module-registry-protocol.html.md

1: There is a mismatch in the segment labels for the version query URL (system vs provider)
2: There is a discrepancy between the documentation and the actual generated request for retrieving module source code (URL segments 4 vs 3)
 - There is no segment for "provider"

* Update module-registry-protocol.html.md

Changed ```:system``` to ```:provider``` for versions and source API URLs
2020-10-28 09:09:52 -04:00
Martin Atkins ddf9635af6 website: Don't claim that things are "very easy"
We typically try to avoid making subjective, boasty claims in our
documentation in recent times, but there remained both some older
documentation that we've not recently revised and also some newer examples
that are, in retrospect, also perhaps more "boasty" than they need to be.

We prefer not to use this sort of boasty language because not everyone
using Terraform has the same background and experience, and so what is
"easy" or "intuitive" to one person may not be so to another person, and
that should not suggest that the second person is in any way wrong or
inadequate.

In reviewing some of our use of the word "easy" here I tried as much as
possible to surgically revise the existing content without getting drawn
into a big rewrite, but in some cases the content was either pretty
unsalvageable (due to talking about obsolete features that were removed
long ago) or required some broader changes to make the result hopefully
still get the same facts across. In those cases I've both removed some
content entirely or adjusted larger paragraphs.

This was not an exhaustive review and so I'm sure there's still plenty of
room for similar improvements elsewhere. I also resisted the urge to
update some pages that contain outdated information about currently-active
features.
2020-10-26 10:02:38 -07:00
James Bardin eb2d4434c8 logging env variable docs 2020-10-23 12:46:32 -04:00
Alisdair McDiarmid aa8c73cd18 website: Credentials helper response for no creds
For a credentials helper plugin to be useful with Terraform 0.13+, we
need to cope with the case of having no credentials for a host without
this being an error. This is to allow the public Terraform Registry to
be accessed without supplying a token.

The way to implement this is to respond to queries for credentials for a
host which has no credentials stored with an empty object and a success
exit code. This contradicts the previous documentation, which calls for
an error response in this case.
2020-09-15 09:00:44 -04:00
Martin Atkins 2bd2a9a923 internal/getproviders: HTTPMirrorSource implementation
We previously had this just stubbed out because it was a stretch goal for
the v0.13.0 release and it ultimately didn't make it in.

Here we fill out the existing stub -- with a minor change to its interface
so it can access credentials -- with a client implementation that is
compatible with the directory structure produced by the
"terraform providers mirror" subcommand, were the result to be published
on a static file server.
2020-08-26 13:18:08 -07:00
Nick Fagerlund 2ffb71bcee
website: Fix several broken links (#25808) 2020-08-11 15:24:51 -07:00
Nick Fagerlund 0e5651560b
Website: 0.13 docs edits, mostly around provider requirements (#25686)
* Make sidebar nav in language docs more intuitive
* Minor display fixes for registry docs
* Explain providers in the registry in the providers index
* Revise a bunch of language docs around provider reqs

This is mostly an effort to smooth out some of the explanations, make sure
things are presented in a helpful order, make sure terminology lines up, draw
connections between related concepts, make default behavior more apparent, and
the like. It shouldn't include very much new information, but there might be one
or two things that came out of a conversation somewhere.

Co-authored-by: Judith Malnick <judith@hashicorp.com>
2020-07-30 21:07:36 -07:00
Pam Selle 9cf5a18532
Merge pull request #25238 from HadrienPatte/fix-json-output-format-docs
Fix JSON output format documentation
2020-07-01 15:08:02 -04:00
Nick Fagerlund b1eb9dcfcf website: Configuration Language navigation refactoring
The "Configuration Language" section was becoming rather unweildy, both
by having a lot of pages and by some of the pages being quite large in
themselves.

This is a first step towards breaking things up a little more, starting
with two changes:

 - The "Configuration Language" navigation is now split into two
   sub-headings "Configuration Blocks" and "Syntax".

 - Some of the information about sub-blocks of the "terraform" block are
   now given their own pages, because their content is quite complex
   in itself.

 - "Version Constraints" is now a page in its own right, rather than this
   content being duplicated in slightly different forms across multiple
   contexts that make use of user-specified version constraints.
2020-06-18 09:31:52 -07:00
Hadrien Patte 4dea1bb5a0
Fix JSON output format documentation 2020-06-13 02:04:50 -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
Pam Selle 146644a848 update addressing section 2020-04-13 12:13:18 -04:00
Pam Selle 65c4ba9c85 First docs for count/for_each on modules 2020-04-10 15:14:06 -04:00
Paddy e6592dc710
Add support for provider metadata to modules. (#22583)
Implement a new provider_meta block in the terraform block of modules, allowing provider-keyed metadata to be communicated from HCL to provider binaries.

Bundled in this change for minimal protocol version bumping is the addition of markdown support for attribute descriptions and the ability to indicate when an attribute is deprecated, so this information can be shown in the schema dump.

Co-authored-by: Paul Tyng <paul@paultyng.net>
2020-03-05 16:53:24 -08:00
Martin Atkins 778f1ab138
website: Documentation for the "terraform login" command (#22727)
Co-authored-by: Alisdair McDiarmid <alisdair@users.noreply.github.com>
2020-02-04 11:30:40 -05:00
Brian Flad cea149340c
docs/internal/resource-addressing: Omit for_each full splat example for now 2019-08-08 08:56:57 -04:00
Brian Flad 720b062d55
Apply suggestions from code review
Co-Authored-By: Nick Fagerlund <nick@hashicorp.com>
2019-08-08 08:54:40 -04:00
Brian Flad 3ad05e50a4
docs/internal/resource-addressing: Add for_each information 2019-08-02 19:38:13 -04:00
Martin Atkins 04f3766fd9 website: Indicate v0.12-only content
We have released the v0.12-oriented content to the website early in order
to support the beta process, but in some places we neglected to explicitly
mark features or content as being v0.12-only.

Here we add explicit markers to the main cases we've seen where readers
have reported confusion, along with some other tweaks in similar vein.
2019-03-18 12:42:21 -07:00
Nick Fagerlund 79c2fd2f3a website: rename expressions-representation to block-expressions-representation 2019-02-21 14:00:58 -08:00
Kristin Laemmert 2aef47d01d website: clarify format_version 2019-02-21 12:07:06 -08:00
Nick Fagerlund 3c42508700
Apply suggestions from code review
Co-Authored-By: mildwonkey <mildwonkey@users.noreply.github.com>
2019-02-21 11:52:08 -08:00
Nick Fagerlund 883d587734 website: ACTUALLY fix indentation issues in config rep
There was an issue with some hardtabs, I think.
2019-02-21 11:02:33 -08:00
Nick Fagerlund 4a19b53b55 website: Fix confusing indentation issues in configuration representation 2019-02-20 18:49:06 -08:00
Nick Fagerlund 92e609c98b website: Revise json format doc 2019-02-20 18:40:44 -08:00
Nick Fagerlund c2979e7278 website: fix JSON typo (resources is array of objects) 2019-02-20 18:40:44 -08:00
Nick Fagerlund ff47cab8c7 website: Fix JSON typo (child_modules is array) 2019-02-20 18:40:39 -08:00
Nick Fagerlund f6c5e33c00 website: fix highlighting and line breaks 2019-02-20 18:40:39 -08:00
Kristin Laemmert a43004e382 website/docs: add detailed documentation for the json serialization of
terraform plan
2019-02-14 14:20:54 -08:00
Chris Doherty 71c79522c6 website: Add docs/internals/archiving.html to describe the archiving process. (#18831)
Add docs/internals/archiving.html to describe the archiving process.
2018-09-10 17:32:43 -07:00
Brian Flad 9b295e2bc7 docs/internal: Fix sidebar navigation for Remote Service Discovery page 2018-03-13 12:49:49 -04:00
Martin Atkins 4fa2b8c519 website: updated docs for the module registry protocol
Now includes more complete information on usage of private registries and
updates the module registry API documentation to include the new
version-enumeration endpoint along with describing Terraform's discovery
protocol.
2017-11-01 07:22:20 -07:00
Martin Atkins 93651450b1 website: don't talk about graphs in the Getting Started guide
Previously we just assumed the reader was familiar with the idea of a
graph but didn't explain it.

Since graphs are an implementation detail of Terraform, rather than
essential information needed for new users, this revises the introduction
text to talk only about _dependencies_, which we assume the user is
familiar with as a more practical concept.

Additionally, Paul Hinze did a great talk on how Terraform uses graphs
at HashiConf 2016 which is good additional content for our existing
"Graph Internals" page, which includes a concise explanation of the
basics of graph theory.
2017-09-11 11:09:11 -07:00
Martin Atkins 7ed70bb00e website: new filesystem layout for core/provider split
This repo now contains only the core docs, with other content moving elsewhere.
2017-06-13 11:25:32 -07:00