Octopus.TerraformApply exported 2026-07-22 by Octopus Deploy belongs to ‘Terraform’ category.
Apply a Terraform template to create, update, or delete infrastructure resources.
Parameters
When this step is included in a project’s deployment process, the parameters below can be set.
AWS Account
Octopus.Action.Terraform.ManagedAccount
Enable AWS managed account integration. If an account is selected, those credentials do not need to be included in the Terraform template.
Allowed values: None, AWS
Default: None
AWS Account Variable
Octopus.Action.AwsAccount.Variable
The variable that references the AWS account to use for authentication.
Use Instance Role
Octopus.Action.AwsAccount.UseInstanceRole
Use the EC2 instance role for authentication instead of an AWS account variable.
Allowed values: True, False
Default: False
Region
Octopus.Action.Aws.Region
The AWS region code for the target region.
Example: us-west-2
Assume a different AWS service role
Octopus.Action.Aws.AssumeRole
Whether to assume a different AWS service role for authentication.
Allowed values: True, False
Default: False
Assumed Role ARN
Octopus.Action.Aws.AssumedRoleArn
The ARN of the AWS role to assume.
Example: arn:aws:iam::123456789012:role/RoleName
Assumed Role Session Name
Octopus.Action.Aws.AssumedRoleSession
The name for the assumed role session.
Assumed Role Session Duration
Octopus.Action.Aws.AssumeRoleSessionDurationSeconds
The duration in seconds for the assumed role session.
Assumed Role External ID
Octopus.Action.Aws.AssumeRoleExternalId
The external ID to use when assuming the role.
Azure Account
Octopus.Action.Terraform.AzureAccount
Enable Azure managed account integration.
Allowed values: True, False
Default: False
Azure Account Variable
Octopus.Action.AzureAccount.Variable
The variable that references the Azure account to use for authentication.
Google Cloud Account
Octopus.Action.Terraform.GoogleCloudAccount
Enable Google Cloud managed account integration.
Allowed values: True, False
Default: False
Google Cloud Account Variable
Octopus.Action.GoogleCloudAccount.Variable
The variable that references the Google Cloud account to use for authentication.
Use VM Service Account
Octopus.Action.GoogleCloud.UseVMServiceAccount
Use the VM service account for authentication instead of an account variable.
Allowed values: True, False
Default: True
Impersonate Service Account
Octopus.Action.GoogleCloud.ImpersonateServiceAccount
Impersonate a service account. Only works with Terraform google provider version 3.45.0 or above. Sets the GOOGLE_IMPERSONATE_SERVICE_ACCOUNT environment variable.
Allowed values: True, False
Default: False
Service Account Emails
Octopus.Action.GoogleCloud.ServiceAccountEmails
The service account emails to impersonate.
Project
Octopus.Action.GoogleCloud.Project
The default Google Cloud project. Sets the GOOGLE_PROJECT environment variable.
Region
Octopus.Action.GoogleCloud.Region
The default Google Cloud region. Sets the GOOGLE_REGION environment variable.
Zone
Octopus.Action.GoogleCloud.Zone
The default Google Cloud zone. Sets the GOOGLE_ZONE environment variable.
Template Source
Octopus.Action.Script.ScriptSource (required)
Select the source of the Terraform template. Templates can be entered as source code, contained in a Git repository, or a package.
Allowed values: Inline, Package, GitRepository
Default: Inline
Terraform Template
Octopus.Action.Terraform.Template
The inline Terraform template source code in HCL or JSON format.
Template Parameters
Octopus.Action.Terraform.TemplateParameters
The JSON-encoded values for the Terraform template variables.
Template Directory
Octopus.Action.Terraform.TemplateDirectory
The optional directory inside the package or repository that contains the Terraform template source files.
Replace variables in default Terraform files
Octopus.Action.Terraform.RunAutomaticFileSubstitution
Replace variables in all *.tf, *.tfvars, *.tf.json, and *.tfvars.json files using the #{Variable} substitution syntax.
Allowed values: True, False
Default: True
Target files
Octopus.Action.Terraform.FileSubstitution
A newline-separated list of file names to substitute variables using the #{Variable} substitution syntax, relative to the package contents. Extended wildcard syntax is supported.
Example: Config\*.json
Additional Variable Files
Octopus.Action.Terraform.VarFiles
An optional newline-separated list of files that are passed as -var-file parameters. 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.
Terraform workspace
Octopus.Action.Terraform.Workspace
The Terraform workspace to use.
Terraform plugin cache directory
Octopus.Action.Terraform.PluginsDirectory
The optional directory that holds the Terraform plugins. This directory will be copied to a temporary workspace for each deployment to avoid downloading the plugins from the Internet. Specify TF_PLUGIN_CACHE_DIR environment variable to use a shared cache folder instead.
Allow additional plugin downloads
Octopus.Action.Terraform.AllowPluginDownloads
Allow Terraform to download plugins that are not found in the plugin cache directory. Note: this option was removed in Terraform v0.15.0; starting with v0.15.0 Terraform always installs plugins.
Allowed values: True, False
Default: True
Custom Terraform executable
Octopus.Action.Terraform.CustomTerraformExecutable
The path to a custom Terraform executable.
Custom terraform init parameters
Octopus.Action.Terraform.AdditionalInitParams
An optional list of additional parameters to pass to the terraform init command.
Custom terraform apply parameters
Octopus.Action.Terraform.AdditionalActionParams
An optional list of additional parameters to pass to the terraform apply command.
Attach log file
Octopus.Action.Terraform.AttachLogFile
Whether to attach the Terraform log file as an artifact.
Allowed values: True, False
Default: False
Environment Variables Mapping
Octopus.Action.Terraform.EnvVariables
Passes through variables into Terraform CLI accessible as environment variables. Environment variables specified here will override options specified in other sections, with a few exceptions such as Terraform variables mapping.
Example: {"TF_LOG":"DEBUG"}
Git Repository Source
Octopus.Action.GitRepository.Source
The source of the Git repository when template source is set to Git repository.
Allowed values: Project, External
Step configuration using OCL
Example in Octopus Configuration Language (OCL):
step "terraform-apply" {
name = "Terraform Apply"
action {
action_type = "Octopus.TerraformApply"
properties = {
Octopus.Action.GoogleCloud.ImpersonateServiceAccount = "False"
Octopus.Action.GoogleCloud.UseVMServiceAccount = "True"
Octopus.Action.RunOnServer = "false"
Octopus.Action.Script.ScriptSource = "Inline"
Octopus.Action.Terraform.AllowPluginDownloads = "True"
Octopus.Action.Terraform.ManagedAccount = "None"
Octopus.Action.Terraform.RunAutomaticFileSubstitution = "True"
Octopus.Action.Terraform.Template = " resource \"null_resource\" \"example\" {}"
}
}
} Page updated on Wednesday, July 22, 2026