DomainOptions

class aws_cdk.aws_appsync.DomainOptions(*, certificate, domain_name)

Bases: object

(experimental) Domain name configuration for AppSync.

Parameters
  • certificate (ICertificate) – (experimental) The certificate to use with the domain name.

  • domain_name (str) – (experimental) The actual domain name. For example, api.example.com.

Stability

experimental

ExampleMetadata

infused

Example:

import aws_cdk.aws_certificatemanager as acm
import aws_cdk.aws_route53 as route53

# hosted zone and route53 features
# hosted_zone_id: str
zone_name = "example.com"


my_domain_name = "api.example.com"
certificate = acm.Certificate(self, "cert", domain_name=my_domain_name)
api = appsync.GraphqlApi(self, "api",
    name="myApi",
    domain_name=appsync.DomainOptions(
        certificate=certificate,
        domain_name=my_domain_name
    )
)

# hosted zone for adding appsync domain
zone = route53.HostedZone.from_hosted_zone_attributes(self, "HostedZone",
    hosted_zone_id=hosted_zone_id,
    zone_name=zone_name
)

# create a cname to the appsync domain. will map to something like xxxx.cloudfront.net
route53.CnameRecord(self, "CnameApiRecord",
    record_name="api",
    zone=zone,
    domain_name=my_domain_name
)

Attributes

certificate

(experimental) The certificate to use with the domain name.

Stability

experimental

Return type

ICertificate

domain_name

(experimental) The actual domain name.

For example, api.example.com.

Stability

experimental

Return type

str