cdk-real-drift 0.2.41 → 0.2.43
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 +82 -20
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1138,6 +1138,7 @@ const KNOWN_DEFAULTS = {
|
|
|
1138
1138
|
EncryptionConfiguration: { SSEAlgorithm: "AES256" }
|
|
1139
1139
|
},
|
|
1140
1140
|
"AWS::Logs::DeliveryDestination": { DeliveryDestinationType: "CWL" },
|
|
1141
|
+
"AWS::Logs::AccountPolicy": { Scope: "ALL" },
|
|
1141
1142
|
"AWS::Logs::Delivery": { RecordFields: [
|
|
1142
1143
|
"date",
|
|
1143
1144
|
"time",
|
|
@@ -1360,7 +1361,10 @@ const KNOWN_DEFAULTS = {
|
|
|
1360
1361
|
EncryptionConfiguration: { EncryptionType: "AES256" },
|
|
1361
1362
|
ImageTagMutability: "MUTABLE"
|
|
1362
1363
|
},
|
|
1363
|
-
"AWS::Kinesis::Stream": {
|
|
1364
|
+
"AWS::Kinesis::Stream": {
|
|
1365
|
+
MaxRecordSizeInKiB: 1024,
|
|
1366
|
+
RetentionPeriodHours: 24
|
|
1367
|
+
},
|
|
1364
1368
|
"AWS::SSM::Parameter": {
|
|
1365
1369
|
DataType: "text",
|
|
1366
1370
|
Tier: "Standard"
|
|
@@ -1456,7 +1460,8 @@ const KNOWN_DEFAULTS = {
|
|
|
1456
1460
|
"AWS::Scheduler::Schedule": {
|
|
1457
1461
|
GroupName: "default",
|
|
1458
1462
|
ActionAfterCompletion: "NONE",
|
|
1459
|
-
ScheduleExpressionTimezone: "UTC"
|
|
1463
|
+
ScheduleExpressionTimezone: "UTC",
|
|
1464
|
+
State: "ENABLED"
|
|
1460
1465
|
},
|
|
1461
1466
|
"AWS::EC2::NetworkInterface": {
|
|
1462
1467
|
InterfaceType: "interface",
|
|
@@ -1542,6 +1547,7 @@ const KNOWN_DEFAULTS = {
|
|
|
1542
1547
|
},
|
|
1543
1548
|
"AWS::EC2::VPCEndpoint": {
|
|
1544
1549
|
IpAddressType: "ipv4",
|
|
1550
|
+
VpcEndpointType: "Gateway",
|
|
1545
1551
|
PolicyDocument: {
|
|
1546
1552
|
Version: "2008-10-17",
|
|
1547
1553
|
Statement: [{
|
|
@@ -1887,7 +1893,10 @@ const KNOWN_DEFAULT_PATHS = {
|
|
|
1887
1893
|
"Replicas.*.ContributorInsightsSpecification.Mode": "ACCESSED_AND_THROTTLED_KEYS",
|
|
1888
1894
|
"Replicas.*.GlobalSecondaryIndexes.*.ContributorInsightsSpecification.Mode": "ACCESSED_AND_THROTTLED_KEYS"
|
|
1889
1895
|
},
|
|
1890
|
-
"AWS::ECS::TaskDefinition": {
|
|
1896
|
+
"AWS::ECS::TaskDefinition": {
|
|
1897
|
+
"ContainerDefinitions.*.Cpu": 0,
|
|
1898
|
+
"ContainerDefinitions.*.Essential": true
|
|
1899
|
+
},
|
|
1891
1900
|
"AWS::Glue::Database": { "DatabaseInput.CreateTableDefaultPermissions": [{
|
|
1892
1901
|
Permissions: ["ALL"],
|
|
1893
1902
|
Principal: { DataLakePrincipalIdentifier: "IAM_ALLOWED_PRINCIPALS" }
|
|
@@ -1896,7 +1905,11 @@ const KNOWN_DEFAULT_PATHS = {
|
|
|
1896
1905
|
"TableInput.Retention": 0,
|
|
1897
1906
|
"TableInput.StorageDescriptor.NumberOfBuckets": 0
|
|
1898
1907
|
},
|
|
1899
|
-
"AWS::Route53::HealthCheck": {
|
|
1908
|
+
"AWS::Route53::HealthCheck": {
|
|
1909
|
+
"HealthCheckConfig.EnableSNI": true,
|
|
1910
|
+
"HealthCheckConfig.RequestInterval": 30,
|
|
1911
|
+
"HealthCheckConfig.FailureThreshold": 3
|
|
1912
|
+
},
|
|
1900
1913
|
"AWS::Route53::RecordSet": { "GeoProximityLocation.Bias": 0 },
|
|
1901
1914
|
"AWS::S3::Bucket": { "LifecycleConfiguration.TransitionDefaultMinimumObjectSize": "all_storage_classes_128K" },
|
|
1902
1915
|
"AWS::Scheduler::Schedule": { "Target.RetryPolicy": {
|
|
@@ -2473,22 +2486,37 @@ function deepCompareUnordered(a, b) {
|
|
|
2473
2486
|
const ak = Object.keys(ao);
|
|
2474
2487
|
return ak.length === Object.keys(bo).length && ak.every((k) => Object.hasOwn(bo, k) && deepCompareUnordered(ao[k], bo[k]));
|
|
2475
2488
|
}
|
|
2476
|
-
function
|
|
2477
|
-
|
|
2489
|
+
function parseStructured(s) {
|
|
2490
|
+
let parsed;
|
|
2491
|
+
try {
|
|
2492
|
+
parsed = JSON.parse(s);
|
|
2493
|
+
} catch {
|
|
2478
2494
|
try {
|
|
2479
|
-
|
|
2495
|
+
parsed = parse(s);
|
|
2480
2496
|
} catch {
|
|
2481
2497
|
return SENTINEL_UNPARSEABLE;
|
|
2482
2498
|
}
|
|
2483
|
-
}
|
|
2484
|
-
|
|
2485
|
-
|
|
2499
|
+
}
|
|
2500
|
+
return parsed !== null && typeof parsed === "object" ? parsed : SENTINEL_UNPARSEABLE;
|
|
2501
|
+
}
|
|
2502
|
+
function isJsonStringStructEqual(a, b) {
|
|
2503
|
+
const aStr = typeof a === "string";
|
|
2504
|
+
const bStr = typeof b === "string";
|
|
2505
|
+
const aObj = !aStr && a !== null && typeof a === "object";
|
|
2506
|
+
if (aStr && !bStr && b !== null && typeof b === "object") {
|
|
2507
|
+
const pa = parseStructured(a);
|
|
2486
2508
|
return pa !== SENTINEL_UNPARSEABLE && deepCompareUnordered(pa, b);
|
|
2487
2509
|
}
|
|
2488
|
-
if (
|
|
2489
|
-
const pb =
|
|
2510
|
+
if (bStr && aObj) {
|
|
2511
|
+
const pb = parseStructured(b);
|
|
2490
2512
|
return pb !== SENTINEL_UNPARSEABLE && deepCompareUnordered(a, pb);
|
|
2491
2513
|
}
|
|
2514
|
+
if (aStr && bStr) {
|
|
2515
|
+
const pa = parseStructured(a);
|
|
2516
|
+
if (pa === SENTINEL_UNPARSEABLE) return false;
|
|
2517
|
+
const pb = parseStructured(b);
|
|
2518
|
+
return pb !== SENTINEL_UNPARSEABLE && deepCompareUnordered(pa, pb);
|
|
2519
|
+
}
|
|
2492
2520
|
return false;
|
|
2493
2521
|
}
|
|
2494
2522
|
const JSON_STRING_PROPS = { "AWS::Config::ConfigRule": new Set(["InputParameters"]) };
|
|
@@ -3287,14 +3315,7 @@ function prettyConstructPath(p) {
|
|
|
3287
3315
|
*/
|
|
3288
3316
|
function collectPrincipalsWithSiblingPolicies(resources, ctx) {
|
|
3289
3317
|
const principals = /* @__PURE__ */ new Map();
|
|
3290
|
-
|
|
3291
|
-
if (res?.Type !== "AWS::IAM::Policy") continue;
|
|
3292
|
-
const name = resolvePolicyName(res.Properties?.PolicyName, ctx);
|
|
3293
|
-
const refs = [
|
|
3294
|
-
...res.Properties?.Roles ?? [],
|
|
3295
|
-
...res.Properties?.Users ?? [],
|
|
3296
|
-
...res.Properties?.Groups ?? []
|
|
3297
|
-
];
|
|
3318
|
+
const attach = (name, refs) => {
|
|
3298
3319
|
for (const r of refs) {
|
|
3299
3320
|
const ref = r && typeof r === "object" ? r.Ref : void 0;
|
|
3300
3321
|
if (typeof ref !== "string") continue;
|
|
@@ -3303,9 +3324,26 @@ function collectPrincipalsWithSiblingPolicies(resources, ctx) {
|
|
|
3303
3324
|
if (name === void 0) principals.set(ref, "unresolved");
|
|
3304
3325
|
else principals.set(ref, [...prev ?? [], name]);
|
|
3305
3326
|
}
|
|
3327
|
+
};
|
|
3328
|
+
for (const res of Object.values(resources)) {
|
|
3329
|
+
const name = resolvePolicyName(res?.Properties?.PolicyName, ctx);
|
|
3330
|
+
if (res?.Type === "AWS::IAM::Policy") attach(name, [
|
|
3331
|
+
...res.Properties?.Roles ?? [],
|
|
3332
|
+
...res.Properties?.Users ?? [],
|
|
3333
|
+
...res.Properties?.Groups ?? []
|
|
3334
|
+
]);
|
|
3335
|
+
else {
|
|
3336
|
+
const singular = IAM_STANDALONE_INLINE_POLICY_TYPES.get(res?.Type);
|
|
3337
|
+
if (singular !== void 0) attach(name, [res?.Properties?.[singular]]);
|
|
3338
|
+
}
|
|
3306
3339
|
}
|
|
3307
3340
|
return principals;
|
|
3308
3341
|
}
|
|
3342
|
+
const IAM_STANDALONE_INLINE_POLICY_TYPES = new Map([
|
|
3343
|
+
["AWS::IAM::RolePolicy", "RoleName"],
|
|
3344
|
+
["AWS::IAM::UserPolicy", "UserName"],
|
|
3345
|
+
["AWS::IAM::GroupPolicy", "GroupName"]
|
|
3346
|
+
]);
|
|
3309
3347
|
/**
|
|
3310
3348
|
* The set of ECS Cluster logicalIds that a sibling AWS::ECS::ClusterCapacityProviderAssociations
|
|
3311
3349
|
* resource references (via its `Cluster: { Ref }`). CapacityProviders and
|
|
@@ -4206,6 +4244,30 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
|
|
|
4206
4244
|
};
|
|
4207
4245
|
}
|
|
4208
4246
|
}
|
|
4247
|
+
if (resourceType === "AWS::EC2::Instance") {
|
|
4248
|
+
const instanceType = declared["InstanceType"];
|
|
4249
|
+
const family = typeof instanceType === "string" ? instanceType.split(".")[0] : void 0;
|
|
4250
|
+
const creditDefault = family === "t2" ? "standard" : family === "t3" || family === "t3a" || family === "t4g" ? "unlimited" : void 0;
|
|
4251
|
+
if (creditDefault !== void 0) knownDef = {
|
|
4252
|
+
...knownDef,
|
|
4253
|
+
CreditSpecification: { CPUCredits: creditDefault }
|
|
4254
|
+
};
|
|
4255
|
+
}
|
|
4256
|
+
if (resourceType === "AWS::EC2::Volume") {
|
|
4257
|
+
const volumeType = declared["VolumeType"] ?? "gp2";
|
|
4258
|
+
const size = declared["Size"];
|
|
4259
|
+
if (volumeType === "gp2" && typeof size === "number") knownDef = {
|
|
4260
|
+
...knownDef,
|
|
4261
|
+
Iops: Math.min(16e3, Math.max(100, 3 * size))
|
|
4262
|
+
};
|
|
4263
|
+
}
|
|
4264
|
+
if (resourceType === "AWS::EC2::NetworkInterface") {
|
|
4265
|
+
const ips = declared["PrivateIpAddresses"];
|
|
4266
|
+
if (Array.isArray(ips)) knownDef = {
|
|
4267
|
+
...knownDef,
|
|
4268
|
+
SecondaryPrivateIpAddressCount: Math.max(0, ips.length - 1)
|
|
4269
|
+
};
|
|
4270
|
+
}
|
|
4209
4271
|
const generatedPaths = GENERATED_PATHS[resourceType] ?? [];
|
|
4210
4272
|
const generatedNestedPaths = GENERATED_NESTED_PATHS[resourceType];
|
|
4211
4273
|
const freeFormMapPaths = schema.freeFormMapPaths ?? [];
|