terraform-provider-octopusdeploy
terraform-provider-octopusdeploy copied to clipboard
use of `run_on_server` and `features` produce a drift in the plan
Describe the bug
I've tried to replace the property Octopus.Action.RunOnServer with the argument run_on_server after getting the warning below.
╷
│ Warning: "Octopus.Action.RunOnServer" is defined in properties
│
│ with octopusdeploy_deployment_process.my_app,
│ on my-app.tf line 128, in resource "octopusdeploy_deployment_process" "my_app":
│ 128: "Octopus.Action.RunOnServer" = "False"
│
│ Please update your template to specify "run_on_server" under the action
│ instead.
│
│ (and one more similar warning elsewhere)
╵
In a similar way I replaced the Octopus.Action.EnabledFeatures property with the features argument.
After making the changes on the configuration I get a permanent change in the plan (see below).
Steps to reproduce
- Create
octopusdeploy_deployment_processresource with a step to run a PS script
resource "octopusdeploy_deployment_process" "my_app" {
project_id = octopusdeploy_project.my_app.id
step {
condition = "Success"
name = "StatusCheck"
package_requirement = "LetOctopusDecide"
properties = {
"Octopus.Action.MaxParallelism" = "1"
"Octopus.Action.TargetRoles" = "my-app"
}
start_trigger = "StartAfterPrevious"
target_roles = [
"my-app",
]
window_size = "1"
run_script_action {
condition = "Success"
environments = [
octopusdeploy_environment.dev.id,
]
features = [
"Octopus.Features.SubstituteInFiles",
]
is_disabled = false
is_required = true
name = "HTTP - Status check"
notes = "check status after deployment"
properties = {
"Octopus.Action.Script.ScriptBody" = file("${path.module}/test_url.ps1")
"Octopus.Action.Script.ScriptSource" = "Inline"
"Octopus.Action.Script.Syntax" = "PowerShell"
}
run_on_server = false
script_body = file("${path.module}/test_url.ps1")
script_source = "Inline"
script_syntax = "PowerShell"
}
}
}
- run
terraform apply - run
terraform planwithout making any change in the configuration. This produces the plan output you can find below
Expected behavior Replacing the properties with the arguments should produce a clean plan after applying the change.
Logs and other supporting information
terraform plan output after replacing the properties with arguments
~ step {
id = "xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx"
name = "StatusCheck"
# (6 unchanged attributes hidden)
~ run_script_action {
id = "xxxxxxxx-yyyy-xxxx-yyyy-xxxxxxxxxxxx"
name = "HTTP - Status check"
~ properties = {
- "Octopus.Action.EnabledFeatures" = "Octopus.Features.SubstituteInFiles" -> null
- "Octopus.Action.RunOnServer" = "False" -> null
# (10 unchanged elements hidden)
}
# (13 unchanged attributes hidden)
# (1 unchanged block hidden)
}
}
Environment and versions:
- OS: Linux
- Octopus Server Version:
2021.3 (Build 8275)(Octopus Deploy Cloud) - Terraform Version:
1.0.6 - Octopus Terraform Provider Version:
0.7.68
Related to https://github.com/OctopusDeployLabs/terraform-provider-octopusdeploy/issues/641
related to #297
This has been resolved in the new process resource released as part of v1.0 of the provider.
On 1 June 2025, the Octopus Deploy Terraform Provider was promoted from a Labs project to a fully-supported, first-class Octopus Deploy integration.
As part of this promotion, we released v1.0 of the provider, and migrated the codebase from the OctopusDeployLabs GitHub organization to the OctopusDeploy organization. The provider also moved in the Hashicorp Terraform Registry.
New Repository: https://github.com/OctopusDeploy/ New Provider Registry Page: https://registry.terraform.io/providers/OctopusDeploy/octopusdeploy/latest/docs Migration Guide: https://registry.terraform.io/providers/OctopusDeploy/octopusdeploy/1.0.0/docs/guides/moving-from-octopus-deploy-labs-namespace We are no longer accepting contributions or issues in this repo, and we plan to archive it.
Please head over to the new repository for continued support, updates and contributions.