Skip to content
This repository was archived by the owner on Jan 9, 2026. It is now read-only.

No primary package option on Step Template resource #896

@William-Yi-Weng

Description

@William-Yi-Weng

Describe the bug
The octopusdeploy_step_template resource doesn't have primary package schema like other resource, e.g. octopusdeploy_deployment_process. We try to add primary package in packages block and use it on step_package_id. It passes the plan but returns error on apply.
Please advise how we can config custom step template with primary package for ScriptSource.

This is a tf resource code we want to create:

resource "octopusdeploy_step_template" "script_custom_step" {
  name               = locals.name
  description     = locals.description
  action_type    = "Octopus.Script"
  space_id         = locals.space_id
  packages        = [{
              feed_id                     = locals.github_repository_feed_id,
              name                         = "Primary",
              package_id               = locals.package_id,
              acquisition_location = "Server"
              properties                  = {
                          selection_mode = "immediate"
              }
            }]
  step_package_id ="Primary"

  properties = {
    "Octopus.Action.Script.ScriptSource"           = "Package"
    "Octopus.Action.Script.ScriptFileName"       = locals.script_file_name
    "Octopus.Action.Script.ScriptParameters"    = locals.script_parameters
  }

  parameters = []

Expected behavior
A step template is created/updated on Octopus instance with the github feed as primary package and passed the tf apply

Logs and other supporting information
There is no error on tf plan. But we have primary package check error on tf apply, which shows the error message:

│ Error: unable to update step template
│ 
│   with module.octopus.octopusdeploy_step_template.script_custom_step,
│   on ../../modules/octopus/step_templates.tf line 1, in resource "octopusdeploy_step_template" "script_custom_step":
│    1: resource "octopusdeploy_step_template" "script_custom_step" ***
│ 
│ Octopus API error: There was a problem with your request. ['Package' was
│ selected as the script-source but a primary package was not selected.] 

Environment and versions:
OS: [Linux]
Octopus Server Version: [2025.2]
Terraform Version: [v1.9.3]
Octopus Terraform Provider Version: [0.43.0]

Additional context
I can see the change has been updated onto the step template (which selects the Primary as the primary package), but cannot pass the primary package pass on tf apply.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions