@intentius/chant-lexicon-aws 0.41.11 → 0.41.12
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.
|
@@ -17,6 +17,19 @@ export interface EksClusterProps {
|
|
|
17
17
|
/** Subnets the nodes land in. Default: the cluster's own `subnetIds`. */
|
|
18
18
|
subnetIds?: string[];
|
|
19
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* Managed add-ons to install, by name (e.g. "eks-pod-identity-agent" —
|
|
22
|
+
* without which an AWS::EKS::PodIdentityAssociation delivers no
|
|
23
|
+
* credentials and the workload it binds crashloops on startup, found on
|
|
24
|
+
* kubemicrovm-ops' first real deploy). Named by the caller, never guessed;
|
|
25
|
+
* versions omitted take EKS's default. Up to three (fixed member slots
|
|
26
|
+
* `addon1..addon3`, keyed by position — the statically-evaluable shape);
|
|
27
|
+
* an estate needing more declares the rest as bare Addon resources.
|
|
28
|
+
*/
|
|
29
|
+
addons?: Array<{
|
|
30
|
+
name: string;
|
|
31
|
+
version?: string;
|
|
32
|
+
}>;
|
|
20
33
|
tags?: Array<{
|
|
21
34
|
Key: string;
|
|
22
35
|
Value: string;
|
|
@@ -29,11 +42,15 @@ export interface EksClusterProps {
|
|
|
29
42
|
};
|
|
30
43
|
}
|
|
31
44
|
export declare const EksCluster: import("@intentius/chant").CompositeDefinition<EksClusterProps, {
|
|
45
|
+
addon3?: (import("@intentius/chant").Declarable & Record<string, string>) | undefined;
|
|
46
|
+
addon2?: (import("@intentius/chant").Declarable & Record<string, string>) | undefined;
|
|
47
|
+
addon1?: (import("@intentius/chant").Declarable & Record<string, string>) | undefined;
|
|
32
48
|
clusterRole: import("@intentius/chant").Declarable & Record<string, string>;
|
|
33
49
|
cluster: import("@intentius/chant").Declarable & Record<string, string>;
|
|
34
|
-
nodeRole?: undefined;
|
|
35
|
-
nodegroup?: undefined;
|
|
36
50
|
} | {
|
|
51
|
+
addon3?: (import("@intentius/chant").Declarable & Record<string, string>) | undefined;
|
|
52
|
+
addon2?: (import("@intentius/chant").Declarable & Record<string, string>) | undefined;
|
|
53
|
+
addon1?: (import("@intentius/chant").Declarable & Record<string, string>) | undefined;
|
|
37
54
|
clusterRole: import("@intentius/chant").Declarable & Record<string, string>;
|
|
38
55
|
cluster: import("@intentius/chant").Declarable & Record<string, string>;
|
|
39
56
|
nodeRole: import("@intentius/chant").Declarable & Record<string, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eks-cluster.d.ts","sourceRoot":"","sources":["../../src/composites/eks-cluster.ts"],"names":[],"mappings":"AA2BA,OAAO,
|
|
1
|
+
{"version":3,"file":"eks-cluster.d.ts","sourceRoot":"","sources":["../../src/composites/eks-cluster.ts"],"names":[],"mappings":"AA2BA,OAAO,EAAS,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAGlE,MAAM,WAAW,eAAe;IAC9B,iFAAiF;IACjF,IAAI,EAAE,MAAM,CAAC;IACb,6EAA6E;IAC7E,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,6EAA6E;IAC7E,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+EAA+E;IAC/E,SAAS,CAAC,EAAE;QACV,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;QACzB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,yEAAyE;QACzE,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;KACtB,CAAC;IACF;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnD,IAAI,CAAC,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7C,QAAQ,CAAC,EAAE;QACT,OAAO,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/D,SAAS,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAChE,WAAW,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7D,QAAQ,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC3D,CAAC;CACH;AAID,eAAO,MAAM,UAAU;;;;;;;;;;;;;;EA8FP,CAAC"}
|
package/dist/integrity.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"algorithm": "sha256",
|
|
3
3
|
"artifacts": {
|
|
4
|
-
"manifest.json": "
|
|
4
|
+
"manifest.json": "c30f447783709ca1501f1c4dbc4648568b08f07fc63fb322cbfeb75cd713740b",
|
|
5
5
|
"meta.json": "2e4cae67cbc2eb2962c3dd0aa57008ae96fb725dd0118af7b04b2b44eab7722a",
|
|
6
6
|
"types/index.d.ts": "6d6b37bd14a9b40fb3ff5c66e1cb49be1ae1032de47a4e167cf5f411c943b7f5",
|
|
7
7
|
"rules/hardcoded-region.ts": "5a0eaf7ab391231fe6cd51426ece29539cb4b36f31c8dd060956638fed55722a",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"skills/chant-aws-eks.md": "8789255709ff004ad0a875fd5999edcdc66fc6e33d710db058d9f42703bcfdfe",
|
|
60
60
|
"skills/chant-aws-carve-terraform.md": "f4c6fe1c702250665f90d82b3bdaba5ea50ae75e380a8ae321dad6eb1c39683e"
|
|
61
61
|
},
|
|
62
|
-
"composite": "
|
|
62
|
+
"composite": "d028551030c4fcd1fce01daf33202ddd5bc1e33fe417025dd6df378e7f2a6cbb"
|
|
63
63
|
}
|
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.41.
|
|
3
|
+
"version": "0.41.12",
|
|
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,7 +80,7 @@
|
|
|
80
80
|
"typescript": "^5.9.3"
|
|
81
81
|
},
|
|
82
82
|
"peerDependencies": {
|
|
83
|
-
"@intentius/chant": "^0.41.
|
|
83
|
+
"@intentius/chant": "^0.41.12",
|
|
84
84
|
"typescript": "^5.9.3"
|
|
85
85
|
}
|
|
86
86
|
}
|
|
@@ -15,21 +15,26 @@ describe("EksCluster", () => {
|
|
|
15
15
|
expect(clusterProps.ResourcesVpcConfig.SubnetIds).toEqual(subnets);
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
+
// The composite's return is a union (nodegroup-less vs full), and the
|
|
19
|
+
// repo-wide typecheck rightly refuses to narrow it structurally — tests go
|
|
20
|
+
// through a member map, the same access the expander itself uses.
|
|
21
|
+
type Members = Record<string, { props?: Record<string, any> } | undefined>;
|
|
22
|
+
|
|
18
23
|
test("with a nodegroup: node role carries the three worker policies, nodes default into the cluster subnets", () => {
|
|
19
24
|
const c = EksCluster({
|
|
20
25
|
name: "kmv-prod",
|
|
21
26
|
subnetIds: subnets,
|
|
22
27
|
version: "1.31",
|
|
23
28
|
nodegroup: { desiredSize: 2 },
|
|
24
|
-
});
|
|
29
|
+
}) as unknown as Members;
|
|
25
30
|
expect(c.nodegroup).toBeDefined();
|
|
26
31
|
expect(c.nodeRole).toBeDefined();
|
|
27
|
-
const ngProps =
|
|
32
|
+
const ngProps = c.nodegroup!.props!;
|
|
28
33
|
expect(ngProps.ClusterName).toBe("kmv-prod");
|
|
29
34
|
expect(ngProps.Subnets).toEqual(subnets);
|
|
30
35
|
expect(ngProps.ScalingConfig.MinSize).toBe(2);
|
|
31
36
|
expect(ngProps.ScalingConfig.MaxSize).toBe(2);
|
|
32
|
-
expect(
|
|
37
|
+
expect(c.nodeRole!.props!.ManagedPolicyArns).toHaveLength(3);
|
|
33
38
|
});
|
|
34
39
|
|
|
35
40
|
test("nodegroup subnets override; scaling bounds honor explicit min/max", () => {
|
|
@@ -37,8 +42,8 @@ describe("EksCluster", () => {
|
|
|
37
42
|
name: "kmv-ha",
|
|
38
43
|
subnetIds: subnets,
|
|
39
44
|
nodegroup: { subnetIds: ["subnet-nodes"], desiredSize: 2, minSize: 1, maxSize: 4 },
|
|
40
|
-
});
|
|
41
|
-
const ng2 =
|
|
45
|
+
}) as unknown as Members;
|
|
46
|
+
const ng2 = c.nodegroup!.props!;
|
|
42
47
|
expect(ng2.Subnets).toEqual(["subnet-nodes"]);
|
|
43
48
|
expect(ng2.ScalingConfig.MinSize).toBe(1);
|
|
44
49
|
expect(ng2.ScalingConfig.MaxSize).toBe(4);
|
|
@@ -52,4 +57,17 @@ describe("EksCluster", () => {
|
|
|
52
57
|
});
|
|
53
58
|
expect((c.cluster as any).props.DeletionProtection).toBe(true);
|
|
54
59
|
});
|
|
60
|
+
|
|
61
|
+
test("addons become keyed members, DependsOn the cluster (the pod-identity agent case)", () => {
|
|
62
|
+
const c = EksCluster({
|
|
63
|
+
name: "kmv-real",
|
|
64
|
+
subnetIds: subnets,
|
|
65
|
+
nodegroup: {},
|
|
66
|
+
addons: [{ name: "eks-pod-identity-agent" }],
|
|
67
|
+
}) as unknown as Members;
|
|
68
|
+
const addon = c.addon1;
|
|
69
|
+
expect(addon).toBeDefined();
|
|
70
|
+
expect(addon!.props?.AddonName).toBe("eks-pod-identity-agent");
|
|
71
|
+
expect(addon!.props?.ClusterName).toBe("kmv-real");
|
|
72
|
+
});
|
|
55
73
|
});
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* emulator being honest about what a laptop can host.
|
|
26
26
|
*/
|
|
27
27
|
import { Composite, mergeDefaults } from "@intentius/chant";
|
|
28
|
-
import { EKSCluster, Nodegroup, Role } from "../generated";
|
|
28
|
+
import { Addon, EKSCluster, Nodegroup, Role } from "../generated";
|
|
29
29
|
import { Sub } from "../intrinsics";
|
|
30
30
|
|
|
31
31
|
export interface EksClusterProps {
|
|
@@ -46,6 +46,16 @@ export interface EksClusterProps {
|
|
|
46
46
|
/** Subnets the nodes land in. Default: the cluster's own `subnetIds`. */
|
|
47
47
|
subnetIds?: string[];
|
|
48
48
|
};
|
|
49
|
+
/**
|
|
50
|
+
* Managed add-ons to install, by name (e.g. "eks-pod-identity-agent" —
|
|
51
|
+
* without which an AWS::EKS::PodIdentityAssociation delivers no
|
|
52
|
+
* credentials and the workload it binds crashloops on startup, found on
|
|
53
|
+
* kubemicrovm-ops' first real deploy). Named by the caller, never guessed;
|
|
54
|
+
* versions omitted take EKS's default. Up to three (fixed member slots
|
|
55
|
+
* `addon1..addon3`, keyed by position — the statically-evaluable shape);
|
|
56
|
+
* an estate needing more declares the rest as bare Addon resources.
|
|
57
|
+
*/
|
|
58
|
+
addons?: Array<{ name: string; version?: string }>;
|
|
49
59
|
tags?: Array<{ Key: string; Value: string }>;
|
|
50
60
|
defaults?: {
|
|
51
61
|
cluster?: Partial<ConstructorParameters<typeof EKSCluster>[0]>;
|
|
@@ -82,8 +92,33 @@ export const EksCluster = Composite((props: EksClusterProps) => {
|
|
|
82
92
|
Tags: props.tags,
|
|
83
93
|
}, defaults?.cluster));
|
|
84
94
|
|
|
95
|
+
// Three fixed add-on slots, the same statically-evaluable shape
|
|
96
|
+
// vpc-default uses for its optional third AZ: a ternary is an expression
|
|
97
|
+
// (EVL-clean); a loop-built member map is control flow the reference
|
|
98
|
+
// composites must not contain (EVL002/EVL003). Members are addon1..addon3
|
|
99
|
+
// in the caller's order — logical ids stay stable as long as the order
|
|
100
|
+
// does, which the caller controls.
|
|
101
|
+
const a1 = props.addons?.[0];
|
|
102
|
+
const a2 = props.addons?.[1];
|
|
103
|
+
const a3 = props.addons?.[2];
|
|
104
|
+
const addon1 = a1
|
|
105
|
+
? new Addon({ ClusterName: props.name, AddonName: a1.name, AddonVersion: a1.version, Tags: props.tags }, { DependsOn: [cluster] })
|
|
106
|
+
: undefined;
|
|
107
|
+
const addon2 = a2
|
|
108
|
+
? new Addon({ ClusterName: props.name, AddonName: a2.name, AddonVersion: a2.version, Tags: props.tags }, { DependsOn: [cluster] })
|
|
109
|
+
: undefined;
|
|
110
|
+
const addon3 = a3
|
|
111
|
+
? new Addon({ ClusterName: props.name, AddonName: a3.name, AddonVersion: a3.version, Tags: props.tags }, { DependsOn: [cluster] })
|
|
112
|
+
: undefined;
|
|
113
|
+
|
|
85
114
|
if (!props.nodegroup) {
|
|
86
|
-
return {
|
|
115
|
+
return {
|
|
116
|
+
clusterRole,
|
|
117
|
+
cluster,
|
|
118
|
+
...(addon1 ? { addon1 } : {}),
|
|
119
|
+
...(addon2 ? { addon2 } : {}),
|
|
120
|
+
...(addon3 ? { addon3 } : {}),
|
|
121
|
+
};
|
|
87
122
|
}
|
|
88
123
|
|
|
89
124
|
const nodeRole = new Role(mergeDefaults({
|
|
@@ -117,5 +152,13 @@ export const EksCluster = Composite((props: EksClusterProps) => {
|
|
|
117
152
|
Tags: props.tags ? Object.fromEntries(props.tags.map((t) => [t.Key, t.Value])) : undefined,
|
|
118
153
|
}, defaults?.nodegroup), { DependsOn: [cluster] });
|
|
119
154
|
|
|
120
|
-
return {
|
|
155
|
+
return {
|
|
156
|
+
clusterRole,
|
|
157
|
+
cluster,
|
|
158
|
+
nodeRole,
|
|
159
|
+
nodegroup,
|
|
160
|
+
...(addon1 ? { addon1 } : {}),
|
|
161
|
+
...(addon2 ? { addon2 } : {}),
|
|
162
|
+
...(addon3 ? { addon3 } : {}),
|
|
163
|
+
};
|
|
121
164
|
}, "EksCluster");
|