Amazon API Gateway REST API Reference

DomainName

Represents a custom domain name as a user-friendly host name of an API (RestApi).


Relation Description Method Templated
self

A relation that refers to the current resource.

GET No
domainname:create

Creates a new domain name.

POST No
domainname:update

Changes information about the domain name resource.

PATCH No
domainname:delete

Deletes the domain name resource.

DELETE No
domainname:basepathmappings

Gets the BasePathMappings resource representing the collection of base path mappings for the specified custom domain name.

This link relation offers the following templated variable(s):

  • limit: Optional.

    The maximum number of returned results per page. The value is 25 by default and could be between 1 - 500.

GET Yes
basepathmapping:by-base-path

Gets a BasePathMapping resource by using the specified identifier.

This link relation offers the following templated variable(s):

  • base_path: Required.

    The base path name that callers of the API must provide as part of the URL after the domain name. This value must be unique for all of the mappings across a single API. Leave this blank if you do not want callers to specify any base path name after the domain name.

GET Yes
basepathmapping:create

Creates a new BasePathMapping resource.

POST No


Properties

{
  "domainName" : "String",
  "certificateName" : "String",
  "certificateArn" : "String",
  "certificateUploadDate" : "Timestamp",
  "regionalDomainName" : "String",
  "regionalHostedZoneId" : "String",
  "regionalCertificateName" : "String",
  "regionalCertificateArn" : "String",
  "distributionDomainName" : "String",
  "distributionHostedZoneId" : "String",
  "endpointConfiguration" : {
    "types" : [ "String" ]
  }
}

  • domainName
  • The name of the DomainName resource.

  • certificateName
  • The name of the certificate that will be used by edge-optimized endpoint for this domain name.

  • certificateArn
  • The reference to an AWS-managed certificate that will be used by edge-optimized endpoint for this domain name. AWS Certificate Manager is the only supported source.

  • certificateUploadDate
  • The timestamp when the certificate that was used by edge-optimized endpoint for this domain name was uploaded.

  • regionalDomainName
  • The domain name associated with the regional endpoint for this custom domain name. You set up this association by adding a DNS record that points the custom domain name to this regional domain name. The regional domain name is returned by API Gateway when you create a regional endpoint.

  • regionalHostedZoneId
  • The region-specific Amazon Route 53 Hosted Zone ID of the regional endpoint. For more information, see Set up a Regional Custom Domain Name and AWS Regions and Endpoints for API Gateway.

  • regionalCertificateName
  • The name of the certificate that will be used for validating the regional domain name.

  • regionalCertificateArn
  • The reference to an AWS-managed certificate that will be used for validating the regional domain name. AWS Certificate Manager is the only supported source.

  • distributionDomainName
  • The domain name of the Amazon CloudFront distribution associated with this custom domain name for an edge-optimized endpoint. You set up this association when adding a DNS record pointing the custom domain name to this distribution name. For more information about CloudFront distributions, see the Amazon CloudFront documentation.

  • distributionHostedZoneId
  • The region-agnostic Amazon Route 53 Hosted Zone ID of the edge-optimized endpoint. The valid value is Z2FDTNDATAQYW2 for all the regions. For more information, see Set up a Regional Custom Domain Name and AWS Regions and Endpoints for API Gateway.

  • endpointConfiguration
  • The endpoint configuration of this DomainName showing the endpoint types of the domain name.

  • types
  • A list of endpoint types of an API (RestApi) or its custom domain name (DomainName). For an edge-optimized API and its custom domain name, the endpoint type is "EDGE". For a regional API and its custom domain name, the endpoint type is REGIONAL.

Remarks

When you deploy an API, API Gateway creates a default host name for the API. This default API host name is of the {restapi-id}.execute-api.{region}.amazonaws.com format. With the default host name, you can access the API's root resource with the URL of https://{restapi-id}.execute-api.{region}.amazonaws.com/{stage}/. When you set up a custom domain name of apis.example.com for this API, you can then access the same resource using the URL of the https://apis.examples.com/myApi, where myApi is the base path mapping (BasePathMapping) of your API under the custom domain name.

See Also

Set a Custom Host Name for an API