interface CnameRecordProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Route53.CnameRecordProps |
Java | software.amazon.awscdk.services.route53.CnameRecordProps |
Python | aws_cdk.aws_route53.CnameRecordProps |
TypeScript (source) | @aws-cdk/aws-route53 » CnameRecordProps |
Construction properties for a CnameRecord.
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 |
---|---|---|
domain | string | The domain name. |
zone | IHosted | The hosted zone in which to define the new record. |
comment? | string | A comment to add on the record. |
record | string | The domain name for this record. |
ttl? | Duration | The resource record cache time to live (TTL). |
domainName
Type:
string
The domain name.
zone
Type:
IHosted
The hosted zone in which to define the new record.
comment?
Type:
string
(optional, default: no comment)
A comment to add on the record.
recordName?
Type:
string
(optional, default: zone root)
The domain name for this record.
ttl?
Type:
Duration
(optional, default: Duration.minutes(30))
The resource record cache time to live (TTL).