Commit graph

332 commits

Author SHA1 Message Date
Radek Simko
fcfbfb3eff
website: ensure for_each examples take maps (#34675) 2024-02-28 08:58:17 +00:00
Eloi Perdereau
30505dd1bf
website docs: fix "Block Representation" for provider schema -json (#34653)
* website docs: fix "Block Representation" for `provider schema -json`

* Update website/docs/cli/commands/providers/schema.mdx

---------

Co-authored-by: Radek Simko <radeksimko@users.noreply.github.com>
2024-02-12 16:43:09 +00:00
Daniel Schmidt
18796d0dea
chore: clarify wording
Co-authored-by: Liam Cervante <liam.cervante@hashicorp.com>
2024-02-12 14:54:38 +01:00
Daniel Schmidt
6f76d2077a
chore: improve wording 2024-02-12 14:09:23 +01:00
Daniel Schmidt
3e2291ae36
document -enable-plugin-cache flag 2024-02-09 10:21:31 +01:00
Brian Flad
3b4964270f
internal/command/jsonprovider: Remove root jsonfunction object from function output (#34536)
Previously, the `providers schema -json` output would include the root object from `metadata functions -json`. This object had its own `format_version` property, which would be confusing with the root `format_version` property already present.

This change still uses the `jsonfunction` package for consistency between cty and provider function JSON handling, but removes that extra object, instead making `functions` directly a mapping of names to signatures/definitions. This also adds a code comment to hint maintainers that jsonprovider format versioning is tied to jsonfunction format versioning.

Example output prior to change:

```jsonc
{
  "format_version": "1.0",
  "provider_schemas": {
    "registry.terraform.io/bflad/framework": {
      // ...
      "functions": {
        "format_version": "1.0",
        "function_signatures": {
          "example": {
            "description": "Echoes given argument as result",
            "summary": "Example function",
            "return_type": "string",
            "parameters": [
              {
                "name": "input",
                "description": "String to echo",
                "type": "string"
              }
            ]
          }
        }
      }
    }
  }
}
```

Example output after change:

```jsonc
{
  "format_version": "1.0",
  "provider_schemas": {
    "registry.terraform.io/bflad/framework": {
      // ...
      "functions": {
        "example": {
          "description": "Echoes given argument as result",
          "summary": "Example function",
          "return_type": "string",
          "parameters": [
            {
              "name": "input",
              "description": "String to echo",
              "type": "string"
            }
          ]
        }
      }
    }
  }
}
```
2024-01-18 15:48:07 -05:00
Brian Flad
1298fcd412
Add missing function deprecation_message to JSON output and website documentation (#34520)
Reference: https://github.com/hashicorp/terraform/pull/34450
2024-01-12 14:49:38 -05:00
Brandon Croft
48aed874f8
Bump go-slug to 0.13.3 and add .terraformignore guidelines 2023-12-14 09:22:12 -07:00
kmoe
56bf889093
website: removed block docs (#34339)
* website: removed block docs

* website: link to removed block from state rm
2023-12-06 10:15:36 +00:00
Martin Atkins
7055650270 terraform console: Option to evaluate in a planned state
Previously "terraform console" always evaluated in a kinda strange context
where resource instance data comes from the prior state, but other derived
of values end up being calculated dynamically based on the current
configuration, which is okay for simple cases but can be confusing if the
configuration has changed significantly since the most recent apply, or
if there haven't yet been any applied changes.

Now we'll allow an optional new mode where Terraform runs the normal plan
phase (as if running "terraform plan") and then uses the resulting
_planned state_ as the basis for evaluation, allowing evaluation against
a partial approximation of what the world ought to look like if these
changes were applied, without having to actually apply them first.

As with the previous use of the eval walk, it's possible that an erroneous
situation will still produce a partial evaluation scope, and so the
console still allows evaluation against that scope but with a caveat that
it might produce unexpected results. In practice this can be useful for
debugging situations like when unknown values block planning of an object,
to allow inspection of the values that are contributing to that blocked
planning operation even though the plan is not yet complete.
2023-12-01 14:35:54 -08:00
Martin Atkins
844b1616e8 command/graph: Simpler resource-only graph by default
Unless a user specifically requests a real operation graph using the
-type option, we'll by default present a simplified graph which only
represents the relationships between resources, since resources are the
main side-effects and so the ordering of these is more interesting than
the ordering of Terraform's internal implementation details.
2023-11-28 13:48:48 -08:00
Liam Cervante
1974c9ec16
docs: add explicit instruction for windows filepaths (#34193)
* docs: add explicit instruction for windows filepaths

* fix you/we/Terraform usage
2023-11-10 09:12:54 +01:00
Craig Wright
e1481b13e7
Merge pull request #33566 from Frankkkkk/patch-1 2023-10-19 11:50:22 -07:00
Frank Villaro-Dixon
f01d08f6e9 website: doc: fmt: specify "no flag" action
Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
2023-10-19 18:33:55 +02:00
George Mauer
821b7ce750
Fix typos using wrong words 2023-10-09 08:37:49 -05:00
Radek Simko
1d1dcc4b8b
cloud: Fix typo & align 'project' field description (#33946) 2023-10-03 16:10:35 +01:00
Liam Cervante
e52dbbb519 Fix typo in login link from test command doc page 2023-09-14 11:42:08 +02:00
Liam Cervante
5756a4af09
Add cloud-run documentation for testing framework (#33875)
* Add cloud-run documentation for testing framework

* Apply suggestions from code review

Co-authored-by: Rose M Koron <32436232+rkoron007@users.noreply.github.com>

* resolve last comment

---------

Co-authored-by: Rose M Koron <32436232+rkoron007@users.noreply.github.com>
2023-09-14 08:16:47 +02:00
Liam Cervante
487eeda94e
[testing framework] Add documentation (#33454)
* [terraform test] add docs

* Apply suggestions from code review

Co-authored-by: Rose M Koron <32436232+rkoron007@users.noreply.github.com>

* polish remaining comments

* Apply suggestions from code review

Co-authored-by: Rose M Koron <32436232+rkoron007@users.noreply.github.com>

* address remaining comments

* typo

* update verbose machine readable docs

* standardise new JSON field names

---------

Co-authored-by: Rose M Koron <32436232+rkoron007@users.noreply.github.com>
2023-08-31 11:45:52 +02:00
Karl Kirch
d7e07e66fc
Add ability to specify Terraform Cloud Project in cloud block (#33489)
* Add ability to specify Terraform Cloud Project in cloud block

Adds project configuration to the workspaces section of the cloud block.
Also configurable via the `TF_CLOUD_PROJECT` environment variable.
When a project is configured, the following behaviors will occur:
- `terraform init` with workspaces.name configured will create the workspace in the given project
- `terraform workspace new <name>` with workspaces.tags configured will create workspaces in the given project
- `terraform workspace list` will list workspaces only from the given project

The following behaviors are NOT affected by project configuration
- `terraform workspace delete <name>` does not validate the workspace's inclusion in the given project
- When initializing a workspace that already exists in Terraform Cloud, the workspace's parent project is NOT validated against the given project

Adds tests for cloud block configuration of project
Update changelog

* Update cloud block docs

* Fix typos and changelog entry

* Add speculative project lookup early in the cloud initialize process to capture inability to find a configured project

* Add project config for alias test
2023-08-01 13:43:07 -07:00
Jason Murray
4c8e560120
Update get CLI docs 2023-07-13 09:35:07 -07:00
Jonathan Matthews
43a8bc06f0
Update environment-variables.mdx 2023-06-12 10:32:53 +01:00
kmoe
991d6f3f1f
website: plannable import docs (#33266)
* 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>
2023-06-09 15:14:42 +01:00
Rose M Koron
2a49d4b784
Merge pull request #32539 from cmaritan/patch-1
DOC: Update supported options of command graph -type=...
2023-05-11 18:01:25 -07:00
Rose M Koron
2eb7fe3b5e
Update website/docs/cli/commands/graph.mdx 2023-05-11 17:13:16 -07:00
Stef Ki
719c5854bb
Update fmt.mdx to include missing period / full stop 2023-05-10 11:45:12 +02:00
Victoria Mann
39667b77b8
Update command to match /cli/commands/taint -replace cmd
Update documentation to match the documentation on the deprecated taint command in /cli/commands/taint.
2023-05-06 17:01:55 -04:00
Rose M Koron
9d815ea727
Merge pull request #32058 from coreyti/patch-1
tiny update to Resource Addressing: "value4"
2023-05-05 16:22:02 -07:00
Rose M Koron
7bc8014f22
Merge pull request #31992 from philomory/patch-1
[docs] Add warning about prefix loss when migrating
2023-05-05 16:12:36 -07:00
Rose M Koron
9ad521eac6
Update website/docs/cli/cloud/migrating.mdx 2023-05-05 16:05:45 -07:00
Matt Smith
2a2e1904ea
Document new -or-create flag. 2023-04-11 13:52:59 +02:00
CJ Horton
2738dc206e update apt install instructions 2023-04-03 13:31:53 -07:00
Craig Wright
bd75dade9c
Merge pull request #32884 from DocAdam/patch-2 2023-03-20 16:44:34 -07:00
Adam Pugh
3b4207a146
Spelling update
updated: configuratation to configuration
2023-03-19 07:14:06 -05:00
Christopher Hackett
493973d6da
Correct docs on Configuration Directory
The option was removed in v0.15 and so is no-longer "plan[ed]" https://newreleases.io/project/github/hashicorp/terraform/release/v0.15.0
2023-03-18 20:22:31 +00:00
Adam Pugh
f4c3611977
Update settings.mdx
updated misspelling to precedence
2023-03-17 11:05:07 -05:00
Alan Szlosek Jr
8ab72c249d
add docs meta descriptions (#32771)
* add docs meta descriptions

* cleanups

* remove old docs files

* Apply suggestions from code review

Co-authored-by: rita <8647768+ritsok@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: rita <8647768+ritsok@users.noreply.github.com>

* remove testing-experiment from nav data

---------

Co-authored-by: rita <8647768+ritsok@users.noreply.github.com>
2023-03-15 15:56:34 -04:00
Martin Atkins
2a1d98bc06 website: Document TF_PLUGIN_CACHE_MAY_BREAK_DEPENDENCY_LOCK_FILE env var
This is an alternative way to set the CLI configuration setting
plugin_cache_may_break_dependency_lock_file to activate the transitional
compatibility behavior that prefers to break the dependency lock file if
that would create an additional opportunity to use the plugin cache.
2023-03-06 17:17:48 -08:00
Ashlee Boyer
32f7b8ebd0 Migrating links to new format 2023-02-23 12:55:56 -05:00
Ashlee Boyer
c5d0bd40b9 Removing test comment 2023-02-23 12:55:35 -05:00
Ashlee Boyer
55f11d07b9 Adding comment for testing 2023-02-23 12:55:15 -05:00
Daniel Banck
4fa77727b5
Introduce metadata functions command (#32487)
* Add metadata functions command skeleton

* Export functions as JSON via cli command

* Add metadata command

* Add tests to jsonfunction package

* WIP: Add metadata functions test

* Change return_type & type in JSON to json.RawMessage

This enables easier deserialisation of types when parsing the JSON.

* Skip is_nullable when false

* Update cli docs with metadata command

* Use tfdiags to report function marshal errors

* Ignore map, list and type functions

* Test Marshal function with diags

* Test metadata functions command output

* Simplify type marshaling by using cty.Type

* Add static function signatures for can and try

* Update internal/command/jsonfunction/function_test.go

Co-authored-by: kmoe <5575356+kmoe@users.noreply.github.com>

---------

Co-authored-by: kmoe <5575356+kmoe@users.noreply.github.com>
2023-02-14 14:08:47 +00:00
Martin Atkins
e2380b1038 cliconfig: Allow forcing use of the plugin cache despite the lock file
Currently Terraform will use an entry from the global plugin cache only if
it matches a checksum already recorded in the dependency lock file. This
allows Terraform to produce a complete lock file entry on the first
encounter with a new provider, whereas using the cache in that case would
cause the lock file to only cover the single package in the cache and
thereefore be unusable on any other operating system or CPU architecture.

This temporary CLI config option is a pragmatic exception to support those
who cannot currently correctly use the dependency lock file but who still
want to benefit from the plugin cache. With this setting enabled,
Terraform has permission to produce a dependency lock file that is only
suitable for the current system if that would allow use of an existing
entry in the plugin cache.

We are introducing this option to resolve a conflict between the needs of
folks who are using the dependency lock file as expected and the needs of
folks who cannot use the dependency lock file for some reason. The hope
then is to give respite to those who need this exception in the meantime
while we understand better why they cannot use the dependency lock file
and improve its design so that everyone will be able to use it
successfully in a future version of Terraform. This option will become a
silent no-op in a future version of Terraform, once the dependency lock
file behavior is sufficient for all supported Terraform development
workflows.
2023-01-25 08:23:01 -08:00
Michele Degges
8f30e970d2
Remove references to old signing key 2023-01-23 14:26:19 -08:00
jerphi
9932642442 removed double negation 2023-01-14 18:17:39 +01:00
Claudio Maritan
2458007d25
DOC: Update options of command graph -type=... 2023-01-12 13:54:43 +01:00
Stefan Sundin
a4a1f47027 Add missing Ubuntu apt repositories jammy and kinetic to the list. 2022-12-16 21:57:26 -08:00
Laura Pacilio
1ce0b91e67
Merge pull request #32020 from hashicorp/fix-future-lang-2
Remove future-facing language from docs (WIP)
2022-11-29 15:09:21 -05:00
alisdair
ec6451a82a
Merge pull request #31999 from JarrettSpiker/jspiker/workspace-delete-rum-docs
Update workspace delete command docs to reference RUM vs empty state
2022-11-25 12:07:02 -05:00
Jarrett Spiker
1e1312fb78 Remove use of RUM acronymn in workspace delete docs 2022-11-22 15:10:58 -05:00