A Terraform plugin to manage Deis applications.
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is even with botlink:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
deis
scripts
.gitignore
Makefile
README.md
main.go

README.md

terraform-provider-deis

A Terraform plugin to manage Deis applications.

Please see our Github Releases page to find the latest compiled binary.

Resources

In order to use this plugin, make sure you set up the proper configuration.

Retrieve an admin user token to use for all API calls similiar to below, change out your values. We use a special continuous integration user so that if someone leaves we don't need to change the token out.

POST /v1/auth/login/ HTTP/1.1
Accept: application/json
Content-Type: application/json
Host: deis.example.com

{"username":"admin_user_username","password":"admin_user_password"}

Configure the Deis provider:

provider "deis" {
  controller_url = "http://deis.example.com"
  token = "the_token_from_the_previous_step"
  username = "admin_user_username"
}

Applications

This is resource corresponds to an application on Deis.

resource "deis_application" "hello_world" {
  name = "hello_world"

  config_vars {
    API_ENDPOINT = "https://api.hello.com"
  }
}

Argument Reference

The following arguments are supported:

  • name - (Required) The name of the application. In Deis, this also acts as the unique id.
  • config_vars - (Optional) These are configuration variables for your application.

Attributes Reference

The following attributes are exported:

  • id - The id of the application. In Deis, this also acts as the application name.
  • name - The name of the application. In Deis, this also acts as the unique id.
  • hostname - A hostname for the Deis application, suitable for pointing DNS records.
  • config_vars - These are the configuration variables for your application.

Note - If you don't specify a config variable, then Terraform won't know about it. This is on the wish list so feel free to make a pull request if you want.

Domains

This is resource corresponds to an application domain on Deis.

Example Usage

# Creates a new Deis domain associated with an application
resource "deis_domain" "hello_dot_com" {
  appID = "${deis_application.hello_world.id}"
  fqdn = "hello.com"
}

Argument Reference

The following arguments are supported:

  • appID - (Required) The id/name of the application.
  • fqdn - (Required) The fully qualified domain name of the application, e.g. hello.com.

Attributes Reference

The following attributes are exported:

  • id - The fully qualified domain name of the application, e.g. hello.com.
  • appID - The id/name of the application.
  • fqdn - The fully qualified domain name of the application, e.g. hello.com.

Certificates

This is resource corresponds to an application certicate on Deis.

Example Usage

# Creates a new Deis certificate for test.com
resource "deis_certificate" "test" {
  certificate = <<CERT
-----BEGIN CERTIFICATE-----
MIIC+TCCAeGgAwIBAgIJAJ8Plb5KBOsoMA0GCSqGSIb3DQEBBQUAMBMxETAPBgNV
BAMMCHRlc3QuY29tMB4XDTE1MTIxMjA4MTcyOFoXDTI1MTIwOTA4MTcyOFowEzER
MA8GA1UEAwwIdGVzdC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB
AQCvk1711ul2ctTewLg1MuzU6WMvexnyO+dFRJKngeD55XxLw2TGySVhVcwPgQsD
4XMMb9oqPlYsxNjaMBBtSUf5OaRN0MItbHdUdR7uHM8gM00DW43rp/MfvDud22Xa
JpY+/lenEwMVkQyHlqzHnzIIVa9Wp6/8Jud3mcx1OfxW073hQEU+C7vz8wWwYcxO
wf9X5wIhKdroeq45QEyqD1PJMeiZ8nb2i/7osEHw27Wc30NdPq0VSxGhlNerr/Fs
+GVz93Wbj9dnXObfKSWrH02oJMidRn8Vm2HbJiKouEP00qKfcjcLCE5G/htkEdis
/GzMV778NPi0bsVkdGmJ5wGpAgMBAAGjUDBOMB0GA1UdDgQWBBSngqUaB05+klqo
rs/2AwaMReayWDAfBgNVHSMEGDAWgBSngqUaB05+klqors/2AwaMReayWDAMBgNV
HRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQB3V1KlITywAGAsTYAGLsN7Jyem
udeD8LmmDav9QIjTGgnUNVtAOWnvNU/gaKEQ6lxVk/shdcASTV3L72gs7MKGoZEy
qKhkEiP7B/h4taQfZPjuO3tYym7vZOdMNtyhwhd+kV0xV0u7AsbP5gucp4VuLj74
kZpwboW5l87lrxNZcjZMIyBD+sK13jCRLW+71P9Nd693tBqo7KCxcA1aC2XsFRI5
P/s1PoG6XO2TN5gDMH1UQA3WzpWOuXnqMsT3v9Ud9ahS99fikYZYMj0rnyn6Lzyh
bZKfM9rUOyPjVGaUwaaTH4IE2wxirJ+FdaPO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rAu2cn5D39AazQuWpA/coAGlVUDmvtpXDPdVqQscaMQDVX3LT4BCqxMMyN8
NMy5F4so7kdReQ3LDicDLMZ5fSGtJ5ACSbEm6xUCgYBEK7p9sBKTUixvaj2RGXSY
/U3UXe+xEdlPKZ+zbKtBX6kk/a+aaRhzn6Y/e4iFbrdd7Qi1JR8tVBHN/1wFFBKo
z+nePHkXbUd6wtuqXGmTWcm7Eh1Tq8TZjcbNpIPrg82Iy/miNHsDcpPFTaRZ28Vy
zcRMW6MIcK3S8/hQTKnYuQKBgCguAbucICeGN6tE5pXTXKP1zKO4huIjMCi//LcY
dedhTf+yI/dWAwqfEKu6iAa9334PPc+pxE9tCmfnJMajuHIGi4jjRaWa4DcPTeLE
qLKxP5+A2dyLWsuhwidTOHhAZiMW6W/Y4QBEiheFO2PvjRiwX+WZgoDBwOue56aJ
HAmlAoGABSpMFAdbj3zuUFF8O94lB/VnRjey1gwp2b8LD5EJmVhzI2JG8gA0fyqh
ma+EOc+PYpvHTvi3X3zMEi7UpxK9fO+lvEi56W70h99dTKxJNey+ZG+5s+EA0HQl
D70s8vfL24lDXXvwaaiiQx1yVWEmiaG25voapoGqvVUbhh4jPtc=
-----END RSA PRIVATE KEY-----
KEY
}

Argument Reference

The following arguments are supported:

  • certificate - (Required) The SSL certificate.
  • commonName - (Optional) The fully qualified domain name of the certificate, e.g. test.com.
  • key - (Required) The corresponding key to the certificate.

Attributes Reference

The following attributes are exported:

  • id - The ID used to store the certificate in the database.
  • certificate - The SSL certificate.
  • commonName - The fully qualified domain name of the certificate, e.g. test.com.
  • key - The corresponding key to the certificate.

API Compatibility

This plugin was written against Deis API v1.7.