|
1 |
| -# terraform-provider-spinnaker |
| 1 | +# Terraform Provider |
2 | 2 |
|
3 |
| -Manage [Spinnaker](https://spinnaker.io) applications and pipelines with Terraform. |
| 3 | +- Website: https://www.terraform.io |
| 4 | +- [](https://gitter.im/hashicorp-terraform/Lobby) |
| 5 | +- Mailing list: [Google Groups](http://groups.google.com/group/terraform-tool) |
4 | 6 |
|
5 |
| -## Demo |
| 7 | +<img src="https://cdn.rawgit.com/hashicorp/terraform-website/master/content/source/assets/images/logo-hashicorp.svg" width="300px"> |
6 | 8 |
|
7 |
| - |
| 9 | +## Spinnaker |
8 | 10 |
|
9 |
| -## Example |
| 11 | +https://spinnaker.io/concepts/ |
10 | 12 |
|
11 |
| -``` |
12 |
| -provider "spinnaker" { |
13 |
| - server = "http://spinnaker-gate.myorg.io" |
14 |
| -} |
15 |
| -
|
16 |
| -resource "spinnaker_application" "my_app" { |
17 |
| - application = "terraformtest" |
18 |
| - |
19 |
| -} |
20 |
| -
|
21 |
| -resource "spinnaker_pipeline" "terraform_example" { |
22 |
| - application = "${spinnaker_application.my_app.application}" |
23 |
| - name = "Example Pipeline" |
24 |
| - pipeline = "${file("pipelines/example.json")}" |
25 |
| -} |
26 |
| -``` |
27 |
| - |
28 |
| -## Installation |
29 |
| - |
30 |
| -#### Build from Source |
31 |
| - |
32 |
| -_Requires Go to be installed on the system._ |
33 |
| - |
34 |
| -``` |
35 |
| -$ env GO111MODULE=on go get github.com/armory-io/terraform-provider-spinnaker |
36 |
| -$ cd $GOPATH/src/github.com/armory-io/terraform-provider-spinnaker |
37 |
| -$ env GO111MODULE=on go build |
38 |
| -``` |
39 |
| - |
40 |
| -#### Installing 3rd Party Plugins |
41 |
| - |
42 |
| -See [Terraform documentation](https://www.terraform.io/docs/configuration/providers.html#third-party-plugins) for installing 3rd party plugins. |
43 |
| - |
44 |
| -## Provider |
45 |
| - |
46 |
| -#### Example Usage |
47 |
| - |
48 |
| -``` |
49 |
| -provider "spinnaker" { |
50 |
| - server = "http://spinnaker-gate.myorg.io" |
51 |
| - config = "/path/to/config.yml" |
52 |
| - ignore_cert_errors = true |
53 |
| - default_headers = "Api-Key=abc123" |
54 |
| -} |
55 |
| -``` |
56 |
| - |
57 |
| -#### Argument Reference |
58 |
| - |
59 |
| -- `server` - The Gate API Url |
60 |
| -- `config` - (Optional) - Path to Gate config file. See the [Spin CLI](https://github.com/spinnaker/spin/blob/master/config/example.yaml) for an example config. |
61 |
| -- `ignore_cert_errors` - (Optional) - Set this to `true` to ignore certificate errors from Gate. Defaults to `false`. |
62 |
| -- `default_headers` - (Optional) - Pass through a comma separated set of key value pairs to set default headers for the gate client when sending requests to your gate endpoint e.g. "header1=value1,header2=value2". Defaults to "". |
63 |
| - |
64 |
| -## Resources |
65 |
| - |
66 |
| -### `spinnaker_application` |
67 |
| - |
68 |
| -#### Example Usage |
| 13 | +## Requirements |
69 | 14 |
|
70 |
| -``` |
71 |
| -resource "spinnaker_application" "my_app" { |
72 |
| - application = "terraformtest" |
73 |
| - |
74 |
| -} |
75 |
| -``` |
76 |
| - |
77 |
| -#### Argument Reference |
78 |
| - |
79 |
| -- `application` - Application name |
80 |
| -- `email` - Owner email |
81 |
| - |
82 |
| -### `spinnaker_pipeline` |
83 |
| - |
84 |
| -#### Example Usage |
85 |
| - |
86 |
| -``` |
87 |
| -resource "spinnaker_pipeline" "terraform_example" { |
88 |
| - application = "${spinnaker_application.my_app.application}" |
89 |
| - name = "Example Pipeline" |
90 |
| - pipeline = file("pipelines/example.json") |
91 |
| -} |
92 |
| -``` |
93 |
| - |
94 |
| -#### Argument Reference |
95 |
| - |
96 |
| -- `application` - Application name |
97 |
| -- `name` - Pipeline name |
98 |
| -- `pipeline` - Pipeline JSON in string format, example `file(pipelines/example.json)` |
| 15 | +- [Terraform](https://www.terraform.io/downloads.html) 0.10.x |
| 16 | +- [Go](https://golang.org/doc/install) 1.11 (to build the provider plugin) |
99 | 17 |
|
100 |
| -### `spinnaker_pipeline_template` |
101 |
| - |
102 |
| -#### Example Usage |
103 |
| - |
104 |
| -``` |
105 |
| -data "template_file" "dcd_template" { |
106 |
| - template = "${file("template.yml")}" |
107 |
| -} |
108 |
| -
|
109 |
| -resource "spinnaker_pipeline_template" "terraform_example" { |
110 |
| - template = "${data.template_file.dcd_template.rendered}" |
111 |
| -} |
112 |
| -``` |
113 |
| - |
114 |
| -#### Argument Reference |
115 |
| - |
116 |
| -- `template` - A yaml formated [DCD Spec pipeline template](https://github.com/spinnaker/dcd-spec/blob/master/PIPELINE_TEMPLATES.md#templates) |
117 |
| - |
118 |
| -### `spinnaker_pipeline_template_config` |
119 |
| - |
120 |
| -#### Example Usage |
121 |
| - |
122 |
| -``` |
123 |
| -data "template_file" "dcd_template_config" { |
124 |
| - template = "${file("config.yml")}" |
125 |
| -} |
| 18 | +## Building and Developing The Provider |
126 | 19 |
|
127 |
| -resource "spinnaker_pipeline_template_config" "terraform_example" { |
128 |
| - pipeline_config = "${data.template_file.dcd_template_config.rendered}" |
129 |
| -} |
| 20 | +```sh |
| 21 | +$ git clone [email protected]:tidal-engineering/terraform-provider-spinnaker.git |
| 22 | +$ cd terraform-provider-spinnaker/ |
| 23 | +$ go build |
| 24 | +$ go test./... |
130 | 25 | ```
|
131 | 26 |
|
132 |
| -#### Argument Reference |
| 27 | +## Using the provider |
133 | 28 |
|
134 |
| -- `pipeline_config` - A yaml formated [DCD Spec pipeline configuration](https://github.com/spinnaker/dcd-spec/blob/master/PIPELINE_TEMPLATES.md#configurations) |
| 29 | +If you're building the provider, follow the instructions to [install it as a plugin.](https://www.terraform.io/docs/plugins/basics.html#installing-a-plugin) After placing it into your plugins directory, run `terraform init` to initialize it. |
0 commit comments