cdk-real-drift 0.2.3 → 0.2.5
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 +40 -9
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1587,8 +1587,17 @@ const KNOWN_DEFAULTS = {
|
|
|
1587
1587
|
Event: "END_ENTITY_CERTIFICATE_EXPIRY",
|
|
1588
1588
|
Threshold: 45
|
|
1589
1589
|
}] },
|
|
1590
|
-
"AWS::Location::Tracker": {
|
|
1590
|
+
"AWS::Location::Tracker": {
|
|
1591
|
+
PricingPlan: "RequestBasedUsage",
|
|
1592
|
+
PositionFiltering: "TimeBased"
|
|
1593
|
+
},
|
|
1591
1594
|
"AWS::Location::GeofenceCollection": { PricingPlan: "RequestBasedUsage" },
|
|
1595
|
+
"AWS::Location::PlaceIndex": {
|
|
1596
|
+
PricingPlan: "RequestBasedUsage",
|
|
1597
|
+
DataSourceConfiguration: { IntendedUse: "SingleUse" }
|
|
1598
|
+
},
|
|
1599
|
+
"AWS::Location::Map": { PricingPlan: "RequestBasedUsage" },
|
|
1600
|
+
"AWS::Location::RouteCalculator": { PricingPlan: "RequestBasedUsage" },
|
|
1592
1601
|
"AWS::MediaTailor::PlaybackConfiguration": {
|
|
1593
1602
|
InsertionMode: "STITCHED_ONLY",
|
|
1594
1603
|
AdConditioningConfiguration: { StreamingMediaFileConditioning: "TRANSCODE" },
|
|
@@ -2669,6 +2678,19 @@ const UNORDERED_OBJECT_ARRAY_PROPS = {
|
|
|
2669
2678
|
"AWS::WAFv2::LoggingConfiguration": new Set(["RedactedFields"]),
|
|
2670
2679
|
"AWS::EC2::PrefixList": new Set(["Entries"])
|
|
2671
2680
|
};
|
|
2681
|
+
const UNORDERED_OBJECT_ARRAY_IDENTITY = {
|
|
2682
|
+
"AWS::Cognito::UserPoolResourceServer": { Scopes: "ScopeName" },
|
|
2683
|
+
"AWS::SecretsManager::Secret": { ReplicaRegions: "Region" },
|
|
2684
|
+
"AWS::ElastiCache::CacheCluster": { LogDeliveryConfigurations: "LogType" },
|
|
2685
|
+
"AWS::ElastiCache::ReplicationGroup": { LogDeliveryConfigurations: "LogType" },
|
|
2686
|
+
"AWS::AutoScaling::AutoScalingGroup": { LifecycleHookSpecificationList: "LifecycleHookName" },
|
|
2687
|
+
"AWS::Redshift::ClusterParameterGroup": { Parameters: "ParameterName" },
|
|
2688
|
+
"AWS::ElasticLoadBalancingV2::ListenerRule": { Conditions: "Field" },
|
|
2689
|
+
"AWS::EC2::PrefixList": { Entries: "Cidr" },
|
|
2690
|
+
"AWS::IAM::Role": { Policies: "PolicyName" },
|
|
2691
|
+
"AWS::IAM::User": { Policies: "PolicyName" },
|
|
2692
|
+
"AWS::IAM::Group": { Policies: "PolicyName" }
|
|
2693
|
+
};
|
|
2672
2694
|
const UNORDERED_NESTED_OBJECT_ARRAY_PATHS = {
|
|
2673
2695
|
"AWS::CloudFront::CachePolicy": new Set(["CachePolicyConfig.ParametersInCacheKeyAndForwardedToOrigin.HeadersConfig.Headers"]),
|
|
2674
2696
|
"AWS::CloudFront::Distribution": new Set(["DistributionConfig.Aliases"]),
|
|
@@ -2720,11 +2742,15 @@ function canonicalJson(v) {
|
|
|
2720
2742
|
}
|
|
2721
2743
|
return JSON.stringify(v) ?? "null";
|
|
2722
2744
|
}
|
|
2723
|
-
function sortUnorderedObjectArray(v) {
|
|
2745
|
+
function sortUnorderedObjectArray(v, identityField) {
|
|
2724
2746
|
if (!Array.isArray(v)) return v;
|
|
2747
|
+
const keyOf = (e) => {
|
|
2748
|
+
const id = identityField && e !== null && typeof e === "object" && !Array.isArray(e) ? e[identityField] : void 0;
|
|
2749
|
+
return `${id === void 0 ? "" : `${String(id)}`}${canonicalJson(e)}`;
|
|
2750
|
+
};
|
|
2725
2751
|
return [...v].sort((a, b) => {
|
|
2726
|
-
const ka =
|
|
2727
|
-
const kb =
|
|
2752
|
+
const ka = keyOf(a);
|
|
2753
|
+
const kb = keyOf(b);
|
|
2728
2754
|
return ka < kb ? -1 : ka > kb ? 1 : 0;
|
|
2729
2755
|
});
|
|
2730
2756
|
}
|
|
@@ -3958,6 +3984,7 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
|
|
|
3958
3984
|
const nestedSubPaths = [...new Set([...nestedUnordered ?? [], ...schema.unorderedObjectArrayPaths ?? []].filter((p) => p.startsWith(`${k}.`)).map((p) => p.slice(k.length + 1)))];
|
|
3959
3985
|
let declaredVal = v;
|
|
3960
3986
|
let liveVal = live[k];
|
|
3987
|
+
let declaredRemapSource;
|
|
3961
3988
|
if (subsetSpec && Array.isArray(v) && Array.isArray(live[k])) {
|
|
3962
3989
|
const { idField, normalizeId } = subsetSpec;
|
|
3963
3990
|
const idOf = (e) => {
|
|
@@ -4005,8 +4032,11 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
|
|
|
4005
4032
|
declaredVal = declaredSorted;
|
|
4006
4033
|
liveVal = liveAligned;
|
|
4007
4034
|
} else if (unorderedObjArray) {
|
|
4008
|
-
|
|
4009
|
-
|
|
4035
|
+
const declaredNestedSorted = nestedSubPaths.length > 0 ? sortNestedObjectArrays(v, nestedSubPaths) : v;
|
|
4036
|
+
const idField = UNORDERED_OBJECT_ARRAY_IDENTITY[resourceType]?.[k];
|
|
4037
|
+
declaredVal = sortUnorderedObjectArray(declaredNestedSorted, idField);
|
|
4038
|
+
liveVal = sortUnorderedObjectArray(nestedSubPaths.length > 0 ? sortNestedObjectArrays(live[k], nestedSubPaths) : live[k], idField);
|
|
4039
|
+
if (Array.isArray(declaredNestedSorted)) declaredRemapSource = declaredNestedSorted;
|
|
4010
4040
|
} else if (nestedSubPaths.length > 0) {
|
|
4011
4041
|
declaredVal = sortNestedObjectArrays(v, nestedSubPaths);
|
|
4012
4042
|
liveVal = sortNestedObjectArrays(live[k], nestedSubPaths);
|
|
@@ -4082,8 +4112,8 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
|
|
|
4082
4112
|
if (INTELLIGENT_TIERING_PATHS[resourceType]?.has(d.path) && isIntelligentTieringMatch(d.stateValue, d.awsValue)) continue;
|
|
4083
4113
|
if ((UNORDERED_ARRAY_PROPS[resourceType]?.has(d.path) || UNORDERED_ARRAY_PROPS[resourceType]?.has(d.path.replace(/\.\d+(?=\.|$)/g, ".*")) || schema.unorderedScalarPaths?.includes(d.path)) && isEqualUnorderedScalarSet(d.stateValue, d.awsValue)) continue;
|
|
4084
4114
|
if (isTrivialEmpty(d.stateValue) && d.path in knownDef && deepEqual(d.awsValue, knownDef[d.path])) continue;
|
|
4085
|
-
const unorderedExtra = unorderedObjArray && Array.isArray(declaredVal) &&
|
|
4086
|
-
path: remapSortedIndexToDeclared(d.path, k, declaredVal,
|
|
4115
|
+
const unorderedExtra = unorderedObjArray && Array.isArray(declaredVal) && declaredRemapSource ? {
|
|
4116
|
+
path: remapSortedIndexToDeclared(d.path, k, declaredVal, declaredRemapSource),
|
|
4087
4117
|
wholeArrayRevert: {
|
|
4088
4118
|
path: k,
|
|
4089
4119
|
value: v
|
|
@@ -10045,7 +10075,8 @@ const REVERT_SET_DEFAULT_PATHS = new Set([
|
|
|
10045
10075
|
"AWS::Cognito::IdentityPool\0AllowClassicFlow",
|
|
10046
10076
|
"AWS::Transfer::Server\0SecurityPolicyName",
|
|
10047
10077
|
"AWS::AppRunner::Service\0HealthCheckConfiguration",
|
|
10048
|
-
"AWS::AppRunner::Service\0NetworkConfiguration"
|
|
10078
|
+
"AWS::AppRunner::Service\0NetworkConfiguration",
|
|
10079
|
+
"AWS::Location::Tracker\0PositionFiltering"
|
|
10049
10080
|
]);
|
|
10050
10081
|
/**
|
|
10051
10082
|
* A nested undeclared value (a live sub-key inside a declared object, R96/R98) — a dotted
|