2014-11-27 12:12:34 +01:00
|
|
|
---
|
|
|
|
layout: "heroku"
|
|
|
|
page_title: "Heroku: heroku_cert"
|
|
|
|
sidebar_current: "docs-heroku-resource-cert"
|
|
|
|
description: |-
|
|
|
|
Provides a Heroku SSL certificate resource. It allows to set a given certificate for a Heroku app.
|
|
|
|
---
|
|
|
|
|
|
|
|
# heroku\_cert
|
|
|
|
|
|
|
|
Provides a Heroku SSL certificate resource. It allows to set a given certificate for a Heroku app.
|
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
|
|
|
```
|
2015-01-03 19:31:53 +01:00
|
|
|
# Create a new Heroku app
|
2014-11-27 12:12:34 +01:00
|
|
|
resource "heroku_app" "default" {
|
2017-02-18 23:48:50 +01:00
|
|
|
name = "test-app"
|
2014-11-27 12:12:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# Add-on SSL to application
|
|
|
|
resource "heroku_addon" "ssl" {
|
2017-02-18 23:48:50 +01:00
|
|
|
app = "${heroku_app.default.name}"
|
|
|
|
plan = "ssl"
|
2014-11-27 12:12:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
# Establish certificate for a given application
|
|
|
|
resource "heroku_cert" "ssl_certificate" {
|
2017-02-18 23:48:50 +01:00
|
|
|
app = "${heroku_app.default.name}"
|
|
|
|
certificate_chain = "${file("server.crt")}"
|
|
|
|
private_key = "${file("server.key")}"
|
|
|
|
depends_on = "heroku_addon.ssl"
|
2014-11-27 12:12:34 +01:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported:
|
|
|
|
|
|
|
|
* `app` - (Required) The Heroku app to add to.
|
|
|
|
* `certificate_chain` - (Required) The certificate chain to add
|
|
|
|
* `private_key` - (Required) The private key for a given certificate chain
|
|
|
|
|
|
|
|
## Attributes Reference
|
|
|
|
|
|
|
|
The following attributes are exported:
|
|
|
|
|
|
|
|
* `id` - The ID of the add-on
|
2015-01-03 19:31:53 +01:00
|
|
|
* `cname` - The CNAME for the SSL endpoint
|
2014-11-27 12:12:34 +01:00
|
|
|
* `name` - The name of the SSL certificate
|
|
|
|
|