@intentius/chant-lexicon-aws 0.124.38 → 0.124.39
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/dist/composites/catalog.d.ts.map +1 -1
- package/dist/composites/catalog.js +132 -0
- package/dist/composites/index.d.ts +2 -0
- package/dist/composites/index.d.ts.map +1 -1
- package/dist/composites/index.js +1 -0
- package/dist/composites/latency-entry.d.ts +66 -0
- package/dist/composites/latency-entry.d.ts.map +1 -0
- package/dist/composites/latency-entry.js +77 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/integrity.json +2 -2
- package/dist/manifest.json +1 -1
- package/package.json +2 -2
- package/src/composites/catalog.ts +132 -0
- package/src/composites/index.ts +2 -0
- package/src/composites/latency-entry.test.ts +99 -0
- package/src/composites/latency-entry.ts +121 -0
- package/src/index.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/composites/catalog.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,eAAO,MAAM,gBAAgB,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/composites/catalog.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,eAAO,MAAM,gBAAgB,EAAE,cAAc,EA6xF5C,CAAC"}
|
|
@@ -1,4 +1,73 @@
|
|
|
1
1
|
export const compositeCatalog = [
|
|
2
|
+
{
|
|
3
|
+
"name": "AddressEntry",
|
|
4
|
+
"lexicon": "aws",
|
|
5
|
+
"description": "A Route 53 latency CNAME to an A record naming an IP endpoint, guarded by a health check probing that address.",
|
|
6
|
+
"bundles": [
|
|
7
|
+
"HealthCheck",
|
|
8
|
+
"RecordSet"
|
|
9
|
+
],
|
|
10
|
+
"params": [
|
|
11
|
+
{
|
|
12
|
+
"name": "origin",
|
|
13
|
+
"type": "Value<string>",
|
|
14
|
+
"required": true,
|
|
15
|
+
"description": "The name the address is published under (an A record), which the latency record points at."
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"name": "port",
|
|
19
|
+
"type": "number",
|
|
20
|
+
"required": true,
|
|
21
|
+
"description": "The port the check probes."
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "defaults",
|
|
25
|
+
"type": "HostnameEntryProps[\"defaults\"] & { origin?: Partial<ConstructorParameters<typeof RecordSet>[0]>; }",
|
|
26
|
+
"required": false
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "zoneId",
|
|
30
|
+
"type": "Value<string>",
|
|
31
|
+
"required": true,
|
|
32
|
+
"description": "The hosted zone's id (`zone.Id`)."
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "name",
|
|
36
|
+
"type": "Value<string>",
|
|
37
|
+
"required": true,
|
|
38
|
+
"description": "The name every entry answers for."
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "id",
|
|
42
|
+
"type": "string",
|
|
43
|
+
"required": true,
|
|
44
|
+
"description": "The record's set identifier, unique among the entries for `name`."
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "region",
|
|
48
|
+
"type": "string",
|
|
49
|
+
"required": true,
|
|
50
|
+
"description": "The AWS region whose latency this record is chosen for."
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "endpoint",
|
|
54
|
+
"type": "Value<string>",
|
|
55
|
+
"required": true,
|
|
56
|
+
"description": "The endpoint: a hostname here, an IP address for AddressEntry."
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "ttl",
|
|
60
|
+
"type": "number",
|
|
61
|
+
"required": false,
|
|
62
|
+
"description": "The records' TTL in seconds."
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "check",
|
|
66
|
+
"type": "LatencyEntryCheck",
|
|
67
|
+
"required": false
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
},
|
|
2
71
|
{
|
|
3
72
|
"name": "AgentCoreAgent",
|
|
4
73
|
"lexicon": "aws",
|
|
@@ -799,6 +868,69 @@ export const compositeCatalog = [
|
|
|
799
868
|
}
|
|
800
869
|
]
|
|
801
870
|
},
|
|
871
|
+
{
|
|
872
|
+
"name": "HostnameEntry",
|
|
873
|
+
"lexicon": "aws",
|
|
874
|
+
"description": "A Route 53 latency CNAME to a hostname endpoint, guarded by a health check probing that hostname.",
|
|
875
|
+
"bundles": [
|
|
876
|
+
"HealthCheck",
|
|
877
|
+
"RecordSet"
|
|
878
|
+
],
|
|
879
|
+
"params": [
|
|
880
|
+
{
|
|
881
|
+
"name": "zoneId",
|
|
882
|
+
"type": "Value<string>",
|
|
883
|
+
"required": true,
|
|
884
|
+
"description": "The hosted zone's id (`zone.Id`)."
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
"name": "name",
|
|
888
|
+
"type": "Value<string>",
|
|
889
|
+
"required": true,
|
|
890
|
+
"description": "The name every entry answers for."
|
|
891
|
+
},
|
|
892
|
+
{
|
|
893
|
+
"name": "id",
|
|
894
|
+
"type": "string",
|
|
895
|
+
"required": true,
|
|
896
|
+
"description": "The record's set identifier, unique among the entries for `name`."
|
|
897
|
+
},
|
|
898
|
+
{
|
|
899
|
+
"name": "region",
|
|
900
|
+
"type": "string",
|
|
901
|
+
"required": true,
|
|
902
|
+
"description": "The AWS region whose latency this record is chosen for."
|
|
903
|
+
},
|
|
904
|
+
{
|
|
905
|
+
"name": "endpoint",
|
|
906
|
+
"type": "Value<string>",
|
|
907
|
+
"required": true,
|
|
908
|
+
"description": "The endpoint: a hostname here, an IP address for AddressEntry."
|
|
909
|
+
},
|
|
910
|
+
{
|
|
911
|
+
"name": "port",
|
|
912
|
+
"type": "number",
|
|
913
|
+
"required": false,
|
|
914
|
+
"description": "The port the check probes."
|
|
915
|
+
},
|
|
916
|
+
{
|
|
917
|
+
"name": "ttl",
|
|
918
|
+
"type": "number",
|
|
919
|
+
"required": false,
|
|
920
|
+
"description": "The records' TTL in seconds."
|
|
921
|
+
},
|
|
922
|
+
{
|
|
923
|
+
"name": "check",
|
|
924
|
+
"type": "LatencyEntryCheck",
|
|
925
|
+
"required": false
|
|
926
|
+
},
|
|
927
|
+
{
|
|
928
|
+
"name": "defaults",
|
|
929
|
+
"type": "{ check?: Partial<ConstructorParameters<typeof HealthCheck>[0]>; record?: Partial<ConstructorParameters<typeof Record...",
|
|
930
|
+
"required": false
|
|
931
|
+
}
|
|
932
|
+
]
|
|
933
|
+
},
|
|
802
934
|
{
|
|
803
935
|
"name": "LambdaApi",
|
|
804
936
|
"lexicon": "aws",
|
|
@@ -54,4 +54,6 @@ export { MonitoringStack } from "./monitoring-stack.js";
|
|
|
54
54
|
export type { MonitoringStackProps, MonitoringMetricSpec } from "./monitoring-stack.js";
|
|
55
55
|
export { BucketDeployment } from "./bucket-deployment.js";
|
|
56
56
|
export type { BucketDeploymentProps, BucketDeploymentResult } from "./bucket-deployment.js";
|
|
57
|
+
export { HostnameEntry, AddressEntry } from "./latency-entry.js";
|
|
58
|
+
export type { HostnameEntryProps, AddressEntryProps, LatencyEntryCheck } from "./latency-entry.js";
|
|
57
59
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composites/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC9G,YAAY,EACV,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAA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E,MAAM,oBAAoB,CAAC;AACrD,YAAY,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AACrF,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,YAAY,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC9D,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dist/composites/index.js
CHANGED
|
@@ -26,3 +26,4 @@ export { AgentCoreAgent, agentCoreDefaultEndpointArn, AGENTCORE_LIMITS } from ".
|
|
|
26
26
|
export { StepFunctionsWorkflow } from "./step-functions-workflow.js";
|
|
27
27
|
export { MonitoringStack } from "./monitoring-stack.js";
|
|
28
28
|
export { BucketDeployment } from "./bucket-deployment.js";
|
|
29
|
+
export { HostnameEntry, AddressEntry } from "./latency-entry.js";
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One endpoint's way in through Route 53: a latency record for a shared name,
|
|
3
|
+
* guarded by a health check on that endpoint (#4264). A record whose check
|
|
4
|
+
* fails stops answering, and the other entries for the same name take its
|
|
5
|
+
* traffic. The endpoint can live in any cloud.
|
|
6
|
+
*
|
|
7
|
+
* HostnameEntry is for an endpoint with a hostname (a load balancer's, a
|
|
8
|
+
* Container App's): the record is a CNAME to it and the check probes it by
|
|
9
|
+
* name. AddressEntry is for an endpoint that is an IP address: it gets a name
|
|
10
|
+
* of its own, an A record, the latency record is a CNAME to that name, and the
|
|
11
|
+
* check probes the address. Latency records sharing a name must share a type,
|
|
12
|
+
* which is why the address gets its own A record instead of the latency
|
|
13
|
+
* record being one.
|
|
14
|
+
*/
|
|
15
|
+
import { type Value } from "@intentius/chant";
|
|
16
|
+
import { HealthCheck, RecordSet } from "../generated/index.js";
|
|
17
|
+
export interface LatencyEntryCheck {
|
|
18
|
+
/** Defaults to "HTTP". */
|
|
19
|
+
protocol?: "HTTP" | "HTTPS";
|
|
20
|
+
/** The path the check requests. Defaults to "/". */
|
|
21
|
+
path?: string;
|
|
22
|
+
/** When set, the check passes only if the response body contains this string (an `_STR_MATCH` check). */
|
|
23
|
+
searchString?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface HostnameEntryProps {
|
|
26
|
+
/** The hosted zone's id (`zone.Id`). */
|
|
27
|
+
zoneId: Value<string>;
|
|
28
|
+
/** The name every entry answers for. */
|
|
29
|
+
name: Value<string>;
|
|
30
|
+
/** The record's set identifier, unique among the entries for `name`. */
|
|
31
|
+
id: string;
|
|
32
|
+
/** The AWS region whose latency this record is chosen for. */
|
|
33
|
+
region: string;
|
|
34
|
+
/** The endpoint: a hostname here, an IP address for AddressEntry. */
|
|
35
|
+
endpoint: Value<string>;
|
|
36
|
+
/** The port the check probes. Defaults to the protocol's port (80 or 443). */
|
|
37
|
+
port?: number;
|
|
38
|
+
/** The records' TTL in seconds. Defaults to 60. */
|
|
39
|
+
ttl?: number;
|
|
40
|
+
check?: LatencyEntryCheck;
|
|
41
|
+
defaults?: {
|
|
42
|
+
check?: Partial<ConstructorParameters<typeof HealthCheck>[0]>;
|
|
43
|
+
record?: Partial<ConstructorParameters<typeof RecordSet>[0]>;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
export interface AddressEntryProps extends HostnameEntryProps {
|
|
47
|
+
/** The name the address is published under (an A record), which the latency record points at. */
|
|
48
|
+
origin: Value<string>;
|
|
49
|
+
/** The port the check probes. */
|
|
50
|
+
port: number;
|
|
51
|
+
defaults?: HostnameEntryProps["defaults"] & {
|
|
52
|
+
origin?: Partial<ConstructorParameters<typeof RecordSet>[0]>;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
/** A Route 53 latency CNAME to a hostname endpoint, guarded by a health check probing that hostname. */
|
|
56
|
+
export declare const HostnameEntry: import("@intentius/chant").CompositeDefinition<HostnameEntryProps, {
|
|
57
|
+
check: import("@intentius/chant").Declarable & Record<string, string>;
|
|
58
|
+
record: import("@intentius/chant").Declarable & Record<string, string>;
|
|
59
|
+
}>;
|
|
60
|
+
/** A Route 53 latency CNAME to an A record naming an IP endpoint, guarded by a health check probing that address. */
|
|
61
|
+
export declare const AddressEntry: import("@intentius/chant").CompositeDefinition<AddressEntryProps, {
|
|
62
|
+
check: import("@intentius/chant").Declarable & Record<string, string>;
|
|
63
|
+
origin: import("@intentius/chant").Declarable & Record<string, string>;
|
|
64
|
+
record: import("@intentius/chant").Declarable & Record<string, string>;
|
|
65
|
+
}>;
|
|
66
|
+
//# sourceMappingURL=latency-entry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"latency-entry.d.ts","sourceRoot":"","sources":["../../src/composites/latency-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAA4B,KAAK,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEtD,MAAM,WAAW,iBAAiB;IAChC,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,oDAAoD;IACpD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yGAAyG;IACzG,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,kBAAkB;IACjC,wCAAwC;IACxC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,wCAAwC;IACxC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACpB,wEAAwE;IACxE,EAAE,EAAE,MAAM,CAAC;IACX,8DAA8D;IAC9D,MAAM,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACxB,8EAA8E;IAC9E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mDAAmD;IACnD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,QAAQ,CAAC,EAAE;QACT,KAAK,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9D,MAAM,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC9D,CAAC;CACH;AAED,MAAM,WAAW,iBAAkB,SAAQ,kBAAkB;IAC3D,iGAAiG;IACjG,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,iCAAiC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC,GAAG;QAC1C,MAAM,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC9D,CAAC;CACH;AAOD,wGAAwG;AACxG,eAAO,MAAM,aAAa;;;EAuBP,CAAC;AAEpB,qHAAqH;AACrH,eAAO,MAAM,YAAY;;;;EA8BP,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One endpoint's way in through Route 53: a latency record for a shared name,
|
|
3
|
+
* guarded by a health check on that endpoint (#4264). A record whose check
|
|
4
|
+
* fails stops answering, and the other entries for the same name take its
|
|
5
|
+
* traffic. The endpoint can live in any cloud.
|
|
6
|
+
*
|
|
7
|
+
* HostnameEntry is for an endpoint with a hostname (a load balancer's, a
|
|
8
|
+
* Container App's): the record is a CNAME to it and the check probes it by
|
|
9
|
+
* name. AddressEntry is for an endpoint that is an IP address: it gets a name
|
|
10
|
+
* of its own, an A record, the latency record is a CNAME to that name, and the
|
|
11
|
+
* check probes the address. Latency records sharing a name must share a type,
|
|
12
|
+
* which is why the address gets its own A record instead of the latency
|
|
13
|
+
* record being one.
|
|
14
|
+
*/
|
|
15
|
+
import { Composite, mergeDefaults } from "@intentius/chant";
|
|
16
|
+
import { HealthCheck, RecordSet } from "../generated/index.js";
|
|
17
|
+
function checkType(check) {
|
|
18
|
+
const protocol = check?.protocol ?? "HTTP";
|
|
19
|
+
return check?.searchString !== undefined ? `${protocol}_STR_MATCH` : protocol;
|
|
20
|
+
}
|
|
21
|
+
/** A Route 53 latency CNAME to a hostname endpoint, guarded by a health check probing that hostname. */
|
|
22
|
+
export const HostnameEntry = Composite((props) => {
|
|
23
|
+
const check = new HealthCheck(mergeDefaults({
|
|
24
|
+
HealthCheckConfig: {
|
|
25
|
+
Type: checkType(props.check),
|
|
26
|
+
FullyQualifiedDomainName: props.endpoint,
|
|
27
|
+
ResourcePath: props.check?.path ?? "/",
|
|
28
|
+
RequestInterval: 10,
|
|
29
|
+
FailureThreshold: 1,
|
|
30
|
+
...(props.port !== undefined ? { Port: props.port } : {}),
|
|
31
|
+
...(props.check?.searchString !== undefined ? { SearchString: props.check.searchString } : {}),
|
|
32
|
+
},
|
|
33
|
+
}, props.defaults?.check));
|
|
34
|
+
const record = new RecordSet(mergeDefaults({
|
|
35
|
+
HostedZoneId: props.zoneId,
|
|
36
|
+
Name: props.name,
|
|
37
|
+
Type: "CNAME",
|
|
38
|
+
TTL: String(props.ttl ?? 60),
|
|
39
|
+
SetIdentifier: props.id,
|
|
40
|
+
Region: props.region,
|
|
41
|
+
ResourceRecords: [props.endpoint],
|
|
42
|
+
HealthCheckId: check.HealthCheckId,
|
|
43
|
+
}, props.defaults?.record));
|
|
44
|
+
return { check, record };
|
|
45
|
+
}, "HostnameEntry");
|
|
46
|
+
/** A Route 53 latency CNAME to an A record naming an IP endpoint, guarded by a health check probing that address. */
|
|
47
|
+
export const AddressEntry = Composite((props) => {
|
|
48
|
+
const check = new HealthCheck(mergeDefaults({
|
|
49
|
+
HealthCheckConfig: {
|
|
50
|
+
Type: checkType(props.check),
|
|
51
|
+
IPAddress: props.endpoint,
|
|
52
|
+
Port: props.port,
|
|
53
|
+
ResourcePath: props.check?.path ?? "/",
|
|
54
|
+
RequestInterval: 10,
|
|
55
|
+
FailureThreshold: 1,
|
|
56
|
+
...(props.check?.searchString !== undefined ? { SearchString: props.check.searchString } : {}),
|
|
57
|
+
},
|
|
58
|
+
}, props.defaults?.check));
|
|
59
|
+
const origin = new RecordSet(mergeDefaults({
|
|
60
|
+
HostedZoneId: props.zoneId,
|
|
61
|
+
Name: props.origin,
|
|
62
|
+
Type: "A",
|
|
63
|
+
TTL: String(props.ttl ?? 60),
|
|
64
|
+
ResourceRecords: [props.endpoint],
|
|
65
|
+
}, props.defaults?.origin));
|
|
66
|
+
const record = new RecordSet(mergeDefaults({
|
|
67
|
+
HostedZoneId: props.zoneId,
|
|
68
|
+
Name: props.name,
|
|
69
|
+
Type: "CNAME",
|
|
70
|
+
TTL: String(props.ttl ?? 60),
|
|
71
|
+
SetIdentifier: props.id,
|
|
72
|
+
Region: props.region,
|
|
73
|
+
ResourceRecords: [props.origin],
|
|
74
|
+
HealthCheckId: check.HealthCheckId,
|
|
75
|
+
}, props.defaults?.record));
|
|
76
|
+
return { check, origin, record };
|
|
77
|
+
}, "AddressEntry");
|
package/dist/index.d.ts
CHANGED
|
@@ -34,8 +34,8 @@ export type { CFNSchema, SchemaProperty, SchemaDefinition } from "./spec/fetch.j
|
|
|
34
34
|
export { parseCFNSchema, cfnShortName, cfnServiceName } from "./spec/parse.js";
|
|
35
35
|
export type { SchemaParseResult, ParsedResource, ParsedProperty, ParsedAttribute, ParsedPropertyType, ParsedEnum, PropertyConstraints } from "./spec/parse.js";
|
|
36
36
|
export { S3Actions, LambdaActions, DynamoDBActions, SQSActions, SNSActions, IAMActions, ECRActions, LogsActions, ECSActions } from "./actions/index.js";
|
|
37
|
-
export { LambdaFunction, LambdaNode, LambdaPython, NodeLambda, PythonLambda, LambdaApi, LambdaScheduled, ScheduledLambda, LambdaSqs, LambdaEventBridge, LambdaDynamoDB, DynamoDBTable, EcrRepository, LambdaS3, LambdaSns, VpcDefault, FargateAlb, AlbShared, FargateService, FARGATE_SERVICE_LIMITS, NlbService, RdsInstance, RdsPostgres, EfsWithAccessPoint, Ec2InstanceRole, Ec2InstanceBundle, MinimalVpc, EksCluster, SolrFargateService, MicrovmApp, MICROVM_LIMITS, AgentCoreAgent, agentCoreDefaultEndpointArn, AGENTCORE_LIMITS, OrganizationRoot, GovernanceFoundation, RegionRestriction, OrganizationTrail, StepFunctionsWorkflow, MonitoringStack, BucketDeployment, } from "./composites/index.js";
|
|
38
|
-
export type { LambdaFunctionProps, LambdaApiProps, ScheduledLambdaProps, LambdaSqsProps, LambdaEventBridgeProps, LambdaDynamoDBProps, DynamoDBTableProps, DynamoDBKey, DynamoDBCapacity, DynamoDBGlobalSecondaryIndex, EcrRepositoryProps, EcrLifecycleRule, EcrEncryption, LambdaS3Props, LambdaSnsProps, VpcDefaultProps, FargateAlbProps, AlbSharedProps, FargateServiceProps, NlbServiceProps, RdsInstanceProps, RdsPostgresProps, EfsWithAccessPointProps, Ec2InstanceRoleProps, Ec2InstanceBundleProps, Ec2InstanceBundleIngressRule, MinimalVpcProps, EksClusterProps, SolrFargateServiceProps, MicrovmAppProps, MicrovmAppResult, MicrovmAppBuildConnectorProps, MicrovmMemoryMiB, AgentCoreAgentProps, AgentCoreAgentResult, OrganizationRootProps, GovernanceFoundationProps, RegionRestrictionProps, OrganizationTrailProps, StepFunctionsWorkflowProps, MonitoringStackProps, MonitoringMetricSpec, BucketDeploymentProps, BucketDeploymentResult, } from "./composites/index.js";
|
|
37
|
+
export { LambdaFunction, LambdaNode, LambdaPython, NodeLambda, PythonLambda, LambdaApi, LambdaScheduled, ScheduledLambda, LambdaSqs, LambdaEventBridge, LambdaDynamoDB, DynamoDBTable, EcrRepository, LambdaS3, LambdaSns, VpcDefault, FargateAlb, AlbShared, FargateService, FARGATE_SERVICE_LIMITS, NlbService, RdsInstance, RdsPostgres, EfsWithAccessPoint, Ec2InstanceRole, Ec2InstanceBundle, MinimalVpc, EksCluster, SolrFargateService, MicrovmApp, MICROVM_LIMITS, AgentCoreAgent, agentCoreDefaultEndpointArn, AGENTCORE_LIMITS, OrganizationRoot, GovernanceFoundation, RegionRestriction, OrganizationTrail, StepFunctionsWorkflow, MonitoringStack, BucketDeployment, HostnameEntry, AddressEntry, } from "./composites/index.js";
|
|
38
|
+
export type { LambdaFunctionProps, LambdaApiProps, ScheduledLambdaProps, LambdaSqsProps, LambdaEventBridgeProps, LambdaDynamoDBProps, DynamoDBTableProps, DynamoDBKey, DynamoDBCapacity, DynamoDBGlobalSecondaryIndex, EcrRepositoryProps, EcrLifecycleRule, EcrEncryption, LambdaS3Props, LambdaSnsProps, VpcDefaultProps, FargateAlbProps, AlbSharedProps, FargateServiceProps, NlbServiceProps, RdsInstanceProps, RdsPostgresProps, EfsWithAccessPointProps, Ec2InstanceRoleProps, Ec2InstanceBundleProps, Ec2InstanceBundleIngressRule, MinimalVpcProps, EksClusterProps, SolrFargateServiceProps, MicrovmAppProps, MicrovmAppResult, MicrovmAppBuildConnectorProps, MicrovmMemoryMiB, AgentCoreAgentProps, AgentCoreAgentResult, OrganizationRootProps, GovernanceFoundationProps, RegionRestrictionProps, OrganizationTrailProps, StepFunctionsWorkflowProps, MonitoringStackProps, MonitoringMetricSpec, BucketDeploymentProps, BucketDeploymentResult, HostnameEntryProps, AddressEntryProps, LatencyEntryCheck, } from "./composites/index.js";
|
|
39
39
|
export { generate, writeGeneratedFiles } from "./codegen/generate.js";
|
|
40
40
|
export { packageLexicon } from "./codegen/package.js";
|
|
41
41
|
export type { PackageOptions, PackageResult } from "./codegen/package.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,OAAO,EAAE,SAAS,EAAE,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OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAIrE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAChI,YAAY,EACV,mBAAmB,EACnB,sBAAsB,EACtB,QAAQ,EACR,SAAS,EACT,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -56,7 +56,7 @@ export { parseCFNSchema, cfnShortName, cfnServiceName } from "./spec/parse.js";
|
|
|
56
56
|
// Action constants
|
|
57
57
|
export { S3Actions, LambdaActions, DynamoDBActions, SQSActions, SNSActions, IAMActions, ECRActions, LogsActions, ECSActions } from "./actions/index.js";
|
|
58
58
|
// Built-in composites
|
|
59
|
-
export { LambdaFunction, LambdaNode, LambdaPython, NodeLambda, PythonLambda, LambdaApi, LambdaScheduled, ScheduledLambda, LambdaSqs, LambdaEventBridge, LambdaDynamoDB, DynamoDBTable, EcrRepository, LambdaS3, LambdaSns, VpcDefault, FargateAlb, AlbShared, FargateService, FARGATE_SERVICE_LIMITS, NlbService, RdsInstance, RdsPostgres, EfsWithAccessPoint, Ec2InstanceRole, Ec2InstanceBundle, MinimalVpc, EksCluster, SolrFargateService, MicrovmApp, MICROVM_LIMITS, AgentCoreAgent, agentCoreDefaultEndpointArn, AGENTCORE_LIMITS, OrganizationRoot, GovernanceFoundation, RegionRestriction, OrganizationTrail, StepFunctionsWorkflow, MonitoringStack, BucketDeployment, } from "./composites/index.js";
|
|
59
|
+
export { LambdaFunction, LambdaNode, LambdaPython, NodeLambda, PythonLambda, LambdaApi, LambdaScheduled, ScheduledLambda, LambdaSqs, LambdaEventBridge, LambdaDynamoDB, DynamoDBTable, EcrRepository, LambdaS3, LambdaSns, VpcDefault, FargateAlb, AlbShared, FargateService, FARGATE_SERVICE_LIMITS, NlbService, RdsInstance, RdsPostgres, EfsWithAccessPoint, Ec2InstanceRole, Ec2InstanceBundle, MinimalVpc, EksCluster, SolrFargateService, MicrovmApp, MICROVM_LIMITS, AgentCoreAgent, agentCoreDefaultEndpointArn, AGENTCORE_LIMITS, OrganizationRoot, GovernanceFoundation, RegionRestriction, OrganizationTrail, StepFunctionsWorkflow, MonitoringStack, BucketDeployment, HostnameEntry, AddressEntry, } from "./composites/index.js";
|
|
60
60
|
// Code generation pipeline
|
|
61
61
|
export { generate, writeGeneratedFiles } from "./codegen/generate.js";
|
|
62
62
|
export { packageLexicon } from "./codegen/package.js";
|
package/dist/integrity.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"algorithm": "sha256",
|
|
3
3
|
"artifacts": {
|
|
4
|
-
"manifest.json": "
|
|
4
|
+
"manifest.json": "9d69eb221cc362ed12ecc47de98a5954ebf59750944b17628ff02fa20e6a01b3",
|
|
5
5
|
"meta.json": "3e18663eb9eb09920882f8014020432330a74ccd480689e7384c2022cbb10f39",
|
|
6
6
|
"types/index.d.ts": "8651f9ae166668f4311eea1fe61c3fe235f345947951c1d23d1df24a4fd3384f",
|
|
7
7
|
"rules/hardcoded-region.ts": "957eadcaa9f39cc17d21437565d7a94607d9b082cf28918b178fa067f07498a9",
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"skills/chant-aws-eks.md": "8789255709ff004ad0a875fd5999edcdc66fc6e33d710db058d9f42703bcfdfe",
|
|
75
75
|
"skills/chant-aws-carve-terraform.md": "8780b94ce60aded935938d5ef20ea667738354051da1bf9ca6d70d9886f65d21"
|
|
76
76
|
},
|
|
77
|
-
"composite": "
|
|
77
|
+
"composite": "6b0e542fd6dbbe3e88214238cfeb9bf460cc262bd918a4422c83c9b8eeda1c7e"
|
|
78
78
|
}
|
package/dist/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentius/chant-lexicon-aws",
|
|
3
|
-
"version": "0.124.
|
|
3
|
+
"version": "0.124.39",
|
|
4
4
|
"description": "AWS CloudFormation lexicon for chant — declarative IaC in TypeScript",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://intentius.io/chant",
|
|
@@ -80,6 +80,6 @@
|
|
|
80
80
|
"typescript": "^5.9.3"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
|
-
"@intentius/chant": "^0.124.
|
|
83
|
+
"@intentius/chant": "^0.124.39"
|
|
84
84
|
}
|
|
85
85
|
}
|
|
@@ -4,6 +4,75 @@
|
|
|
4
4
|
import type { CompositeEntry } from "@intentius/chant/lexicon";
|
|
5
5
|
|
|
6
6
|
export const compositeCatalog: CompositeEntry[] = [
|
|
7
|
+
{
|
|
8
|
+
"name": "AddressEntry",
|
|
9
|
+
"lexicon": "aws",
|
|
10
|
+
"description": "A Route 53 latency CNAME to an A record naming an IP endpoint, guarded by a health check probing that address.",
|
|
11
|
+
"bundles": [
|
|
12
|
+
"HealthCheck",
|
|
13
|
+
"RecordSet"
|
|
14
|
+
],
|
|
15
|
+
"params": [
|
|
16
|
+
{
|
|
17
|
+
"name": "origin",
|
|
18
|
+
"type": "Value<string>",
|
|
19
|
+
"required": true,
|
|
20
|
+
"description": "The name the address is published under (an A record), which the latency record points at."
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "port",
|
|
24
|
+
"type": "number",
|
|
25
|
+
"required": true,
|
|
26
|
+
"description": "The port the check probes."
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "defaults",
|
|
30
|
+
"type": "HostnameEntryProps[\"defaults\"] & { origin?: Partial<ConstructorParameters<typeof RecordSet>[0]>; }",
|
|
31
|
+
"required": false
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "zoneId",
|
|
35
|
+
"type": "Value<string>",
|
|
36
|
+
"required": true,
|
|
37
|
+
"description": "The hosted zone's id (`zone.Id`)."
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "name",
|
|
41
|
+
"type": "Value<string>",
|
|
42
|
+
"required": true,
|
|
43
|
+
"description": "The name every entry answers for."
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "id",
|
|
47
|
+
"type": "string",
|
|
48
|
+
"required": true,
|
|
49
|
+
"description": "The record's set identifier, unique among the entries for `name`."
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"name": "region",
|
|
53
|
+
"type": "string",
|
|
54
|
+
"required": true,
|
|
55
|
+
"description": "The AWS region whose latency this record is chosen for."
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"name": "endpoint",
|
|
59
|
+
"type": "Value<string>",
|
|
60
|
+
"required": true,
|
|
61
|
+
"description": "The endpoint: a hostname here, an IP address for AddressEntry."
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"name": "ttl",
|
|
65
|
+
"type": "number",
|
|
66
|
+
"required": false,
|
|
67
|
+
"description": "The records' TTL in seconds."
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"name": "check",
|
|
71
|
+
"type": "LatencyEntryCheck",
|
|
72
|
+
"required": false
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
},
|
|
7
76
|
{
|
|
8
77
|
"name": "AgentCoreAgent",
|
|
9
78
|
"lexicon": "aws",
|
|
@@ -804,6 +873,69 @@ export const compositeCatalog: CompositeEntry[] = [
|
|
|
804
873
|
}
|
|
805
874
|
]
|
|
806
875
|
},
|
|
876
|
+
{
|
|
877
|
+
"name": "HostnameEntry",
|
|
878
|
+
"lexicon": "aws",
|
|
879
|
+
"description": "A Route 53 latency CNAME to a hostname endpoint, guarded by a health check probing that hostname.",
|
|
880
|
+
"bundles": [
|
|
881
|
+
"HealthCheck",
|
|
882
|
+
"RecordSet"
|
|
883
|
+
],
|
|
884
|
+
"params": [
|
|
885
|
+
{
|
|
886
|
+
"name": "zoneId",
|
|
887
|
+
"type": "Value<string>",
|
|
888
|
+
"required": true,
|
|
889
|
+
"description": "The hosted zone's id (`zone.Id`)."
|
|
890
|
+
},
|
|
891
|
+
{
|
|
892
|
+
"name": "name",
|
|
893
|
+
"type": "Value<string>",
|
|
894
|
+
"required": true,
|
|
895
|
+
"description": "The name every entry answers for."
|
|
896
|
+
},
|
|
897
|
+
{
|
|
898
|
+
"name": "id",
|
|
899
|
+
"type": "string",
|
|
900
|
+
"required": true,
|
|
901
|
+
"description": "The record's set identifier, unique among the entries for `name`."
|
|
902
|
+
},
|
|
903
|
+
{
|
|
904
|
+
"name": "region",
|
|
905
|
+
"type": "string",
|
|
906
|
+
"required": true,
|
|
907
|
+
"description": "The AWS region whose latency this record is chosen for."
|
|
908
|
+
},
|
|
909
|
+
{
|
|
910
|
+
"name": "endpoint",
|
|
911
|
+
"type": "Value<string>",
|
|
912
|
+
"required": true,
|
|
913
|
+
"description": "The endpoint: a hostname here, an IP address for AddressEntry."
|
|
914
|
+
},
|
|
915
|
+
{
|
|
916
|
+
"name": "port",
|
|
917
|
+
"type": "number",
|
|
918
|
+
"required": false,
|
|
919
|
+
"description": "The port the check probes."
|
|
920
|
+
},
|
|
921
|
+
{
|
|
922
|
+
"name": "ttl",
|
|
923
|
+
"type": "number",
|
|
924
|
+
"required": false,
|
|
925
|
+
"description": "The records' TTL in seconds."
|
|
926
|
+
},
|
|
927
|
+
{
|
|
928
|
+
"name": "check",
|
|
929
|
+
"type": "LatencyEntryCheck",
|
|
930
|
+
"required": false
|
|
931
|
+
},
|
|
932
|
+
{
|
|
933
|
+
"name": "defaults",
|
|
934
|
+
"type": "{ check?: Partial<ConstructorParameters<typeof HealthCheck>[0]>; record?: Partial<ConstructorParameters<typeof Record...",
|
|
935
|
+
"required": false
|
|
936
|
+
}
|
|
937
|
+
]
|
|
938
|
+
},
|
|
807
939
|
{
|
|
808
940
|
"name": "LambdaApi",
|
|
809
941
|
"lexicon": "aws",
|
package/src/composites/index.ts
CHANGED
|
@@ -64,3 +64,5 @@ export { MonitoringStack } from "./monitoring-stack";
|
|
|
64
64
|
export type { MonitoringStackProps, MonitoringMetricSpec } from "./monitoring-stack";
|
|
65
65
|
export { BucketDeployment } from "./bucket-deployment";
|
|
66
66
|
export type { BucketDeploymentProps, BucketDeploymentResult } from "./bucket-deployment";
|
|
67
|
+
export { HostnameEntry, AddressEntry } from "./latency-entry";
|
|
68
|
+
export type { HostnameEntryProps, AddressEntryProps, LatencyEntryCheck } from "./latency-entry";
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { describe, test, expect } from "vitest";
|
|
2
|
+
import { expandComposite } from "@intentius/chant";
|
|
3
|
+
import { HostnameEntry, AddressEntry } from "./latency-entry";
|
|
4
|
+
|
|
5
|
+
const base = { zoneId: "Z123", name: "app.example.com", id: "aws", region: "us-east-1" };
|
|
6
|
+
|
|
7
|
+
describe("HostnameEntry", () => {
|
|
8
|
+
test("a latency CNAME to the hostname, guarded by an HTTP check on it", () => {
|
|
9
|
+
const entry = HostnameEntry({ ...base, endpoint: "lb.example.net" });
|
|
10
|
+
expect(Object.keys(entry.members)).toEqual(["check", "record"]);
|
|
11
|
+
const check = (entry.check as any).props;
|
|
12
|
+
expect(check.HealthCheckConfig).toEqual({
|
|
13
|
+
Type: "HTTP",
|
|
14
|
+
FullyQualifiedDomainName: "lb.example.net",
|
|
15
|
+
ResourcePath: "/",
|
|
16
|
+
RequestInterval: 10,
|
|
17
|
+
FailureThreshold: 1,
|
|
18
|
+
});
|
|
19
|
+
const record = (entry.record as any).props;
|
|
20
|
+
expect(record).toMatchObject({
|
|
21
|
+
HostedZoneId: "Z123",
|
|
22
|
+
Name: "app.example.com",
|
|
23
|
+
Type: "CNAME",
|
|
24
|
+
TTL: "60",
|
|
25
|
+
SetIdentifier: "aws",
|
|
26
|
+
Region: "us-east-1",
|
|
27
|
+
ResourceRecords: ["lb.example.net"],
|
|
28
|
+
});
|
|
29
|
+
expect(record.HealthCheckId).toBe(entry.check.HealthCheckId);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
test("an HTTPS check with a path and a string match", () => {
|
|
33
|
+
const entry = HostnameEntry({
|
|
34
|
+
...base,
|
|
35
|
+
endpoint: "lb.example.net",
|
|
36
|
+
port: 8443,
|
|
37
|
+
check: { protocol: "HTTPS", path: "/healthz", searchString: "ok" },
|
|
38
|
+
});
|
|
39
|
+
expect((entry.check as any).props.HealthCheckConfig).toMatchObject({
|
|
40
|
+
Type: "HTTPS_STR_MATCH",
|
|
41
|
+
ResourcePath: "/healthz",
|
|
42
|
+
SearchString: "ok",
|
|
43
|
+
Port: 8443,
|
|
44
|
+
});
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
test("defaults override the check and the record", () => {
|
|
48
|
+
const entry = HostnameEntry({
|
|
49
|
+
...base,
|
|
50
|
+
endpoint: "lb.example.net",
|
|
51
|
+
ttl: 30,
|
|
52
|
+
defaults: { check: { HealthCheckConfig: { RequestInterval: 30, FailureThreshold: 3 } }, record: { Comment: "aws" } },
|
|
53
|
+
});
|
|
54
|
+
expect((entry.check as any).props.HealthCheckConfig).toMatchObject({ Type: "HTTP", RequestInterval: 30, FailureThreshold: 3 });
|
|
55
|
+
expect((entry.record as any).props).toMatchObject({ TTL: "30", Comment: "aws", Type: "CNAME" });
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
test("expands to the entry's logical names", () => {
|
|
59
|
+
const expanded = expandComposite("aws", HostnameEntry({ ...base, endpoint: "lb.example.net" }));
|
|
60
|
+
expect([...expanded.keys()].sort()).toEqual(["awsCheck", "awsRecord"]);
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
describe("AddressEntry", () => {
|
|
65
|
+
test("an A record naming the address, a latency CNAME to it, and a check on the address", () => {
|
|
66
|
+
const entry = AddressEntry({ ...base, id: "gcp", endpoint: "203.0.113.7", origin: "gcp.app.example.com", port: 80 });
|
|
67
|
+
expect(Object.keys(entry.members)).toEqual(["check", "origin", "record"]);
|
|
68
|
+
expect((entry.check as any).props.HealthCheckConfig).toEqual({
|
|
69
|
+
Type: "HTTP",
|
|
70
|
+
IPAddress: "203.0.113.7",
|
|
71
|
+
Port: 80,
|
|
72
|
+
ResourcePath: "/",
|
|
73
|
+
RequestInterval: 10,
|
|
74
|
+
FailureThreshold: 1,
|
|
75
|
+
});
|
|
76
|
+
expect((entry.origin as any).props).toEqual({
|
|
77
|
+
HostedZoneId: "Z123",
|
|
78
|
+
Name: "gcp.app.example.com",
|
|
79
|
+
Type: "A",
|
|
80
|
+
TTL: "60",
|
|
81
|
+
ResourceRecords: ["203.0.113.7"],
|
|
82
|
+
});
|
|
83
|
+
const record = (entry.record as any).props;
|
|
84
|
+
expect(record).toMatchObject({
|
|
85
|
+
Name: "app.example.com",
|
|
86
|
+
Type: "CNAME",
|
|
87
|
+
SetIdentifier: "gcp",
|
|
88
|
+
Region: "us-east-1",
|
|
89
|
+
ResourceRecords: ["gcp.app.example.com"],
|
|
90
|
+
});
|
|
91
|
+
expect(record.HealthCheckId).toBe(entry.check.HealthCheckId);
|
|
92
|
+
expect((entry.origin as any).props.SetIdentifier).toBeUndefined();
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
test("expands to the entry's logical names", () => {
|
|
96
|
+
const expanded = expandComposite("gcp", AddressEntry({ ...base, endpoint: "203.0.113.7", origin: "gcp.app.example.com", port: 80 }));
|
|
97
|
+
expect([...expanded.keys()].sort()).toEqual(["gcpCheck", "gcpOrigin", "gcpRecord"]);
|
|
98
|
+
});
|
|
99
|
+
});
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One endpoint's way in through Route 53: a latency record for a shared name,
|
|
3
|
+
* guarded by a health check on that endpoint (#4264). A record whose check
|
|
4
|
+
* fails stops answering, and the other entries for the same name take its
|
|
5
|
+
* traffic. The endpoint can live in any cloud.
|
|
6
|
+
*
|
|
7
|
+
* HostnameEntry is for an endpoint with a hostname (a load balancer's, a
|
|
8
|
+
* Container App's): the record is a CNAME to it and the check probes it by
|
|
9
|
+
* name. AddressEntry is for an endpoint that is an IP address: it gets a name
|
|
10
|
+
* of its own, an A record, the latency record is a CNAME to that name, and the
|
|
11
|
+
* check probes the address. Latency records sharing a name must share a type,
|
|
12
|
+
* which is why the address gets its own A record instead of the latency
|
|
13
|
+
* record being one.
|
|
14
|
+
*/
|
|
15
|
+
import { Composite, mergeDefaults, type Value } from "@intentius/chant";
|
|
16
|
+
import { HealthCheck, RecordSet } from "../generated";
|
|
17
|
+
|
|
18
|
+
export interface LatencyEntryCheck {
|
|
19
|
+
/** Defaults to "HTTP". */
|
|
20
|
+
protocol?: "HTTP" | "HTTPS";
|
|
21
|
+
/** The path the check requests. Defaults to "/". */
|
|
22
|
+
path?: string;
|
|
23
|
+
/** When set, the check passes only if the response body contains this string (an `_STR_MATCH` check). */
|
|
24
|
+
searchString?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface HostnameEntryProps {
|
|
28
|
+
/** The hosted zone's id (`zone.Id`). */
|
|
29
|
+
zoneId: Value<string>;
|
|
30
|
+
/** The name every entry answers for. */
|
|
31
|
+
name: Value<string>;
|
|
32
|
+
/** The record's set identifier, unique among the entries for `name`. */
|
|
33
|
+
id: string;
|
|
34
|
+
/** The AWS region whose latency this record is chosen for. */
|
|
35
|
+
region: string;
|
|
36
|
+
/** The endpoint: a hostname here, an IP address for AddressEntry. */
|
|
37
|
+
endpoint: Value<string>;
|
|
38
|
+
/** The port the check probes. Defaults to the protocol's port (80 or 443). */
|
|
39
|
+
port?: number;
|
|
40
|
+
/** The records' TTL in seconds. Defaults to 60. */
|
|
41
|
+
ttl?: number;
|
|
42
|
+
check?: LatencyEntryCheck;
|
|
43
|
+
defaults?: {
|
|
44
|
+
check?: Partial<ConstructorParameters<typeof HealthCheck>[0]>;
|
|
45
|
+
record?: Partial<ConstructorParameters<typeof RecordSet>[0]>;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface AddressEntryProps extends HostnameEntryProps {
|
|
50
|
+
/** The name the address is published under (an A record), which the latency record points at. */
|
|
51
|
+
origin: Value<string>;
|
|
52
|
+
/** The port the check probes. */
|
|
53
|
+
port: number;
|
|
54
|
+
defaults?: HostnameEntryProps["defaults"] & {
|
|
55
|
+
origin?: Partial<ConstructorParameters<typeof RecordSet>[0]>;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function checkType(check: LatencyEntryCheck | undefined): string {
|
|
60
|
+
const protocol = check?.protocol ?? "HTTP";
|
|
61
|
+
return check?.searchString !== undefined ? `${protocol}_STR_MATCH` : protocol;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** A Route 53 latency CNAME to a hostname endpoint, guarded by a health check probing that hostname. */
|
|
65
|
+
export const HostnameEntry = Composite((props: HostnameEntryProps) => {
|
|
66
|
+
const check = new HealthCheck(mergeDefaults({
|
|
67
|
+
HealthCheckConfig: {
|
|
68
|
+
Type: checkType(props.check),
|
|
69
|
+
FullyQualifiedDomainName: props.endpoint,
|
|
70
|
+
ResourcePath: props.check?.path ?? "/",
|
|
71
|
+
RequestInterval: 10,
|
|
72
|
+
FailureThreshold: 1,
|
|
73
|
+
...(props.port !== undefined ? { Port: props.port } : {}),
|
|
74
|
+
...(props.check?.searchString !== undefined ? { SearchString: props.check.searchString } : {}),
|
|
75
|
+
},
|
|
76
|
+
}, props.defaults?.check));
|
|
77
|
+
const record = new RecordSet(mergeDefaults({
|
|
78
|
+
HostedZoneId: props.zoneId,
|
|
79
|
+
Name: props.name,
|
|
80
|
+
Type: "CNAME",
|
|
81
|
+
TTL: String(props.ttl ?? 60),
|
|
82
|
+
SetIdentifier: props.id,
|
|
83
|
+
Region: props.region,
|
|
84
|
+
ResourceRecords: [props.endpoint],
|
|
85
|
+
HealthCheckId: check.HealthCheckId,
|
|
86
|
+
}, props.defaults?.record));
|
|
87
|
+
return { check, record };
|
|
88
|
+
}, "HostnameEntry");
|
|
89
|
+
|
|
90
|
+
/** A Route 53 latency CNAME to an A record naming an IP endpoint, guarded by a health check probing that address. */
|
|
91
|
+
export const AddressEntry = Composite((props: AddressEntryProps) => {
|
|
92
|
+
const check = new HealthCheck(mergeDefaults({
|
|
93
|
+
HealthCheckConfig: {
|
|
94
|
+
Type: checkType(props.check),
|
|
95
|
+
IPAddress: props.endpoint,
|
|
96
|
+
Port: props.port,
|
|
97
|
+
ResourcePath: props.check?.path ?? "/",
|
|
98
|
+
RequestInterval: 10,
|
|
99
|
+
FailureThreshold: 1,
|
|
100
|
+
...(props.check?.searchString !== undefined ? { SearchString: props.check.searchString } : {}),
|
|
101
|
+
},
|
|
102
|
+
}, props.defaults?.check));
|
|
103
|
+
const origin = new RecordSet(mergeDefaults({
|
|
104
|
+
HostedZoneId: props.zoneId,
|
|
105
|
+
Name: props.origin,
|
|
106
|
+
Type: "A",
|
|
107
|
+
TTL: String(props.ttl ?? 60),
|
|
108
|
+
ResourceRecords: [props.endpoint],
|
|
109
|
+
}, props.defaults?.origin));
|
|
110
|
+
const record = new RecordSet(mergeDefaults({
|
|
111
|
+
HostedZoneId: props.zoneId,
|
|
112
|
+
Name: props.name,
|
|
113
|
+
Type: "CNAME",
|
|
114
|
+
TTL: String(props.ttl ?? 60),
|
|
115
|
+
SetIdentifier: props.id,
|
|
116
|
+
Region: props.region,
|
|
117
|
+
ResourceRecords: [props.origin],
|
|
118
|
+
HealthCheckId: check.HealthCheckId,
|
|
119
|
+
}, props.defaults?.record));
|
|
120
|
+
return { check, origin, record };
|
|
121
|
+
}, "AddressEntry");
|
package/src/index.ts
CHANGED
|
@@ -180,6 +180,7 @@ export {
|
|
|
180
180
|
StepFunctionsWorkflow,
|
|
181
181
|
MonitoringStack,
|
|
182
182
|
BucketDeployment,
|
|
183
|
+
HostnameEntry, AddressEntry,
|
|
183
184
|
} from "./composites/index";
|
|
184
185
|
export type {
|
|
185
186
|
LambdaFunctionProps, LambdaApiProps, ScheduledLambdaProps,
|
|
@@ -194,6 +195,7 @@ export type {
|
|
|
194
195
|
StepFunctionsWorkflowProps,
|
|
195
196
|
MonitoringStackProps, MonitoringMetricSpec,
|
|
196
197
|
BucketDeploymentProps, BucketDeploymentResult,
|
|
198
|
+
HostnameEntryProps, AddressEntryProps, LatencyEntryCheck,
|
|
197
199
|
} from "./composites/index";
|
|
198
200
|
|
|
199
201
|
// Code generation pipeline
|