@composurecdk/route53 0.3.4 → 0.3.6
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 +118 -10
- package/dist/a-record-builder.d.ts.map +1 -1
- package/dist/a-record-builder.js +2 -3
- package/dist/a-record-builder.js.map +1 -1
- package/dist/aaaa-record-builder.d.ts.map +1 -1
- package/dist/aaaa-record-builder.js +2 -3
- package/dist/aaaa-record-builder.js.map +1 -1
- package/dist/caa-record-builder.d.ts +44 -0
- package/dist/caa-record-builder.d.ts.map +1 -0
- package/dist/caa-record-builder.js +33 -0
- package/dist/caa-record-builder.js.map +1 -0
- package/dist/cname-record-builder.d.ts.map +1 -1
- package/dist/cname-record-builder.js +1 -2
- package/dist/cname-record-builder.js.map +1 -1
- package/dist/defaults.d.ts +42 -0
- package/dist/defaults.d.ts.map +1 -1
- package/dist/defaults.js +49 -0
- package/dist/defaults.js.map +1 -1
- package/dist/ds-record-builder.d.ts +42 -0
- package/dist/ds-record-builder.d.ts.map +1 -0
- package/dist/ds-record-builder.js +33 -0
- package/dist/ds-record-builder.js.map +1 -0
- package/dist/https-record-builder.d.ts +45 -0
- package/dist/https-record-builder.d.ts.map +1 -0
- package/dist/https-record-builder.js +41 -0
- package/dist/https-record-builder.js.map +1 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/mx-record-builder.d.ts +40 -0
- package/dist/mx-record-builder.d.ts.map +1 -0
- package/dist/mx-record-builder.js +33 -0
- package/dist/mx-record-builder.js.map +1 -0
- package/dist/ns-record-builder.d.ts +40 -0
- package/dist/ns-record-builder.d.ts.map +1 -0
- package/dist/ns-record-builder.js +38 -0
- package/dist/ns-record-builder.js.map +1 -0
- package/dist/srv-record-builder.d.ts +40 -0
- package/dist/srv-record-builder.d.ts.map +1 -0
- package/dist/srv-record-builder.js +33 -0
- package/dist/srv-record-builder.js.map +1 -0
- package/dist/svcb-record-builder.d.ts +41 -0
- package/dist/svcb-record-builder.d.ts.map +1 -0
- package/dist/svcb-record-builder.js +34 -0
- package/dist/svcb-record-builder.js.map +1 -0
- package/dist/txt-record-builder.d.ts.map +1 -1
- package/dist/txt-record-builder.js +1 -2
- package/dist/txt-record-builder.js.map +1 -1
- package/dist/zone/index.d.ts +3 -0
- package/dist/zone/index.d.ts.map +1 -0
- package/dist/zone/index.js +3 -0
- package/dist/zone/index.js.map +1 -0
- package/dist/zone/zone-dsl.d.ts +252 -0
- package/dist/zone/zone-dsl.d.ts.map +1 -0
- package/dist/zone/zone-dsl.js +198 -0
- package/dist/zone/zone-dsl.js.map +1 -0
- package/dist/zone/zone-records.d.ts +67 -0
- package/dist/zone/zone-records.d.ts.map +1 -0
- package/dist/zone/zone-records.js +267 -0
- package/dist/zone/zone-records.js.map +1 -0
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Route 53 hosted zone and record builders for [ComposureCDK](../../README.md).
|
|
4
4
|
|
|
5
|
-
This package provides fluent builders for Route 53 public hosted zones and for the record types most commonly needed when fronting an AWS workload (A/AAAA alias, CNAME, TXT). It wraps the CDK [aws-route53](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_route53-readme.html) constructs — refer to the CDK documentation for the full set of configurable properties.
|
|
5
|
+
This package provides fluent builders for Route 53 public hosted zones and for the record types most commonly needed when fronting an AWS workload (A/AAAA alias, CNAME, TXT, MX, SRV, CAA, NS, DS, HTTPS, SVCB). It wraps the CDK [aws-route53](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_route53-readme.html) constructs — refer to the CDK documentation for the full set of configurable properties.
|
|
6
6
|
|
|
7
7
|
## Hosted Zone Builder
|
|
8
8
|
|
|
@@ -73,20 +73,128 @@ Each helper accepts a `Resolvable`, so targets produced by other composed compon
|
|
|
73
73
|
|
|
74
74
|
## Secure Defaults
|
|
75
75
|
|
|
76
|
-
| Builder | Property | Default | Rationale
|
|
77
|
-
| -------------------------- | ---------------- | --------------------- |
|
|
78
|
-
| `createHostedZoneBuilder` | `addTrailingDot` | `true` | Matches RFC 1035 and the CDK default; unambiguous apex.
|
|
79
|
-
| `createARecordBuilder` | `ttl` | `Duration.minutes(5)` | Balances propagation latency against DNS cache churn.
|
|
80
|
-
| `createAaaaRecordBuilder` | `ttl` | `Duration.minutes(5)` | Same
|
|
81
|
-
| `createCnameRecordBuilder` | `ttl` | `Duration.minutes(5)` | Same rationale as A records.
|
|
82
|
-
| `createTxtRecordBuilder` | `ttl` | `Duration.minutes(5)` | Same rationale as A records.
|
|
83
|
-
|
|
84
|
-
|
|
76
|
+
| Builder | Property | Default | Rationale |
|
|
77
|
+
| -------------------------- | ---------------- | --------------------- | ---------------------------------------------------------------------------------------- |
|
|
78
|
+
| `createHostedZoneBuilder` | `addTrailingDot` | `true` | Matches RFC 1035 and the CDK default; unambiguous apex. |
|
|
79
|
+
| `createARecordBuilder` | `ttl` | `Duration.minutes(5)` | Balances propagation latency against DNS cache churn; skipped for alias targets.[^alias] |
|
|
80
|
+
| `createAaaaRecordBuilder` | `ttl` | `Duration.minutes(5)` | Same as A records; skipped for alias targets.[^alias] |
|
|
81
|
+
| `createCnameRecordBuilder` | `ttl` | `Duration.minutes(5)` | Same rationale as A records. |
|
|
82
|
+
| `createTxtRecordBuilder` | `ttl` | `Duration.minutes(5)` | Same rationale as A records. |
|
|
83
|
+
| `createMxRecordBuilder` | `ttl` | `Duration.minutes(5)` | Same rationale as A records. |
|
|
84
|
+
| `createSrvRecordBuilder` | `ttl` | `Duration.minutes(5)` | Same rationale as A records. |
|
|
85
|
+
| `createCaaRecordBuilder` | `ttl` | `Duration.minutes(5)` | Same rationale as A records. |
|
|
86
|
+
| `createNsRecordBuilder` | `ttl` | `Duration.hours(24)` | Delegation records change rarely; long TTL cuts lookups. |
|
|
87
|
+
| `createDsRecordBuilder` | `ttl` | `Duration.hours(24)` | DNSSEC trust anchors change on key rollover only. |
|
|
88
|
+
| `createHttpsRecordBuilder` | `ttl` | `Duration.minutes(5)` | Same as A records; skipped for alias targets.[^alias] |
|
|
89
|
+
| `createSvcbRecordBuilder` | `ttl` | `Duration.minutes(5)` | Same rationale as A records. |
|
|
90
|
+
|
|
91
|
+
The defaults are exported as `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`, and `SVCB_RECORD_DEFAULTS` for visibility and testing.
|
|
92
|
+
|
|
93
|
+
[^alias]: AWS ignores TTL on alias records and CDK emits a warning when one is set, so `A`, `AAAA`, and `HTTPS` builders skip the default TTL whenever the target is an alias.
|
|
85
94
|
|
|
86
95
|
## Recommended Alarms
|
|
87
96
|
|
|
88
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).
|
|
89
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
|
+
|
|
90
198
|
## Composing with ACM and CloudFront
|
|
91
199
|
|
|
92
200
|
```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a-record-builder.d.ts","sourceRoot":"","sources":["../src/a-record-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,SAAS,EAEd,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;AAG5B;;;;;;GAMG;AACH,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,QAAQ,CAAC;IAChF;;;;OAIG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IAE/B;;;;OAIG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,6DAA6D;IAC7D,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,mBAAmB,EAAE,cAAc,CAAC,CAAC;AAE5E,cAAM,cAAe,YAAW,SAAS,CAAC,oBAAoB,CAAC;IAC7D,KAAK,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAM;IAEzC,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,oBAAoB;
|
|
1
|
+
{"version":3,"file":"a-record-builder.d.ts","sourceRoot":"","sources":["../src/a-record-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,SAAS,EAEd,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;AAG5B;;;;;;GAMG;AACH,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,YAAY,EAAE,MAAM,GAAG,QAAQ,CAAC;IAChF;;;;OAIG;IACH,IAAI,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IAE/B;;;;OAIG;IACH,MAAM,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,6DAA6D;IAC7D,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,CAAC,mBAAmB,EAAE,cAAc,CAAC,CAAC;AAE5E,cAAM,cAAe,YAAW,SAAS,CAAC,oBAAoB,CAAC;IAC7D,KAAK,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAM;IAEzC,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,oBAAoB;CAuB7F;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,eAAe,CAEtD"}
|
package/dist/a-record-builder.js
CHANGED
|
@@ -11,13 +11,12 @@ class ARecordBuilder {
|
|
|
11
11
|
if (!target) {
|
|
12
12
|
throw new Error(`ARecordBuilder "${id}" requires a target. Call .target() with a RecordTarget.`);
|
|
13
13
|
}
|
|
14
|
-
const
|
|
15
|
-
const resolvedTarget = resolve(target, resolvedContext);
|
|
14
|
+
const resolvedTarget = resolve(target, context);
|
|
16
15
|
const isAlias = resolvedTarget.aliasTarget !== undefined;
|
|
17
16
|
const mergedProps = {
|
|
18
17
|
...(isAlias ? {} : A_RECORD_DEFAULTS),
|
|
19
18
|
...rest,
|
|
20
|
-
zone: resolve(zone,
|
|
19
|
+
zone: resolve(zone, context),
|
|
21
20
|
target: resolvedTarget,
|
|
22
21
|
};
|
|
23
22
|
const record = new ARecord(scope, id, mergedProps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"a-record-builder.js","sourceRoot":"","sources":["../src/a-record-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,GAIR,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,OAAO,EAGP,OAAO,GAER,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AA+ClD,MAAM,cAAc;IAClB,KAAK,GAAiC,EAAE,CAAC;IAEzC,KAAK,CAAC,KAAiB,EAAE,EAAU,EAAE,OAAgC;QACnE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC7C,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,mBAAmB,EAAE,sDAAsD,CAAC,CAAC;QAC/F,CAAC;QACD,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,KAAK,CACb,mBAAmB,EAAE,0DAA0D,CAChF,CAAC;QACJ,CAAC;QAED,MAAM,
|
|
1
|
+
{"version":3,"file":"a-record-builder.js","sourceRoot":"","sources":["../src/a-record-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,GAIR,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,OAAO,EAGP,OAAO,GAER,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AA+ClD,MAAM,cAAc;IAClB,KAAK,GAAiC,EAAE,CAAC;IAEzC,KA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AC,CAAC;IAC/B,yBAAyB;IACzB,MAAM,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,gEAAgE;IAChE,MAAM,EAAE,UAAU,CAAC;CACpB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC,sBAAsB,EAAE,iBAAiB,CAAC,CAAC;AAErF,cAAM,iBAAkB,YAAW,SAAS,CAAC,uBAAuB,CAAC;IACnE,KAAK,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAM;IAE5C,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,uBAAuB;CAyBhG;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,IAAI,kBAAkB,CAE5D"}
|
|
@@ -11,13 +11,12 @@ class AaaaRecordBuilder {
|
|
|
11
11
|
if (!target) {
|
|
12
12
|
throw new Error(`AaaaRecordBuilder "${id}" requires a target. Call .target() with a RecordTarget.`);
|
|
13
13
|
}
|
|
14
|
-
const
|
|
15
|
-
const resolvedTarget = resolve(target, resolvedContext);
|
|
14
|
+
const resolvedTarget = resolve(target, context);
|
|
16
15
|
const isAlias = resolvedTarget.aliasTarget !== undefined;
|
|
17
16
|
const mergedProps = {
|
|
18
17
|
...(isAlias ? {} : AAAA_RECORD_DEFAULTS),
|
|
19
18
|
...rest,
|
|
20
|
-
zone: resolve(zone,
|
|
19
|
+
zone: resolve(zone, context),
|
|
21
20
|
target: resolvedTarget,
|
|
22
21
|
};
|
|
23
22
|
const record = new AaaaRecord(scope, id, mergedProps);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aaaa-record-builder.js","sourceRoot":"","sources":["../src/aaaa-record-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,GAIX,MAAM,yBAAyB,C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AAc,GAAG,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAChD,MAAM,OAAO,GAAG,cAAc,CAAC,WAAW,KAAK,SAAS,CAAC;QACzD,MAAM,WAAW,GAAG;YAClB,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,oBAAoB,CAAC;YACxC,GAAG,IAAI;YACP,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;YAC5B,MAAM,EAAE,cAAc;SACJ,CAAC;QAErB,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,KAAK,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC;QACtD,OAAO,EAAE,MAAM,EAAE,CAAC;IACpB,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB;IACrC,OAAO,OAAO,CAA4C,iBAAiB,CAAC,CAAC;AAC/E,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { CaaRecord, type CaaRecordProps, type IHostedZone } from "aws-cdk-lib/aws-route53";
|
|
2
|
+
import { type IConstruct } from "constructs";
|
|
3
|
+
import { type IBuilder, type Lifecycle, type Resolvable } from "@composurecdk/core";
|
|
4
|
+
/**
|
|
5
|
+
* Configuration properties for the Route53 CAA record builder.
|
|
6
|
+
*
|
|
7
|
+
* Extends the CDK {@link CaaRecordProps} but replaces `zone` with a
|
|
8
|
+
* {@link Resolvable} so it can be wired from composed components.
|
|
9
|
+
*/
|
|
10
|
+
export interface CaaRecordBuilderProps extends Omit<CaaRecordProps, "zone"> {
|
|
11
|
+
/** The hosted zone in which to create the record. */
|
|
12
|
+
zone?: Resolvable<IHostedZone>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The build output of an {@link ICaaRecordBuilder}.
|
|
16
|
+
*/
|
|
17
|
+
export interface CaaRecordBuilderResult {
|
|
18
|
+
/** The Route53 CAA record construct created by the builder. */
|
|
19
|
+
record: CaaRecord;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A fluent builder for configuring and creating a Route53 CAA record.
|
|
23
|
+
*
|
|
24
|
+
* CAA records restrict which certificate authorities may issue certificates
|
|
25
|
+
* for the domain — a CA that does not match any permitted `issue` / `issuewild`
|
|
26
|
+
* entry must refuse to issue. When issuing via ACM, see
|
|
27
|
+
* `createCaaAmazonRecordBuilder` (not yet implemented — use a CAA record with
|
|
28
|
+
* `amazon.com` / `amazontrust.com` / `awstrust.com` / `amazonaws.com` values).
|
|
29
|
+
*
|
|
30
|
+
* @see https://docs.aws.amazon.com/acm/latest/userguide/setup-caa.html
|
|
31
|
+
*/
|
|
32
|
+
export type ICaaRecordBuilder = IBuilder<CaaRecordBuilderProps, CaaRecordBuilder>;
|
|
33
|
+
declare class CaaRecordBuilder implements Lifecycle<CaaRecordBuilderResult> {
|
|
34
|
+
props: Partial<CaaRecordBuilderProps>;
|
|
35
|
+
build(scope: IConstruct, id: string, context?: Record<string, object>): CaaRecordBuilderResult;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Creates a new {@link ICaaRecordBuilder} for configuring a Route53 CAA record.
|
|
39
|
+
*
|
|
40
|
+
* @returns A fluent builder for a Route53 CAA record.
|
|
41
|
+
*/
|
|
42
|
+
export declare function createCaaRecordBuilder(): ICaaRecordBuilder;
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=caa-record-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"caa-record-builder.d.ts","sourceRoot":"","sources":["../src/caa-record-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3F,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,SAAS,EAEd,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;AAG5B;;;;;GAKG;AACH,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC;IACzE,qDAAqD;IACrD,IAAI,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,+DAA+D;IAC/D,MAAM,EAAE,SAAS,CAAC;CACnB;AAED;;;;;;;;;;GAUG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,qBAAqB,EAAE,gBAAgB,CAAC,CAAC;AAElF,cAAM,gBAAiB,YAAW,SAAS,CAAC,sBAAsB,CAAC;IACjE,KAAK,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAM;IAE3C,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,sBAAsB;CAwB/F;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,iBAAiB,CAE1D"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { CaaRecord } from "aws-cdk-lib/aws-route53";
|
|
2
|
+
import { Builder, resolve, } from "@composurecdk/core";
|
|
3
|
+
import { CAA_RECORD_DEFAULTS } from "./defaults.js";
|
|
4
|
+
class CaaRecordBuilder {
|
|
5
|
+
props = {};
|
|
6
|
+
build(scope, id, context) {
|
|
7
|
+
const { zone, values, ...rest } = this.props;
|
|
8
|
+
if (!zone) {
|
|
9
|
+
throw new Error(`CaaRecordBuilder "${id}" requires a zone. Call .zone() with an IHostedZone.`);
|
|
10
|
+
}
|
|
11
|
+
if (!values || values.length === 0) {
|
|
12
|
+
throw new Error(`CaaRecordBuilder "${id}" requires non-empty values. ` +
|
|
13
|
+
`Call .values() with one or more { flag, tag, value } entries.`);
|
|
14
|
+
}
|
|
15
|
+
const mergedProps = {
|
|
16
|
+
...CAA_RECORD_DEFAULTS,
|
|
17
|
+
...rest,
|
|
18
|
+
values,
|
|
19
|
+
zone: resolve(zone, context),
|
|
20
|
+
};
|
|
21
|
+
const record = new CaaRecord(scope, id, mergedProps);
|
|
22
|
+
return { record };
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Creates a new {@link ICaaRecordBuilder} for configuring a Route53 CAA record.
|
|
27
|
+
*
|
|
28
|
+
* @returns A fluent builder for a Route53 CAA record.
|
|
29
|
+
*/
|
|
30
|
+
export function createCaaRecordBuilder() {
|
|
31
|
+
return Builder(CaaRecordBuilder);
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=caa-record-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"caa-record-builder.js","sourceRoot":"","sources":["../src/caa-record-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAyC,MAAM,yBAAyB,CAAC;AAE3F,OAAO,EACL,OAAO,EAGP,OAAO,GAER,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAkCpD,MAAM,gBAAgB;IACpB,KAAK,GAAmC,EAAE,CAAC;IAE3C,KAAK,CAAC,KAAiB,EAAE,EAAU,EAAE,OAAgC;QACnE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC7C,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CACb,qBAAqB,EAAE,sDAAsD,CAC9E,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACnC,MAAM,IAAI,KAAK,CACb,qBAAqB,EAAE,+BAA+B;gBACpD,+DAA+D,CAClE,CAAC;QACJ,CAAC;QAED,MAAM,WAAW,GAAG;YAClB,GAAG,mBAAmB;YACtB,GAAG,IAAI;YACP,MAAM;YACN,IAAI,E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
1
|
+
{"version":3,"file":"cname-record-builder.d.ts","sourceRoot":"","sources":["../src/cname-record-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC/F,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,SAAS,EAEd,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;AAG5B;;;;;GAKG;AACH,MAAM,WAAW,uBAAwB,SAAQ,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAC7E,qDAAqD;IACrD,IAAI,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,iEAAiE;IACjE,MAAM,EAAE,WAAW,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,uBAAuB,EAAE,kBAAkB,CAAC,CAAC;AAExF,cAAM,kBAAmB,YAAW,SAAS,CAAC,wBAAwB,CAAC;IACrE,KAAK,EAAE,OAAO,CAAC,uBAAuB,CAAC,CAAM;IAE7C,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,wBAAwB;CA+BjG;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,IAAI,mBAAmB,CAE9D"}
|
|
@@ -16,13 +16,12 @@ class CnameRecordBuilder {
|
|
|
16
16
|
throw new Error(`CnameRecordBuilder "${id}" requires a recordName. ` +
|
|
17
17
|
`Call .recordName() with the subdomain — CNAME records cannot be at the zone apex.`);
|
|
18
18
|
}
|
|
19
|
-
const resolvedContext = context ?? {};
|
|
20
19
|
const mergedProps = {
|
|
21
20
|
...CNAME_RECORD_DEFAULTS,
|
|
22
21
|
...rest,
|
|
23
22
|
domainName,
|
|
24
23
|
recordName,
|
|
25
|
-
zone: resolve(zone,
|
|
24
|
+
zone: resolve(zone, context),
|
|
26
25
|
};
|
|
27
26
|
const record = new CnameRecord(scope, id, mergedProps);
|
|
28
27
|
return { record };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cname-record-builder.js","sourceRoot":"","sources":["../src/cname-record-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA2C,MAAM,yBAAyB,CAAC;AAE/F,OAAO,EACL,OAAO,EAGP,OAAO,GAER,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AA+BtD,MAAM,kBAAkB;IACtB,KAAK,GAAqC,EAAE,CAAC;IAE7C,KAAK,CAAC,KAAiB,EAAE,EAAU,EAAE,OAAgC;QACnE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC7D,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CACb,uBAAuB,EAAE,sDAAsD,CAChF,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CACb,uBAAuB,EAAE,2BAA2B;gBAClD,qEAAqE,CACxE,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CACb,uBAAuB,EAAE,2BAA2B;gBAClD,mFAAmF,CACtF,CAAC;QACJ,CAAC;QAED,MAAM,
|
|
1
|
+
{"version":3,"file":"cname-record-builder.js","sourceRoot":"","sources":["../src/cname-record-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAA2C,MAAM,yBAAyB,CAAC;AAE/F,OAAO,EACL,OAAO,EAGP,OAAO,GAER,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AA+BtD,MAAM,kBAAkB;IACtB,KAAK,GAAqC,EAAE,CAAC;IAE7C,KAAK,CAAC,KAAiB,EAAE,EAAU,EAAE,OAAgC;QACnE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC7D,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CACb,uBAAuB,EAAE,sDAAsD,CAChF,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CACb,uBAAuB,EAAE,2BAA2B;gBAClD,qEAAqE,CACxE,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CACb,uBAAuB,EAAE,2BAA2B;gBAClD,mFAAmF,CACtF,CAAC;QACJ,CAAC;QAED,MAAM,WAAW,GAAG;YAClB,GAAG,qBAAqB;YACxB,GAAG,IAAI;YACP,UAAU;YACV,UAAU;YACV,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACT,CAAC;QAEtB,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC,KAAK,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC;QACvD,OAAO,EAAE,MAAM,EAAE,CAAC;IACpB,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB;IACtC,OAAO,OAAO,CAA8C,kBAAkB,CAAC,CAAC;AAClF,CAAC"}
|
package/dist/defaults.d.ts
CHANGED
|
@@ -3,6 +3,13 @@ import type { ARecordBuilderProps } from "./a-record-builder.js";
|
|
|
3
3
|
import type { AaaaRecordBuilderProps } from "./aaaa-record-builder.js";
|
|
4
4
|
import type { CnameRecordBuilderProps } from "./cname-record-builder.js";
|
|
5
5
|
import type { TxtRecordBuilderProps } from "./txt-record-builder.js";
|
|
6
|
+
import type { MxRecordBuilderProps } from "./mx-record-builder.js";
|
|
7
|
+
import type { SrvRecordBuilderProps } from "./srv-record-builder.js";
|
|
8
|
+
import type { CaaRecordBuilderProps } from "./caa-record-builder.js";
|
|
9
|
+
import type { NsRecordBuilderProps } from "./ns-record-builder.js";
|
|
10
|
+
import type { DsRecordBuilderProps } from "./ds-record-builder.js";
|
|
11
|
+
import type { HttpsRecordBuilderProps } from "./https-record-builder.js";
|
|
12
|
+
import type { SvcbRecordBuilderProps } from "./svcb-record-builder.js";
|
|
6
13
|
/**
|
|
7
14
|
* Secure, AWS-recommended defaults applied to every public hosted zone built
|
|
8
15
|
* with {@link createHostedZoneBuilder}. Each property can be individually
|
|
@@ -33,4 +40,39 @@ export declare const CNAME_RECORD_DEFAULTS: Partial<CnameRecordBuilderProps>;
|
|
|
33
40
|
* Defaults for {@link createTxtRecordBuilder}. Overridable via the fluent API.
|
|
34
41
|
*/
|
|
35
42
|
export declare const TXT_RECORD_DEFAULTS: Partial<TxtRecordBuilderProps>;
|
|
43
|
+
/**
|
|
44
|
+
* Defaults for {@link createMxRecordBuilder}. Overridable via the fluent API.
|
|
45
|
+
*/
|
|
46
|
+
export declare const MX_RECORD_DEFAULTS: Partial<MxRecordBuilderProps>;
|
|
47
|
+
/**
|
|
48
|
+
* Defaults for {@link createSrvRecordBuilder}. Overridable via the fluent API.
|
|
49
|
+
*/
|
|
50
|
+
export declare const SRV_RECORD_DEFAULTS: Partial<SrvRecordBuilderProps>;
|
|
51
|
+
/**
|
|
52
|
+
* Defaults for {@link createCaaRecordBuilder}. Overridable via the fluent API.
|
|
53
|
+
*/
|
|
54
|
+
export declare const CAA_RECORD_DEFAULTS: Partial<CaaRecordBuilderProps>;
|
|
55
|
+
/**
|
|
56
|
+
* Defaults for {@link createNsRecordBuilder}. Overridable via the fluent API.
|
|
57
|
+
*
|
|
58
|
+
* A longer TTL is appropriate for delegation records — resolvers cache NS
|
|
59
|
+
* responses, and frequent churn forces parent-side re-delegation lookups.
|
|
60
|
+
*/
|
|
61
|
+
export declare const NS_RECORD_DEFAULTS: Partial<NsRecordBuilderProps>;
|
|
62
|
+
/**
|
|
63
|
+
* Defaults for {@link createDsRecordBuilder}. Overridable via the fluent API.
|
|
64
|
+
*
|
|
65
|
+
* DS records change rarely (key-signing rollovers); a long TTL reduces
|
|
66
|
+
* DNSSEC validation load on resolvers.
|
|
67
|
+
*/
|
|
68
|
+
export declare const DS_RECORD_DEFAULTS: Partial<DsRecordBuilderProps>;
|
|
69
|
+
/**
|
|
70
|
+
* Defaults for {@link createHttpsRecordBuilder}. Overridable via the fluent API.
|
|
71
|
+
* Same alias-target caveat as {@link A_RECORD_DEFAULTS}.
|
|
72
|
+
*/
|
|
73
|
+
export declare const HTTPS_RECORD_DEFAULTS: Partial<HttpsRecordBuilderProps>;
|
|
74
|
+
/**
|
|
75
|
+
* Defaults for {@link createSvcbRecordBuilder}. Overridable via the fluent API.
|
|
76
|
+
*/
|
|
77
|
+
export declare const SVCB_RECORD_DEFAULTS: Partial<SvcbRecordBuilderProps>;
|
|
36
78
|
//# sourceMappingURL=defaults.d.ts.map
|
package/dist/defaults.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAA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AAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,OAAO,CAAC,qBAAqB,CAE9D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,OAAO,CAAC,oBAAoB,CAE5D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,EAAE,OAAO,CAAC,oBAAoB,CAE5D,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,qBAAqB,EAAE,OAAO,CAAC,uBAAuB,CAElE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,OAAO,CAAC,sBAAsB,CAEhE,CAAC"}
|
package/dist/defaults.js
CHANGED
|
@@ -53,4 +53,53 @@ export const CNAME_RECORD_DEFAULTS = {
|
|
|
53
53
|
export const TXT_RECORD_DEFAULTS = {
|
|
54
54
|
ttl: DEFAULT_RECORD_TTL,
|
|
55
55
|
};
|
|
56
|
+
/**
|
|
57
|
+
* Defaults for {@link createMxRecordBuilder}. Overridable via the fluent API.
|
|
58
|
+
*/
|
|
59
|
+
export const MX_RECORD_DEFAULTS = {
|
|
60
|
+
ttl: DEFAULT_RECORD_TTL,
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Defaults for {@link createSrvRecordBuilder}. Overridable via the fluent API.
|
|
64
|
+
*/
|
|
65
|
+
export const SRV_RECORD_DEFAULTS = {
|
|
66
|
+
ttl: DEFAULT_RECORD_TTL,
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Defaults for {@link createCaaRecordBuilder}. Overridable via the fluent API.
|
|
70
|
+
*/
|
|
71
|
+
export const CAA_RECORD_DEFAULTS = {
|
|
72
|
+
ttl: DEFAULT_RECORD_TTL,
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Defaults for {@link createNsRecordBuilder}. Overridable via the fluent API.
|
|
76
|
+
*
|
|
77
|
+
* A longer TTL is appropriate for delegation records — resolvers cache NS
|
|
78
|
+
* responses, and frequent churn forces parent-side re-delegation lookups.
|
|
79
|
+
*/
|
|
80
|
+
export const NS_RECORD_DEFAULTS = {
|
|
81
|
+
ttl: Duration.hours(24),
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Defaults for {@link createDsRecordBuilder}. Overridable via the fluent API.
|
|
85
|
+
*
|
|
86
|
+
* DS records change rarely (key-signing rollovers); a long TTL reduces
|
|
87
|
+
* DNSSEC validation load on resolvers.
|
|
88
|
+
*/
|
|
89
|
+
export const DS_RECORD_DEFAULTS = {
|
|
90
|
+
ttl: Duration.hours(24),
|
|
91
|
+
};
|
|
92
|
+
/**
|
|
93
|
+
* Defaults for {@link createHttpsRecordBuilder}. Overridable via the fluent API.
|
|
94
|
+
* Same alias-target caveat as {@link A_RECORD_DEFAULTS}.
|
|
95
|
+
*/
|
|
96
|
+
export const HTTPS_RECORD_DEFAULTS = {
|
|
97
|
+
ttl: DEFAULT_RECORD_TTL,
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Defaults for {@link createSvcbRecordBuilder}. Overridable via the fluent API.
|
|
101
|
+
*/
|
|
102
|
+
export const SVCB_RECORD_DEFAULTS = {
|
|
103
|
+
ttl: DEFAULT_RECORD_TTL,
|
|
104
|
+
};
|
|
56
105
|
//# sourceMappingURL=defaults.js.map
|
package/dist/defaults.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAcvC;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAoC;IACnE;;;OAGG;IACH,cAAc,EAAE,IAAI;CACrB,CAAC;AAEF;;;;;;;;GAQG;AAC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
2
|
+
import { type IConstruct } from "constructs";
|
|
3
|
+
import { type IBuilder, type Lifecycle, type Resolvable } from "@composurecdk/core";
|
|
4
|
+
/**
|
|
5
|
+
* Configuration properties for the Route53 DS record builder.
|
|
6
|
+
*
|
|
7
|
+
* Extends the CDK {@link DsRecordProps} but replaces `zone` with a
|
|
8
|
+
* {@link Resolvable} so it can be wired from composed components.
|
|
9
|
+
*/
|
|
10
|
+
export interface DsRecordBuilderProps extends Omit<DsRecordProps, "zone"> {
|
|
11
|
+
/** The hosted zone in which to create the record. */
|
|
12
|
+
zone?: Resolvable<IHostedZone>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The build output of an {@link IDsRecordBuilder}.
|
|
16
|
+
*/
|
|
17
|
+
export interface DsRecordBuilderResult {
|
|
18
|
+
/** The Route53 DS record construct created by the builder. */
|
|
19
|
+
record: DsRecord;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A fluent builder for configuring and creating a Route53 DS record.
|
|
23
|
+
*
|
|
24
|
+
* DS (Delegation Signer) records establish the DNSSEC chain of trust from a
|
|
25
|
+
* parent zone to a delegated child zone. Each value is a rdata string of
|
|
26
|
+
* `keyTag algorithm digestType digest`.
|
|
27
|
+
*
|
|
28
|
+
* @see https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-configuring-dnssec-chain-of-trust.html
|
|
29
|
+
*/
|
|
30
|
+
export type IDsRecordBuilder = IBuilder<DsRecordBuilderProps, DsRecordBuilder>;
|
|
31
|
+
declare class DsRecordBuilder implements Lifecycle<DsRecordBuilderResult> {
|
|
32
|
+
props: Partial<DsRecordBuilderProps>;
|
|
33
|
+
build(scope: IConstruct, id: string, context?: Record<string, object>): DsRecordBuilderResult;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Creates a new {@link IDsRecordBuilder} for configuring a Route53 DS record.
|
|
37
|
+
*
|
|
38
|
+
* @returns A fluent builder for a Route53 DS record.
|
|
39
|
+
*/
|
|
40
|
+
export declare function createDsRecordBuilder(): IDsRecordBuilder;
|
|
41
|
+
export {};
|
|
42
|
+
//# sourceMappingURL=ds-record-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ds-record-builder.d.ts","sourceRoot":"","sources":["../src/ds-record-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACzF,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,SAAS,EAEd,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;AAG5B;;;;;GAKG;AACH,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC;IACvE,qDAAqD;IACrD,IAAI,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,8DAA8D;IAC9D,MAAM,EAAE,QAAQ,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC,oBAAoB,EAAE,eAAe,CAAC,CAAC;AAE/E,cAAM,eAAgB,YAAW,SAAS,CAAC,qBAAqB,CAAC;IAC/D,KAAK,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAM;IAE1C,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,qBAAqB;CAsB9F;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,gBAAgB,CAExD"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DsRecord } from "aws-cdk-lib/aws-route53";
|
|
2
|
+
import { Builder, resolve, } from "@composurecdk/core";
|
|
3
|
+
import { DS_RECORD_DEFAULTS } from "./defaults.js";
|
|
4
|
+
class DsRecordBuilder {
|
|
5
|
+
props = {};
|
|
6
|
+
build(scope, id, context) {
|
|
7
|
+
const { zone, values, ...rest } = this.props;
|
|
8
|
+
if (!zone) {
|
|
9
|
+
throw new Error(`DsRecordBuilder "${id}" requires a zone. Call .zone() with an IHostedZone.`);
|
|
10
|
+
}
|
|
11
|
+
if (!values || values.length === 0) {
|
|
12
|
+
throw new Error(`DsRecordBuilder "${id}" requires non-empty values. ` +
|
|
13
|
+
`Call .values() with one or more DS rdata strings (keyTag algorithm digestType digest).`);
|
|
14
|
+
}
|
|
15
|
+
const mergedProps = {
|
|
16
|
+
...DS_RECORD_DEFAULTS,
|
|
17
|
+
...rest,
|
|
18
|
+
values,
|
|
19
|
+
zone: resolve(zone, context),
|
|
20
|
+
};
|
|
21
|
+
const record = new DsRecord(scope, id, mergedProps);
|
|
22
|
+
return { record };
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Creates a new {@link IDsRecordBuilder} for configuring a Route53 DS record.
|
|
27
|
+
*
|
|
28
|
+
* @returns A fluent builder for a Route53 DS record.
|
|
29
|
+
*/
|
|
30
|
+
export function createDsRecordBuilder() {
|
|
31
|
+
return Builder(DsRecordBuilder);
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=ds-record-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ds-record-builder.js","sourceRoot":"","sources":["../src/ds-record-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAwC,MAAM,yBAAyB,CAAC;AAEzF,OAAO,EACL,OAAO,EAGP,OAAO,GAER,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAgCnD,MAAM,eAAe;IACnB,KAAK,GAAkC,EAAE,CAAC;IAE1C,KAAK,CAAC,KAAiB,EAAE,EAAU,EAAE,OAAgC;QACnE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC;QAC7C,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,oBAAoB,EAAE,sDAAsD,CAAC,CAAC;QAChG,CAAC;QACD,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACnC,MAAM,IAAI,KAAK,CACb,oBAAoB,EAAE,+BAA+B;gBACnD,wFAAwF,CAC3F,CAAC;QACJ,CAAC;QAED,MAAM,WAAW,GAAG;YAClB,GAAG,kBAAkB;YACrB,GAAG,IAAI;YACP,MAAM;YACN,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACZ,CAAC;QAEnB,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,KAAK,EAAE,EAAE,EAAE,WAAW,CAAC,CAAC;QACpD,OAAO,EAAE,MAAM,EAAE,CAAC;IACpB,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO,OAAO,CAAwC,eAAe,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { HttpsRecord, type HttpsRecordProps, type IHostedZone, type RecordTarget } from "aws-cdk-lib/aws-route53";
|
|
2
|
+
import { type IConstruct } from "constructs";
|
|
3
|
+
import { type IBuilder, type Lifecycle, type Resolvable } from "@composurecdk/core";
|
|
4
|
+
/**
|
|
5
|
+
* Configuration properties for the Route53 HTTPS record builder.
|
|
6
|
+
*
|
|
7
|
+
* Extends the CDK {@link HttpsRecordProps} but replaces `zone` and `target`
|
|
8
|
+
* with {@link Resolvable} variants so they can be wired from composed
|
|
9
|
+
* components (e.g. a CloudFront distribution used as an alias target).
|
|
10
|
+
*/
|
|
11
|
+
export interface HttpsRecordBuilderProps extends Omit<HttpsRecordProps, "zone" | "target"> {
|
|
12
|
+
/** The hosted zone in which to create the record. */
|
|
13
|
+
zone?: Resolvable<IHostedZone>;
|
|
14
|
+
/** The record target — mutually exclusive with `values`. */
|
|
15
|
+
target?: Resolvable<RecordTarget>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The build output of an {@link IHttpsRecordBuilder}.
|
|
19
|
+
*/
|
|
20
|
+
export interface HttpsRecordBuilderResult {
|
|
21
|
+
/** The Route53 HTTPS record construct created by the builder. */
|
|
22
|
+
record: HttpsRecord;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A fluent builder for configuring and creating a Route53 HTTPS record.
|
|
26
|
+
*
|
|
27
|
+
* HTTPS records (RFC 9460) advertise protocol hints — ALPN, port, IP hints —
|
|
28
|
+
* that clients can use before opening a connection, enabling one-round-trip
|
|
29
|
+
* HTTP/3 upgrades. Specify exactly one of `values` (explicit parameter list)
|
|
30
|
+
* or `target` (alias, typically a CloudFront distribution).
|
|
31
|
+
*/
|
|
32
|
+
export type IHttpsRecordBuilder = IBuilder<HttpsRecordBuilderProps, HttpsRecordBuilder>;
|
|
33
|
+
declare class HttpsRecordBuilder implements Lifecycle<HttpsRecordBuilderResult> {
|
|
34
|
+
props: Partial<HttpsRecordBuilderProps>;
|
|
35
|
+
build(scope: IConstruct, id: string, context?: Record<string, object>): HttpsRecordBuilderResult;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Creates a new {@link IHttpsRecordBuilder} for configuring a Route53 HTTPS
|
|
39
|
+
* record.
|
|
40
|
+
*
|
|
41
|
+
* @returns A fluent builder for a Route53 HTTPS record.
|
|
42
|
+
*/
|
|
43
|
+
export declare function createHttpsRecordBuilder(): IHttpsRecordBuilder;
|
|
44
|
+
export {};
|
|
45
|
+
//# sourceMappingURL=https-record-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"https-record-builder.d.ts","sourceRoot":"","sources":["../src/https-record-builder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAEL,KAAK,QAAQ,EACb,KAAK,SAAS,EAEd,KAAK,UAAU,EAChB,MAAM,oBAAoB,CAAC;AAG5B;;;;;;GAMG;AACH,MAAM,WAAW,uBAAwB,SAAQ,IAAI,CAAC,gBAAgB,EAAE,MAAM,GAAG,QAAQ,CAAC;IACxF,qDAAqD;IACrD,IAAI,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IAC/B,4DAA4D;IAC5D,MAAM,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,iEAAiE;IACjE,MAAM,EAAE,WAAW,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,uBAAuB,EAAE,kBAAkB,CAAC,CAAC;AAExF,cAAM,kBAAmB,YAAW,SAAS,CAAC,wBAAwB,CAAC;IACrE,KAAK,EAAE,OAAO,CAAC,uBAAuB,CAAC,CAAM;IAE7C,KAAK,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,wBAAwB;CAiCjG;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,IAAI,mBAAmB,CAE9D"}
|