cdk-real-drift 0.2.38 → 0.2.39
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 +26 -0
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -4018,6 +4018,28 @@ function remapSortedIndexToDeclared(path, arrayKey, sortedDeclared, rawDeclared)
|
|
|
4018
4018
|
const rawIdx = rawDeclared.findIndex((e) => deepEqual(e, el));
|
|
4019
4019
|
return rawIdx < 0 ? path : `${arrayKey}.${rawIdx}${m[2]}`;
|
|
4020
4020
|
}
|
|
4021
|
+
function expandExecuteApiResources(policy, arnPrefix) {
|
|
4022
|
+
if (!policy || typeof policy !== "object" || Array.isArray(policy)) return policy;
|
|
4023
|
+
const p = policy;
|
|
4024
|
+
const stmts = p["Statement"];
|
|
4025
|
+
if (!Array.isArray(stmts)) return policy;
|
|
4026
|
+
const PREFIX = "execute-api:";
|
|
4027
|
+
const expand = (r) => typeof r === "string" && r.startsWith(PREFIX) ? arnPrefix + r.slice(12) : r;
|
|
4028
|
+
const newStmts = stmts.map((s) => {
|
|
4029
|
+
if (!s || typeof s !== "object" || Array.isArray(s)) return s;
|
|
4030
|
+
const stmt = { ...s };
|
|
4031
|
+
for (const key of ["Resource", "NotResource"]) {
|
|
4032
|
+
const v = stmt[key];
|
|
4033
|
+
if (typeof v === "string") stmt[key] = expand(v);
|
|
4034
|
+
else if (Array.isArray(v)) stmt[key] = v.map(expand);
|
|
4035
|
+
}
|
|
4036
|
+
return stmt;
|
|
4037
|
+
});
|
|
4038
|
+
return {
|
|
4039
|
+
...p,
|
|
4040
|
+
Statement: newStmts
|
|
4041
|
+
};
|
|
4042
|
+
}
|
|
4021
4043
|
function classifyResource(resource, liveRaw, schema, opts = {}) {
|
|
4022
4044
|
const { logicalId, resourceType, physicalId, declared: declaredIn } = resource;
|
|
4023
4045
|
const findings = [];
|
|
@@ -4148,6 +4170,10 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
|
|
|
4148
4170
|
"EndpointConfiguration.IpAddressType": "dualstack"
|
|
4149
4171
|
};
|
|
4150
4172
|
}
|
|
4173
|
+
if (physicalId && opts.accountId !== void 0 && declared["Policy"]) {
|
|
4174
|
+
const arnPrefix = `arn:${opts.region?.startsWith("cn-") ? "aws-cn" : opts.region?.startsWith("us-gov-") ? "aws-us-gov" : "aws"}:execute-api:${opts.region ?? ""}:${opts.accountId}:${physicalId}`;
|
|
4175
|
+
declared["Policy"] = canonicalizePolicy(expandExecuteApiResources(declared["Policy"], arnPrefix));
|
|
4176
|
+
}
|
|
4151
4177
|
}
|
|
4152
4178
|
if (resourceType === "AWS::Cognito::UserPool") {
|
|
4153
4179
|
const tpvd = (declared["Policies"]?.["PasswordPolicy"])?.["TemporaryPasswordValidityDays"];
|