@intentius/chant 0.42.1 → 0.44.2
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/build.d.ts +15 -1
- package/dist/build.d.ts.map +1 -1
- package/dist/cli/commands/build.d.ts.map +1 -1
- package/dist/cli/commands/lint.d.ts +10 -0
- package/dist/cli/commands/lint.d.ts.map +1 -1
- package/dist/cli/handlers/lifecycle.d.ts.map +1 -1
- package/dist/cli/plugins.d.ts +8 -0
- package/dist/cli/plugins.d.ts.map +1 -1
- package/dist/components/cli-support.d.ts +1 -1
- package/dist/components/cli-support.d.ts.map +1 -1
- package/dist/components/deploy-units.d.ts.map +1 -1
- package/dist/governance.d.ts +1 -1
- package/dist/graph-detail.d.ts +31 -13
- package/dist/graph-detail.d.ts.map +1 -1
- package/dist/lexicon.d.ts +44 -0
- package/dist/lexicon.d.ts.map +1 -1
- package/dist/lifecycle/change-set.d.ts +7 -0
- package/dist/lifecycle/change-set.d.ts.map +1 -1
- package/dist/lifecycle/live-diff.d.ts +18 -0
- package/dist/lifecycle/live-diff.d.ts.map +1 -1
- package/dist/lifecycle/observe.d.ts.map +1 -1
- package/dist/lint/component-checks.d.ts +2 -1
- package/dist/lint/component-checks.d.ts.map +1 -1
- package/dist/observation.d.ts +33 -3
- package/dist/observation.d.ts.map +1 -1
- package/dist/reconcile.d.ts +5 -5
- package/dist/reconcile.d.ts.map +1 -1
- package/dist/terraform/aws-resources.d.ts.map +1 -1
- package/dist/terraform/graph.d.ts.map +1 -1
- package/dist/terraform/tier-map.d.ts +4 -3
- package/dist/terraform/tier-map.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/audit/rules-doc.ts +1 -1
- package/src/build.test.ts +95 -0
- package/src/build.ts +46 -1
- package/src/cli/commands/build.ts +9 -1
- package/src/cli/commands/lint.ts +14 -3
- package/src/cli/handlers/components.ts +1 -1
- package/src/cli/handlers/graph.ts +32 -7
- package/src/cli/handlers/lifecycle.ts +15 -4
- package/src/cli/plugins.ts +17 -0
- package/src/codegen/publish-order.test.ts +1 -1
- package/src/codegen/release-wiring.test.ts +3 -4
- package/src/components/cli-support.test.ts +52 -0
- package/src/components/cli-support.ts +13 -2
- package/src/components/deploy-units.test.ts +13 -0
- package/src/components/deploy-units.ts +5 -0
- package/src/governance.test.ts +1 -1
- package/src/governance.ts +1 -1
- package/src/graph-detail.test.ts +117 -6
- package/src/graph-detail.ts +76 -18
- package/src/lexicon.ts +47 -0
- package/src/lifecycle/change-set.test.ts +26 -0
- package/src/lifecycle/change-set.ts +13 -0
- package/src/lifecycle/live-diff.test.ts +35 -0
- package/src/lifecycle/live-diff.ts +21 -0
- package/src/lifecycle/observe.ts +2 -1
- package/src/lint/component-checks.ts +8 -1
- package/src/observation.test.ts +54 -7
- package/src/observation.ts +53 -13
- package/src/reconcile.ts +7 -7
- package/src/terraform/aws-resources.test.ts +52 -2
- package/src/terraform/aws-resources.ts +95 -4
- package/src/terraform/graph.test.ts +17 -0
- package/src/terraform/graph.ts +12 -2
- package/src/terraform/tier-map.ts +60 -8
|
@@ -20,12 +20,52 @@ export interface TierInfo {
|
|
|
20
20
|
mapsTo: string;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Kubernetes provider types with a native k8s-lexicon target. `kubernetes_manifest`
|
|
25
|
+
* IS the manifest (tier 1). The typed provider resources (`kubernetes_deployment`,
|
|
26
|
+
* ...) reshape their HCL schema back into a manifest, so they rank tier 2; the
|
|
27
|
+
* common `_v1` aliases share their base type's entry.
|
|
28
|
+
*/
|
|
29
|
+
const K8S_TIER_BASE: Record<string, TierInfo> = {
|
|
30
|
+
kubernetes_manifest: { tier: 1, mapsTo: "k8s:manifest" },
|
|
31
|
+
kubernetes_namespace: { tier: 2, mapsTo: "k8s:Namespace" },
|
|
32
|
+
kubernetes_config_map: { tier: 2, mapsTo: "k8s:ConfigMap" },
|
|
33
|
+
kubernetes_secret: { tier: 2, mapsTo: "k8s:Secret" },
|
|
34
|
+
kubernetes_service: { tier: 2, mapsTo: "k8s:Service" },
|
|
35
|
+
kubernetes_service_account: { tier: 2, mapsTo: "k8s:ServiceAccount" },
|
|
36
|
+
kubernetes_deployment: { tier: 2, mapsTo: "k8s:Deployment" },
|
|
37
|
+
kubernetes_stateful_set: { tier: 2, mapsTo: "k8s:StatefulSet" },
|
|
38
|
+
kubernetes_daemon_set: { tier: 2, mapsTo: "k8s:DaemonSet" },
|
|
39
|
+
kubernetes_job: { tier: 2, mapsTo: "k8s:Job" },
|
|
40
|
+
kubernetes_cron_job: { tier: 2, mapsTo: "k8s:CronJob" },
|
|
41
|
+
kubernetes_ingress: { tier: 2, mapsTo: "k8s:Ingress" },
|
|
42
|
+
kubernetes_network_policy: { tier: 2, mapsTo: "k8s:NetworkPolicy" },
|
|
43
|
+
kubernetes_persistent_volume_claim: { tier: 2, mapsTo: "k8s:PersistentVolumeClaim" },
|
|
44
|
+
kubernetes_role: { tier: 2, mapsTo: "k8s:Role" },
|
|
45
|
+
kubernetes_role_binding: { tier: 2, mapsTo: "k8s:RoleBinding" },
|
|
46
|
+
kubernetes_cluster_role: { tier: 2, mapsTo: "k8s:ClusterRole" },
|
|
47
|
+
kubernetes_cluster_role_binding: { tier: 2, mapsTo: "k8s:ClusterRoleBinding" },
|
|
48
|
+
kubernetes_resource_quota: { tier: 2, mapsTo: "k8s:ResourceQuota" },
|
|
49
|
+
kubernetes_limit_range: { tier: 2, mapsTo: "k8s:LimitRange" },
|
|
50
|
+
kubernetes_priority_class: { tier: 2, mapsTo: "k8s:PriorityClass" },
|
|
51
|
+
kubernetes_pod_disruption_budget: { tier: 2, mapsTo: "k8s:PodDisruptionBudget" },
|
|
52
|
+
kubernetes_horizontal_pod_autoscaler: { tier: 2, mapsTo: "k8s:HorizontalPodAutoscaler" },
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const K8S_TIER: Record<string, TierInfo> = Object.fromEntries(
|
|
56
|
+
Object.entries(K8S_TIER_BASE).flatMap(([type, info]) =>
|
|
57
|
+
type === "kubernetes_manifest" ? [[type, info]] : [[type, info], [`${type}_v1`, info]],
|
|
58
|
+
),
|
|
59
|
+
);
|
|
60
|
+
// The one provider type whose current alias is _v2, not _v1.
|
|
61
|
+
K8S_TIER.kubernetes_horizontal_pod_autoscaler_v2 = K8S_TIER_BASE.kubernetes_horizontal_pod_autoscaler;
|
|
62
|
+
|
|
23
63
|
/** TF resource type → native tier. Absent = unsupported (score 0). */
|
|
24
64
|
export const TIER_MAP: Record<string, TierInfo> = {
|
|
25
65
|
// AWS: derived from the carve-out table so advise and emit stay in lockstep.
|
|
26
66
|
...Object.fromEntries(AWS_CARVE_TYPES.map((t) => [t.tfType, { tier: t.tier, mapsTo: t.nativeType }])),
|
|
27
|
-
// Kubernetes —
|
|
28
|
-
|
|
67
|
+
// Kubernetes — ranked by advise; emit support is a separate target.
|
|
68
|
+
...K8S_TIER,
|
|
29
69
|
};
|
|
30
70
|
|
|
31
71
|
/**
|
|
@@ -44,16 +84,28 @@ export const FOLDS_INTO: Record<string, string> = {
|
|
|
44
84
|
aws_s3_bucket_public_access_block: "aws_s3_bucket",
|
|
45
85
|
aws_s3_bucket_server_side_encryption_configuration: "aws_s3_bucket",
|
|
46
86
|
aws_s3_bucket_lifecycle_configuration: "aws_s3_bucket",
|
|
87
|
+
aws_s3_bucket_website_configuration: "aws_s3_bucket",
|
|
88
|
+
aws_s3_bucket_cors_configuration: "aws_s3_bucket",
|
|
89
|
+
aws_s3_bucket_logging: "aws_s3_bucket",
|
|
90
|
+
aws_s3_bucket_ownership_controls: "aws_s3_bucket",
|
|
91
|
+
aws_s3_bucket_notification: "aws_s3_bucket",
|
|
92
|
+
aws_s3_bucket_accelerate_configuration: "aws_s3_bucket",
|
|
93
|
+
aws_s3_bucket_request_payment_configuration: "aws_s3_bucket",
|
|
94
|
+
aws_s3_bucket_intelligent_tiering_configuration: "aws_s3_bucket",
|
|
95
|
+
aws_ecr_lifecycle_policy: "aws_ecr_repository",
|
|
96
|
+
aws_ecr_repository_policy: "aws_ecr_repository",
|
|
47
97
|
};
|
|
48
98
|
|
|
49
99
|
/**
|
|
50
|
-
* The HCL attribute carrying a resource's physical name, per type —
|
|
51
|
-
* from the
|
|
52
|
-
*
|
|
100
|
+
* The HCL attribute carrying a resource's physical name, per type — AWS entries
|
|
101
|
+
* derived from the carve-out table, non-AWS listed directly. A dotted entry is
|
|
102
|
+
* a path into nested blocks (`manifest.metadata.name`). Used for the graph's
|
|
103
|
+
* identity and the live-import hint. Absent → fall back to the TF logical name.
|
|
53
104
|
*/
|
|
54
|
-
export const IDENTITY_ATTR: Record<string, string> =
|
|
55
|
-
AWS_CARVE_TYPES.filter((t) => t.identityAttr).map((t) => [t.tfType, t.identityAttr!]),
|
|
56
|
-
|
|
105
|
+
export const IDENTITY_ATTR: Record<string, string> = {
|
|
106
|
+
...Object.fromEntries(AWS_CARVE_TYPES.filter((t) => t.identityAttr).map((t) => [t.tfType, t.identityAttr!])),
|
|
107
|
+
kubernetes_manifest: "manifest.metadata.name",
|
|
108
|
+
};
|
|
57
109
|
|
|
58
110
|
export function resolveTier(tfType: string): TierInfo | null {
|
|
59
111
|
return TIER_MAP[tfType] ?? null;
|