Class CnameRecord
A DNS CNAME record.
Inherited Members
Namespace: Amazon.CDK.AWS.Route53
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CnameRecord : RecordSet, IRecordSet, IResource, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public Class CnameRecord Inherits RecordSet Implements IRecordSet, IResource, IConstruct, IDependable, IEnvironmentAware
Remarks
Resource: AWS::Route53::RecordSet
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.CertificateManager;
using Amazon.CDK.AWS.Route53;
// hosted zone and route53 features
string hostedZoneId;
var zoneName = "example.com";
var myDomainName = "api.example.com";
var certificate = new Certificate(this, "cert", new CertificateProps { DomainName = myDomainName });
var schema = new SchemaFile(new SchemaProps { FilePath = "mySchemaFile" });
var api = new GraphqlApi(this, "api", new GraphqlApiProps {
Name = "myApi",
Definition = Definition.FromSchema(schema),
DomainName = new DomainOptions {
Certificate = certificate,
DomainName = myDomainName
}
});
// hosted zone for adding appsync domain
var zone = HostedZone.FromHostedZoneAttributes(this, "HostedZone", new HostedZoneAttributes {
HostedZoneId = hostedZoneId,
ZoneName = zoneName
});
// create a cname to the appsync domain. will map to something like xxxx.cloudfront.net
// create a cname to the appsync domain. will map to something like xxxx.cloudfront.net
new CnameRecord(this, "CnameApiRecord", new CnameRecordProps {
RecordName = "api",
Zone = zone,
DomainName = api.AppSyncDomainName
});
Synopsis
Constructors
| CnameRecord(Construct, string, ICnameRecordProps) | A DNS CNAME record. |
Properties
| PROPERTY_INJECTION_ID | Uniquely identifies this class. |
Constructors
CnameRecord(Construct, string, ICnameRecordProps)
A DNS CNAME record.
public CnameRecord(Construct scope, string id, ICnameRecordProps props)
Parameters
- scope Construct
- id string
- props ICnameRecordProps
Remarks
Resource: AWS::Route53::RecordSet
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.CertificateManager;
using Amazon.CDK.AWS.Route53;
// hosted zone and route53 features
string hostedZoneId;
var zoneName = "example.com";
var myDomainName = "api.example.com";
var certificate = new Certificate(this, "cert", new CertificateProps { DomainName = myDomainName });
var schema = new SchemaFile(new SchemaProps { FilePath = "mySchemaFile" });
var api = new GraphqlApi(this, "api", new GraphqlApiProps {
Name = "myApi",
Definition = Definition.FromSchema(schema),
DomainName = new DomainOptions {
Certificate = certificate,
DomainName = myDomainName
}
});
// hosted zone for adding appsync domain
var zone = HostedZone.FromHostedZoneAttributes(this, "HostedZone", new HostedZoneAttributes {
HostedZoneId = hostedZoneId,
ZoneName = zoneName
});
// create a cname to the appsync domain. will map to something like xxxx.cloudfront.net
// create a cname to the appsync domain. will map to something like xxxx.cloudfront.net
new CnameRecord(this, "CnameApiRecord", new CnameRecordProps {
RecordName = "api",
Zone = zone,
DomainName = api.AppSyncDomainName
});
Properties
PROPERTY_INJECTION_ID
Uniquely identifies this class.
public static string PROPERTY_INJECTION_ID { get; }
Property Value
Remarks
Resource: AWS::Route53::RecordSet
ExampleMetadata: infused
Implements
Constructs.IConstruct
Constructs.IDependable