terraform-provider-octopusdeploy
terraform-provider-octopusdeploy copied to clipboard
Add ability to consume Step Templates in Deployment Processes
Is there a plan to support usage of step templates in octopusdeploy_deployment_process in the future?
I managed to get something working via a standard step action:
step {
name = "Terraform - PlanV2"
condition = "Success"
start_trigger = "StartAfterPrevious"
action {
action_type = "Octopus.TerraformPlan"
can_be_used_for_project_versioning = true
is_disabled = false
is_required = true
name = "Terraform - PlanV2"
properties = {
"Octopus.Action.Package.DownloadOnTentacle" = "False"
"Octopus.Action.Package.FeedId" = "feeds-builtin"
"Octopus.Action.Package.PackageId" = "#{Octopus.Project.Name}"
"Octopus.Action.Script.ScriptSource" = "Package"
"Octopus.Action.Template.Id" = "ActionTemplates-123"
"Octopus.Action.Template.Version" = "3"
Found it useful to import from existing projects to get a working solution:
- Create a sample project in OD
- add the step processes you want
- create a local terraform project and add a
octopusdeploy_deployment_process
resource, don't worry about the step details - run a
terraform import <RESOURCE-ADDRESS> <OD-ID>
- run a plan and it will show the differences which is effectively the data you want to grab or you can go through the statefile for details
From that information you can build you terraform code to suit the step template and clear out your temporary bits. May not be the long term best solution but for now it means we can proceed with deploying our OD build processes using step templates.
The octopusdeploy_deployment_process
resource has support for step
lists. An example has been included in the documentation found in the Terraform Registry.
Is there something missing?
@jbristowe It is completely ok for usual steps, but what about step templates ? When you use it, the right solution seems to be just to pass step template parameters as we do in GUI, but here we need to basically copy all of internal step template insides via properties manually
I'm unclear on if using library step templates within the deployment process is actually supported. I raised issue #184 because I can't seem to import a deployment process that uses a library step template.
Additionally, I can't seem to create a new deployment resource using a library step template without specifying all the properties of the library step template directly, which defeats the purpose, as @Shanjohn mentioned above.
@jbristowe can you provide some clarity on if this pattern is supported for the octopusdeploy_deployment_process resource?
The properties can be attached by including add them in the properties object in the deploy_package_action
I just raised a ticket #196 (which most likely can be linked to this) as this object has been flagged to be deprecated and its seems like a workaround
an example of this workaround is in there
I am also facing the same issue. We can't use step template without defining the content of the step template.
any update on this. I also get this warning in v0.8.1 "Warning: Argument is deprecated │ │ with module.project.octopusdeploy_deployment_process.main, │ on ....\modules\project\process.tf line 24, in resource "octopusdeploy_deployment_process" "main": │ 24: properties = {
seems like the work around for using properties to reference step templates. may be impacted by this in a coming release? hopefully, there are plans for a step_template resources and data blocks?
I'm really hoping for progress on this, being able to keep step templates in sync across spaces would be a big help!
We currently have around 100 deployments which are identical over 5 spaces, would be nice to be able to keep the same deployment processes the same.
Another user seeing this issue (internal) - https://octopus.zendesk.com/agent/tickets/172218
Another affected user [Internal Link]
Just want to chime in that this is an issue for us as well, and working around it makes our code become really messy. It would be great if it got some traction.