cdk-real-drift 0.4.10 → 0.4.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.
- package/dist/cli.js +20 -5
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2257,6 +2257,7 @@ const KNOWN_DEFAULTS = {
|
|
|
2257
2257
|
"AWS::CodeStarConnections::Connection": { HostArn: "arn:aws:codestar-connections:us-west-2:000000000000:host/00000000-0000-0000-0000-000000000000" }
|
|
2258
2258
|
};
|
|
2259
2259
|
const KNOWN_DEFAULT_ONE_OF = { "AWS::ApiGatewayV2::Integration": { TimeoutInMillis: [29e3, 3e4] } };
|
|
2260
|
+
const KNOWN_DEFAULT_ONE_OF_PATHS = { "AWS::EKS::Cluster": { "KubernetesNetworkConfig.ServiceIpv4Cidr": ["10.100.0.0/16", "172.20.0.0/16"] } };
|
|
2260
2261
|
const KNOWN_DEFAULT_PATHS = {
|
|
2261
2262
|
"AWS::ElasticLoadBalancingV2::TargetGroup": { "Targets.*.AvailabilityZone": "all" },
|
|
2262
2263
|
"AWS::ApiGatewayV2::Stage": { "DefaultRouteSettings.LoggingLevel": "OFF" },
|
|
@@ -2770,6 +2771,8 @@ const VALUE_INDEPENDENT_DEFAULT_TOPLEVEL_PATHS = {
|
|
|
2770
2771
|
"EngineLifecycleSupport"
|
|
2771
2772
|
]),
|
|
2772
2773
|
"AWS::EKS::AccessEntry": new Set(["Username"]),
|
|
2774
|
+
"AWS::EKS::Cluster": new Set(["Version"]),
|
|
2775
|
+
"AWS::EKS::Addon": new Set(["AddonVersion"]),
|
|
2773
2776
|
"AWS::Glue::Job": new Set(["MaxCapacity", "AllocatedCapacity"]),
|
|
2774
2777
|
"AWS::EC2::SecurityGroupIngress": new Set(["SourceSecurityGroupName"]),
|
|
2775
2778
|
"AWS::EC2::SecurityGroupEgress": new Set(["DestinationSecurityGroupName"]),
|
|
@@ -4931,7 +4934,7 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
|
|
|
4931
4934
|
if (!isObjectForm || /tags$/i.test(parentKey)) return;
|
|
4932
4935
|
}
|
|
4933
4936
|
const schemaPath = path.replace(/\[[^\]]*\]/g, ".*");
|
|
4934
|
-
const tier = schemaPath in schema.defaultPaths && matchesKnownDefault(value, schema.defaultPaths[schemaPath]) || schemaPath in knownDefPaths && matchesKnownDefault(value, knownDefPaths[schemaPath]) || dynamoGsiWarmThroughputAtDefault(resourceType, path, value, live) ? "atDefault" : generatedPaths.includes(schemaPath) && isPhysicalIdSegment(value, physicalId) || generatedNestedPaths?.has(schemaPath) && !(schemaPath in knownDefPaths) ? "generated" : "undeclared";
|
|
4937
|
+
const tier = schemaPath in schema.defaultPaths && matchesKnownDefault(value, schema.defaultPaths[schemaPath]) || schemaPath in knownDefPaths && matchesKnownDefault(value, knownDefPaths[schemaPath]) || (KNOWN_DEFAULT_ONE_OF_PATHS[resourceType]?.[schemaPath]?.some((d) => matchesKnownDefault(value, d)) ?? false) || dynamoGsiWarmThroughputAtDefault(resourceType, path, value, live) ? "atDefault" : generatedPaths.includes(schemaPath) && isPhysicalIdSegment(value, physicalId) || generatedNestedPaths?.has(schemaPath) && !(schemaPath in knownDefPaths) ? "generated" : "undeclared";
|
|
4935
4938
|
const freeFormKey = tier === "undeclared" && underFreeFormMap(schemaPath);
|
|
4936
4939
|
findings.push({
|
|
4937
4940
|
tier,
|
|
@@ -9989,13 +9992,25 @@ function carryForwardUnreadable(recorded, existing, findings) {
|
|
|
9989
9992
|
/**
|
|
9990
9993
|
* The single source of truth for "is this baseline value equal to the current
|
|
9991
9994
|
* value?". `applyBaseline` (suppress vs surface) and `splitRecordedByBaseline`
|
|
9992
|
-
* (unchanged vs changed) MUST share this exact predicate.
|
|
9995
|
+
* (unchanged vs changed) MUST share this exact predicate. BOTH sides are
|
|
9993
9996
|
* re-canonicalized through the CURRENT pipeline so a baseline written under older
|
|
9994
|
-
* normalization rules still matches today's canonical live value (R6)
|
|
9995
|
-
*
|
|
9997
|
+
* normalization rules still matches today's canonical live value (R6).
|
|
9998
|
+
*
|
|
9999
|
+
* #807: canonicalize the CURRENT side too, not just the baseline side. The caller's
|
|
10000
|
+
* `currentCanonicalValue` is only canonical at the OUTER value — a free-form-map
|
|
10001
|
+
* ENTRY (a Lambda env var, a Glue `Parameters` value, a Docker label) whose value is
|
|
10002
|
+
* a JSON- or policy-shaped STRING keeps its ancestry-lost RAW string. Canonicalizing
|
|
10003
|
+
* just the baseline side then policy-parses / JSON-minifies / key-sorts that bare
|
|
10004
|
+
* string on the recorded side while the live side stays raw, so `deepEqual` is false
|
|
10005
|
+
* forever — the predicate is not reflexive (`baselineValueMatches(v, v)` is false)
|
|
10006
|
+
* and a re-record never converges. Running the SAME `canonicalizeForCompare` on both
|
|
10007
|
+
* sides restores reflexivity for the whole free-form-string class (and composes
|
|
10008
|
+
* cleanly with #767's identity-sort case). Idempotency of the pipeline means an
|
|
10009
|
+
* already-canonical live value is unchanged, so this never weakens real change
|
|
10010
|
+
* detection: two values that differ after canonicalization still compare unequal.
|
|
9996
10011
|
*/
|
|
9997
10012
|
function baselineValueMatches(baselineValue, currentCanonicalValue) {
|
|
9998
|
-
return deepEqual(canonicalizeForCompare(baselineValue), currentCanonicalValue);
|
|
10013
|
+
return deepEqual(canonicalizeForCompare(baselineValue), canonicalizeForCompare(currentCanonicalValue));
|
|
9999
10014
|
}
|
|
10000
10015
|
const DELTA_IDENTITY_FIELDS = [
|
|
10001
10016
|
"Key",
|