GoCD for Azure Deployment using Terraform

65 views
Skip to first unread message

sam law

unread,
Jun 4, 2021, 8:54:46 AM6/4/21
to go-cd
Hello all,

Can anybody point me to "starter" documentation on how to deploy Azure resources into Azure using GoCD and Terraform templates.

Is this even possible with GoCD at the moment?

Jason Smyth

unread,
Jun 4, 2021, 11:11:11 AM6/4/21
to go-cd
Hello,

GoCD can interact with anything that has a command line interface, so deploying Azure resources into Azure using Terraform templates should be possible.

I would start with learning Terraform and how to manage a single Terraformed deployment from multiple client machines. I do not know a lot about Terraform, but I do know that this will involve, at least, choosing and implementing a remote location for storing Terraform state information. You will also need to decide how you will manage getting the Terraform secrets into the GoCD Agents.

Once you have a solid understanding of how Terraform works, I would think it should be fairly trivial to write some wrapper scripts for GoCD to leverage.

Hope this helps,
Jason Smyth

Marques Lee

unread,
Jun 4, 2021, 2:40:04 PM6/4/21
to go...@googlegroups.com
I agree with Jason — once you build out your templates and ensure terraform is installed on your agents, it should be as simple as running `terraform apply -auto-approve` in your build. GoCD can run anything you can run in a terminal, the only caveat being that commands must be non-interactive. GoCD cannot respond to input prompts.

I’m sure there are plenty of tutorials for terraform quick starts.

Have a look at the `azurerm` provider documentation as well. It’s quite good. I’ve used this a lot as I’ve recently found myself building a lot of azure infra as of late.


--
You received this message because you are subscribed to the Google Groups "go-cd" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-cd+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/6bef3e33-7ddf-4877-9b48-575a9df50733n%40googlegroups.com.

shola lawani

unread,
Jun 4, 2021, 2:55:33 PM6/4/21
to go...@googlegroups.com
Thanks all,

I'm okay with building out Terraform and just more concerned about the deployment from a GoCD perspective.

So, essentially, I will have to build out and configure Terraform on the GoCD server/agents,  I guess this is just the same way of building a Terraform environment on any server?

You received this message because you are subscribed to a topic in the Google Groups "go-cd" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/go-cd/eYNu5TYZ5ow/unsubscribe.
To unsubscribe from this group and all its topics, send an email to go-cd+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/go-cd/CAPKX9jZmxHNFqvf%2Bha%3DT0kZ%2Br%2BywGx_RSLW-53ApzOXePgF5-w%40mail.gmail.com.

Marques Lee

unread,
Jun 4, 2021, 3:09:37 PM6/4/21
to go...@googlegroups.com
By building out a terraform environment, I assume you mean download/unzip terraform to a location on the “go” user’s path?

I think that’s really all you’d need as terraform usually installs the azurerm plugin on the fly during build. It should be that simple. Alternatively I’m sure there are docker images with terraform if that’s the way you want to go.

The server won’t need terraform. Just the agents since they are doing the work.

And if you need any special env variables, you can set that up in the pipeline config for your build and/or use tfvars.

shola lawani

unread,
Jun 4, 2021, 3:59:40 PM6/4/21
to go...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages