terraform-provider-octopusdeploy
terraform-provider-octopusdeploy copied to clipboard
[Feature] action_templates to be able to create/update Step Templates
We want to be able to use the same step template across spaces and we'd like to be able to manage this through terraform, we can currently do this with a bash script
Using CURL
curl -X POST "http://your-octopus-server/api/actiontemplates" \
-H "X-Octopus-ApiKey: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"Name": "My Custom Step",
"Description": "This is a custom step for deploying a specific component",
"ActionType": "Octopus.Script",
"Version": 0,
"Properties": {
"Octopus.Action.Script.Syntax": "PowerShell",
"Octopus.Action.Script.ScriptBody": "Write-Host \"Hello from my custom step!\""
},
"Parameters": [
{
"Name": "Parameter1",
"Label": "My First Parameter",
"HelpText": "This is a parameter used by the custom step.",
"DefaultValue": "",
"DisplaySettings": {
"Octopus.ControlType": "SingleLineText"
}
}
]
}'
We'd like to be able to do something like this
resource "octopusdeploy_action_template" "my_custom_step" {
name = "My Custom Step"
description = "This is a custom step for deploying a specific component"
space_id = "Space-1"
action_type = "Octopus.Script"
properties {
syntax = "PowerShell"
script_body = "Write-Host Hello"
}
parameter {
name = "Parameter1"
label = "My Parameter"
default_value = ""
}
}
+1 this is something my team has been needing for a while.
for the time being I am using the restapi
terraform module. You can see a working example POC i created to help you through.
https://github.com/kennethgarza/terraform-script-module-null-resource-poc
+1