Attention

Generally we recommend to use existing zones, because other features, such as x-acm for DNS validation, won’t work without a working hosted zone. We specially recommend that for production workloads and use Lookup

x-route53

x-route53:
  domain-01:
    ZoneName: example.com
    Properties: {}
    Lookup: {}

Create or Lookup Route53 Hosted Zones in your AWS Account, to use along your services. Once you have defined the HostedZone, compose-x will use its properties where appropriate with other resources.

Use with x-elbv2

To create new Alias records pointing to your ELBv2 (NLB or ALB), simply create the x-route53 zone and set use DnsAliases in x-elbv2.

x-route53:
  public-domain:
    ZoneName: compose-x.io
    Lookup: true

x-elbv2:
  public-alb:
    DnsAliases:
      - Route53Zone: x-route53::public-zone
        Names:
          - traefik.compose-x.io # Will create a new record pointing to the ALB/NLB
    Properties: {}
    ...

Use with x-acm

Now that AWS ACM supports DNS validation built-into AWS CloudFormation, you can combine x-rds and x-acm to create new ACM Certificates that will automatically set the DNS records in your DNS zone.

x-route53:
  public-domain:
    ZoneName: compose-x.io
    Lookup: true

x-acm:
  traefik-cert:
    MacroParameters:
      DomainNames:
        - test.compose-x.io
        - someother.test.compose-x.io
      HostedZoneId: x-route53::public-domain

Warning

Your zone must be active and functional in order to have the certificates activated. If not, the certificates creation won’t complete, leading CFN to rollback.

Note

Compose-X will verify that the DNS names you enter in the DNS validation / ELBv2 aliases are going to match with the x-route53 ZoneName property defined.

JSON Schema

Model

x-route53

x-route53.spec.json

x-route53 specification

type

object

properties

  • ZoneName

type

string

format

idn-hostname

  • Name

type

string

format

idn-hostname

  • Lookup

oneOf

type

object

properties

  • RoleArn

x-resources.common.spec.json#/definitions/Lookup/properties/RoleArn

  • HostedZoneId

If set, will retrieve the zone details from the Zone ID directly.

#/definitions/HostedZoneId

  • IsPrivateZone

Defines whether the zone is private

type

boolean

default

False

When set to true, finds the zone based on ZoneName alone.

type

boolean

additionalProperties

False

definitions

  • HostedZoneId

The Route53 ZoneID

type

string

pattern

Z[A-Z0-9]+$

Definition

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "id": "x-route53.spec.json",
  "$id": "x-route53.spec.json",
  "title": "x-route53",
  "description": "x-route53 specification",
  "type": "object",
  "additionalProperties": false,
  "oneOf": [
    {
      "required": [
        "ZoneName"
      ]
    },
    {
      "required": [
        "Name"
      ]
    }
  ],
  "properties": {
    "ZoneName": {
      "type": "string",
      "format": "idn-hostname"
    },
    "Name": {
      "type": "string",
      "format": "idn-hostname"
    },
    "Lookup": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "RoleArn": {
              "$ref": "x-resources.common.spec.json#/definitions/Lookup/properties/RoleArn"
            },
            "HostedZoneId": {
              "$ref": "#/definitions/HostedZoneId",
              "description": "If set, will retrieve the zone details from the Zone ID directly."
            },
            "IsPrivateZone": {
              "type": "boolean",
              "default": false,
              "description": "Defines whether the zone is private"
            }
          }
        },
        {
          "type": "boolean",
          "description": "When set to true, finds the zone based on ZoneName alone."
        }
      ]
    }
  },
  "definitions": {
    "HostedZoneId": {
      "type": "string",
      "pattern": "Z[A-Z0-9]+$",
      "description": "The Route53 ZoneID"
    }
  }
}