From 4441fcfec0a2e24c78f70f6dd4a3061d540ec37a Mon Sep 17 00:00:00 2001 From: trujillo-adam Date: Thu, 14 Nov 2024 16:08:41 -0800 Subject: [PATCH 1/2] restructure language reference --- website/data/language-nav-data.json | 76 ++--- .../index.mdx} | 11 +- .../provisioners/connect.mdx} | 0 .../provisioners/define.mdx} | 0 .../define-resource/provisioners/index.mdx | 0 .../provisioners/null_resource.mdx | 2 +- .../terraform-data.mdx | 11 +- .../language/{resources => }/ephemeral.mdx | 0 website/docs/language/provisioner.mdx | 320 ++++++++++++++++++ website/docs/language/resource.mdx | 72 ++++ website/docs/language/resources/index.mdx | 36 -- .../language/resources/provisioners/file.mdx | 129 ------- .../resources/provisioners/local-exec.mdx | 104 ------ .../resources/provisioners/remote-exec.mdx | 89 ----- website/docs/language/resources/syntax.mdx | 214 ------------ 15 files changed, 431 insertions(+), 633 deletions(-) rename website/docs/language/{resources/behavior.mdx => define-resource/index.mdx} (94%) rename website/docs/language/{resources/provisioners/connection.mdx => define-resource/provisioners/connect.mdx} (100%) rename website/docs/language/{resources/provisioners/syntax.mdx => define-resource/provisioners/define.mdx} (100%) create mode 100644 website/docs/language/define-resource/provisioners/index.mdx rename website/docs/language/{resources => define-resource}/provisioners/null_resource.mdx (97%) rename website/docs/language/{resources => define-resource}/terraform-data.mdx (87%) rename website/docs/language/{resources => }/ephemeral.mdx (100%) create mode 100644 website/docs/language/provisioner.mdx create mode 100644 website/docs/language/resource.mdx delete mode 100644 website/docs/language/resources/index.mdx delete mode 100644 website/docs/language/resources/provisioners/file.mdx delete mode 100644 website/docs/language/resources/provisioners/local-exec.mdx delete mode 100644 website/docs/language/resources/provisioners/remote-exec.mdx delete mode 100644 website/docs/language/resources/syntax.mdx diff --git a/website/data/language-nav-data.json b/website/data/language-nav-data.json index b23ca5d1502d..b17bf1e06224 100644 --- a/website/data/language-nav-data.json +++ b/website/data/language-nav-data.json @@ -70,75 +70,33 @@ ] }, { - "title": "Resources", + "title": "Define resources", "routes": [ - { "title": "Overview", "path": "resources" }, - { "title": "Resource Blocks", "path": "resources/syntax" }, + { "title": "Overview", "path": "define-resource" }, { - "title": "Resource Behavior", - "path": "resources/behavior" - }, - { - "title": "Meta-Arguments", + "title": "Apply provisioners", "routes": [ { - "title": "depends_on", - "href": "/language/meta-arguments/depends_on" - }, - { - "title": "count", - "href": "/language/meta-arguments/count" - }, - { - "title": "for_each", - "href": "/language/meta-arguments/for_each" + "title": "Overview", + "path": "define-resource/provisioners" }, - { - "title": "provider", - "href": "/language/meta-arguments/resource-provider" - }, - { - "title": "lifecycle", - "href": "/language/meta-arguments/lifecycle" - } - ] - }, - { - "title": "Provisioners", - "routes": [ { "title": "Declaring Provisioners", - "path": "resources/provisioners/syntax" + "path": "define-resource/provisioners/define" }, { "title": "Provisioner Connections", - "path": "resources/provisioners/connection" - }, - { - "title": "Provisioners Without a Resource", - "path": "resources/provisioners/null_resource" - }, - { - "title": "file", - "path": "resources/provisioners/file" - }, - { - "title": "local-exec", - "path": "resources/provisioners/local-exec" + "path": "define-resource/provisioners/connect" }, { - "title": "remote-exec", - "path": "resources/provisioners/remote-exec" + "title": "Run commands on standard lifecycle resources", + "path": "define-resource/provisioners/null_resource" } ] }, { - "title": "The terraform_data Resource Type", - "path": "resources/terraform-data" - }, - { - "title": "Ephemeral Resources", - "path": "resources/ephemeral" + "title": "Apply standard lifecycle", + "path": "define-resource/terraform-data" } ] }, @@ -257,6 +215,14 @@ } ] }, + { + "title": "Resource block", + "path": "resource" + }, + { + "title": "Ephemeral block", + "path": "ephemeral" + }, { "title": "Moved block", "path": "moved" @@ -265,6 +231,10 @@ "title": "Terraform block", "path": "terraform" }, + { + "title": "Provisioner block", + "path": "provisioner" + }, { "title": "Backend block", "routes": [ diff --git a/website/docs/language/resources/behavior.mdx b/website/docs/language/define-resource/index.mdx similarity index 94% rename from website/docs/language/resources/behavior.mdx rename to website/docs/language/define-resource/index.mdx index c65de9d1f45f..7f43fdec20fe 100644 --- a/website/docs/language/resources/behavior.mdx +++ b/website/docs/language/define-resource/index.mdx @@ -1,11 +1,14 @@ --- -page_title: Resource Behavior - Configuration Language +page_title: Manage resources in Terraform configuration language description: >- - Learn how Terraform uses resource blocks to create infrastructure objects. - Also learn about resource dependencies and how to access resource attributes. + Resource blocks define real-world resources. Learn how to define resource blocks to create and manage infrastructure resources with Terraform. --- -# Resource Behavior +# Manage resources in Terraform configuration language + +This topic provides an overview of the Terraform `resource` block. + +## Introduction A `resource` block declares that you want a particular infrastructure object to exist with the given settings. If you are writing a new configuration for diff --git a/website/docs/language/resources/provisioners/connection.mdx b/website/docs/language/define-resource/provisioners/connect.mdx similarity index 100% rename from website/docs/language/resources/provisioners/connection.mdx rename to website/docs/language/define-resource/provisioners/connect.mdx diff --git a/website/docs/language/resources/provisioners/syntax.mdx b/website/docs/language/define-resource/provisioners/define.mdx similarity index 100% rename from website/docs/language/resources/provisioners/syntax.mdx rename to website/docs/language/define-resource/provisioners/define.mdx diff --git a/website/docs/language/define-resource/provisioners/index.mdx b/website/docs/language/define-resource/provisioners/index.mdx new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/website/docs/language/resources/provisioners/null_resource.mdx b/website/docs/language/define-resource/provisioners/null_resource.mdx similarity index 97% rename from website/docs/language/resources/provisioners/null_resource.mdx rename to website/docs/language/define-resource/provisioners/null_resource.mdx index b91430807b14..2d22f0b4c8b9 100644 --- a/website/docs/language/resources/provisioners/null_resource.mdx +++ b/website/docs/language/define-resource/provisioners/null_resource.mdx @@ -5,7 +5,7 @@ description: >- are not directly associated with a single existing resource. --- -# Provisioners Without a Resource +# Run commands on standard lifecycle resources If you need to run provisioners that aren't directly associated with a specific resource, you can associate them with a `terraform_data`. diff --git a/website/docs/language/resources/terraform-data.mdx b/website/docs/language/define-resource/terraform-data.mdx similarity index 87% rename from website/docs/language/resources/terraform-data.mdx rename to website/docs/language/define-resource/terraform-data.mdx index 4e82c4481575..598bedfdffd8 100644 --- a/website/docs/language/resources/terraform-data.mdx +++ b/website/docs/language/define-resource/terraform-data.mdx @@ -1,13 +1,18 @@ --- -page_title: The terraform_data Managed Resource Type +page_title: Apply the standard Terraform resource lifecycle description: >- Retrieves the root module output values from a Terraform state snapshot stored in a remote backend. --- -# The `terraform_data` Managed Resource Type +# Apply the standard Terraform resource lifecycle + +This topic describes how to configure resources to follow the standard Terraform resource lifecycle. + +## Configure the `terraform_data` resource type + +The `terraform_data` resource type implements the standard resource lifecycle for the resource but does not directly take any other actions. -The `terraform_data` implements the standard resource lifecycle, but does not directly take any other actions. You can use the `terraform_data` resource without requiring or configuring a provider. It is always available through a built-in provider with the [source address](/terraform/language/providers/requirements#source-addresses) `terraform.io/builtin/terraform`. The `terraform_data` resource is useful for storing values which need to follow a manage resource lifecycle, and for triggering provisioners when there is no other logical managed resource in which to place them. diff --git a/website/docs/language/resources/ephemeral.mdx b/website/docs/language/ephemeral.mdx similarity index 100% rename from website/docs/language/resources/ephemeral.mdx rename to website/docs/language/ephemeral.mdx diff --git a/website/docs/language/provisioner.mdx b/website/docs/language/provisioner.mdx new file mode 100644 index 000000000000..362a133aca59 --- /dev/null +++ b/website/docs/language/provisioner.mdx @@ -0,0 +1,320 @@ +--- +page_title: provisioner block reference +description: Learn how to configure the Terraform `resource` block. +--- + +# `provisioner` block + +This topic provides reference information about the `provisioner` block in the Terraform configuration language. Add `provisioner` blocks to `resource` blocks in your Terraform configurations to perform additional actions during Terraform operations. + +Refer to the following topics for additional information: + +- [`resource` block reference](/terraform/language/resource) +- [Usage topics for provisioners](linky-link) + +## Configuration model + +Add `provisioner` blocks to `resource` blocks in your configuration. You can specify the following types of `provisioner` blocks: + +- `provisioner "file" "