cdk-real-drift 0.2.40 → 0.2.42
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 +49 -6
- 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": {
|
|
@@ -2254,7 +2267,7 @@ const VALUE_INDEPENDENT_DEFAULT_TOPLEVEL_PATHS = {
|
|
|
2254
2267
|
"AWS::KinesisAnalyticsV2::Application": new Set(["ApplicationMaintenanceConfiguration"]),
|
|
2255
2268
|
"AWS::ElasticBeanstalk::ConfigurationTemplate": new Set(["PlatformArn"]),
|
|
2256
2269
|
"AWS::ElasticBeanstalk::Environment": new Set(["PlatformArn"]),
|
|
2257
|
-
"AWS::ElasticLoadBalancing::LoadBalancer": new Set(["AvailabilityZones"
|
|
2270
|
+
"AWS::ElasticLoadBalancing::LoadBalancer": new Set(["AvailabilityZones"]),
|
|
2258
2271
|
"AWS::AutoScaling::AutoScalingGroup": new Set(["AvailabilityZones", "AvailabilityZoneIds"]),
|
|
2259
2272
|
"AWS::ApiGateway::Authorizer": new Set(["AuthType"]),
|
|
2260
2273
|
"AWS::RDS::DBCluster": new Set([
|
|
@@ -3875,6 +3888,12 @@ function dynamoGsiWarmThroughputAtDefault(resourceType, path, value, live) {
|
|
|
3875
3888
|
if (!isNestedObject(gsi)) return false;
|
|
3876
3889
|
return deepEqual(value, warmThroughputDefault(gsi.ProvisionedThroughput));
|
|
3877
3890
|
}
|
|
3891
|
+
const CLB_DEFAULT_SSL_POLICY_NAME = "ELBSecurityPolicy-2016-08";
|
|
3892
|
+
function clbDefaultSslPoliciesAtDefault(resourceType, key, value) {
|
|
3893
|
+
if (resourceType !== "AWS::ElasticLoadBalancing::LoadBalancer" || key !== "Policies") return false;
|
|
3894
|
+
if (!Array.isArray(value) || value.length === 0) return false;
|
|
3895
|
+
return value.every((el) => isNestedObject(el) && el["PolicyType"] === "SSLNegotiationPolicyType" && el["PolicyName"] === CLB_DEFAULT_SSL_POLICY_NAME);
|
|
3896
|
+
}
|
|
3878
3897
|
const CFN_RANDOM_SUFFIX = /-[0-9A-Za-z]{12,}$/;
|
|
3879
3898
|
function stripInjectedJsonStringDefaults(declared, live, defaults) {
|
|
3880
3899
|
const stripObject = (d, l) => {
|
|
@@ -4200,6 +4219,30 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
|
|
|
4200
4219
|
};
|
|
4201
4220
|
}
|
|
4202
4221
|
}
|
|
4222
|
+
if (resourceType === "AWS::EC2::Instance") {
|
|
4223
|
+
const instanceType = declared["InstanceType"];
|
|
4224
|
+
const family = typeof instanceType === "string" ? instanceType.split(".")[0] : void 0;
|
|
4225
|
+
const creditDefault = family === "t2" ? "standard" : family === "t3" || family === "t3a" || family === "t4g" ? "unlimited" : void 0;
|
|
4226
|
+
if (creditDefault !== void 0) knownDef = {
|
|
4227
|
+
...knownDef,
|
|
4228
|
+
CreditSpecification: { CPUCredits: creditDefault }
|
|
4229
|
+
};
|
|
4230
|
+
}
|
|
4231
|
+
if (resourceType === "AWS::EC2::Volume") {
|
|
4232
|
+
const volumeType = declared["VolumeType"] ?? "gp2";
|
|
4233
|
+
const size = declared["Size"];
|
|
4234
|
+
if (volumeType === "gp2" && typeof size === "number") knownDef = {
|
|
4235
|
+
...knownDef,
|
|
4236
|
+
Iops: Math.min(16e3, Math.max(100, 3 * size))
|
|
4237
|
+
};
|
|
4238
|
+
}
|
|
4239
|
+
if (resourceType === "AWS::EC2::NetworkInterface") {
|
|
4240
|
+
const ips = declared["PrivateIpAddresses"];
|
|
4241
|
+
if (Array.isArray(ips)) knownDef = {
|
|
4242
|
+
...knownDef,
|
|
4243
|
+
SecondaryPrivateIpAddressCount: Math.max(0, ips.length - 1)
|
|
4244
|
+
};
|
|
4245
|
+
}
|
|
4203
4246
|
const generatedPaths = GENERATED_PATHS[resourceType] ?? [];
|
|
4204
4247
|
const generatedNestedPaths = GENERATED_NESTED_PATHS[resourceType];
|
|
4205
4248
|
const freeFormMapPaths = schema.freeFormMapPaths ?? [];
|
|
@@ -4536,7 +4579,7 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
|
|
|
4536
4579
|
}
|
|
4537
4580
|
continue;
|
|
4538
4581
|
}
|
|
4539
|
-
if (k in schema.defaults && matchesKnownDefault(v, schema.defaults[k]) || k in knownDef && matchesKnownDefault(v, knownDef[k]) || KNOWN_DEFAULT_ONE_OF[resourceType]?.[k]?.some((d) => matchesKnownDefault(v, d)) || VALUE_INDEPENDENT_DEFAULT_TOPLEVEL_PATHS[resourceType]?.has(k) && !isTrivialEmpty(v)) {
|
|
4582
|
+
if (k in schema.defaults && matchesKnownDefault(v, schema.defaults[k]) || k in knownDef && matchesKnownDefault(v, knownDef[k]) || KNOWN_DEFAULT_ONE_OF[resourceType]?.[k]?.some((d) => matchesKnownDefault(v, d)) || VALUE_INDEPENDENT_DEFAULT_TOPLEVEL_PATHS[resourceType]?.has(k) && !isTrivialEmpty(v) || clbDefaultSslPoliciesAtDefault(resourceType, k, v)) {
|
|
4540
4583
|
findings.push({
|
|
4541
4584
|
tier: "atDefault",
|
|
4542
4585
|
logicalId,
|