heroku_domain

Provides a Heroku Domain resource. This can be used to create and manage custom domains on Heroku.

Example Usage

# Create a new Heroku app
resource "heroku_app" "default" {
  name = "test-app"
  region = "us"
}

# Associate a custom domain
resource "heroku_domain" "default" {
  app_id   = heroku_app.default.id
  hostname = "www.example.com"
}

Argument Reference

For apps with ACM enabled (automated certificate management):

For apps with heroku_ssl (SNI Endpoint) resources (manual certificate management):

Attributes Reference

The following attributes are exported:

Importing

When importing a Heroku domain resource, the ID is specified APP_NAME:DOMAIN_IDENTIFIER, where the domain can be identified either with the UUID from the Heroku API or the domain name.

For an app named test-app with a domain name of terraform.example.com, you could import it with:

$ terraform import heroku_domain.default test-app:terraform.example.com