diff --git a/examples/resources/octopusdeploy_lifecycle/resource.tf b/examples/resources/octopusdeploy_lifecycle/resource.tf index ec567f8ff..0f751ccde 100644 --- a/examples/resources/octopusdeploy_lifecycle/resource.tf +++ b/examples/resources/octopusdeploy_lifecycle/resource.tf @@ -36,4 +36,11 @@ resource "octopusdeploy_lifecycle" "example" { name = "bar" optional_deployment_targets = ["Environments-321"] } + + phase { + is_optional_phase = true + name = "priority phase" + is_priority_phase = true + optional_deployment_targets = ["Environments-321"] + } } diff --git a/octopusdeploy/schema_phase.go b/octopusdeploy/schema_phase.go index 9c44f9130..7e268a427 100644 --- a/octopusdeploy/schema_phase.go +++ b/octopusdeploy/schema_phase.go @@ -30,6 +30,10 @@ func expandPhase(flattenedPhase interface{}) *lifecycles.Phase { phase.IsOptionalPhase = v.(bool) } + if v, ok := flattenedValues["is_priority_phase"]; ok { + phase.IsPriorityPhase = v.(bool) + } + if v, ok := flattenedValues["minimum_environments_before_promotion"]; ok { if n, isInt32 := v.(int32); isInt32 { phase.MinimumEnvironmentsBeforePromotion = n @@ -91,6 +95,7 @@ func flattenPhase(phase *lifecycles.Phase) interface{} { flattenedPhase["automatic_deployment_targets"] = flattenArray(phase.AutomaticDeploymentTargets) flattenedPhase["id"] = phase.ID flattenedPhase["is_optional_phase"] = phase.IsOptionalPhase + flattenedPhase["is_priority_phase"] = phase.IsPriorityPhase flattenedPhase["minimum_environments_before_promotion"] = int(phase.MinimumEnvironmentsBeforePromotion) flattenedPhase["name"] = phase.Name flattenedPhase["optional_deployment_targets"] = flattenArray(phase.OptionalDeploymentTargets) @@ -127,6 +132,12 @@ func getPhaseSchema() map[string]*schema.Schema { Optional: true, Type: schema.TypeBool, }, + "is_priority_phase": { + Default: false, + Description: "If true, deployments in this phase will be prioritized in the task queue.", + Optional: true, + Type: schema.TypeBool, + }, "minimum_environments_before_promotion": { Default: 0, Description: "The number of units required before a release can enter the next phase. If 0, all environments are required.",