From 5895472c937242adbf642edda3d8c16abfcfd928 Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Tue, 1 Dec 2020 13:10:05 -0800 Subject: [PATCH 1/5] website: link to functions tutorial where applicable --- website/docs/configuration/expressions/function-calls.html.md | 2 ++ website/docs/configuration/functions.html.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/website/docs/configuration/expressions/function-calls.html.md b/website/docs/configuration/expressions/function-calls.html.md index 771b75f72..77b6f75ba 100644 --- a/website/docs/configuration/expressions/function-calls.html.md +++ b/website/docs/configuration/expressions/function-calls.html.md @@ -5,6 +5,8 @@ page_title: "Function Calls - Configuration Language" # Function Calls +> **Hands-on:** Try the [Perform Dynamic Operations with Functions](https://learn.hashicorp.com/tutorials/terraform/functions?in=terraform/configuration-language&utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) tutorial on HashiCorp Learn. + The Terraform language has a number of [built-in functions](/docs/configuration/functions.html) that can be used in expressions to transform and combine values. These diff --git a/website/docs/configuration/functions.html.md b/website/docs/configuration/functions.html.md index 6ba460c62..8317bcf64 100644 --- a/website/docs/configuration/functions.html.md +++ b/website/docs/configuration/functions.html.md @@ -13,6 +13,8 @@ description: |- earlier, see [0.11 Configuration Language: Interpolation Syntax](../configuration-0-11/interpolation.html). +> **Hands-on:** Try the [Perform Dynamic Operations with Functions](https://learn.hashicorp.com/tutorials/terraform/functions?in=terraform/configuration-language&utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) tutorial on HashiCorp Learn. + The Terraform language includes a number of built-in functions that you can call from within expressions to transform and combine values. The general syntax for function calls is a function name followed by comma-separated From a1e73ade61d7e52cf7d2b160b531d52346f560f5 Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Tue, 1 Dec 2020 13:12:12 -0800 Subject: [PATCH 2/5] website: link to expressions tutorial where applicable This tutorial uses references to local values, conditional expressions, and splat expressions, so I've added it to those pages as well as the expressions overview. --- website/docs/configuration/expressions/conditionals.html.md | 2 ++ website/docs/configuration/expressions/index.html.md | 2 ++ website/docs/configuration/expressions/references.html.md | 2 ++ website/docs/configuration/expressions/splat.html.md | 2 ++ 4 files changed, 8 insertions(+) diff --git a/website/docs/configuration/expressions/conditionals.html.md b/website/docs/configuration/expressions/conditionals.html.md index b9f247e1b..56edeac1e 100644 --- a/website/docs/configuration/expressions/conditionals.html.md +++ b/website/docs/configuration/expressions/conditionals.html.md @@ -5,6 +5,8 @@ page_title: "Conditional Expressions - Configuration Language" # Conditional Expressions +> **Hands-on:** Try the [Create Dynamic Expressions](https://learn.hashicorp.com/tutorials/terraform/expressions?in=terraform/configuration-language&utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) tutorial on HashiCorp Learn. + A _conditional expression_ uses the value of a bool expression to select one of two values. diff --git a/website/docs/configuration/expressions/index.html.md b/website/docs/configuration/expressions/index.html.md index 0de96564c..d29fb4042 100644 --- a/website/docs/configuration/expressions/index.html.md +++ b/website/docs/configuration/expressions/index.html.md @@ -5,6 +5,8 @@ page_title: "Expressions - Configuration Language" # Expressions +> **Hands-on:** Try the [Create Dynamic Expressions](https://learn.hashicorp.com/tutorials/terraform/expressions?in=terraform/configuration-language&utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) tutorial on HashiCorp Learn. + _Expressions_ are used to refer to or compute values within a configuration. The simplest expressions are just literal values, like `"hello"` or `5`, but the Terraform language also allows more complex expressions such as diff --git a/website/docs/configuration/expressions/references.html.md b/website/docs/configuration/expressions/references.html.md index a1cb91781..7954af0bb 100644 --- a/website/docs/configuration/expressions/references.html.md +++ b/website/docs/configuration/expressions/references.html.md @@ -5,6 +5,8 @@ page_title: "References to Values - Configuration Language" # References to Named Values +> **Hands-on:** Try the [Create Dynamic Expressions](https://learn.hashicorp.com/tutorials/terraform/expressions?in=terraform/configuration-language&utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) tutorial on HashiCorp Learn. + Terraform makes several kinds of named values available. Each of these names is an expression that references the associated value; you can use them as standalone expressions, or combine them with other expressions to compute new diff --git a/website/docs/configuration/expressions/splat.html.md b/website/docs/configuration/expressions/splat.html.md index d0fa27f08..ce3b18d24 100644 --- a/website/docs/configuration/expressions/splat.html.md +++ b/website/docs/configuration/expressions/splat.html.md @@ -5,6 +5,8 @@ page_title: "Splat Expressions - Configuration Language" # Splat Expressions +> **Hands-on:** Try the [Create Dynamic Expressions](https://learn.hashicorp.com/tutorials/terraform/expressions?in=terraform/configuration-language&utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) tutorial on HashiCorp Learn. + A _splat expression_ provides a more concise way to express a common operation that could otherwise be performed with a `for` expression. From 652b48bb49625e437b797e1a991aa4fa31126dfd Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Tue, 1 Dec 2020 15:12:25 -0800 Subject: [PATCH 3/5] website: link to sensitive variables tutorial --- website/docs/configuration/variables.html.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/website/docs/configuration/variables.html.md b/website/docs/configuration/variables.html.md index c51cce622..26ee510b0 100644 --- a/website/docs/configuration/variables.html.md +++ b/website/docs/configuration/variables.html.md @@ -211,7 +211,9 @@ using a sentence structure similar to the above examples. [inpage-sensitive]: #suppressing-values-in-cli-output --> This feature was introduced in Terraform CLI v0.14.0. +-> This feature was introduced in Terraform v0.14.0. + +> **Hands-on:** Try the [Protect Sensitive Input Variables](https://learn.hashicorp.com/tutorials/terraform/sensitive-variables?in=terraform/configuration-language&utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) tutorial on HashiCorp Learn. Setting a variable as `sensitive` prevents Terraform from showing its value in the `plan` or `apply` output, when that variable is used within a configuration. From d5950b7fd23f56bd3e64e14f184b9487e7f99bff Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Tue, 1 Dec 2020 15:20:14 -0800 Subject: [PATCH 4/5] website: link to dependency lock file tutorial --- .../docs/configuration/blocks/providers/index.html.md | 2 ++ website/docs/configuration/dependency-lock.html.md | 2 ++ website/docs/configuration/provider-requirements.html.md | 9 +++++++++ 3 files changed, 13 insertions(+) diff --git a/website/docs/configuration/blocks/providers/index.html.md b/website/docs/configuration/blocks/providers/index.html.md index 81ef9f094..287eb6539 100644 --- a/website/docs/configuration/blocks/providers/index.html.md +++ b/website/docs/configuration/blocks/providers/index.html.md @@ -69,6 +69,8 @@ and commit it to version control along with your configuration. If a lock file is present, Terraform Cloud, CLI, and Enterprise will all obey it when installing providers. +> **Hands-on:** Try the [Lock and Upgrade Provider Versions](https://learn.hashicorp.com/tutorials/terraform/provider-versioning?in=terraform/configuration-language&utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) tutorial on HashiCorp Learn. + ## How to Find Providers To find providers for the infrastructure platforms you use, browse diff --git a/website/docs/configuration/dependency-lock.html.md b/website/docs/configuration/dependency-lock.html.md index c65902ba1..9b516d753 100644 --- a/website/docs/configuration/dependency-lock.html.md +++ b/website/docs/configuration/dependency-lock.html.md @@ -9,6 +9,8 @@ page_title: "Dependency Lock File (.terraform.lock.hcl) - Configuration Language versions of Terraform did not track dependency selections at all, so the information here is not relevant to those versions. +> **Hands-on:** Try the [Lock and Upgrade Provider Versions](https://learn.hashicorp.com/tutorials/terraform/provider-versioning?in=terraform/configuration-language&utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) tutorial on HashiCorp Learn. + A Terraform configuration may refer to two different kinds of external dependency that come from outside of its own codebase: diff --git a/website/docs/configuration/provider-requirements.html.md b/website/docs/configuration/provider-requirements.html.md index ba613e86f..40ca196da 100644 --- a/website/docs/configuration/provider-requirements.html.md +++ b/website/docs/configuration/provider-requirements.html.md @@ -217,6 +217,15 @@ The `version` argument is optional; if omitted, Terraform will accept any version of the provider as compatible. However, we strongly recommend specifying a version constraint for every provider your module depends on. +To ensure Terraform always installs the same provider versions for a given +configuration, you can use Terraform CLI to create a +[dependency lock file](/docs/configuration/dependency-lock.html) +and commit it to version control along with your configuration. If a lock file +is present, Terraform Cloud, CLI, and Enterprise will all obey it when +installing providers. + +> **Hands-on:** Try the [Lock and Upgrade Provider Versions](https://learn.hashicorp.com/tutorials/terraform/provider-versioning?in=terraform/configuration-language&utm_source=WEBSITE&utm_medium=WEB_IO&utm_offer=ARTICLE_PAGE&utm_content=DOCS) tutorial on HashiCorp Learn. + ### Best Practices for Provider Versions Each module should at least declare the minimum provider version it is known From 83ebb9b17898b114465f88fd4a1e2a8eaffb34d6 Mon Sep 17 00:00:00 2001 From: Nick Fagerlund Date: Tue, 1 Dec 2020 15:27:41 -0800 Subject: [PATCH 5/5] website: Add big whitespace separators to recovery landing pages The resources, expressions, and modules pages were all split into smaller, more navigable pages, but the old URLs had accumulated a large number of deep links to their section headers. To help people recover when they click an old link, we converted those old URLs to landing pages, which preserve all of the old in-page anchors and point readers to the appropriate new destinations. However, because the new link-to-new-page sections are so small, it was kind of hard to tell which section you had clicked into! Especially if you were near the bottom of the page and the browser wasn't able to position the desired section at the very top of the window. This commit aims to improve that by putting one full screen of whitespace in between every linkable section on these landing pages. Yes, it's a hack, but you're meant to only view these pages for three seconds or so before moving on to the place you wanted to be, and this should help dispel any confusion about which place that is. --- .../docs/configuration/expressions.html.md | 34 +++++++++++++++ website/docs/configuration/modules.html.md | 10 +++++ website/docs/configuration/resources.html.md | 43 ++++++++++++++++++- 3 files changed, 86 insertions(+), 1 deletion(-) diff --git a/website/docs/configuration/expressions.html.md b/website/docs/configuration/expressions.html.md index 560b5c014..c9e9afd04 100644 --- a/website/docs/configuration/expressions.html.md +++ b/website/docs/configuration/expressions.html.md @@ -23,6 +23,10 @@ Terraform's types are `string`, `number`, `bool`, `list`, `tuple`, `map`, This information has moved to [Types and Values](/docs/configuration/expressions/types.html). +
+ + + @@ -38,6 +42,10 @@ You can refer to certain values by name, like `var.some_variable` or This information has moved to [References to Values](/docs/configuration/expressions/references.html). +
+ + + @@ -51,6 +59,10 @@ numbers (`+`) or comparing two values to get a bool (`==`, `>=`, etc.). This information has moved to [Operators](/docs/configuration/expressions/references.html). +
+ + + ## Conditional Expressions The `condition ? true_val : false_val` expression chooses between two @@ -59,6 +71,10 @@ expressions based on a bool condition. This information has moved to [Conditional Expressions](/docs/configuration/expressions/conditionals.html). +
+ + + @@ -69,6 +85,10 @@ Terraform's functions can be called like `function_name(arg1, arg2)`. This information has moved to [Function Calls](/docs/configuration/expressions/function-calls.html). +
+ + + ## `for` Expressions @@ -79,6 +99,10 @@ value into another complex type value. This information has moved to [For Expressions](/docs/configuration/expressions/for.html). +
+ + + @@ -90,6 +114,10 @@ collections. This information has moved to [Splat Expressions](/docs/configuration/expressions/splat.html). +
+ + + @@ -101,6 +129,10 @@ except it creates multiple repeatable nested blocks instead of a complex value. This information has moved to [Dynamic Blocks](/docs/configuration/expressions/dynamic-blocks.html). +
+ + + @@ -121,3 +153,5 @@ Strings can also include escape sequences like `\n`, interpolation sequences This information has moved to [Strings and Templates](/docs/configuration/expressions/strings.html). + +
diff --git a/website/docs/configuration/modules.html.md b/website/docs/configuration/modules.html.md index 4af54dcc7..d5575436b 100644 --- a/website/docs/configuration/modules.html.md +++ b/website/docs/configuration/modules.html.md @@ -20,6 +20,10 @@ pages. This information has moved to [Module Blocks](/docs/configuration/blocks/modules/syntax.html). +
+ + + ## Multiple Instances with `count` and `for_each` @@ -28,6 +32,10 @@ This information has moved to [`count`](/docs/configuration/meta-arguments/count.html) and [`for_each`](/docs/configuration/meta-arguments/for_each.html). +
+ + + @@ -42,3 +50,5 @@ This information has moved to (for users of re-usable modules) and [Providers Within Modules](/docs/modules/providers.html) (for module developers). + +
diff --git a/website/docs/configuration/resources.html.md b/website/docs/configuration/resources.html.md index 4c3942c5c..f4b767776 100644 --- a/website/docs/configuration/resources.html.md +++ b/website/docs/configuration/resources.html.md @@ -21,6 +21,10 @@ pages. This information has moved to [Resource Blocks](/docs/configuration/blocks/resources/syntax.html). +
+ + + @@ -31,9 +35,24 @@ This information has moved to This information has moved to [Resource Behavior](/docs/configuration/blocks/resources/behavior.html). +
+ + + ## Resource Meta-Arguments -Each resource meta-argument has moved to its own page. +Each resource meta-argument has moved to its own page: + +- [`depends_on`](/docs/configuration/meta-arguments/depends_on.html) +- [`count`](/docs/configuration/meta-arguments/count.html) +- [`for_each`](/docs/configuration/meta-arguments/for_each.html) +- [`provider`](/docs/configuration/meta-arguments/resource-provider.html) +- [`lifecycle`](/docs/configuration/meta-arguments/lifecycle.html) +- [Provisioners](/docs/configuration/blocks/resources/provisioners/index.html) + +
+ + @@ -42,6 +61,10 @@ Each resource meta-argument has moved to its own page. This information has moved to [`depends_on`](/docs/configuration/meta-arguments/depends_on.html). +
+ + + @@ -53,6 +76,10 @@ This information has moved to This information has moved to [`count`](/docs/configuration/meta-arguments/count.html). +
+ + + @@ -64,6 +91,10 @@ This information has moved to This information has moved to [`for_each`](/docs/configuration/meta-arguments/for_each.html). +
+ + + ### `provider` @@ -71,6 +102,10 @@ This information has moved to This information has moved to [`provider`](/docs/configuration/meta-arguments/resource-provider.html). +
+ + + ### `lifecycle` @@ -78,9 +113,15 @@ This information has moved to This information has moved to [`lifecycle`](/docs/configuration/meta-arguments/lifecycle.html). +
+ + + ### Provisioners This information has moved to [Provisioners](/docs/configuration/blocks/resources/provisioners/index.html). + +