DomainName

class aws_cdk.aws_apigateway.DomainName(scope, id, *, mapping=None, certificate, domain_name, endpoint_type=None)

Bases: aws_cdk.core.Resource

__init__(scope, id, *, mapping=None, certificate, domain_name, endpoint_type=None)
Parameters
  • scope (Construct) –

  • id (str) –

  • props

  • mapping (Optional[IRestApi]) – If specified, all requests to this domain will be mapped to the production deployment of this API. If you wish to map this domain to multiple APIs with different base paths, don’t specify this option and use addBasePathMapping. Default: - you will have to call addBasePathMapping to map this domain to API endpoints.

  • certificate (ICertificate) – The reference to an AWS-managed certificate for use by the edge-optimized endpoint for the domain name. For “EDGE” domain names, the certificate needs to be in the US East (N. Virginia) region.

  • domain_name (str) – The custom domain name for your API. Uppercase letters are not supported.

  • endpoint_type (Optional[EndpointType]) – The type of endpoint for this DomainName. Default: REGIONAL

Return type

None

Methods

add_base_path_mapping(target_api, *, base_path=None)

Maps this domain to an API endpoint.

Parameters
  • target_api (IRestApi) – That target API endpoint, requests will be mapped to the deployment stage.

  • options – Options for mapping to base path with or without a stage.

  • base_path (Optional[str]) – The base path name that callers of the API must provide in the URL after the domain name (e.g. example.com/base-path). If you specify this property, it can’t be an empty string. Default: - map requests from the domain root (e.g. example.com). If this is undefined, no additional mappings will be allowed on this domain name.

Return type

BasePathMapping

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

domain_name

The domain name (e.g. example.com).

Return type

str

domain_name_alias_domain_name

The Route53 alias target to use in order to connect a record set to this domain through an alias.

Return type

str

domain_name_alias_hosted_zone_id

The Route53 hosted zone ID to use in order to connect a record set to this domain through an alias.

Return type

str

node

Construct tree node which offers APIs for interacting with the construct tree.

Return type

ConstructNode

stack

The stack in which this resource is defined.

Return type

Stack

Static Methods

classmethod from_domain_name_attributes(scope, id, *, domain_name, domain_name_alias_hosted_zone_id, domain_name_alias_target)

Imports an existing domain name.

Parameters
  • scope (Construct) –

  • id (str) –

  • attrs

  • domain_name (str) – The domain name (e.g. example.com).

  • domain_name_alias_hosted_zone_id (str) – Thje Route53 hosted zone ID to use in order to connect a record set to this domain through an alias.

  • domain_name_alias_target (str) – The Route53 alias target to use in order to connect a record set to this domain through an alias.

Return type

IDomainName

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool