cdk-real-drift 0.18.11 → 0.18.13
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/README.md +7 -3
- package/dist/cli.js +150 -8
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1024,9 +1024,13 @@ covers them. **If you never run `revert`, cdkrd needs no write permissions at al
|
|
|
1024
1024
|
re-surfaces as drift — otherwise invisible (the function `Code` is write-only and
|
|
1025
1025
|
a later `cdk deploy` does not heal it). It folds silently on a clean deploy
|
|
1026
1026
|
(zero first-run noise), `record` snapshots it, and a later change re-surfaces as
|
|
1027
|
-
"changed since record".
|
|
1028
|
-
|
|
1029
|
-
|
|
1027
|
+
"changed since record". A **legitimate** `cdk deploy` that updates the code
|
|
1028
|
+
does NOT re-surface it: `record` also fingerprints the declared `Code`, so a
|
|
1029
|
+
hash that moved because the template's code changed folds into a re-record
|
|
1030
|
+
nudge instead of false drift (same for the Glue script hash below). The old
|
|
1031
|
+
code bytes are gone, so it is detect-only (not revertable — redeploy with a
|
|
1032
|
+
forced code update). Without the permission the signal is skipped, never
|
|
1033
|
+
false-flagged.
|
|
1030
1034
|
- Optional: `glue:GetJob` + `s3:GetObject` (on the script bucket) record a content
|
|
1031
1035
|
hash of an `AWS::Glue::Job`'s ETL script (`ScriptSha256`, fetched from
|
|
1032
1036
|
`Command.ScriptLocation`) so an out-of-band script swap at the **same S3 key**
|
package/dist/cli.js
CHANGED
|
@@ -2091,6 +2091,7 @@ const KNOWN_DEFAULTS = {
|
|
|
2091
2091
|
IngressConfiguration: { IsPubliclyAccessible: true }
|
|
2092
2092
|
}
|
|
2093
2093
|
},
|
|
2094
|
+
"AWS::GuardDuty::Filter": { Action: "NOOP" },
|
|
2094
2095
|
"AWS::GuardDuty::Detector": {
|
|
2095
2096
|
FindingPublishingFrequency: "SIX_HOURS",
|
|
2096
2097
|
DataSources: {
|
|
@@ -2234,7 +2235,9 @@ const KNOWN_DEFAULTS = {
|
|
|
2234
2235
|
MaximumRetryAttempts: -1,
|
|
2235
2236
|
MaximumRecordAgeInSeconds: -1,
|
|
2236
2237
|
Enabled: true,
|
|
2237
|
-
MaximumBatchingWindowInSeconds: 0
|
|
2238
|
+
MaximumBatchingWindowInSeconds: 0,
|
|
2239
|
+
ParallelizationFactor: 1,
|
|
2240
|
+
TumblingWindowInSeconds: 0
|
|
2238
2241
|
},
|
|
2239
2242
|
"AWS::Lambda::Alias": { Description: "" },
|
|
2240
2243
|
"AWS::Lambda::Version": { RuntimePolicy: { UpdateRuntimeOn: "Auto" } },
|
|
@@ -2933,6 +2936,7 @@ const KNOWN_DEFAULT_ONE_OF = {
|
|
|
2933
2936
|
"AWS::ApiGatewayV2::Integration": { TimeoutInMillis: [29e3, 3e4] },
|
|
2934
2937
|
"AWS::SecurityHub::Hub": { ControlFindingGenerator: ["SECURITY_CONTROL", "STANDARD_CONTROL"] },
|
|
2935
2938
|
"AWS::Glue::Job": { Timeout: [2880, 480] },
|
|
2939
|
+
"AWS::CodePipeline::Pipeline": { PipelineType: ["V1", "V2"] },
|
|
2936
2940
|
"AWS::OpenSearchService::Domain": { DomainEndpointOptions: [{
|
|
2937
2941
|
CustomEndpointEnabled: false,
|
|
2938
2942
|
EnforceHTTPS: false,
|
|
@@ -3082,7 +3086,9 @@ const KNOWN_DEFAULT_PATHS = {
|
|
|
3082
3086
|
MaximumEventAgeInSeconds: 86400,
|
|
3083
3087
|
MaximumRetryAttempts: 185
|
|
3084
3088
|
} },
|
|
3089
|
+
"AWS::CodePipeline::Pipeline": { "Stages.*.Actions.*.RunOrder": 1 },
|
|
3085
3090
|
"AWS::ECS::Service": {
|
|
3091
|
+
"NetworkConfiguration.AwsvpcConfiguration.AssignPublicIp": "DISABLED",
|
|
3086
3092
|
"DeploymentConfiguration.Strategy": "ROLLING",
|
|
3087
3093
|
"DeploymentConfiguration.BakeTimeInMinutes": 0,
|
|
3088
3094
|
"DeploymentConfiguration.DeploymentCircuitBreaker.ResetOnHealthyTask": true,
|
|
@@ -3551,6 +3557,7 @@ const VALUE_INDEPENDENT_DEFAULT_TOPLEVEL_PATHS = {
|
|
|
3551
3557
|
"LifecycleHookSpecificationList"
|
|
3552
3558
|
]),
|
|
3553
3559
|
"AWS::ApiGateway::Authorizer": new Set(["AuthType"]),
|
|
3560
|
+
"AWS::GuardDuty::Filter": new Set(["Rank"]),
|
|
3554
3561
|
"AWS::DMS::Endpoint": new Set(["KmsKeyId"]),
|
|
3555
3562
|
"AWS::DMS::ReplicationInstance": new Set([
|
|
3556
3563
|
"EngineVersion",
|
|
@@ -3966,6 +3973,40 @@ function isBooleanTokenEquivalent(a, b) {
|
|
|
3966
3973
|
return ta !== void 0 && ta === tok(b);
|
|
3967
3974
|
}
|
|
3968
3975
|
const CASE_INSENSITIVE_KEY_PATHS = { "AWS::DataBrew::Recipe": new Set(["Steps[].Action.Parameters"]) };
|
|
3976
|
+
const GUARDDUTY_CONDITION_KEY_ALIASES = {
|
|
3977
|
+
Eq: "Equals",
|
|
3978
|
+
Neq: "NotEquals",
|
|
3979
|
+
Gt: "GreaterThan",
|
|
3980
|
+
Gte: "GreaterThanOrEqual",
|
|
3981
|
+
Lt: "LessThan",
|
|
3982
|
+
Lte: "LessThanOrEqual"
|
|
3983
|
+
};
|
|
3984
|
+
function canonicalizeGuardDutyCriterionKeys(declared) {
|
|
3985
|
+
const fc = declared["FindingCriteria"];
|
|
3986
|
+
if (fc === null || typeof fc !== "object" || Array.isArray(fc)) return declared;
|
|
3987
|
+
const criterion = fc["Criterion"];
|
|
3988
|
+
if (criterion === null || typeof criterion !== "object" || Array.isArray(criterion)) return declared;
|
|
3989
|
+
const outCriterion = {};
|
|
3990
|
+
for (const [field, cond] of Object.entries(criterion)) {
|
|
3991
|
+
if (cond === null || typeof cond !== "object" || Array.isArray(cond)) {
|
|
3992
|
+
outCriterion[field] = cond;
|
|
3993
|
+
continue;
|
|
3994
|
+
}
|
|
3995
|
+
const outCond = {};
|
|
3996
|
+
for (const [k, v] of Object.entries(cond)) {
|
|
3997
|
+
const long = GUARDDUTY_CONDITION_KEY_ALIASES[k];
|
|
3998
|
+
outCond[long !== void 0 && !(long in cond) ? long : k] = v;
|
|
3999
|
+
}
|
|
4000
|
+
outCriterion[field] = outCond;
|
|
4001
|
+
}
|
|
4002
|
+
return {
|
|
4003
|
+
...declared,
|
|
4004
|
+
FindingCriteria: {
|
|
4005
|
+
...fc,
|
|
4006
|
+
Criterion: outCriterion
|
|
4007
|
+
}
|
|
4008
|
+
};
|
|
4009
|
+
}
|
|
3969
4010
|
function isCaseInsensitiveKeyMapEqual(a, b) {
|
|
3970
4011
|
if (a === null || b === null || typeof a !== "object" || typeof b !== "object") return false;
|
|
3971
4012
|
if (Array.isArray(a) || Array.isArray(b)) return false;
|
|
@@ -5842,6 +5883,7 @@ const MEANINGFUL_WHEN_OFF_NESTED = {
|
|
|
5842
5883
|
} }
|
|
5843
5884
|
};
|
|
5844
5885
|
const GUARDDUTY_FEATURE_CREATION_STATUS = {
|
|
5886
|
+
AI_PROTECTION: ["DISABLED"],
|
|
5845
5887
|
AI_ANALYST: ["DISABLED"],
|
|
5846
5888
|
RUNTIME_MONITORING: ["DISABLED", "ENABLED"],
|
|
5847
5889
|
EKS_RUNTIME_MONITORING: ["DISABLED", "ENABLED"],
|
|
@@ -6757,7 +6799,8 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
|
|
|
6757
6799
|
oaiCanonicalIds: oaiMap,
|
|
6758
6800
|
resourceType
|
|
6759
6801
|
}), opts.stackTags ?? {}, declaredTagKeys(declaredForCompare));
|
|
6760
|
-
|
|
6802
|
+
let declared = canonicalizeForCompare(rewriteOaiPrincipalsDeep(declaredForCompare, oaiMap), resourceType);
|
|
6803
|
+
if (resourceType === "AWS::GuardDuty::Filter") declared = canonicalizeGuardDutyCriterionKeys(declared);
|
|
6761
6804
|
const reflected = REFLECTED_CHILD_PROPS[resourceType];
|
|
6762
6805
|
if (reflected && !(reflected in declared)) delete live[reflected];
|
|
6763
6806
|
if (resourceType === EVENT_BUS_TYPE && !(EVENT_BUS_POLICY_PROP in declared)) {
|
|
@@ -15251,6 +15294,9 @@ function hashOfCanonical(canonicalValue) {
|
|
|
15251
15294
|
function redactedHashSentinel(canonicalValue) {
|
|
15252
15295
|
return { [REDACTION_HASH_KEY]: hashOfCanonical(canonicalValue) };
|
|
15253
15296
|
}
|
|
15297
|
+
function stableValueHash(value) {
|
|
15298
|
+
return hashOfCanonical(value);
|
|
15299
|
+
}
|
|
15254
15300
|
function isRedactedHashSentinel(v) {
|
|
15255
15301
|
return !!v && typeof v === "object" && !Array.isArray(v) && Object.keys(v).length === 1 && typeof v[REDACTION_HASH_KEY] === "string";
|
|
15256
15302
|
}
|
|
@@ -15269,7 +15315,8 @@ const KNOWN_BASELINE_KEYS = new Set([
|
|
|
15269
15315
|
"templateHash",
|
|
15270
15316
|
"recorded",
|
|
15271
15317
|
"completeResources",
|
|
15272
|
-
"recordedPhysicalIds"
|
|
15318
|
+
"recordedPhysicalIds",
|
|
15319
|
+
"recordedSourceFingerprints"
|
|
15273
15320
|
]);
|
|
15274
15321
|
const KNOWN_RECORDED_ENTRY_KEYS = new Set([
|
|
15275
15322
|
"logicalId",
|
|
@@ -15329,6 +15376,7 @@ async function loadBaseline(stackName, accountId, region) {
|
|
|
15329
15376
|
validateRecordedUniqueness(parsed.recorded, path);
|
|
15330
15377
|
validateCompleteResources(parsed.completeResources, path);
|
|
15331
15378
|
validateRecordedPhysicalIds(parsed.recordedPhysicalIds, path);
|
|
15379
|
+
validateRecordedSourceFingerprints(parsed.recordedSourceFingerprints, path);
|
|
15332
15380
|
return parsed;
|
|
15333
15381
|
}
|
|
15334
15382
|
/**
|
|
@@ -15407,6 +15455,18 @@ function validateRecordedPhysicalIds(value, path) {
|
|
|
15407
15455
|
if (typeof value !== "object" || value === null || Array.isArray(value)) throw new Error(`${at} must be an object mapping logicalId to physical id`);
|
|
15408
15456
|
for (const [key, v] of Object.entries(value)) if (typeof v !== "string") throw new Error(`${at}: "${key}" must map to a string`);
|
|
15409
15457
|
}
|
|
15458
|
+
/**
|
|
15459
|
+
* Validate `recordedSourceFingerprints` (optional). When present it must be a plain object
|
|
15460
|
+
* mapping string recordedKey -> string fingerprint — a non-object or a non-string value would
|
|
15461
|
+
* otherwise mis-drive the stale-source void silently (the same loud-vs-silent principle as
|
|
15462
|
+
* validateRecordedPhysicalIds). Reject bad shapes loudly, naming the file + key.
|
|
15463
|
+
*/
|
|
15464
|
+
function validateRecordedSourceFingerprints(value, path) {
|
|
15465
|
+
if (value === void 0) return;
|
|
15466
|
+
const at = `baseline file ${path}: \`recordedSourceFingerprints\``;
|
|
15467
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) throw new Error(`${at} must be an object mapping "<logicalId>::<path>" to a fingerprint`);
|
|
15468
|
+
for (const [key, v] of Object.entries(value)) if (typeof v !== "string") throw new Error(`${at}: "${key}" must map to a string`);
|
|
15469
|
+
}
|
|
15410
15470
|
/** Deterministic order for `recorded` entries: lexicographic by (logicalId, path).
|
|
15411
15471
|
* The single point where order is imposed — read/compare logic is order-independent,
|
|
15412
15472
|
* so this only affects the bytes on disk. Without it the entries inherit findings
|
|
@@ -15429,6 +15489,12 @@ function sortedPhysicalIds(ids, recorded, complete) {
|
|
|
15429
15489
|
for (const key of Object.keys(ids).sort()) if (persist.has(key) && ids[key] !== void 0) out[key] = ids[key];
|
|
15430
15490
|
return out;
|
|
15431
15491
|
}
|
|
15492
|
+
function sortedSourceFingerprints(fps, recorded) {
|
|
15493
|
+
const persist = new Set(recorded.map((e) => recordedKey(e)));
|
|
15494
|
+
const out = {};
|
|
15495
|
+
for (const key of Object.keys(fps).sort()) if (persist.has(key) && fps[key] !== void 0) out[key] = fps[key];
|
|
15496
|
+
return out;
|
|
15497
|
+
}
|
|
15432
15498
|
async function writeBaselineFile(b) {
|
|
15433
15499
|
const p = baselinePath(b.stackName, b.accountId, b.region);
|
|
15434
15500
|
await mkdir(dirname(p), { recursive: true });
|
|
@@ -15436,7 +15502,8 @@ async function writeBaselineFile(b) {
|
|
|
15436
15502
|
...b,
|
|
15437
15503
|
recorded: sortRecorded(b.recorded),
|
|
15438
15504
|
...b.completeResources ? { completeResources: [...b.completeResources].sort() } : {},
|
|
15439
|
-
...b.recordedPhysicalIds ? { recordedPhysicalIds: sortedPhysicalIds(b.recordedPhysicalIds, b.recorded, b.completeResources ?? []) } : {}
|
|
15505
|
+
...b.recordedPhysicalIds ? { recordedPhysicalIds: sortedPhysicalIds(b.recordedPhysicalIds, b.recorded, b.completeResources ?? []) } : {},
|
|
15506
|
+
...b.recordedSourceFingerprints ? { recordedSourceFingerprints: sortedSourceFingerprints(b.recordedSourceFingerprints, b.recorded) } : {}
|
|
15440
15507
|
};
|
|
15441
15508
|
await writeFile(p, JSON.stringify(stable, null, 2) + "\n", "utf8");
|
|
15442
15509
|
return p;
|
|
@@ -15506,7 +15573,8 @@ async function writeBaseline(stackName, region, accountId, findings, rawTemplate
|
|
|
15506
15573
|
templateHash: hashTemplate(rawTemplate),
|
|
15507
15574
|
recorded,
|
|
15508
15575
|
completeResources,
|
|
15509
|
-
...buildRecordedPhysicalIds(recorded, completeResources, opts.physicalIdByLogical, opts.previous)
|
|
15576
|
+
...buildRecordedPhysicalIds(recorded, completeResources, opts.physicalIdByLogical, opts.previous),
|
|
15577
|
+
...buildRecordedSourceFingerprints(recorded, opts.declaredByLogical, opts.previous)
|
|
15510
15578
|
}),
|
|
15511
15579
|
count: recorded.length
|
|
15512
15580
|
};
|
|
@@ -15556,6 +15624,48 @@ const RECORDABLE_GENERATED_PATHS = {
|
|
|
15556
15624
|
function isRecordableGenerated(f) {
|
|
15557
15625
|
return f.tier === "generated" && (RECORDABLE_GENERATED_PATHS[f.resourceType]?.has(f.path) ?? false);
|
|
15558
15626
|
}
|
|
15627
|
+
const RECORDABLE_GENERATED_SOURCE_PATHS = {
|
|
15628
|
+
"AWS::Lambda::Function": { CodeSha256: "Code" },
|
|
15629
|
+
"AWS::Glue::Job": { ScriptSha256: "Command.ScriptLocation" }
|
|
15630
|
+
};
|
|
15631
|
+
/**
|
|
15632
|
+
* Fingerprint of a recordable-generated entry's DECLARED SOURCE value (deep key-sorted
|
|
15633
|
+
* content hash), or undefined when the (resourceType, path) has no source mapping, no
|
|
15634
|
+
* declared model is available, or the source path does not resolve in it — the undefined
|
|
15635
|
+
* cases all fall back to today's behavior (never void on unknown).
|
|
15636
|
+
*/
|
|
15637
|
+
function declaredSourceFingerprint(resourceType, path, declared) {
|
|
15638
|
+
const sourcePath = RECORDABLE_GENERATED_SOURCE_PATHS[resourceType]?.[path];
|
|
15639
|
+
if (sourcePath === void 0 || declared === void 0) return void 0;
|
|
15640
|
+
let node = declared;
|
|
15641
|
+
for (const seg of pathSegments$1(sourcePath)) {
|
|
15642
|
+
node = descendDeclared(node, seg);
|
|
15643
|
+
if (node === void 0) return void 0;
|
|
15644
|
+
}
|
|
15645
|
+
return stableValueHash(node);
|
|
15646
|
+
}
|
|
15647
|
+
/**
|
|
15648
|
+
* Build the `recordedSourceFingerprints` map for the entries being written. For each entry
|
|
15649
|
+
* with a source mapping: prefer the PREVIOUS baseline's fingerprint when the entry's VALUE
|
|
15650
|
+
* was carried forward unchanged from it (a resource unread this run — e.g. skipped — must
|
|
15651
|
+
* keep its hash paired with the template that deployed it, else a re-record after a legit
|
|
15652
|
+
* code deploy would pair the OLD hash with the NEW template and resurface the FP);
|
|
15653
|
+
* otherwise stamp the CURRENT declared source's fingerprint (falling back to the previous
|
|
15654
|
+
* one when the source does not resolve). Returns `{}` (spread to nothing) when no
|
|
15655
|
+
* fingerprint is known, so the field stays absent on baselines without any.
|
|
15656
|
+
*/
|
|
15657
|
+
function buildRecordedSourceFingerprints(recorded, declaredByLogical, previous) {
|
|
15658
|
+
const out = {};
|
|
15659
|
+
for (const e of recorded) {
|
|
15660
|
+
if (RECORDABLE_GENERATED_SOURCE_PATHS[e.resourceType]?.[e.path] === void 0) continue;
|
|
15661
|
+
const key = recordedKey(e);
|
|
15662
|
+
const prevFp = previous?.recordedSourceFingerprints?.[key];
|
|
15663
|
+
const prevEntry = previous?.recorded.find((a) => a.logicalId === e.logicalId && a.path === e.path && a.resourceType === e.resourceType);
|
|
15664
|
+
const fp = prevFp !== void 0 && prevEntry !== void 0 && deepEqual(prevEntry.value, e.value) ? prevFp : declaredSourceFingerprint(e.resourceType, e.path, declaredByLogical?.get(e.logicalId)) ?? prevFp;
|
|
15665
|
+
if (fp !== void 0) out[key] = fp;
|
|
15666
|
+
}
|
|
15667
|
+
return Object.keys(out).length > 0 ? { recordedSourceFingerprints: out } : {};
|
|
15668
|
+
}
|
|
15559
15669
|
/** Build the recorded set from a check run's findings: undeclared PROPERTIES plus
|
|
15560
15670
|
* out-of-band `added` RESOURCES (PR4 — `added` is the resource-granularity sibling of
|
|
15561
15671
|
* undeclared, so `record` snapshots its full live model and a later change to it
|
|
@@ -15919,6 +16029,14 @@ function applyBaseline(findings, baseline, opts = {}) {
|
|
|
15919
16029
|
const liveId = opts.physicalIdByLogical?.get(logicalId);
|
|
15920
16030
|
if (liveId !== void 0 && liveId !== recordedId) replacedLogical.add(logicalId);
|
|
15921
16031
|
}
|
|
16032
|
+
const sourceRedeployedVoid = /* @__PURE__ */ new Set();
|
|
16033
|
+
const recordedSourceFps = baseline.recordedSourceFingerprints ?? {};
|
|
16034
|
+
for (const e of recorded) {
|
|
16035
|
+
const storedFp = recordedSourceFps[recordedKey(e)];
|
|
16036
|
+
if (storedFp === void 0) continue;
|
|
16037
|
+
const currentFp = declaredSourceFingerprint(e.resourceType, e.path, opts.declaredByLogical?.get(e.logicalId));
|
|
16038
|
+
if (currentFp !== void 0 && currentFp !== storedFp) sourceRedeployedVoid.add(recordedKey(e));
|
|
16039
|
+
}
|
|
15922
16040
|
const liveTypeByLogical = /* @__PURE__ */ new Map();
|
|
15923
16041
|
for (const f of findings) if (f.resourceType) liveTypeByLogical.set(f.logicalId, f.resourceType);
|
|
15924
16042
|
const isTypeVoid = (e) => {
|
|
@@ -15956,7 +16074,8 @@ function applyBaseline(findings, baseline, opts = {}) {
|
|
|
15956
16074
|
kept.push(f);
|
|
15957
16075
|
continue;
|
|
15958
16076
|
}
|
|
15959
|
-
const
|
|
16077
|
+
const matched = replacedLogical.has(f.logicalId) ? void 0 : recorded.find((a) => entryMatches(a, f));
|
|
16078
|
+
const entry = matched !== void 0 && sourceRedeployedVoid.has(recordedKey(matched)) ? void 0 : matched;
|
|
15960
16079
|
if (entry && baselineValueMatches(entry.value, f.actual, f.resourceType, f.path)) continue;
|
|
15961
16080
|
if (entry) {
|
|
15962
16081
|
const delta = identityArrayDelta(canonicalizeForCompare(entry.value, f.resourceType), f.actual);
|
|
@@ -16000,6 +16119,7 @@ function applyBaseline(findings, baseline, opts = {}) {
|
|
|
16000
16119
|
const typeMismatchStale = [];
|
|
16001
16120
|
const adoptedStale = [];
|
|
16002
16121
|
const nameStrippedStale = [];
|
|
16122
|
+
const sourceRedeployedStale = [];
|
|
16003
16123
|
for (const a of recorded) {
|
|
16004
16124
|
if (a.path === "") {
|
|
16005
16125
|
if (presentAddedLogical.has(a.logicalId)) continue;
|
|
@@ -16027,6 +16147,10 @@ function applyBaseline(findings, baseline, opts = {}) {
|
|
|
16027
16147
|
replacedStale.push(`${a.logicalId}.${a.path}`);
|
|
16028
16148
|
continue;
|
|
16029
16149
|
}
|
|
16150
|
+
if (sourceRedeployedVoid.has(recordedKey(a))) {
|
|
16151
|
+
sourceRedeployedStale.push(`${a.logicalId}.${a.path}`);
|
|
16152
|
+
continue;
|
|
16153
|
+
}
|
|
16030
16154
|
if (currentPaths.has(`${a.logicalId}.${a.path}`)) continue;
|
|
16031
16155
|
if (skippedLogical.has(a.logicalId)) continue;
|
|
16032
16156
|
if (deletedLogical.has(a.logicalId)) continue;
|
|
@@ -16061,9 +16185,21 @@ function applyBaseline(findings, baseline, opts = {}) {
|
|
|
16061
16185
|
if (typeMismatchStale.length > 0) opts.warn?.(formatTypeMismatchStaleNote(typeMismatchStale));
|
|
16062
16186
|
if (adoptedStale.length > 0) opts.warn?.(formatAdoptedStaleNote(adoptedStale));
|
|
16063
16187
|
if (nameStrippedStale.length > 0) opts.warn?.(formatNameStrippedStaleNote(nameStrippedStale));
|
|
16188
|
+
if (sourceRedeployedStale.length > 0) opts.warn?.(formatSourceRedeployedStaleNote(sourceRedeployedStale));
|
|
16064
16189
|
return kept;
|
|
16065
16190
|
}
|
|
16066
16191
|
/**
|
|
16192
|
+
* The folded one-line note for recorded content-hash entries whose DECLARED SOURCE was
|
|
16193
|
+
* redeployed through CloudFormation since record (a legit IaC code update — the recorded
|
|
16194
|
+
* hash is stale, not violated). Until the user re-records, the new code's hash is not
|
|
16195
|
+
* being watched, so the nudge matters: a swap AFTER the redeploy is invisible until then.
|
|
16196
|
+
* Mirror of formatReplacedStaleNote. Pure + exported for unit tests.
|
|
16197
|
+
*/
|
|
16198
|
+
function formatSourceRedeployedStaleNote(paths) {
|
|
16199
|
+
const n = paths.length;
|
|
16200
|
+
return `note: ${n === 1 ? `baseline entry (${paths[0]}) is a content hash whose` : `${n} baseline entries are content hashes whose`} declared code was redeployed via CloudFormation since record — re-run \`cdkrd record\` to watch the new code.`;
|
|
16201
|
+
}
|
|
16202
|
+
/**
|
|
16067
16203
|
* The folded one-line note for baseline entries now declared in the template (R134). One
|
|
16068
16204
|
* line with a count instead of one line per entry; `record` re-snapshots to clear them.
|
|
16069
16205
|
* Pure + exported for unit tests.
|
|
@@ -18732,6 +18868,10 @@ const REVERT_SET_DEFAULT_PATHS = new Set([
|
|
|
18732
18868
|
"AWS::ECR::Repository\0ImageTagMutability",
|
|
18733
18869
|
"AWS::ECR::Repository\0ImageScanningConfiguration",
|
|
18734
18870
|
"AWS::SQS::Queue\0MaximumMessageSize",
|
|
18871
|
+
"AWS::SQS::Queue\0SqsManagedSseEnabled",
|
|
18872
|
+
"AWS::StepFunctions::StateMachine\0LoggingConfiguration",
|
|
18873
|
+
"AWS::ApiGateway::RestApi\0DisableExecuteApiEndpoint",
|
|
18874
|
+
"AWS::Cognito::UserPoolClient\0RefreshTokenValidity",
|
|
18735
18875
|
"AWS::Lambda::Url\0InvokeMode",
|
|
18736
18876
|
"AWS::RolesAnywhere::Profile\0DurationSeconds",
|
|
18737
18877
|
"AWS::RolesAnywhere::Profile\0AttributeMappings",
|
|
@@ -19321,7 +19461,8 @@ const CC_UPDATE_REJECTED_EMPTY_PATHS = {
|
|
|
19321
19461
|
"/Distributions/*/FastLaunchConfigurations",
|
|
19322
19462
|
"/Distributions/*/LaunchTemplateConfigurations"
|
|
19323
19463
|
],
|
|
19324
|
-
"AWS::Lambda::EventInvokeConfig": ["/DestinationConfig/OnSuccess", "/DestinationConfig/OnFailure"]
|
|
19464
|
+
"AWS::Lambda::EventInvokeConfig": ["/DestinationConfig/OnSuccess", "/DestinationConfig/OnFailure"],
|
|
19465
|
+
"AWS::Lambda::EventSourceMapping": ["/DestinationConfig/OnFailure"]
|
|
19325
19466
|
};
|
|
19326
19467
|
function expandPointer(model, pointer) {
|
|
19327
19468
|
let frontier = [{
|
|
@@ -19987,7 +20128,8 @@ async function recordStack(p) {
|
|
|
19987
20128
|
const { path, count } = await writeBaseline(stackName, region, desired.accountId, findings, desired.rawTemplate, recorded, {
|
|
19988
20129
|
allLogicalIds: desired.resources.map((r) => r.logicalId),
|
|
19989
20130
|
previous: existing,
|
|
19990
|
-
physicalIdByLogical: physicalIdsByLogical(desired.resources)
|
|
20131
|
+
physicalIdByLogical: physicalIdsByLogical(desired.resources),
|
|
20132
|
+
declaredByLogical: declaredKeysByLogical(desired.resources)
|
|
19991
20133
|
});
|
|
19992
20134
|
if (!p.json) console.log(style.ok(recordOutcomeMessage(stackName, path, count, refreshedOnly, !!existing)));
|
|
19993
20135
|
const scopeNote = recordScopeNote(stackName, findings);
|