Manage Spinnaker applications and pipelines with Terraform.
provider "spinnaker" {
server = "http://spinnaker-gate.myorg.io"
}
resource "spinnaker_application" "my_app" {
application = "terraformtest"
email = "ethan@armory.io"
}
resource "spinnaker_pipeline" "terraform_example" {
application = "${spinnaker_application.my_app.application}"
name = "Example Pipeline"
pipeline = file("pipelines/example.json")
}
Requires Go and Dep be installed on the system.
$ go get github.com/armory-io/terraform-provider-spinnaker
$ cd $GOPATH/src/github.com/armory-io/terraform-provider-spinnaker
$ dep ensure
$ go build
See Terraform documentation for installing 3rd party plugins.
provider "spinnaker" {
server = "http://spinnaker-gate.myorg.io"
config = "/path/to/config.yml"
ignore_cert_errors = true
}
server
- The Gate API Urlconfig
- (Optional) - Path to Gate config file. See the Spin CLI for an example config.ignore_cert_errors
- (Optional) - Set this totrue
to ignore certificate errors from Gate. Defaults tofalse
.
resource "spinnaker_application" "my_app" {
application = "terraformtest"
email = "ethan@armory.io"
}
application
- Application nameemail
- Owner email
resource "spinnaker_pipeline" "terraform_example" {
application = "${spinnaker_application.my_app.application}"
name = "Example Pipeline"
pipeline = file("pipelines/example.json")
}
application
- Application namename
- Pipeline namepipeline
- Pipeline JSON in string format, examplefile(pipelines/example.json)
data "template_file" "dcd_template" {
template = "${file("template.yml")}"
}
resource "spinnaker_pipeline_template" "terraform_example" {
template = "${data.template_file.dcd_template.rendered}"
}
template
- A yaml formated DCD Spec pipeline template
data "template_file" "dcd_template_config" {
template = "${file("config.yml")}"
}
resource "spinnaker_pipeline_template_config" "terraform_example" {
pipeline_config = "${data.template_file.dcd_template_config.rendered}"
}
pipeline_config
- A yaml formated DCD Spec pipeline configuration