From 8e040e71040a889b72f03ff11b5bd442d917c883 Mon Sep 17 00:00:00 2001 From: Tim Nicholas Date: Mon, 30 Mar 2026 10:01:52 +1300 Subject: [PATCH 1/3] Remove misleading specificity. Note ability to disable default substitution. The previous version accientally implied that variable replacement is only done with in-line and package files. I think this is a hangover from before Octopus supported Git repositories as a source. Rather than include the third third source, it seems better (assuming it is accurate) to say that substitution is always applied. Similarly, the potential for a Git source was missing from the statement about which files are substitued. Additionally, I have includes a line making it visible that the default substitution can be disabled. --- .../terraform/working-with-built-in-steps/index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/docs/deployments/terraform/working-with-built-in-steps/index.md b/src/pages/docs/deployments/terraform/working-with-built-in-steps/index.md index 8a843150cf..82caf9dfff 100644 --- a/src/pages/docs/deployments/terraform/working-with-built-in-steps/index.md +++ b/src/pages/docs/deployments/terraform/working-with-built-in-steps/index.md @@ -108,9 +108,9 @@ If you are storing your project configuration in a Git repository using the [Con ### Variable replacements -Variable replacement is performed before the template is applied or destroyed when defined in either an inline script or a package. +Variable replacement is performed before terraform is executed. -When deploying a template from a package, all `*.tf`, `*.tfvar`, `*.tf.json` and `*.tfvar.json` files will have variable substitution applied to them. You can also have variable substitution applied to additional files by defining the file names in the `Target files` field. +When deploying a template from a package or Git repository, all `*.tf`, `*.tfvar`, `*.tf.json` and `*.tfvar.json` files will have variable substitution applied to them by default. You can disable the automatic substitution by deselecting `Replace variables in default Terraform files`. You can also have variable substitution applied to additional files by defining file names in the `Target files` field. For example, if you were deploying from a package and your template file looked like this: @@ -136,4 +136,4 @@ See the [variable substitution](/docs/projects/variables/variable-substitutions) The `Additional variable files` option contains a new-line separated list of variable files to use with the deployment. All files called `terraform.tfvars`, `terraform.tfvars.json`, `*.auto.tfvars` and `*.auto.tfvars.json` are automatically loaded by Terraform, and do not need to be listed here. However, you may want to reference environment specific variable files by referencing them with files names built around variable substitution such as `#{Octopus.Environment.Name}.tfvars`. -Each line entered into this field will be passed to Terraform as `-var-file ''`. \ No newline at end of file +Each line entered into this field will be passed to Terraform as `-var-file ''`. From fa505309f94e9ec1df6f97a9dba5b3ccd2285150 Mon Sep 17 00:00:00 2001 From: Tim Nicholas Date: Mon, 30 Mar 2026 11:15:09 +1300 Subject: [PATCH 2/3] Fix pure-formatting lintting failures --- .../terraform/working-with-built-in-steps/index.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/pages/docs/deployments/terraform/working-with-built-in-steps/index.md b/src/pages/docs/deployments/terraform/working-with-built-in-steps/index.md index 82caf9dfff..8e4c54d2e0 100644 --- a/src/pages/docs/deployments/terraform/working-with-built-in-steps/index.md +++ b/src/pages/docs/deployments/terraform/working-with-built-in-steps/index.md @@ -4,14 +4,15 @@ pubDate: 2023-01-01 modDate: 2023-01-01 title: Terraform step configuration with Octopus navTitle: Terraform step configuration -description: Configuring common Terraform options using the Octopus built in steps +description: Configuring common Terraform options using the Octopus built in steps navOrder: 20 --- -Octopus provides four built-in step templates for managing and interacting with your Terraform code: +Octopus provides four built-in step templates for managing and interacting with your Terraform code: + - `Apply a Terraform template` - `Destroy Terraform resources` -- `Plan to apply a Terraform template` +- `Plan to apply a Terraform template` - `Plan a Terraform destroy` :::figure @@ -32,9 +33,10 @@ You can optionally prepare the environment that Terraform runs in using the deta Using credentials managed by Octopus is optional, and credentials defined in the Terraform template take precedence over any credentials defined in the step. You can learn more about creating managed cloud accounts using Octopus [here](/docs/infrastructure/accounts). ::: -## Template section +## Template section The Terraform template can come from three sources: + - Directly entered source code - Files in a package - Files in a Git repository - *New!* @@ -100,7 +102,7 @@ If you are storing your project configuration directly in Octopus (i.e. not in a - URL - Credentials (either anonymous or selecting a Git credential from the Library) -When creating a Release, you choose the tip of a branch for your files. The commit hash for this branch is saved to the Release. This means redeploying that release will only ever use that specific commit and not the _new_ tip of the branch. +When creating a Release, you choose the tip of a branch for your files. The commit hash for this branch is saved to the Release. This means redeploying that release will only ever use that specific commit and not the *new* tip of the branch. #### Version-controlled projects From 36fe0255fe3c9844d1392965d4df233448ce94f5 Mon Sep 17 00:00:00 2001 From: Tim Nicholas Date: Mon, 30 Mar 2026 11:26:07 +1300 Subject: [PATCH 3/3] Address md linting error MD059/descriptive-link-text --- .../terraform/working-with-built-in-steps/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/docs/deployments/terraform/working-with-built-in-steps/index.md b/src/pages/docs/deployments/terraform/working-with-built-in-steps/index.md index 8e4c54d2e0..136713d18f 100644 --- a/src/pages/docs/deployments/terraform/working-with-built-in-steps/index.md +++ b/src/pages/docs/deployments/terraform/working-with-built-in-steps/index.md @@ -27,10 +27,10 @@ While these are the options common to each step, there are additional ways to in ## Managed Accounts -You can optionally prepare the environment that Terraform runs in using the details defined in accounts managed by Octopus. If an account is selected then those credentials do not need to be included in the Terraform template. +You can optionally prepare the environment that Terraform runs in using the details defined in [accounts](/docs/infrastructure/accounts) managed by Octopus. If an account is selected then those credentials do not need to be included in the Terraform template. :::div{.hint} -Using credentials managed by Octopus is optional, and credentials defined in the Terraform template take precedence over any credentials defined in the step. You can learn more about creating managed cloud accounts using Octopus [here](/docs/infrastructure/accounts). +Using credentials managed by Octopus is optional, and credentials defined in the Terraform template take precedence over any credentials defined in the step. ::: ## Template section