@composurecdk/route53 0.3.5 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -96,6 +96,105 @@ The defaults are exported as `HOSTED_ZONE_DEFAULTS`, `A_RECORD_DEFAULTS`, `AAAA_
96
96
 
97
97
  Route 53 health checks expose a `HealthCheckStatus` metric that [AWS recommends alarming on](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Best_Practice_Recommended_Alarms_AWS_Services.html#Route53). This package does not yet expose a `HealthCheckBuilder`; once it does, the recommended alarm will be enabled by default alongside the health check. Tracked in [#45](https://github.com/laazyj/composureCDK/issues/45).
98
98
 
99
+ ## Zone DSL
100
+
101
+ Individual builders are convenient for AWS-service records wired to other constructs, but a real zone file — apex, www, mail, SPF/DMARC/DKIM, CAA, service records — is faster to read and write as a flat list of records. `@composurecdk/route53/zone` exposes a BIND-style DSL that compiles to the same builders:
102
+
103
+ ```ts
104
+ import { compose, ref } from "@composurecdk/core";
105
+ import { createHostedZoneBuilder, type HostedZoneBuilderResult } from "@composurecdk/route53";
106
+ import {
107
+ A,
108
+ AAAA,
109
+ APEX,
110
+ CAA_ISSUE,
111
+ CAA_ISSUEWILD,
112
+ CNAME,
113
+ MX,
114
+ SRV,
115
+ TXT,
116
+ zoneRecords,
117
+ } from "@composurecdk/route53/zone";
118
+
119
+ compose(
120
+ {
121
+ zone: createHostedZoneBuilder().zoneName("example.com"),
122
+ records: zoneRecords([
123
+ A(APEX, "203.0.113.10"),
124
+ AAAA(APEX, "2001:db8::10"),
125
+ A("api", ["203.0.113.20", "203.0.113.21"]),
126
+
127
+ MX(APEX, 10, "mail1.example.com."),
128
+ MX(APEX, 20, "mail2.example.com."),
129
+ TXT(APEX, "v=spf1 mx -all"),
130
+ TXT("_dmarc", "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com"),
131
+ CNAME("k1._domainkey", "k1.dkim.esp.example.net."),
132
+
133
+ SRV("_sip._tcp", 10, 60, 5060, "sip1.example.com."),
134
+
135
+ CAA_ISSUE(APEX, "amazon.com"),
136
+ CAA_ISSUEWILD(APEX, "amazon.com"),
137
+ ]).zone(ref<HostedZoneBuilderResult>("zone").get("hostedZone")),
138
+ },
139
+ { zone: [], records: ["zone"] },
140
+ ).build(stack, "DNS");
141
+ ```
142
+
143
+ ### Helpers
144
+
145
+ | Helper | Shape | Notes |
146
+ | -------------------------------------------- | --------------------- | ------------------------------------------------------------ |
147
+ | `A(name, addr \| addrs, opts?)` | IPv4 addresses | Repeat calls merge; use `APEX` for `@` |
148
+ | `AAAA(name, addr \| addrs, opts?)` | IPv6 addresses | As `A` |
149
+ | `CNAME(name, target, opts?)` | One canonical target | Duplicate or apex CNAME is rejected |
150
+ | `TXT(name, value \| values, opts?)` | One or more strings | Repeat calls merge |
151
+ | `MX(name, prio, host, opts?)` | Mail exchanger | Repeat calls merge `(priority, hostName)` pairs |
152
+ | `SRV(name, prio, weight, port, host, opts?)` | Service locator | BIND order; repeat calls merge |
153
+ | `CAA(name, flag, tag, value, opts?)` | Raw CAA | Prefer the wrappers below |
154
+ | `CAA_ISSUE(name, ca, opts?)` | `0 issue "ca"` | Authorize a CA |
155
+ | `CAA_ISSUEWILD(name, ca, opts?)` | `0 issuewild "ca"` | Authorize a CA for wildcards |
156
+ | `CAA_IODEF(name, url, opts?)` | `0 iodef "url"` | Report policy violations |
157
+ | `NS(name, host \| hosts, opts?)` | Delegation | Apex NS is rejected (managed by Route 53) |
158
+ | `DS(name, rdata \| rdatas, opts?)` | DNSSEC chain-of-trust | Each value is a full `keyTag alg digestType digest` rdata |
159
+ | `HTTPS(name, value \| values, opts?)` | RFC 9460 HTTPS record | Accepts `HttpsRecordValue.alias()`/`.service()` from the CDK |
160
+ | `SVCB(name, value \| values, opts?)` | RFC 9460 generic SVCB | As `HTTPS`; for web traffic prefer `HTTPS` |
161
+
162
+ The trailing `opts` argument is `{ ttl?, comment? }`. When records with the same `(type, name)` are merged, the **first defined** `ttl`/`comment` in declaration order wins — so to give a merged group a TTL or comment, attach it to the first call:
163
+
164
+ ```ts
165
+ // TTL of 10m applies to the whole merged RR-set. The later calls inherit it.
166
+ A("api", "203.0.113.20", { ttl: Duration.minutes(10), comment: "primary" }),
167
+ A("api", "203.0.113.21"),
168
+ A("api", "203.0.113.22"),
169
+ ```
170
+
171
+ Putting the TTL on a later call is silently ignored if an earlier call in the group already has one — this keeps merge output deterministic regardless of how the list is reordered.
172
+
173
+ ### APEX sentinel
174
+
175
+ `APEX` (= `"@"`) stands in for the zone's own name, matching BIND zone-file convention. When records are bound to CDK the sentinel is translated to an undefined `recordName`, so CDK emits them at the zone apex.
176
+
177
+ ### RR-set merge semantics
178
+
179
+ DNS resolvers see one record set per `(type, name)`, so the DSL groups every call sharing `(type, name)` into a single CDK record. Repeated `A`, `AAAA`, `TXT`, `MX`, `SRV`, `CAA`, `NS`, `DS`, `HTTPS`, and `SVCB` calls for the same name are merged; the order of values within the merged set matches the order of the DSL calls.
180
+
181
+ Exact-duplicate string values (same IP appearing twice in an `A` merge, the same TXT string, the same NS hostname) are de-duplicated during merge — DNS RR-sets never want identical values and CDK rejects them with an opaque error. Structured values (MX `(priority, host)` pairs, SRV, CAA, HTTPS/SVCB) are passed through as given.
182
+
183
+ ### Errors surfaced at build time
184
+
185
+ - `CNAME` at the apex — DNS forbids CNAMEs from coexisting with the mandatory apex SOA/NS records. Use an A/AAAA alias instead.
186
+ - More than one `CNAME` for the same name — DNS allows at most one CNAME per name.
187
+ - `NS` at the apex — Route 53 manages the apex NS set itself; recreating it clashes with the zone's delegation.
188
+ - `zoneRecords(...).build(...)` without a `.zone(...)` call.
189
+
190
+ ### HTTPS / SVCB alias mode
191
+
192
+ The DSL supports value-mode HTTPS/SVCB records (fixed advertised parameters). For alias-mode records — typically pointing at a CloudFront distribution — use `createHttpsRecordBuilder().target(cloudfrontAliasTarget(dist))` directly; `HTTPS(...)` is intentionally value-mode only to keep the DSL's merge semantics consistent.
193
+
194
+ ### Worked example
195
+
196
+ A production-like zone with every record type is demonstrated in [`packages/examples/src/dns-zone-app.ts`](../examples/src/dns-zone-app.ts).
197
+
99
198
  ## Composing with ACM and CloudFront
100
199
 
101
200
  ```ts
package/dist/index.d.ts CHANGED
@@ -1,15 +1,15 @@
1
- export { createHostedZoneBuilder, type HostedZoneBuilderResult, type IHostedZoneBuilder, } from "./hosted-zone-builder.js";
2
- export { createARecordBuilder, type ARecordBuilderResult, type IARecordBuilder, } from "./a-record-builder.js";
3
- export { createAaaaRecordBuilder, type AaaaRecordBuilderResult, type IAaaaRecordBuilder, } from "./aaaa-record-builder.js";
4
- export { createCnameRecordBuilder, type CnameRecordBuilderResult, type ICnameRecordBuilder, } from "./cname-record-builder.js";
5
- export { createTxtRecordBuilder, type TxtRecordBuilderResult, type ITxtRecordBuilder, } from "./txt-record-builder.js";
6
- export { createMxRecordBuilder, type MxRecordBuilderResult, type IMxRecordBuilder, } from "./mx-record-builder.js";
7
- export { createSrvRecordBuilder, type SrvRecordBuilderResult, type ISrvRecordBuilder, } from "./srv-record-builder.js";
8
- export { createCaaRecordBuilder, type CaaRecordBuilderResult, type ICaaRecordBuilder, } from "./caa-record-builder.js";
9
- export { createNsRecordBuilder, type NsRecordBuilderResult, type INsRecordBuilder, } from "./ns-record-builder.js";
10
- export { createDsRecordBuilder, type DsRecordBuilderResult, type IDsRecordBuilder, } from "./ds-record-builder.js";
11
- export { createHttpsRecordBuilder, type HttpsRecordBuilderResult, type IHttpsRecordBuilder, } from "./https-record-builder.js";
12
- export { createSvcbRecordBuilder, type SvcbRecordBuilderResult, type ISvcbRecordBuilder, } from "./svcb-record-builder.js";
1
+ export { createHostedZoneBuilder, type HostedZoneBuilderProps, type HostedZoneBuilderResult, type IHostedZoneBuilder, } from "./hosted-zone-builder.js";
2
+ export { createARecordBuilder, type ARecordBuilderProps, type ARecordBuilderResult, type IARecordBuilder, } from "./a-record-builder.js";
3
+ export { createAaaaRecordBuilder, type AaaaRecordBuilderProps, type AaaaRecordBuilderResult, type IAaaaRecordBuilder, } from "./aaaa-record-builder.js";
4
+ export { createCnameRecordBuilder, type CnameRecordBuilderProps, type CnameRecordBuilderResult, type ICnameRecordBuilder, } from "./cname-record-builder.js";
5
+ export { createTxtRecordBuilder, type TxtRecordBuilderProps, type TxtRecordBuilderResult, type ITxtRecordBuilder, } from "./txt-record-builder.js";
6
+ export { createMxRecordBuilder, type MxRecordBuilderProps, type MxRecordBuilderResult, type IMxRecordBuilder, } from "./mx-record-builder.js";
7
+ export { createSrvRecordBuilder, type SrvRecordBuilderProps, type SrvRecordBuilderResult, type ISrvRecordBuilder, } from "./srv-record-builder.js";
8
+ export { createCaaRecordBuilder, type CaaRecordBuilderProps, type CaaRecordBuilderResult, type ICaaRecordBuilder, } from "./caa-record-builder.js";
9
+ export { createNsRecordBuilder, type NsRecordBuilderProps, type NsRecordBuilderResult, type INsRecordBuilder, } from "./ns-record-builder.js";
10
+ export { createDsRecordBuilder, type DsRecordBuilderProps, type DsRecordBuilderResult, type IDsRecordBuilder, } from "./ds-record-builder.js";
11
+ export { createHttpsRecordBuilder, type HttpsRecordBuilderProps, type HttpsRecordBuilderResult, type IHttpsRecordBuilder, } from "./https-record-builder.js";
12
+ export { createSvcbRecordBuilder, type SvcbRecordBuilderProps, type SvcbRecordBuilderResult, type ISvcbRecordBuilder, } from "./svcb-record-builder.js";
13
13
  export { cloudfrontAliasTarget, apiGatewayAliasTarget, apiGatewayDomainAliasTarget, } from "./alias-targets.js";
14
14
  export { HOSTED_ZONE_DEFAULTS, A_RECORD_DEFAULTS, AAAA_RECORD_DEFAULTS, CNAME_RECORD_DEFAULTS, TXT_RECORD_DEFAULTS, MX_RECORD_DEFAULTS, SRV_RECORD_DEFAULTS, CAA_RECORD_DEFAULTS, NS_RECORD_DEFAULTS, DS_RECORD_DEFAULTS, HTTPS_RECORD_DEFAULTS, SVCB_RECORD_DEFAULTS, } from "./defaults.js";
15
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,oBAAoB,EACpB,KAAK,oBAAoB,EACzB,KAAK,eAAe,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,uBAAuB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,wBAAwB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,GACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,GACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,qBAAqB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,GACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,GACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,sBAAsB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,GACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,qBAAqB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,GACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,qBAAqB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,GACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,wBAAwB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,GACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,uBAAuB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,E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AAM,yBAAyB,CAAC;AACjC,OAAO,EACL,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,GACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,GACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,wBAAwB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,GACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,uBAAuB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,eAAe,CAAC"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,GAGxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,oBAAoB,GAGrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,uBAAuB,GAGxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,wBAAwB,GAGzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,sBAAsB,GAGvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,qBAAqB,GAGtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,sBAAsB,GAGvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,sBAAsB,GAGvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,qBAAqB,GAGtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,qBAAqB,GAGtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,wBAAwB,GAGzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,uBAAuB,GAGxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,GAIxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,oBAAoB,GAIrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,uBAAuB,GAIxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,wBAAwB,GAIzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,sBAAsB,GAIvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,qBAAqB,GAItB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,sBAAsB,GAIvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,sBAAsB,GAIvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,qBAAqB,GAItB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,qBAAqB,GAItB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,wBAAwB,GAIzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,uBAAuB,GAIxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,eAAe,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { APEX, A, AAAA, CNAME, TXT, MX, SRV, CAA, CAA_ISSUE, CAA_ISSUEWILD, CAA_IODEF, NS, DS, HTTPS, SVCB, type RecordOptions, type RecordSpec, type RecordType, type ARecordSpec, type AaaaRecordSpec, type CnameRecordSpec, type TxtRecordSpec, type MxRecordSpec, type SrvRecordSpec, type CaaRecordSpec, type NsRecordSpec, type DsRecordSpec, type HttpsRecordSpec, type SvcbRecordSpec, } from "./zone-dsl.js";
2
+ export { zoneRecords, type IZoneRecordsBuilder, type ZoneRecordsBuilderResult, } from "./zone-records.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/zone/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,CAAC,EACD,IAAI,EACJ,KAAK,EACL,GAAG,EACH,EAAE,EACF,GAAG,EACH,GAAG,EACH,SAAS,EACT,aAAa,EACb,SAAS,EACT,EAAE,EACF,EAAE,EACF,KAAK,EACL,IAAI,EACJ,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,cAAc,GACpB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,WAAW,EACX,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,GAC9B,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { APEX, A, AAAA, CNAME, TXT, MX, SRV, CAA, CAA_ISSUE, CAA_ISSUEWILD, CAA_IODEF, NS, DS, HTTPS, SVCB, } from "./zone-dsl.js";
2
+ export { zoneRecords, } from "./zone-records.js";
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/zone/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,CAAC,EACD,IAAI,EACJ,KAAK,EACL,GAAG,EACH,EAAE,EACF,GAAG,EACH,GAAG,EACH,SAAS,EACT,aAAa,EACb,SAAS,EACT,EAAE,EACF,EAAE,EACF,KAAK,EACL,IAAI,GAeL,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,WAAW,GAGZ,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,252 @@
1
+ import type { Duration } from "aws-cdk-lib";
2
+ import { CaaTag, type HttpsRecordValue, type SvcbRecordValue } from "aws-cdk-lib/aws-route53";
3
+ /**
4
+ * Sentinel name representing the zone apex (the zone-file `@`).
5
+ *
6
+ * Translated to an undefined CDK `recordName` when bound to a CDK construct.
7
+ */
8
+ export declare const APEX = "@";
9
+ /**
10
+ * Per-record options applied to the underlying CDK construct.
11
+ *
12
+ * Mirrors the optional fields shared by every Route 53 record builder. Each
13
+ * record-type DSL helper accepts these as a trailing options argument.
14
+ */
15
+ export interface RecordOptions {
16
+ /** TTL for the record set. Falls back to the underlying builder's default. */
17
+ readonly ttl?: Duration;
18
+ /** Optional comment passed through to the CDK construct. */
19
+ readonly comment?: string;
20
+ }
21
+ export interface ARecordSpec extends RecordOptions {
22
+ readonly type: "A";
23
+ readonly name: string;
24
+ readonly addresses: readonly string[];
25
+ }
26
+ export interface AaaaRecordSpec extends RecordOptions {
27
+ readonly type: "AAAA";
28
+ readonly name: string;
29
+ readonly addresses: readonly string[];
30
+ }
31
+ export interface CnameRecordSpec extends RecordOptions {
32
+ readonly type: "CNAME";
33
+ readonly name: string;
34
+ readonly target: string;
35
+ }
36
+ export interface TxtRecordSpec extends RecordOptions {
37
+ readonly type: "TXT";
38
+ readonly name: string;
39
+ readonly values: readonly string[];
40
+ }
41
+ export interface MxRecordSpec extends RecordOptions {
42
+ readonly type: "MX";
43
+ readonly name: string;
44
+ readonly values: readonly {
45
+ readonly priority: number;
46
+ readonly hostName: string;
47
+ }[];
48
+ }
49
+ export interface SrvRecordSpec extends RecordOptions {
50
+ readonly type: "SRV";
51
+ readonly name: string;
52
+ readonly values: readonly {
53
+ readonly priority: number;
54
+ readonly weight: number;
55
+ readonly port: number;
56
+ readonly hostName: string;
57
+ }[];
58
+ }
59
+ export interface CaaRecordSpec extends RecordOptions {
60
+ readonly type: "CAA";
61
+ readonly name: string;
62
+ readonly values: readonly {
63
+ readonly flag: number;
64
+ readonly tag: CaaTag;
65
+ readonly value: string;
66
+ }[];
67
+ }
68
+ export interface NsRecordSpec extends RecordOptions {
69
+ readonly type: "NS";
70
+ readonly name: string;
71
+ readonly values: readonly string[];
72
+ }
73
+ export interface DsRecordSpec extends RecordOptions {
74
+ readonly type: "DS";
75
+ readonly name: string;
76
+ readonly values: readonly string[];
77
+ }
78
+ export interface HttpsRecordSpec extends RecordOptions {
79
+ readonly type: "HTTPS";
80
+ readonly name: string;
81
+ readonly values: readonly HttpsRecordValue[];
82
+ }
83
+ export interface SvcbRecordSpec extends RecordOptions {
84
+ readonly type: "SVCB";
85
+ readonly name: string;
86
+ readonly values: readonly SvcbRecordValue[];
87
+ }
88
+ export type RecordSpec = ARecordSpec | AaaaRecordSpec | CnameRecordSpec | TxtRecordSpec | MxRecordSpec | SrvRecordSpec | CaaRecordSpec | NsRecordSpec | DsRecordSpec | HttpsRecordSpec | SvcbRecordSpec;
89
+ /** Record type discriminators surfaced by {@link RecordSpec}. */
90
+ export type RecordType = RecordSpec["type"];
91
+ /**
92
+ * IPv4 address record. Use {@link APEX} (`"@"`) as `name` for the zone apex.
93
+ *
94
+ * Multiple `A` calls for the same `name` are merged into a single CDK record
95
+ * set with all addresses; alternatively, pass an array as the second argument.
96
+ *
97
+ * @example
98
+ * ```ts
99
+ * A("@", "1.2.3.4")
100
+ * A("ha", ["1.2.3.4", "5.6.7.8"])
101
+ * A("www", "1.2.3.4", { ttl: Duration.minutes(10) })
102
+ * ```
103
+ */
104
+ export declare function A(name: string, address: string | readonly string[], options?: RecordOptions): ARecordSpec;
105
+ /**
106
+ * IPv6 address record. See {@link A} for the merging / array semantics — they
107
+ * are identical.
108
+ */
109
+ export declare function AAAA(name: string, address: string | readonly string[], options?: RecordOptions): AaaaRecordSpec;
110
+ /**
111
+ * Canonical-name record. DNS forbids more than one CNAME per name, so a second
112
+ * `CNAME(name, …)` for the same name is a configuration error and is rejected
113
+ * when the records are bound to the zone.
114
+ *
115
+ * CNAMEs also cannot live at the zone apex — use an A/AAAA alias instead.
116
+ *
117
+ * Targets containing dots should be fully qualified (trailing `.`).
118
+ *
119
+ * @example
120
+ * ```ts
121
+ * CNAME("dkim1", "dkim1.39769.dkim.example.")
122
+ * ```
123
+ */
124
+ export declare function CNAME(name: string, target: string, options?: RecordOptions): CnameRecordSpec;
125
+ /**
126
+ * Text record. Pass a single string or an array of strings; multiple `TXT`
127
+ * calls for the same `name` are merged into one CDK record set.
128
+ *
129
+ * @example
130
+ * ```ts
131
+ * TXT("@", "v=spf1 mx -all")
132
+ * TXT("_dmarc", "v=DMARC1; p=none;")
133
+ * TXT("multi", ["one", "two"])
134
+ * ```
135
+ */
136
+ export declare function TXT(name: string, value: string | readonly string[], options?: RecordOptions): TxtRecordSpec;
137
+ /**
138
+ * Mail-exchanger record. The argument order matches BIND zone files
139
+ * (`name priority target`); multiple `MX(name, …)` calls for the same name are
140
+ * merged into one CDK record set with all `(priority, hostName)` pairs.
141
+ *
142
+ * Targets containing dots should be fully qualified (trailing `.`).
143
+ *
144
+ * @example
145
+ * ```ts
146
+ * MX("@", 10, "mail.example.com.")
147
+ * MX("@", 20, "backup.example.com.")
148
+ * ```
149
+ */
150
+ export declare function MX(name: string, priority: number, hostName: string, options?: RecordOptions): MxRecordSpec;
151
+ /**
152
+ * Service-locator record. The argument order matches BIND zone files
153
+ * (`name priority weight port target`); multiple `SRV(name, …)` calls for the
154
+ * same name are merged into one CDK record set.
155
+ *
156
+ * Record names typically follow the `_service._proto` convention (e.g.
157
+ * `_sip._tcp`). Lower priority wins; weight distributes load across peers.
158
+ *
159
+ * @example
160
+ * ```ts
161
+ * SRV("_sip._tcp", 10, 60, 5060, "sip1.example.com.")
162
+ * SRV("_sip._tcp", 10, 40, 5060, "sip2.example.com.")
163
+ * ```
164
+ */
165
+ export declare function SRV(name: string, priority: number, weight: number, port: number, hostName: string, options?: RecordOptions): SrvRecordSpec;
166
+ /**
167
+ * Certification-authority authorization record. Argument order matches BIND
168
+ * zone files (`name flag tag value`); multiple `CAA(name, …)` calls for the
169
+ * same name are merged into one CDK record set.
170
+ *
171
+ * For the common cases, prefer {@link CAA_ISSUE}, {@link CAA_ISSUEWILD}, or
172
+ * {@link CAA_IODEF}.
173
+ *
174
+ * @example
175
+ * ```ts
176
+ * CAA("@", 0, CaaTag.ISSUE, "amazon.com")
177
+ * ```
178
+ */
179
+ export declare function CAA(name: string, flag: number, tag: CaaTag, value: string, options?: RecordOptions): CaaRecordSpec;
180
+ /**
181
+ * CAA `issue` record — authorizes a specific certificate authority to issue
182
+ * certificates for the name. Merges with other CAA records at the same name.
183
+ *
184
+ * @example
185
+ * ```ts
186
+ * CAA_ISSUE("@", "amazon.com")
187
+ * CAA_ISSUE("@", "amazontrust.com")
188
+ * ```
189
+ */
190
+ export declare function CAA_ISSUE(name: string, authority: string, options?: RecordOptions): CaaRecordSpec;
191
+ /**
192
+ * CAA `issuewild` record — authorizes a specific CA to issue wildcard
193
+ * certificates for the name. Merges with other CAA records at the same name.
194
+ */
195
+ export declare function CAA_ISSUEWILD(name: string, authority: string, options?: RecordOptions): CaaRecordSpec;
196
+ /**
197
+ * CAA `iodef` record — reports policy violations to a URL. Merges with other
198
+ * CAA records at the same name.
199
+ *
200
+ * @example
201
+ * ```ts
202
+ * CAA_IODEF("@", "mailto:security@example.com")
203
+ * ```
204
+ */
205
+ export declare function CAA_IODEF(name: string, url: string, options?: RecordOptions): CaaRecordSpec;
206
+ /**
207
+ * Name-server delegation record. Delegates a subdomain to the supplied name
208
+ * servers. NS records cannot live at the zone apex — the apex NS set is
209
+ * managed by Route 53 itself.
210
+ *
211
+ * Multiple `NS(name, …)` calls for the same name are merged; alternatively,
212
+ * pass an array of host names.
213
+ *
214
+ * @example
215
+ * ```ts
216
+ * NS("internal", ["ns-1.awsdns-00.co.uk.", "ns-2.awsdns-00.com."])
217
+ * ```
218
+ */
219
+ export declare function NS(name: string, hostName: string | readonly string[], options?: RecordOptions): NsRecordSpec;
220
+ /**
221
+ * DNSSEC delegation-signer record. Each value is a full rdata string
222
+ * (`keyTag algorithm digestType digest`). Multiple `DS(name, …)` calls for the
223
+ * same name are merged.
224
+ *
225
+ * @example
226
+ * ```ts
227
+ * DS("secure", "60485 5 1 2BB183AF5F22588179A53B0A98631FAD1A292118")
228
+ * ```
229
+ */
230
+ export declare function DS(name: string, rdata: string | readonly string[], options?: RecordOptions): DsRecordSpec;
231
+ /**
232
+ * HTTPS service-binding record (RFC 9460). Accepts pre-constructed
233
+ * {@link HttpsRecordValue} instances from the CDK. For alias-mode HTTPS
234
+ * records (typically pointing at a CloudFront distribution), use
235
+ * `createHttpsRecordBuilder` directly — the DSL supports value-mode only.
236
+ *
237
+ * Multiple `HTTPS(name, …)` calls for the same name are merged.
238
+ *
239
+ * @example
240
+ * ```ts
241
+ * HTTPS("@", HttpsRecordValue.service({ alpn: [Alpn.H3, Alpn.H2] }))
242
+ * ```
243
+ */
244
+ export declare function HTTPS(name: string, value: HttpsRecordValue | readonly HttpsRecordValue[], options?: RecordOptions): HttpsRecordSpec;
245
+ /**
246
+ * Generic service-binding record (RFC 9460). For HTTPS specifically, prefer
247
+ * {@link HTTPS} — most clients only consult HTTPS records for web traffic.
248
+ *
249
+ * Multiple `SVCB(name, …)` calls for the same name are merged.
250
+ */
251
+ export declare function SVCB(name: string, value: SvcbRecordValue | readonly SvcbRecordValue[], options?: RecordOptions): SvcbRecordSpec;
252
+ //# sourceMappingURL=zone-dsl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zone-dsl.d.ts","sourceRoot":"","sources":["../../src/zone/zone-dsl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE9F;;;;GAIG;AACH,eAAO,MAAM,IAAI,MAAM,CAAC;AAExB;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,8EAA8E;IAC9E,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC;IACxB,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,WAAY,SAAQ,aAAa;IAChD,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAED,MAAM,WAAW,cAAe,SAAQ,aAAa;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAED,MAAM,WAAW,eAAgB,SAAQ,aAAa;IACpD,QAAQ,CAAC,IAAI,EAAE,OAAO,CAA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aAAkB,iBAE/E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,EAAE,CAChB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,EACpC,OAAO,GAAE,aAAkB,GAC1B,YAAY,CAEd;AAED;;;;;;;;;GASG;AACH,wBAAgB,EAAE,CAChB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,EACjC,OAAO,GAAE,aAAkB,GAC1B,YAAY,CAEd;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,KAAK,CACnB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,gBAAgB,GAAG,SAAS,gBAAgB,EAAE,EACrD,OAAO,GAAE,aAAkB,GAC1B,eAAe,CAEjB;AAED;;;;;GAKG;AACH,wBAAgB,IAAI,CAClB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,eAAe,GAAG,SAAS,eAAe,EAAE,EACnD,OAAO,GAAE,aAAkB,GAC1B,cAAc,CAEhB"}
@@ -0,0 +1,198 @@
1
+ import { CaaTag } from "aws-cdk-lib/aws-route53";
2
+ /**
3
+ * Sentinel name representing the zone apex (the zone-file `@`).
4
+ *
5
+ * Translated to an undefined CDK `recordName` when bound to a CDK construct.
6
+ */
7
+ export const APEX = "@";
8
+ const toArray = (x) => Array.isArray(x) ? x : [x];
9
+ /**
10
+ * IPv4 address record. Use {@link APEX} (`"@"`) as `name` for the zone apex.
11
+ *
12
+ * Multiple `A` calls for the same `name` are merged into a single CDK record
13
+ * set with all addresses; alternatively, pass an array as the second argument.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * A("@", "1.2.3.4")
18
+ * A("ha", ["1.2.3.4", "5.6.7.8"])
19
+ * A("www", "1.2.3.4", { ttl: Duration.minutes(10) })
20
+ * ```
21
+ */
22
+ export function A(name, address, options = {}) {
23
+ return { type: "A", name, addresses: toArray(address), ...options };
24
+ }
25
+ /**
26
+ * IPv6 address record. See {@link A} for the merging / array semantics — they
27
+ * are identical.
28
+ */
29
+ export function AAAA(name, address, options = {}) {
30
+ return { type: "AAAA", name, addresses: toArray(address), ...options };
31
+ }
32
+ /**
33
+ * Canonical-name record. DNS forbids more than one CNAME per name, so a second
34
+ * `CNAME(name, …)` for the same name is a configuration error and is rejected
35
+ * when the records are bound to the zone.
36
+ *
37
+ * CNAMEs also cannot live at the zone apex — use an A/AAAA alias instead.
38
+ *
39
+ * Targets containing dots should be fully qualified (trailing `.`).
40
+ *
41
+ * @example
42
+ * ```ts
43
+ * CNAME("dkim1", "dkim1.39769.dkim.example.")
44
+ * ```
45
+ */
46
+ export function CNAME(name, target, options = {}) {
47
+ return { type: "CNAME", name, target, ...options };
48
+ }
49
+ /**
50
+ * Text record. Pass a single string or an array of strings; multiple `TXT`
51
+ * calls for the same `name` are merged into one CDK record set.
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * TXT("@", "v=spf1 mx -all")
56
+ * TXT("_dmarc", "v=DMARC1; p=none;")
57
+ * TXT("multi", ["one", "two"])
58
+ * ```
59
+ */
60
+ export function TXT(name, value, options = {}) {
61
+ return { type: "TXT", name, values: toArray(value), ...options };
62
+ }
63
+ /**
64
+ * Mail-exchanger record. The argument order matches BIND zone files
65
+ * (`name priority target`); multiple `MX(name, …)` calls for the same name are
66
+ * merged into one CDK record set with all `(priority, hostName)` pairs.
67
+ *
68
+ * Targets containing dots should be fully qualified (trailing `.`).
69
+ *
70
+ * @example
71
+ * ```ts
72
+ * MX("@", 10, "mail.example.com.")
73
+ * MX("@", 20, "backup.example.com.")
74
+ * ```
75
+ */
76
+ export function MX(name, priority, hostName, options = {}) {
77
+ return { type: "MX", name, values: [{ priority, hostName }], ...options };
78
+ }
79
+ /**
80
+ * Service-locator record. The argument order matches BIND zone files
81
+ * (`name priority weight port target`); multiple `SRV(name, …)` calls for the
82
+ * same name are merged into one CDK record set.
83
+ *
84
+ * Record names typically follow the `_service._proto` convention (e.g.
85
+ * `_sip._tcp`). Lower priority wins; weight distributes load across peers.
86
+ *
87
+ * @example
88
+ * ```ts
89
+ * SRV("_sip._tcp", 10, 60, 5060, "sip1.example.com.")
90
+ * SRV("_sip._tcp", 10, 40, 5060, "sip2.example.com.")
91
+ * ```
92
+ */
93
+ export function SRV(name, priority, weight, port, hostName, options = {}) {
94
+ return { type: "SRV", name, values: [{ priority, weight, port, hostName }], ...options };
95
+ }
96
+ /**
97
+ * Certification-authority authorization record. Argument order matches BIND
98
+ * zone files (`name flag tag value`); multiple `CAA(name, …)` calls for the
99
+ * same name are merged into one CDK record set.
100
+ *
101
+ * For the common cases, prefer {@link CAA_ISSUE}, {@link CAA_ISSUEWILD}, or
102
+ * {@link CAA_IODEF}.
103
+ *
104
+ * @example
105
+ * ```ts
106
+ * CAA("@", 0, CaaTag.ISSUE, "amazon.com")
107
+ * ```
108
+ */
109
+ export function CAA(name, flag, tag, value, options = {}) {
110
+ return { type: "CAA", name, values: [{ flag, tag, value }], ...options };
111
+ }
112
+ /**
113
+ * CAA `issue` record — authorizes a specific certificate authority to issue
114
+ * certificates for the name. Merges with other CAA records at the same name.
115
+ *
116
+ * @example
117
+ * ```ts
118
+ * CAA_ISSUE("@", "amazon.com")
119
+ * CAA_ISSUE("@", "amazontrust.com")
120
+ * ```
121
+ */
122
+ export function CAA_ISSUE(name, authority, options = {}) {
123
+ return CAA(name, 0, CaaTag.ISSUE, authority, options);
124
+ }
125
+ /**
126
+ * CAA `issuewild` record — authorizes a specific CA to issue wildcard
127
+ * certificates for the name. Merges with other CAA records at the same name.
128
+ */
129
+ export function CAA_ISSUEWILD(name, authority, options = {}) {
130
+ return CAA(name, 0, CaaTag.ISSUEWILD, authority, options);
131
+ }
132
+ /**
133
+ * CAA `iodef` record — reports policy violations to a URL. Merges with other
134
+ * CAA records at the same name.
135
+ *
136
+ * @example
137
+ * ```ts
138
+ * CAA_IODEF("@", "mailto:security@example.com")
139
+ * ```
140
+ */
141
+ export function CAA_IODEF(name, url, options = {}) {
142
+ return CAA(name, 0, CaaTag.IODEF, url, options);
143
+ }
144
+ /**
145
+ * Name-server delegation record. Delegates a subdomain to the supplied name
146
+ * servers. NS records cannot live at the zone apex — the apex NS set is
147
+ * managed by Route 53 itself.
148
+ *
149
+ * Multiple `NS(name, …)` calls for the same name are merged; alternatively,
150
+ * pass an array of host names.
151
+ *
152
+ * @example
153
+ * ```ts
154
+ * NS("internal", ["ns-1.awsdns-00.co.uk.", "ns-2.awsdns-00.com."])
155
+ * ```
156
+ */
157
+ export function NS(name, hostName, options = {}) {
158
+ return { type: "NS", name, values: toArray(hostName), ...options };
159
+ }
160
+ /**
161
+ * DNSSEC delegation-signer record. Each value is a full rdata string
162
+ * (`keyTag algorithm digestType digest`). Multiple `DS(name, …)` calls for the
163
+ * same name are merged.
164
+ *
165
+ * @example
166
+ * ```ts
167
+ * DS("secure", "60485 5 1 2BB183AF5F22588179A53B0A98631FAD1A292118")
168
+ * ```
169
+ */
170
+ export function DS(name, rdata, options = {}) {
171
+ return { type: "DS", name, values: toArray(rdata), ...options };
172
+ }
173
+ /**
174
+ * HTTPS service-binding record (RFC 9460). Accepts pre-constructed
175
+ * {@link HttpsRecordValue} instances from the CDK. For alias-mode HTTPS
176
+ * records (typically pointing at a CloudFront distribution), use
177
+ * `createHttpsRecordBuilder` directly — the DSL supports value-mode only.
178
+ *
179
+ * Multiple `HTTPS(name, …)` calls for the same name are merged.
180
+ *
181
+ * @example
182
+ * ```ts
183
+ * HTTPS("@", HttpsRecordValue.service({ alpn: [Alpn.H3, Alpn.H2] }))
184
+ * ```
185
+ */
186
+ export function HTTPS(name, value, options = {}) {
187
+ return { type: "HTTPS", name, values: toArray(value), ...options };
188
+ }
189
+ /**
190
+ * Generic service-binding record (RFC 9460). For HTTPS specifically, prefer
191
+ * {@link HTTPS} — most clients only consult HTTPS records for web traffic.
192
+ *
193
+ * Multiple `SVCB(name, …)` calls for the same name are merged.
194
+ */
195
+ export function SVCB(name, value, options = {}) {
196
+ return { type: "SVCB", name, values: toArray(value), ...options };
197
+ }
198
+ //# sourceMappingURL=zone-dsl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zone-dsl.js","sourceRoot":"","sources":["../../src/zone/zone-dsl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAA+C,MAAM,yBAAyB,CAAC;AAE9F;;;;GAIG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,GAAG,CAAC;AA0GxB,MAAM,OAAO,GAAG,CAAI,CAAmB,EAAgB,EAAE,CACvD,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAAkB,CAAC,CAAC,CAAC,CAAC,CAAM,CAAC,CAAC;AAEpD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,CAAC,CACf,IAAY,EACZ,OAAmC,EACnC,UAAyB,EAAE;IAE3B,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC;AACtE,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,IAAI,CAClB,IAAY,EACZ,OAAmC,EACnC,UAAyB,EAAE;IAE3B,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC;AACzE,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,KAAK,CAAC,IAAY,EAAE,MAAc,EAAE,UAAyB,EAAE;IAC7E,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC;AACrD,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,GAAG,CACjB,IAAY,EACZ,KAAiC,EACjC,UAAyB,EAAE;IAE3B,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,KAA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vable } from "@composurecdk/core";
3
+ import { type AaaaRecordBuilderResult } from "../aaaa-record-builder.js";
4
+ import { type ARecordBuilderResult } from "../a-record-builder.js";
5
+ import { type CaaRecordBuilderResult } from "../caa-record-builder.js";
6
+ import { type CnameRecordBuilderResult } from "../cname-record-builder.js";
7
+ import { type DsRecordBuilderResult } from "../ds-record-builder.js";
8
+ import { type HttpsRecordBuilderResult } from "../https-record-builder.js";
9
+ import { type MxRecordBuilderResult } from "../mx-record-builder.js";
10
+ import { type NsRecordBuilderResult } from "../ns-record-builder.js";
11
+ import { type SrvRecordBuilderResult } from "../srv-record-builder.js";
12
+ import { type SvcbRecordBuilderResult } from "../svcb-record-builder.js";
13
+ import { type TxtRecordBuilderResult } from "../txt-record-builder.js";
14
+ import { type RecordSpec } from "./zone-dsl.js";
15
+ /**
16
+ * Build output of {@link zoneRecords}, split per record type. Each sub-map is
17
+ * keyed by the record's DNS name; the apex uses the {@link APEX} sentinel
18
+ * (`"@"`) so it never collides with a user-supplied label.
19
+ */
20
+ export interface ZoneRecordsBuilderResult {
21
+ readonly a: Record<string, ARecordBuilderResult>;
22
+ readonly aaaa: Record<string, AaaaRecordBuilderResult>;
23
+ readonly cname: Record<string, CnameRecordBuilderResult>;
24
+ readonly txt: Record<string, TxtRecordBuilderResult>;
25
+ readonly mx: Record<string, MxRecordBuilderResult>;
26
+ readonly srv: Record<string, SrvRecordBuilderResult>;
27
+ readonly caa: Record<string, CaaRecordBuilderResult>;
28
+ readonly ns: Record<string, NsRecordBuilderResult>;
29
+ readonly ds: Record<string, DsRecordBuilderResult>;
30
+ readonly https: Record<string, HttpsRecordBuilderResult>;
31
+ readonly svcb: Record<string, SvcbRecordBuilderResult>;
32
+ }
33
+ /**
34
+ * Fluent builder that emits every record for a hosted zone from a
35
+ * {@link RecordSpec} list as a single composable {@link Lifecycle}.
36
+ *
37
+ * Records sharing `(type, name)` are merged into one CDK record set, matching
38
+ * DNS RR-set semantics. Every type uses its matching `@composurecdk/route53`
39
+ * builder, inheriting per-type TTL defaults.
40
+ */
41
+ export interface IZoneRecordsBuilder extends Lifecycle<ZoneRecordsBuilderResult> {
42
+ /**
43
+ * The hosted zone to attach every record to. Accepts a {@link Resolvable},
44
+ * so a zone produced by a sibling compose component can be wired in via
45
+ * `ref("zone").get("hostedZone")`.
46
+ */
47
+ zone(zone: Resolvable<IHostedZone>): IZoneRecordsBuilder;
48
+ }
49
+ /**
50
+ * Creates a single compose component that emits every record in `specs`.
51
+ *
52
+ * @example
53
+ * ```ts
54
+ * compose(
55
+ * {
56
+ * zone: createHostedZoneBuilder().zoneName("example.com"),
57
+ * records: zoneRecords([
58
+ * A("@", "1.2.3.4"),
59
+ * MX("@", 10, "mail.example.com."),
60
+ * ]).zone(ref<HostedZoneBuilderResult>("zone").get("hostedZone")),
61
+ * },
62
+ * { zone: [], records: ["zone"] },
63
+ * ).build(stack, "DNS");
64
+ * ```
65
+ */
66
+ export declare function zoneRecords(specs: readonly RecordSpec[]): IZoneRecordsBuilder;
67
+ //# sourceMappingURL=zone-records.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zone-records.d.ts","sourceRoot":"","sources":["../../src/zone/zone-records.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAgB,MAAM,yBAAyB,CAAC;AAEzE,OAAO,EAAe,KAAK,SAAS,EAAW,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC3F,OAAO,EAAE,KAAK,uBAAuB,EAA2B,MAAM,2BAA2B,CAAC;AAClG,OAAO,EAAE,KAAK,oBAAoB,EAAwB,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAAE,KAAK,sBAAsB,EAA0B,MAAM,0BAA0B,CAAC;AAC/F,OAAO,EACL,KAAK,wBAAwB,EAE9B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,KAAK,qBAAqB,EAAyB,MAAM,yBAAyB,CAAC;AAC5F,OAAO,EACL,KAAK,wBAAwB,EAE9B,MAAM,4BAA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B,CAAC,CAAC;CACxD;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAoB,SAAQ,SAAS,CAAC,wBAAwB,CAAC;IAC9E;;;;OAIG;IACH,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,mBAAmB,CAAC;CAC1D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,GAAG,mBAAmB,CAE7E"}
@@ -0,0 +1,270 @@
1
+ import { RecordTarget } from "aws-cdk-lib/aws-route53";
2
+ import { Construct } from "constructs";
3
+ import { constructId, resolve } from "@composurecdk/core";
4
+ import { createAaaaRecordBuilder } from "../aaaa-record-builder.js";
5
+ import { createARecordBuilder } from "../a-record-builder.js";
6
+ import { createCaaRecordBuilder } from "../caa-record-builder.js";
7
+ import { createCnameRecordBuilder, } from "../cname-record-builder.js";
8
+ import { createDsRecordBuilder } from "../ds-record-builder.js";
9
+ import { createHttpsRecordBuilder, } from "../https-record-builder.js";
10
+ import { createMxRecordBuilder } from "../mx-record-builder.js";
11
+ import { createNsRecordBuilder } from "../ns-record-builder.js";
12
+ import { createSrvRecordBuilder } from "../srv-record-builder.js";
13
+ import { createSvcbRecordBuilder } from "../svcb-record-builder.js";
14
+ import { createTxtRecordBuilder } from "../txt-record-builder.js";
15
+ import { APEX, } from "./zone-dsl.js";
16
+ /**
17
+ * Creates a single compose component that emits every record in `specs`.
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * compose(
22
+ * {
23
+ * zone: createHostedZoneBuilder().zoneName("example.com"),
24
+ * records: zoneRecords([
25
+ * A("@", "1.2.3.4"),
26
+ * MX("@", 10, "mail.example.com."),
27
+ * ]).zone(ref<HostedZoneBuilderResult>("zone").get("hostedZone")),
28
+ * },
29
+ * { zone: [], records: ["zone"] },
30
+ * ).build(stack, "DNS");
31
+ * ```
32
+ */
33
+ export function zoneRecords(specs) {
34
+ return new ZoneRecordsBuilder(specs);
35
+ }
36
+ class ZoneRecordsBuilder {
37
+ #zone;
38
+ #specs;
39
+ constructor(specs) {
40
+ this.#specs = specs;
41
+ }
42
+ zone(zone) {
43
+ this.#zone = zone;
44
+ return this;
45
+ }
46
+ build(scope, id, context) {
47
+ if (!this.#zone) {
48
+ throw new Error(`zoneRecords "${id}" requires a zone. Call .zone() with an IHostedZone.`);
49
+ }
50
+ validateSpecs(this.#specs);
51
+ const zone = resolve(this.#zone, context ?? {});
52
+ const result = {
53
+ a: {},
54
+ aaaa: {},
55
+ cname: {},
56
+ txt: {},
57
+ mx: {},
58
+ srv: {},
59
+ caa: {},
60
+ ns: {},
61
+ ds: {},
62
+ https: {},
63
+ svcb: {},
64
+ };
65
+ const root = new Construct(scope, id);
66
+ const subScopes = new Map();
67
+ const subScope = (bucket) => {
68
+ let s = subScopes.get(bucket);
69
+ if (!s) {
70
+ s = new Construct(root, bucket);
71
+ subScopes.set(bucket, s);
72
+ }
73
+ return s;
74
+ };
75
+ for (const group of groupRecords(this.#specs)) {
76
+ const head = group[0];
77
+ // Use the APEX sentinel ("@") as the result-map key, but a readable
78
+ // "Apex" as the construct id so the synthesised logical ID keeps a
79
+ // human-visible marker. ("@" sanitises to empty and produces opaque
80
+ // logical IDs like `DNSrecordsa85669662`.) CDK's duplicate-id check
81
+ // catches the rare case of a user-supplied label also spelled "Apex".
82
+ const key = head.name;
83
+ const childId = key === APEX ? "Apex" : constructId(key);
84
+ switch (head.type) {
85
+ case "A":
86
+ result.a[key] = buildA(subScope("a"), childId, group, zone, context);
87
+ break;
88
+ case "AAAA":
89
+ result.aaaa[key] = buildAaaa(subScope("aaaa"), childId, group, zone, context);
90
+ break;
91
+ case "CNAME":
92
+ result.cname[key] = buildCname(subScope("cname"), childId, group, zone, context);
93
+ break;
94
+ case "TXT":
95
+ result.txt[key] = buildTxt(subScope("txt"), childId, group, zone, context);
96
+ break;
97
+ case "MX":
98
+ result.mx[key] = buildMx(subScope("mx"), childId, group, zone, context);
99
+ break;
100
+ case "SRV":
101
+ result.srv[key] = buildSrv(subScope("srv"), childId, group, zone, context);
102
+ break;
103
+ case "CAA":
104
+ result.caa[key] = buildCaa(subScope("caa"), childId, group, zone, context);
105
+ break;
106
+ case "NS":
107
+ result.ns[key] = buildNs(subScope("ns"), childId, group, zone, context);
108
+ break;
109
+ case "DS":
110
+ result.ds[key] = buildDs(subScope("ds"), childId, group, zone, context);
111
+ break;
112
+ case "HTTPS":
113
+ result.https[key] = buildHttps(subScope("https"), childId, group, zone, context);
114
+ break;
115
+ case "SVCB":
116
+ result.svcb[key] = buildSvcb(subScope("svcb"), childId, group, zone, context);
117
+ break;
118
+ default: {
119
+ const _exhaustive = head;
120
+ throw new Error(`Unhandled record type: ${_exhaustive.type}`);
121
+ }
122
+ }
123
+ }
124
+ return result;
125
+ }
126
+ }
127
+ /** CDK-style record-name convention: apex is `undefined`. */
128
+ const sub = (name) => (name === APEX ? undefined : name);
129
+ /** Preserve insertion order while dropping duplicates. */
130
+ const dedupe = (xs) => [...new Set(xs)];
131
+ function validateSpecs(specs) {
132
+ for (const spec of specs) {
133
+ switch (spec.type) {
134
+ case "A":
135
+ case "AAAA":
136
+ if (spec.addresses.length === 0) {
137
+ throw new Error(`${spec.type}("${spec.name}") must supply at least one address.`);
138
+ }
139
+ break;
140
+ case "TXT":
141
+ case "MX":
142
+ case "SRV":
143
+ case "CAA":
144
+ case "NS":
145
+ case "DS":
146
+ case "HTTPS":
147
+ case "SVCB":
148
+ if (spec.values.length === 0) {
149
+ throw new Error(`${spec.type}("${spec.name}") must supply at least one value.`);
150
+ }
151
+ break;
152
+ case "CNAME":
153
+ // CNAME carries a single `target` string; the DSL factory cannot
154
+ // produce an empty one.
155
+ break;
156
+ }
157
+ }
158
+ }
159
+ /** Group records by `(type, name)`, preserving the insertion order of groups. */
160
+ function groupRecords(specs) {
161
+ const groups = new Map();
162
+ for (const s of specs) {
163
+ const k = `${s.type}/${s.name}`;
164
+ const existing = groups.get(k);
165
+ if (existing)
166
+ existing.push(s);
167
+ else
168
+ groups.set(k, [s]);
169
+ }
170
+ return [...groups.values()];
171
+ }
172
+ /** First non-undefined value of `field` across the group, or `undefined`. */
173
+ function pickOption(group, field) {
174
+ for (const s of group)
175
+ if (s[field] !== undefined)
176
+ return s[field];
177
+ return undefined;
178
+ }
179
+ function applyCommon(builder, specs, name) {
180
+ let b = builder;
181
+ if (name)
182
+ b = b.recordName(name);
183
+ const ttl = pickOption(specs, "ttl");
184
+ if (ttl)
185
+ b = b.ttl(ttl);
186
+ const comment = pickOption(specs, "comment");
187
+ if (comment)
188
+ b = b.comment(comment);
189
+ return b;
190
+ }
191
+ function buildA(scope, id, specs, zone, context) {
192
+ const addresses = dedupe(specs.flatMap((s) => [...s.addresses]));
193
+ const b = applyCommon(createARecordBuilder()
194
+ .zone(zone)
195
+ .target(RecordTarget.fromIpAddresses(...addresses)), specs, sub(specs[0].name));
196
+ return b.build(scope, id, context);
197
+ }
198
+ function buildAaaa(scope, id, specs, zone, context) {
199
+ const addresses = dedupe(specs.flatMap((s) => [...s.addresses]));
200
+ const b = applyCommon(createAaaaRecordBuilder()
201
+ .zone(zone)
202
+ .target(RecordTarget.fromIpAddresses(...addresses)), specs, sub(specs[0].name));
203
+ return b.build(scope, id, context);
204
+ }
205
+ function buildCname(scope, id, specs, zone, context) {
206
+ if (specs.length > 1) {
207
+ throw new Error(`CNAME for "${specs[0].name}" declared ${String(specs.length)} times. ` +
208
+ `DNS allows at most one CNAME per name.`);
209
+ }
210
+ const [spec] = specs;
211
+ const name = sub(spec.name);
212
+ if (!name)
213
+ throw new Error("CNAME records cannot live at the zone apex.");
214
+ let b = createCnameRecordBuilder().zone(zone).recordName(name).domainName(spec.target);
215
+ if (spec.ttl)
216
+ b = b.ttl(spec.ttl);
217
+ if (spec.comment)
218
+ b = b.comment(spec.comment);
219
+ return b.build(scope, id, context);
220
+ }
221
+ function buildTxt(scope, id, specs, zone, context) {
222
+ const values = dedupe(specs.flatMap((s) => [...s.values]));
223
+ const b = applyCommon(createTxtRecordBuilder().zone(zone).values(values), specs, sub(specs[0].name));
224
+ return b.build(scope, id, context);
225
+ }
226
+ function buildMx(scope, id, specs, zone, context) {
227
+ const values = specs.flatMap((s) => s.values.map((v) => ({ priority: v.priority, hostName: v.hostName })));
228
+ const b = applyCommon(createMxRecordBuilder().zone(zone).values(values), specs, sub(specs[0].name));
229
+ return b.build(scope, id, context);
230
+ }
231
+ function buildSrv(scope, id, specs, zone, context) {
232
+ const values = specs.flatMap((s) => s.values.map((v) => ({
233
+ priority: v.priority,
234
+ weight: v.weight,
235
+ port: v.port,
236
+ hostName: v.hostName,
237
+ })));
238
+ const b = applyCommon(createSrvRecordBuilder().zone(zone).values(values), specs, sub(specs[0].name));
239
+ return b.build(scope, id, context);
240
+ }
241
+ function buildCaa(scope, id, specs, zone, context) {
242
+ const values = specs.flatMap((s) => s.values.map((v) => ({ flag: v.flag, tag: v.tag, value: v.value })));
243
+ const b = applyCommon(createCaaRecordBuilder().zone(zone).values(values), specs, sub(specs[0].name));
244
+ return b.build(scope, id, context);
245
+ }
246
+ function buildNs(scope, id, specs, zone, context) {
247
+ const name = sub(specs[0].name);
248
+ if (!name) {
249
+ throw new Error(`NS records cannot live at the zone apex. The apex NS set is managed by Route 53.`);
250
+ }
251
+ const values = dedupe(specs.flatMap((s) => [...s.values]));
252
+ const b = applyCommon(createNsRecordBuilder().zone(zone).values(values), specs, name);
253
+ return b.build(scope, id, context);
254
+ }
255
+ function buildDs(scope, id, specs, zone, context) {
256
+ const values = dedupe(specs.flatMap((s) => [...s.values]));
257
+ const b = applyCommon(createDsRecordBuilder().zone(zone).values(values), specs, sub(specs[0].name));
258
+ return b.build(scope, id, context);
259
+ }
260
+ function buildHttps(scope, id, specs, zone, context) {
261
+ const values = specs.flatMap((s) => [...s.values]);
262
+ const b = applyCommon(createHttpsRecordBuilder().zone(zone).values(values), specs, sub(specs[0].name));
263
+ return b.build(scope, id, context);
264
+ }
265
+ function buildSvcb(scope, id, specs, zone, context) {
266
+ const values = specs.flatMap((s) => [...s.values]);
267
+ const b = applyCommon(createSvcbRecordBuilder().zone(zone).values(values), specs, sub(specs[0].name));
268
+ return b.build(scope, id, context);
269
+ }
270
+ //# sourceMappingURL=zone-records.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zone-records.js","sourceRoot":"","sources":["../../src/zone/zone-records.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,SAAS,EAAmB,MAAM,YAAY,CAAC;AACxD,OAAO,EAAE,WAAW,EAAkB,OAAO,EAAmB,MAAM,oBAAoB,CAAC;AAC3F,OAAO,EAAgC,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAClG,OAAO,EAA6B,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAA+B,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC/F,OAAO,EAEL,wBAAwB,GACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAA8B,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC5F,OAAO,EAEL,wBAAwB,GACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAA8B,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC5F,OAAO,EAA8B,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC5F,OAAO,EAA+B,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC/F,OAAO,EAAgC,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAClG,OAAO,EAA+B,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC/F,OAAO,EACL,IAAI,GAcL,MAAM,eAAe,CAAC;AAsCvB;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,WAAW,CAAC,KAA4B;IACtD,OAAO,IAAI,kBAAkB,CAAC,KAAK,CAAC,CAAC;AACvC,CAAC;AAeD,MAAM,kBAAkB;IACtB,KAAK,CAA2B;IAC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B,EACjB,EAAU,EACV,KAAuB,EACvB,IAAiB,EACjB,OAAgC;IAEhC,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;IACnD,MAAM,CAAC,GAAG,WAAW,CACnB,uBAAuB,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EACnD,KAAK,EACL,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CACnB,CAAC;IACF,OAAO,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;AACrC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@composurecdk/route53",
3
- "version": "0.3.5",
3
+ "version": "0.4.1",
4
4
  "description": "Composable Route53 hosted zone and record builders with well-architected defaults",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,6 +13,10 @@
13
13
  ".": {
14
14
  "import": "./dist/index.js",
15
15
  "types": "./dist/index.d.ts"
16
+ },
17
+ "./zone": {
18
+ "import": "./dist/zone/index.js",
19
+ "types": "./dist/zone/index.d.ts"
16
20
  }
17
21
  },
18
22
  "files": [
@@ -35,7 +39,7 @@
35
39
  },
36
40
  "type": "module",
37
41
  "peerDependencies": {
38
- "@composurecdk/core": "^0.3.0",
42
+ "@composurecdk/core": "^0.4.0",
39
43
  "aws-cdk-lib": "^2.0.0",
40
44
  "constructs": "^10.0.0"
41
45
  },