terraform-provider-octopusdeploy
terraform-provider-octopusdeploy copied to clipboard
Cannot insert new steps into an existing `deployment_process` correctly
Describe the bug
Having created a deployment process with two steps, adding a new step in between the existing two steps will cause the new step to become a mixture of its own config + the original 2nd step.
Steps to reproduce
With a terraform file like the following:
resource "octopusdeploy_deployment_process" "example" {
project_id = "Projects-61"
step {
name = "Hello world"
run_script_action {
can_be_used_for_project_versioning = false
condition = "Success"
is_disabled = false
is_required = false
name = "Hello world"
script_syntax = "Bash"
script_body = <<-EOT
echo 'Hello world, using Bash'
#TODO: Experiment with steps of your own :)
echo '[Learn more about the types of steps available in Octopus](https://g.octopushq.com/OnboardingAddStepsLearnMore)'
EOT
run_on_server = true
sort_order = 1
}
}
# step {
# name = "Dummy AWS CLI Step"
# action {
# name = "Dummy AWS CLI STep"
# action_type = "Octopus.AwsRunScript"
# run_on_server = true
# environments = ["Dev"]
# excluded_environments = []
# properties = {
# "OctopusUseBundledTooling" = "False"
# "Octopus.Action.Script.ScriptSource" = "Inline",
# "Octopus.Action.Script.Syntax" = "PowerShell",
# "Octopus.Action.Aws.AssumeRole" = "False"
# "Octopus.Action.AwsAccount.UserInstanceRole" = "True"
# "Octopus.Action.Aws.Region" = "us-east-1"
# "Octopus.Action.AwsAccount.Variable" = "DanAWS"
# "Octopus.Action.Script.ScriptBody" = "Write-Host \"This is just a test\""
# }
# is_disabled = false
# }
# }
step {
name = "Plan to apply"
action {
name = "Plan to apply"
action_type = "Octopus.TerraformPlan"
properties = {
"Octopus.Action.Package.DownloadOnTentacle" = "False"
"Octopus.Action.Package.FeedId" = "feeds-builtin"
"Octopus.Action.Package.PackageId" = "hello"
"Octopus.Action.Terraform.TemplateDirectory" = "terraform/infrastructure"
"Octopus.Action.RunOnServer" = "False"
"Octopus.Action.Terraform.PlanJsonOutput" = "False"
"Octopus.Action.Script.ScriptSource" = "Package"
"Octopus.Action.Terraform.RunAutomaticFileSubstitution" = "False"
}
}
}
}
- Apply to create the deployment process with 2 steps
- Uncomment the 2nd step
- Apply to update the deployment process
- See error
Expected behavior Correctly updates the deployment process to have 3 steps that match the config file.
Logs and other supporting information
Error: octopus deploy api returned an error on endpoint /api/Spaces-1/projects/Projects-61/deploymentprocesses - [Providing a package is not valid for inline scripts.]
│
│ with octopusdeploy_deployment_process.example,
│ on test-steps.before.tf line 1, in resource "octopusdeploy_deployment_process" "example":
│ 1: resource "octopusdeploy_deployment_process" "example" {
These are the action properties in the new step that TF sends to the server
Octopus.Action.Aws.AssumeRole: False
Octopus.Action.Aws.Region: us-east-1
Octopus.Action.AwsAccount.UserInstanceRole: True
Octopus.Action.AwsAccount.Variable: DanAWS
Octopus.Action.EnabledFeatures:
Octopus.Action.Package.DownloadOnTentacle: False
Octopus.Action.Package.FeedId: feeds-builtin
Octopus.Action.Package.PackageId: hello
Octopus.Action.RunOnServer: True
Octopus.Action.Script.ScriptBody: Write-Host \"This is just a test\"
Octopus.Action.Script.ScriptSource: Inline
Octopus.Action.Script.Syntax: PowerShell
OctopusUseBundledTooling: False
Environment and versions:
- OS: Tested on windows
- Octopus Server Version: Tested on 2023.2 and 2023.3
- Terraform Version: 1.6.1
- Octopus Terraform Provider Version: Tested 0.12.7 and 0.12.8
Another report [Internal Link]
Validated as still occurring.
Fixing this will be dependent on fixing the overall step sort order problem, which is dependent on the Terraform SDK -> Terraform Framework migration within the provider. That's on our radar to finish off this year, which should unlock a bunch of extra flexibility in how plan/apply works
Validated as still occurring.
Fixing this will be dependent on fixing the overall step sort order problem, which is dependent on the Terraform SDK -> Terraform Framework migration within the provider. That's on our radar to finish off this year, which should unlock a bunch of extra flexibility in how
plan/applyworks
The work to create deployment process in framework has been moved to Q1 2025
Fix with the process resource released as part of v1 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.