interface DomainOptions
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.AppSync.DomainOptions |
Java | software.amazon.awscdk.services.appsync.DomainOptions |
Python | aws_cdk.aws_appsync.DomainOptions |
TypeScript (source) | @aws-cdk/aws-appsync » DomainOptions |
Domain name configuration for AppSync.
Example
import * as acm from '@aws-cdk/aws-certificatemanager';
import * as route53 from '@aws-cdk/aws-route53';
const myDomainName = 'api.example.com';
const certificate = new acm.Certificate(this, 'cert', { domainName: myDomainName });
const api = new appsync.GraphqlApi(this, 'api', {
name: 'myApi',
domainName: {
certificate,
domainName: myDomainName,
},
});
// hosted zone and route53 features
declare const hostedZoneId: string;
declare const zoneName = 'example.com';
// hosted zone for adding appsync domain
const zone = route53.HostedZone.fromHostedZoneAttributes(this, `HostedZone`, {
hostedZoneId,
zoneName,
});
// create a cname to the appsync domain. will map to something like xxxx.cloudfront.net
new route53.CnameRecord(this, `CnameApiRecord`, {
recordName: 'api',
zone,
domainName: myDomainName,
});
Properties
Name | Type | Description |
---|---|---|
certificate | ICertificate | The certificate to use with the domain name. |
domain | string | The actual domain name. |
certificate
Type:
ICertificate
The certificate to use with the domain name.
domainName
Type:
string
The actual domain name.
For example, api.example.com
.