terraform-provider-octopusdeploy
terraform-provider-octopusdeploy copied to clipboard
`octopusdeploy_deployment_process.run_script_action` Capitalizes Boolean values
Describe the bug
When creating octopus_deployment_process resource, within the step block and then run_script_action block, defined booleans for Octopus.Action.* properties end up being capitalized.
Steps to reproduce
- Create a simple
octopusdeploy_deployment_processresource with arun_on_serverproperty set to eithertrueorfalseand for one more exampleOctopus.Features.SubstituteInFilesfeature enabled.
resource "octopusdeploy_deployment_process" "project_deployment_process" {
project_id = octopusdeploy_project.project.id
step {
condition = "Success"
name = "Slack - Notify Deployment Started"
package_requirement = "LetOctopusDecide"
start_trigger = "StartAfterPrevious"
run_script_action {
condition = "Success"
name = "Slack - Notify Deployment Started"
run_on_server = true
is_required = true
features = [ "Octopus.Features.SubstituteInFiles" ]
script_source = "Inline"
script_syntax = "PowerShell"
script_body = <<-EOT
function Slack-Rich-Notification ($notification)
{
# ...
};
EOT
}
}
}
- During the plan everything seems fine:
...
+ features = [
+ "Octopus.Features.SubstituteInFiles",
]
...
+ run_on_server = true
...
- Verifying created configuration on Octopus Deploy, Executed Location is set to Run on each deployment (most likely default false for run_on_server) instead of octopus deploy server
- Comparing this step creation when done manually vs through terraform the json configuration stored in octopus deploy sql server we see that manual creation stores this in lowercase, while through terraform it is capitalized:
Also seems the case for other Octopus.Action.* boolean properties:
But not for values outside of the Octopus.Action.* properties scope, for instance the run_script_action.is_required property :
Expected behavior
When I set the run_script_action.run_on_server property, through terraform, I expect same behaviour when creating this step manually, so the value for Octopus.Action.RunOnServer in the JSON configuration should be stored in lower case and other Octopus.Action.* booleans as well.
Logs and other supporting information
During the initial creation, the tf plan doesn't show any wrong signs, however, when changing configure for instance for run_on_server from true to false we can see that the value is stored capitalized as well:
- "Octopus.Action.RunOnServer" = "True" -> null
Screenshots Already included in previous parts
Environment and versions:
- OS: [
Windows Server 2022] - Octopus Server Version: [
v2023.2 (Build 12643)] - Terraform Version: [
1.3.5] - Octopus Terraform Provider Version: [
0.12.4]