Custom Domains

A CustomDomain object represents an additional customer-owned domain that routes to a Files.com site.

Resource Schema

Required

PropertyDescription
domain
String
Customer-owned domain name.

Optional

PropertyDescription
destination
String
Where this custom domain routes. Can be site_alias, public_hosting, s3_endpoint, or unassigned (not routing traffic). Set to unassigned automatically when a bound public_hosting folder behavior is deleted, and can be set manually via the API for any reason.
Possible values: site_alias, public_hosting, s3_endpoint, unassigned
ssl_certificate_id
Int64
Current SSL certificate ID.
folder_behavior_id
Int64
Public Hosting behavior ID when this domain routes to a specific Public Hosting behavior. Preserved as historical context when destination becomes unassigned.

Read Only

PropertyDescription
id
Int64
Custom Domain ID.
dns_status
String
Current DNS verification status.
Possible values: disabled, correct, no_records, cname_wrong, a_record, caa_conflict
brick_managed
Bool
Is this domain's SSL certificate automatically managed and renewed by Files.com?
created_at
String
When this Custom Domain was created.
updated_at
String
When this Custom Domain was last updated.

Example Resource

resource "files_custom_domain" "example_custom_domain" {
  destination        = "site_alias"
  folder_behavior_id = 1
  ssl_certificate_id = 1
  domain             = "files.example.com"
}

Resource Import

This Resource supports importing using the following syntax:

Example Import Command

# Custom Domains can be imported by specifying the id.
terraform import files_custom_domain.example_custom_domain 1

Data Source Schema

Required

PropertyDescription
id
Int64
Custom Domain ID.

Read Only

PropertyDescription
domain
String
Customer-owned domain name.
destination
String
Where this custom domain routes. Can be site_alias, public_hosting, s3_endpoint, or unassigned (not routing traffic). Set to unassigned automatically when a bound public_hosting folder behavior is deleted, and can be set manually via the API for any reason.
Possible values: site_alias, public_hosting, s3_endpoint, unassigned
dns_status
String
Current DNS verification status.
Possible values: disabled, correct, no_records, cname_wrong, a_record, caa_conflict
ssl_certificate_id
Int64
Current SSL certificate ID.
brick_managed
Bool
Is this domain's SSL certificate automatically managed and renewed by Files.com?
folder_behavior_id
Int64
Public Hosting behavior ID when this domain routes to a specific Public Hosting behavior. Preserved as historical context when destination becomes unassigned.
created_at
String
When this Custom Domain was created.
updated_at
String
When this Custom Domain was last updated.

Example Data Source

data "files_custom_domain" "example_custom_domain" {
  id = 1
}