UNPKG

13.3 kBTypeScriptView Raw
1import * as iam from '@aws-cdk/aws-iam';
2import { Duration, IResource, RemovalPolicy, Resource } from '@aws-cdk/core';
3import { Construct } from 'constructs';
4import { IAliasRecordTarget } from './alias-record-target';
5import { IHostedZone } from './hosted-zone-ref';
6import { Construct as CoreConstruct } from '@aws-cdk/core';
7/**
8 * A record set
9 */
10export interface IRecordSet extends IResource {
11 /**
12 * The domain name of the record
13 */
14 readonly domainName: string;
15}
16/**
17 * The record type.
18 */
19export declare enum RecordType {
20 /**
21 * route traffic to a resource, such as a web server, using an IPv4 address in dotted decimal
22 * notation
23 *
24 * @see https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html#AFormat
25 */
26 A = "A",
27 /**
28 * route traffic to a resource, such as a web server, using an IPv6 address in colon-separated
29 * hexadecimal format
30 *
31 * @see https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html#AAAAFormat
32 */
33 AAAA = "AAAA",
34 /**
35 * A CAA record specifies which certificate authorities (CAs) are allowed to issue certificates
36 * for a domain or subdomain
37 *
38 * @see https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html#CAAFormat
39 */
40 CAA = "CAA",
41 /**
42 * A CNAME record maps DNS queries for the name of the current record, such as acme.example.com,
43 * to another domain (example.com or example.net) or subdomain (acme.example.com or zenith.example.org).
44 *
45 * @see https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html#CNAMEFormat
46 */
47 CNAME = "CNAME",
48 /**
49 * A delegation signer (DS) record refers a zone key for a delegated subdomain zone.
50 *
51 * @see https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html#DSFormat
52 */
53 DS = "DS",
54 /**
55 * An MX record specifies the names of your mail servers and, if you have two or more mail servers,
56 * the priority order.
57 *
58 * @see https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html#MXFormat
59 */
60 MX = "MX",
61 /**
62 * A Name Authority Pointer (NAPTR) is a type of record that is used by Dynamic Delegation Discovery
63 * System (DDDS) applications to convert one value to another or to replace one value with another.
64 * For example, one common use is to convert phone numbers into SIP URIs.
65 *
66 * @see https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html#NAPTRFormat
67 */
68 NAPTR = "NAPTR",
69 /**
70 * An NS record identifies the name servers for the hosted zone
71 *
72 * @see https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html#NSFormat
73 */
74 NS = "NS",
75 /**
76 * A PTR record maps an IP address to the corresponding domain name.
77 *
78 * @see https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html#PTRFormat
79 */
80 PTR = "PTR",
81 /**
82 * A start of authority (SOA) record provides information about a domain and the corresponding Amazon
83 * Route 53 hosted zone
84 *
85 * @see https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html#SOAFormat
86 */
87 SOA = "SOA",
88 /**
89 * SPF records were formerly used to verify the identity of the sender of email messages.
90 * Instead of an SPF record, we recommend that you create a TXT record that contains the applicable value.
91 *
92 * @see https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html#SPFFormat
93 */
94 SPF = "SPF",
95 /**
96 * An SRV record Value element consists of four space-separated values. The first three values are
97 * decimal numbers representing priority, weight, and port. The fourth value is a domain name.
98 *
99 * @see https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html#SRVFormat
100 */
101 SRV = "SRV",
102 /**
103 * A TXT record contains one or more strings that are enclosed in double quotation marks (").
104 *
105 * @see https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/ResourceRecordTypes.html#TXTFormat
106 */
107 TXT = "TXT"
108}
109/**
110 * Options for a RecordSet.
111 */
112export interface RecordSetOptions {
113 /**
114 * The hosted zone in which to define the new record.
115 */
116 readonly zone: IHostedZone;
117 /**
118 * The domain name for this record.
119 *
120 * @default zone root
121 */
122 readonly recordName?: string;
123 /**
124 * The resource record cache time to live (TTL).
125 *
126 * @default Duration.minutes(30)
127 */
128 readonly ttl?: Duration;
129 /**
130 * A comment to add on the record.
131 *
132 * @default no comment
133 */
134 readonly comment?: string;
135}
136/**
137 * Type union for a record that accepts multiple types of target.
138 */
139export declare class RecordTarget {
140 readonly values?: string[] | undefined;
141 readonly aliasTarget?: IAliasRecordTarget | undefined;
142 /**
143 * Use string values as target.
144 */
145 static fromValues(...values: string[]): RecordTarget;
146 /**
147 * Use an alias as target.
148 */
149 static fromAlias(aliasTarget: IAliasRecordTarget): RecordTarget;
150 /**
151 * Use ip addresses as target.
152 */
153 static fromIpAddresses(...ipAddresses: string[]): RecordTarget;
154 /**
155 *
156 * @param values correspond with the chosen record type (e.g. for 'A' Type, specify one or more IP addresses)
157 * @param aliasTarget alias for targets such as CloudFront distribution to route traffic to
158 */
159 protected constructor(values?: string[] | undefined, aliasTarget?: IAliasRecordTarget | undefined);
160}
161/**
162 * Construction properties for a RecordSet.
163 */
164export interface RecordSetProps extends RecordSetOptions {
165 /**
166 * The record type.
167 */
168 readonly recordType: RecordType;
169 /**
170 * The target for this record, either `RecordTarget.fromValues()` or
171 * `RecordTarget.fromAlias()`.
172 */
173 readonly target: RecordTarget;
174}
175/**
176 * A record set.
177 */
178export declare class RecordSet extends Resource implements IRecordSet {
179 readonly domainName: string;
180 constructor(scope: Construct, id: string, props: RecordSetProps);
181}
182/**
183 * Target for a DNS A Record
184 *
185 * @deprecated Use RecordTarget
186 */
187export declare class AddressRecordTarget extends RecordTarget {
188}
189/**
190 * Construction properties for a ARecord.
191 */
192export interface ARecordProps extends RecordSetOptions {
193 /**
194 * The target.
195 */
196 readonly target: RecordTarget;
197}
198/**
199 * A DNS A record
200 *
201 * @resource AWS::Route53::RecordSet
202 */
203export declare class ARecord extends RecordSet {
204 constructor(scope: Construct, id: string, props: ARecordProps);
205}
206/**
207 * Construction properties for a AaaaRecord.
208 */
209export interface AaaaRecordProps extends RecordSetOptions {
210 /**
211 * The target.
212 */
213 readonly target: RecordTarget;
214}
215/**
216 * A DNS AAAA record
217 *
218 * @resource AWS::Route53::RecordSet
219 */
220export declare class AaaaRecord extends RecordSet {
221 constructor(scope: Construct, id: string, props: AaaaRecordProps);
222}
223/**
224 * Construction properties for a CnameRecord.
225 */
226export interface CnameRecordProps extends RecordSetOptions {
227 /**
228 * The domain name.
229 */
230 readonly domainName: string;
231}
232/**
233 * A DNS CNAME record
234 *
235 * @resource AWS::Route53::RecordSet
236 */
237export declare class CnameRecord extends RecordSet {
238 constructor(scope: Construct, id: string, props: CnameRecordProps);
239}
240/**
241 * Construction properties for a TxtRecord.
242 */
243export interface TxtRecordProps extends RecordSetOptions {
244 /**
245 * The text values.
246 */
247 readonly values: string[];
248}
249/**
250 * A DNS TXT record
251 *
252 * @resource AWS::Route53::RecordSet
253 */
254export declare class TxtRecord extends RecordSet {
255 constructor(scope: Construct, id: string, props: TxtRecordProps);
256}
257/**
258 * Properties for a SRV record value.
259 */
260export interface SrvRecordValue {
261 /**
262 * The priority.
263 */
264 readonly priority: number;
265 /**
266 * The weight.
267 */
268 readonly weight: number;
269 /**
270 * The port.
271 */
272 readonly port: number;
273 /**
274 * The server host name.
275 */
276 readonly hostName: string;
277}
278/**
279 * Construction properties for a SrvRecord.
280 */
281export interface SrvRecordProps extends RecordSetOptions {
282 /**
283 * The values.
284 */
285 readonly values: SrvRecordValue[];
286}
287/**
288 * A DNS SRV record
289 *
290 * @resource AWS::Route53::RecordSet
291 */
292export declare class SrvRecord extends RecordSet {
293 constructor(scope: Construct, id: string, props: SrvRecordProps);
294}
295/**
296 * The CAA tag.
297 */
298export declare enum CaaTag {
299 /**
300 * Explicity authorizes a single certificate authority to issue a
301 * certificate (any type) for the hostname.
302 */
303 ISSUE = "issue",
304 /**
305 * Explicity authorizes a single certificate authority to issue a
306 * wildcard certificate (and only wildcard) for the hostname.
307 */
308 ISSUEWILD = "issuewild",
309 /**
310 * Specifies a URL to which a certificate authority may report policy
311 * violations.
312 */
313 IODEF = "iodef"
314}
315/**
316 * Properties for a CAA record value.
317 */
318export interface CaaRecordValue {
319 /**
320 * The flag.
321 */
322 readonly flag: number;
323 /**
324 * The tag.
325 */
326 readonly tag: CaaTag;
327 /**
328 * The value associated with the tag.
329 */
330 readonly value: string;
331}
332/**
333 * Construction properties for a CaaRecord.
334 */
335export interface CaaRecordProps extends RecordSetOptions {
336 /**
337 * The values.
338 */
339 readonly values: CaaRecordValue[];
340}
341/**
342 * A DNS CAA record
343 *
344 * @resource AWS::Route53::RecordSet
345 */
346export declare class CaaRecord extends RecordSet {
347 constructor(scope: Construct, id: string, props: CaaRecordProps);
348}
349/**
350 * Construction properties for a CaaAmazonRecord.
351 */
352export interface CaaAmazonRecordProps extends RecordSetOptions {
353}
354/**
355 * A DNS Amazon CAA record.
356 *
357 * A CAA record to restrict certificate authorities allowed
358 * to issue certificates for a domain to Amazon only.
359 *
360 * @resource AWS::Route53::RecordSet
361 */
362export declare class CaaAmazonRecord extends CaaRecord {
363 constructor(scope: Construct, id: string, props: CaaAmazonRecordProps);
364}
365/**
366 * Properties for a MX record value.
367 */
368export interface MxRecordValue {
369 /**
370 * The priority.
371 */
372 readonly priority: number;
373 /**
374 * The mail server host name.
375 */
376 readonly hostName: string;
377}
378/**
379 * Construction properties for a MxRecord.
380 */
381export interface MxRecordProps extends RecordSetOptions {
382 /**
383 * The values.
384 */
385 readonly values: MxRecordValue[];
386}
387/**
388 * A DNS MX record
389 *
390 * @resource AWS::Route53::RecordSet
391 */
392export declare class MxRecord extends RecordSet {
393 constructor(scope: Construct, id: string, props: MxRecordProps);
394}
395/**
396 * Construction properties for a NSRecord.
397 */
398export interface NsRecordProps extends RecordSetOptions {
399 /**
400 * The NS values.
401 */
402 readonly values: string[];
403}
404/**
405 * A DNS NS record
406 *
407 * @resource AWS::Route53::RecordSet
408 */
409export declare class NsRecord extends RecordSet {
410 constructor(scope: Construct, id: string, props: NsRecordProps);
411}
412/**
413 * Construction properties for a DSRecord.
414 */
415export interface DsRecordProps extends RecordSetOptions {
416 /**
417 * The DS values.
418 */
419 readonly values: string[];
420}
421/**
422 * A DNS DS record
423 *
424 * @resource AWS::Route53::RecordSet
425 */
426export declare class DsRecord extends RecordSet {
427 constructor(scope: Construct, id: string, props: DsRecordProps);
428}
429/**
430 * Construction properties for a ZoneDelegationRecord
431 */
432export interface ZoneDelegationRecordProps extends RecordSetOptions {
433 /**
434 * The name servers to report in the delegation records.
435 */
436 readonly nameServers: string[];
437}
438/**
439 * A record to delegate further lookups to a different set of name servers.
440 */
441export declare class ZoneDelegationRecord extends RecordSet {
442 constructor(scope: Construct, id: string, props: ZoneDelegationRecordProps);
443}
444/**
445 * Construction properties for a CrossAccountZoneDelegationRecord
446 */
447export interface CrossAccountZoneDelegationRecordProps {
448 /**
449 * The zone to be delegated
450 */
451 readonly delegatedZone: IHostedZone;
452 /**
453 * The hosted zone name in the parent account
454 *
455 * @default - no zone name
456 */
457 readonly parentHostedZoneName?: string;
458 /**
459 * The hosted zone id in the parent account
460 *
461 * @default - no zone id
462 */
463 readonly parentHostedZoneId?: string;
464 /**
465 * The delegation role in the parent account
466 */
467 readonly delegationRole: iam.IRole;
468 /**
469 * The resource record cache time to live (TTL).
470 *
471 * @default Duration.days(2)
472 */
473 readonly ttl?: Duration;
474 /**
475 * The removal policy to apply to the record set.
476 *
477 * @default RemovalPolicy.DESTROY
478 */
479 readonly removalPolicy?: RemovalPolicy;
480}
481/**
482 * A Cross Account Zone Delegation record
483 */
484export declare class CrossAccountZoneDelegationRecord extends CoreConstruct {
485 constructor(scope: Construct, id: string, props: CrossAccountZoneDelegationRecordProps);
486}