cdk-real-drift 0.12.7 → 0.12.8
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 +21 -6
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3232,7 +3232,12 @@ function stripAsymmetricIdentityFields(declared, live) {
|
|
|
3232
3232
|
}
|
|
3233
3233
|
const ORDER_SIGNIFICANT_ARRAY_KEYS = {
|
|
3234
3234
|
"AWS::CodePipeline::Pipeline": new Set(["Stages", "Actions"]),
|
|
3235
|
-
"AWS::Logs::Transformer": new Set(["TransformerConfig"])
|
|
3235
|
+
"AWS::Logs::Transformer": new Set(["TransformerConfig"]),
|
|
3236
|
+
"AWS::SSMContacts::Plan": new Set(["Stages"])
|
|
3237
|
+
};
|
|
3238
|
+
const ORDER_SIGNIFICANT_PATHS = {
|
|
3239
|
+
"AWS::Scheduler::Schedule": new Set(["Target.EcsParameters.PlacementStrategy"]),
|
|
3240
|
+
"AWS::AppSync::Resolver": new Set(["PipelineConfig.Functions"])
|
|
3236
3241
|
};
|
|
3237
3242
|
function canonicalizeTagListsDeep(v, orderSig) {
|
|
3238
3243
|
return canonicalizeTagLists(v, orderSig, void 0);
|
|
@@ -5549,8 +5554,12 @@ function sortUnorderedSetProps(model, resourceType, schemaObjectArrayKeys = [],
|
|
|
5549
5554
|
const objKeys = new Set([...UNORDERED_OBJECT_ARRAY_PROPS[resourceType] ?? [], ...schemaObjectArrayKeys]);
|
|
5550
5555
|
const orderSig = ORDER_SIGNIFICANT_ARRAY_KEYS[resourceType];
|
|
5551
5556
|
for (const k of objKeys) if (!orderSig?.has(k) && Array.isArray(model[k])) model[k] = sortUnorderedObjectArray(model[k]);
|
|
5552
|
-
|
|
5553
|
-
|
|
5557
|
+
const orderSigPaths = ORDER_SIGNIFICANT_PATHS[resourceType];
|
|
5558
|
+
for (const path of [...UNORDERED_ARRAY_PROPS[resourceType] ?? [], ...schemaScalarPaths]) {
|
|
5559
|
+
if (orderSigPaths?.has(path)) continue;
|
|
5560
|
+
if (path.includes(".")) sortScalarSetAtNestedPath(model, path.split("."));
|
|
5561
|
+
else if (path in model) model[path] = sortScalarSet(model[path]);
|
|
5562
|
+
}
|
|
5554
5563
|
}
|
|
5555
5564
|
function normalizeLiveModel(liveRaw, schema, opts = {}) {
|
|
5556
5565
|
const oaiMap = opts.oaiCanonicalIds ?? {};
|
|
@@ -6162,7 +6171,8 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
|
|
|
6162
6171
|
const subsetSpec = IDENTITY_KEYED_SUBSET_ARRAYS[resourceType]?.[k];
|
|
6163
6172
|
const unorderedObjArray = !(ORDER_SIGNIFICANT_ARRAY_KEYS[resourceType]?.has(k) ?? false) && (UNORDERED_OBJECT_ARRAY_PROPS[resourceType]?.has(k) || (schema.unorderedObjectArrayPaths?.includes(k) ?? false));
|
|
6164
6173
|
const nestedUnordered = UNORDERED_NESTED_OBJECT_ARRAY_PATHS[resourceType];
|
|
6165
|
-
const
|
|
6174
|
+
const orderSigPathsForType = ORDER_SIGNIFICANT_PATHS[resourceType];
|
|
6175
|
+
const nestedSubPaths = [...new Set([...nestedUnordered ?? [], ...schema.unorderedObjectArrayPaths ?? []].filter((p) => p.startsWith(`${k}.`) && !orderSigPathsForType?.has(p)).map((p) => p.slice(k.length + 1)))];
|
|
6166
6176
|
let declaredVal = v;
|
|
6167
6177
|
let liveVal = live[k];
|
|
6168
6178
|
let declaredRemapSource;
|
|
@@ -6305,7 +6315,7 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
|
|
|
6305
6315
|
if (VERSION_PREFIX_PATHS[resourceType]?.has(d.path) && isVersionPrefixMatch(d.stateValue, d.awsValue)) continue;
|
|
6306
6316
|
if (LATEST_SENTINEL_PATHS[resourceType]?.has(d.path) && isLatestSentinelMatch(d.stateValue, d.awsValue)) continue;
|
|
6307
6317
|
if (INTELLIGENT_TIERING_PATHS[resourceType]?.has(d.path) && isIntelligentTieringMatch(d.stateValue, d.awsValue)) continue;
|
|
6308
|
-
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;
|
|
6318
|
+
if ((UNORDERED_ARRAY_PROPS[resourceType]?.has(d.path) || UNORDERED_ARRAY_PROPS[resourceType]?.has(d.path.replace(/\.\d+(?=\.|$)/g, ".*")) || schema.unorderedScalarPaths?.includes(d.path)) && !ORDER_SIGNIFICANT_PATHS[resourceType]?.has(d.path) && isEqualUnorderedScalarSet(d.stateValue, d.awsValue)) continue;
|
|
6309
6319
|
if (isTrivialEmpty(d.stateValue) && d.path in knownDef && deepEqual(d.awsValue, knownDef[d.path]) && !(MEANINGFUL_WHEN_OFF[resourceType]?.[d.path]?.({
|
|
6310
6320
|
declared,
|
|
6311
6321
|
live
|
|
@@ -8496,12 +8506,16 @@ async function enumerateEfsFileSystemChildren(ctx) {
|
|
|
8496
8506
|
}))
|
|
8497
8507
|
});
|
|
8498
8508
|
}
|
|
8509
|
+
function isImplicitClusterMemberName(clusterId, instanceId) {
|
|
8510
|
+
const escaped = clusterId.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
8511
|
+
return new RegExp(`^${escaped}-instance-\\d+$`).test(instanceId);
|
|
8512
|
+
}
|
|
8499
8513
|
function diffRdsClusterChildren(input) {
|
|
8500
8514
|
const declared = new Set(input.declaredInstanceIds);
|
|
8501
8515
|
const clusterMembers = new Set(input.clusterMemberIds);
|
|
8502
8516
|
const added = [];
|
|
8503
8517
|
for (const i of input.liveInstances) {
|
|
8504
|
-
if (declared.has(i.id) || clusterMembers.has(i.id)) continue;
|
|
8518
|
+
if (declared.has(i.id) || clusterMembers.has(i.id) && isImplicitClusterMemberName(input.clusterId, i.id)) continue;
|
|
8505
8519
|
added.push({
|
|
8506
8520
|
resourceType: "AWS::RDS::DBInstance",
|
|
8507
8521
|
identifier: i.id,
|
|
@@ -8546,6 +8560,7 @@ async function enumerateRdsClusterChildren(ctx) {
|
|
|
8546
8560
|
});
|
|
8547
8561
|
const [instances, clusterMemberIds] = await Promise.all([pageDbInstances(client, clusterId), describeClusterMemberIds(client, clusterId)]);
|
|
8548
8562
|
return diffRdsClusterChildren({
|
|
8563
|
+
clusterId,
|
|
8549
8564
|
declaredInstanceIds,
|
|
8550
8565
|
liveInstances: instances.filter((i) => typeof i.DBInstanceIdentifier === "string" && !isAasManagedReader(i.DBInstanceIdentifier)).map((i) => ({
|
|
8551
8566
|
id: i.DBInstanceIdentifier,
|