cdk-real-drift 0.2.37 → 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 +45 -2
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1308,7 +1308,19 @@ const KNOWN_DEFAULTS = {
|
|
|
1308
1308
|
"AWS::EC2::Instance": {
|
|
1309
1309
|
Tenancy: "default",
|
|
1310
1310
|
SourceDestCheck: true,
|
|
1311
|
-
InstanceInitiatedShutdownBehavior: "stop"
|
|
1311
|
+
InstanceInitiatedShutdownBehavior: "stop",
|
|
1312
|
+
MetadataOptions: {
|
|
1313
|
+
HttpTokens: "required",
|
|
1314
|
+
HttpPutResponseHopLimit: 2,
|
|
1315
|
+
HttpProtocolIpv6: "disabled",
|
|
1316
|
+
InstanceMetadataTags: "disabled",
|
|
1317
|
+
HttpEndpoint: "enabled"
|
|
1318
|
+
},
|
|
1319
|
+
PrivateDnsNameOptions: {
|
|
1320
|
+
HostnameType: "ip-name",
|
|
1321
|
+
EnableResourceNameDnsARecord: false,
|
|
1322
|
+
EnableResourceNameDnsAAAARecord: false
|
|
1323
|
+
}
|
|
1312
1324
|
},
|
|
1313
1325
|
"AWS::ApiGatewayV2::Api": {
|
|
1314
1326
|
RouteSelectionExpression: "$request.method $request.path",
|
|
@@ -2285,7 +2297,12 @@ const VALUE_INDEPENDENT_DEFAULT_TOPLEVEL_PATHS = {
|
|
|
2285
2297
|
"AWS::OpenSearchService::Domain": new Set(["OffPeakWindowOptions"]),
|
|
2286
2298
|
"AWS::AmazonMQ::Broker": new Set(["MaintenanceWindowStartTime"]),
|
|
2287
2299
|
"AWS::EC2::Instance": new Set(["PrivateIpAddress"]),
|
|
2288
|
-
"AWS::EC2::NetworkInterface": new Set([
|
|
2300
|
+
"AWS::EC2::NetworkInterface": new Set([
|
|
2301
|
+
"PrivateIpAddress",
|
|
2302
|
+
"PrivateIpAddresses",
|
|
2303
|
+
"GroupSet"
|
|
2304
|
+
]),
|
|
2305
|
+
"AWS::EC2::Volume": new Set(["KmsKeyId", "AvailabilityZoneId"]),
|
|
2289
2306
|
"AWS::EC2::NatGateway": new Set(["PrivateIpAddress", "VpcId"]),
|
|
2290
2307
|
"AWS::EFS::MountTarget": new Set(["IpAddress"]),
|
|
2291
2308
|
"AWS::EC2::EIP": new Set(["NetworkBorderGroup", "NetworkInterfaceId"]),
|
|
@@ -4001,6 +4018,28 @@ function remapSortedIndexToDeclared(path, arrayKey, sortedDeclared, rawDeclared)
|
|
|
4001
4018
|
const rawIdx = rawDeclared.findIndex((e) => deepEqual(e, el));
|
|
4002
4019
|
return rawIdx < 0 ? path : `${arrayKey}.${rawIdx}${m[2]}`;
|
|
4003
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
|
+
}
|
|
4004
4043
|
function classifyResource(resource, liveRaw, schema, opts = {}) {
|
|
4005
4044
|
const { logicalId, resourceType, physicalId, declared: declaredIn } = resource;
|
|
4006
4045
|
const findings = [];
|
|
@@ -4131,6 +4170,10 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
|
|
|
4131
4170
|
"EndpointConfiguration.IpAddressType": "dualstack"
|
|
4132
4171
|
};
|
|
4133
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
|
+
}
|
|
4134
4177
|
}
|
|
4135
4178
|
if (resourceType === "AWS::Cognito::UserPool") {
|
|
4136
4179
|
const tpvd = (declared["Policies"]?.["PasswordPolicy"])?.["TemporaryPasswordValidityDays"];
|