Commit graph

2409 commits

Author SHA1 Message Date
Jared Baker
b700911cda
Merge branch 'main' into s3/use_legacy_workflow-removal 2024-02-28 16:41:05 -05:00
Martin Atkins
9b57a43bde website: First draft of Terraform v1.8 upgrade guide
We may revise this further during the Terraform v1.8 prerelease period, if
feedback suggests that more information is needed or that this information
is not clear enough. The main goal here is just to get out of the confusing
situation where the v1.8 branch contains a v1.7 upgrade guide, so that
we can link to the upgrade guide from the changelog.

The full upgrade guide page gives us room for more details, allowing the
changelog to serve just as a concise list of changes.
2024-02-28 11:24:32 -08:00
Radek Simko
fcfbfb3eff
website: ensure for_each examples take maps (#34675) 2024-02-28 08:58:17 +00:00
Martin Atkins
573c2db658 provider/terraform: Terraform-specific encoding functions
Using the new possibility of provider-contributed functions, this
introduces three new functions which live in the
terraform.io/builtin/terraform provider, rather than being language
builtins, due to their Terraform-domain-specific nature.

The three new functions are:
 - tfvarsencode: takes a mapping value and tries to transform it into
   Terraform CLI's "tfvars" syntax, which is a small subset of HCL that
   only supports key/value pairs with constant values.
 - tfvarsdecode: takes a string containing content that could potentially
   appear in a "tfvars" file and returns an object representing the
   raw variable values defined inside.
 - exprencode: takes an arbitrary Terraform value and produces a string
   that would yield a similar value if parsed as a Terraform expression.

All three of these are very specialized, of use only in unusual situations
where someone is "gluing together" different Terraform configurations etc
when the usual strategies such as data sources are not suitable. There's
more information on the motivations for (and limitations of) each function
in the included documentation.
2024-02-27 16:13:48 -08:00
Craig Wright
42aa821194
Merge pull request #33969 from sorenisanerd/document-socks5-support
Document support for ssh over SOCKS5
2024-02-27 10:59:05 -08:00
Soren L. Hansen
80f748f6f6
Apply suggestions from code review
Co-authored-by: trujillo-adam <47586768+trujillo-adam@users.noreply.github.com>
2024-02-27 12:56:25 +01:00
Jared Baker
54866790ca
backend/s3: remove use_legacy_workflow argument
The `use_legacy_workflow` argument has been removed to encourage consistency with the AWS SDKs. The backend will now search for credentials in the same order as the default provider chain in the AWS SDKs and AWS CLI.
2024-02-23 10:37:08 -05:00
Daniel Schmidt
4915bdf90c
fix comment
Co-authored-by: Liam Cervante <liam.cervante@hashicorp.com>
2024-02-23 13:46:31 +01:00
Daniel Schmidt
ea0856bfe7
add a line of documentation to clarify 2024-02-23 11:39:37 +01: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
3211068f10
Merge pull request #34644 from hashicorp/document-provider-lock-using-cache
document `-enable-plugin-cache` flag
2024-02-12 15:08:36 +01: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
ae56655afe
chore: remove trailing whitespace from file path 2024-02-12 14:23:35 +01:00
Daniel Schmidt
6f76d2077a
chore: improve wording 2024-02-12 14:09:23 +01:00
Martin Atkins
884e1fb2a4 terraform: Plans can be "complete" and "applyable"
These ideas are both already implied by some logic elsewhere in the system,
but until now we didn't have the decision logic centralized in a single
place that could therefore evolve over time without necessarily always
updating every caller together.

We'll now have the modules runtime produce its own boolean ruling about
each characteristic, which callers can rely on for the mechanical
decision-making of whether to offer the user an "approve" prompt, and
whether to remind the user after apply that it was an incomplete plan
that will probably therefore need at least one more plan/apply round to
converge.

The "Applyable" flag directly replaces the previous method Plan.CanApply,
with equivalent logic. Making this a field instead of a method means that
we can freeze it as part of a saved plan, rather than recalculating it
when we reload the plan, and we can export the field value in our export
formats like JSON while ensuring it'll always be consistent with what
Terraform is using internally.

Callers can (and should) still use other context in the plan to return
more tailored messages for specific situations they already know about
that might be useful to users, but with these flags as a baseline callers
can now just fall back to a generic presentation when encountering a
situation they don't yet understand, rather than making the wrong decision
and causing something strange to happen. That is: a lack of awareness of
a new rule will now cause just a generic message in the UI, rather than
incorrect behavior.

This commit mostly just deals with populating the flags, and then all of
the direct consequences of that on our various tests. Further changes to
actually make use of these flags elsewhere in the system will follow in
later commits, both in this repository and in other repositories.
2024-02-09 09:24:27 -08:00
Daniel Schmidt
3e2291ae36
document -enable-plugin-cache flag 2024-02-09 10:21:31 +01:00
Daniel Schmidt
3a77065e69
add issensitive function
This function can be used to check if a value is marked as
sensitive or not within terraform.

Closes #34572
2024-02-05 16:45:21 +01:00
Tom Bamford
5c259226e6
docs: azurerm backend doc fixups 2024-01-31 13:28:08 +00:00
Jared Holgate
d9ccdfb7d1
docs: improve azurerm backend docs (#34564)
* Update azurerm backend docs

* Use support note notation

* Fix table format

* Tidy and enhance

* Tidy warnings

* Improvements

* Add comment to CLI option

* Add warnings

* Improve example resource names

* Follow convention for warning

* Update website/docs/language/settings/backends/azurerm.mdx

Co-authored-by: Luke Taylor <77284962+luke-taylor@users.noreply.github.com>

* Update website/docs/language/settings/backends/azurerm.mdx

Co-authored-by: Luke Taylor <77284962+luke-taylor@users.noreply.github.com>

* Update website/docs/language/settings/backends/azurerm.mdx

Co-authored-by: Luke Taylor <77284962+luke-taylor@users.noreply.github.com>

* Update website/docs/language/settings/backends/azurerm.mdx

Co-authored-by: Luke Taylor <77284962+luke-taylor@users.noreply.github.com>

* Update website/docs/language/settings/backends/azurerm.mdx

Co-authored-by: Luke Taylor <77284962+luke-taylor@users.noreply.github.com>

* Update website/docs/language/settings/backends/azurerm.mdx

Co-authored-by: Luke Taylor <77284962+luke-taylor@users.noreply.github.com>

* Update website/docs/language/settings/backends/azurerm.mdx

Co-authored-by: Luke Taylor <77284962+luke-taylor@users.noreply.github.com>

* Update website/docs/language/settings/backends/azurerm.mdx

Co-authored-by: Luke Taylor <77284962+luke-taylor@users.noreply.github.com>

* Update website/docs/language/settings/backends/azurerm.mdx

Co-authored-by: Luke Taylor <77284962+luke-taylor@users.noreply.github.com>

* Apply suggestions from code review

---------

Co-authored-by: Luke Taylor <77284962+luke-taylor@users.noreply.github.com>
Co-authored-by: Tom Bamford <tom@bamford.io>
2024-01-31 13:09:04 +00: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
Liam Cervante
ce16e1a68a
Complete upgrade guide for v1.7 (#34514)
* complete 1.7 upgrade guide

* also call out state interoperability

* Update website/docs/language/upgrade-guides/index.mdx

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

* actually fix dangling v1.6 references

---------

Co-authored-by: kmoe <5575356+kmoe@users.noreply.github.com>
2024-01-11 08:57:27 +01:00
Graham Davison
bf4f36a3b7 tabs vs spaces 2024-01-09 15:49:49 -08:00
Graham Davison
0ff0ad8ce4 Updates documentation on IAM permissions with workspaces 2024-01-09 13:24:19 -08:00
Graham Davison
86da6ef19a Adds section on storage locations 2024-01-09 12:56:11 -08:00
Graham Davison
02fadba041 Corrects path 2024-01-09 11:56:28 -08:00
Graham Davison
9d8ff095c0 Formatting 2024-01-09 11:55:42 -08:00
Brian McClain
35d6af0759
Test mocks docs fixes (#34435)
* Update example with valid bucket name

* quote alias name in provider block
2023-12-20 17:43:59 +00:00
Brandon Croft
2973d070b3
Merge pull request #34358 from hashicorp/brandonc/bump_go-slug_0.13.3
Bump go-slug to 0.13.3 and add .terraformignore guidelines
2023-12-14 13:38:31 -07:00
Pratik Thakare
98da7f49ce
Update website/docs/language/state/purpose.mdx
Co-authored-by: Rose M Koron <32436232+rkoron007@users.noreply.github.com>
2023-12-14 22:56:30 +05:30
Brandon Croft
48aed874f8
Bump go-slug to 0.13.3 and add .terraformignore guidelines 2023-12-14 09:22:12 -07:00
KryptoBlack
349c80b50c refact: removed ambiguous reference from purpose of terraform state 2023-12-14 10:38:53 +05:30
Graham Davison
29708f0784 Documents AWS_ENDPOINT_URL environment variable and endpoints configured in shared config files 2023-12-08 15:53:22 -08: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
Liam Cervante
5cbf7c5f96
Add docs for automatic var files in test directories (#34349) 2023-12-06 08:10:45 +01:00
Jared Baker
4729af3ccf
Merge pull request #34337 from hashicorp/s3/use_legacy_workflow-deprecation
backend/s3: default `use_legacy_workflow` to false, deprecate
2023-12-05 11:35:51 -05:00
James Bardin
60ab95d3a7
Merge pull request #34348 from hashicorp/jbardin/import-for-each-docs
add basic import for_each docs
2023-12-05 08:20:17 -05:00
James Bardin
4ae531c8a1 add basic import for_each docs 2023-12-05 08:12:37 -05:00
Craig Wright
5153465e00
Merge pull request #34311 from zhimsel/cidrhost-negative-docs 2023-12-04 15:33:14 -08:00
Craig Wright
9cb86ef1b9
Merge pull request #34299 from summera/custom-condition-doc-correction 2023-12-04 15:29:18 -08:00
Liam Cervante
89c1d06f05
Add documentation for the mocking functionality (#34198)
* Add documentation for the new mocking functionality

* add example for repeated blocks

* validate providers

* Apply suggestions from code review

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

* address comments

* tf fmt all examples

* edits

* fix typos

---------

Co-authored-by: kmoe <5575356+kmoe@users.noreply.github.com>
Co-authored-by: Brian McClain <brianmmcclain@gmail.com>
2023-12-04 17:53:22 +01:00
Jared Baker
38acde89e3
website: s3 backend upgrade guide for 1.7.0 2023-12-04 11:31:39 -05: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
Jared Baker
470a851e45
backend/s3: default use_legacy_workflow to false, deprecate
In Terraform 1.7 we'll begin phasing out the legacy credential chain evaluation order
by defaulting use_legacy_workflow to false and deprecating the argument. This will
bring the default behavior into alignment with the AWS SDKs and CLI. Practitioners
can still preserve the legacy behavior by setting this argument to `true`. In Terraform
1.8 this argument will be removed, and the S3 backend will always use the default
credential chain evaluation order from the AWS SDK for Go.
2023-11-30 13:19:48 -05:00
Liam Cervante
0f94e1e7ab
docs: update terraform test docs with provider to run block reference examples (#34332)
* docs: update terraform test docs with examples on provider to run block references

* undo weird formatting
2023-11-30 16:53:57 +01:00
Liam Cervante
6670ab43f7
terraform test: rearrange the order of destroy operations (#34293) 2023-11-29 16:37:52 +01: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
Zach Himsel
2361c5dc98
Document negative host numbers for cidrhost()
This feature was introduced in
https://github.com/hashicorp/terraform/pull/13765
(and documented there), but it seems that its documentation
was not carried over when the docs were reorganized.
2023-11-28 11:59:04 -05:00
Ari Summer
d12984064a
Correct EC2 instance encryption condition example in custom-conditions.mdx 2023-11-24 10:15:03 -07:00
kmoe
33dfeecbee
docs: more detail on import IDs (#34153) 2023-11-21 08:35:26 +00:00