cdk-real-drift 0.2.15 → 0.2.16
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 +70 -3
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1609,6 +1609,11 @@ const KNOWN_DEFAULTS = {
|
|
|
1609
1609
|
}
|
|
1610
1610
|
]
|
|
1611
1611
|
},
|
|
1612
|
+
"AWS::KinesisVideo::Stream": { DataRetentionInHours: 0 },
|
|
1613
|
+
"AWS::KinesisVideo::SignalingChannel": {
|
|
1614
|
+
Type: "SINGLE_MASTER",
|
|
1615
|
+
MessageTtlSeconds: 60
|
|
1616
|
+
},
|
|
1612
1617
|
"AWS::CodeStarNotifications::NotificationRule": { Status: "ENABLED" },
|
|
1613
1618
|
"AWS::Rbin::Rule": { Status: "available" },
|
|
1614
1619
|
"AWS::RolesAnywhere::TrustAnchor": { NotificationSettings: [{
|
|
@@ -1920,7 +1925,10 @@ const GENERATED_PATHS = {
|
|
|
1920
1925
|
"AWS::XRay::SamplingRule": ["SamplingRule.RuleARN"]
|
|
1921
1926
|
};
|
|
1922
1927
|
const CONTEXT_DEFAULTS = { "AWS::EC2::VPCEndpointService": { SupportedRegions: "regionList" } };
|
|
1923
|
-
const CONTEXT_ARN_DEFAULTS = {
|
|
1928
|
+
const CONTEXT_ARN_DEFAULTS = {
|
|
1929
|
+
"AWS::ResourceExplorer2::View": { Scope: "arn:{partition}:iam::{accountId}:root" },
|
|
1930
|
+
"AWS::KinesisVideo::Stream": { KmsKeyId: "arn:{partition}:kms:{region}:{accountId}:alias/aws/kinesisvideo" }
|
|
1931
|
+
};
|
|
1924
1932
|
const ENGINE_DEFAULTS = {
|
|
1925
1933
|
"AWS::RDS::DBInstance": {
|
|
1926
1934
|
StorageType: (e) => e.startsWith("aurora") ? "aurora" : void 0,
|
|
@@ -1972,7 +1980,8 @@ const GENERATED_TOPLEVEL_PATHS = {
|
|
|
1972
1980
|
};
|
|
1973
1981
|
const DESCEND_UNDECLARED_OBJECT_PATHS = {
|
|
1974
1982
|
"AWS::EKS::Cluster": new Set(["KubernetesNetworkConfig"]),
|
|
1975
|
-
"AWS::Athena::WorkGroup": new Set(["WorkGroupConfiguration"])
|
|
1983
|
+
"AWS::Athena::WorkGroup": new Set(["WorkGroupConfiguration"]),
|
|
1984
|
+
"AWS::KinesisVideo::Stream": new Set(["StreamStorageConfiguration"])
|
|
1976
1985
|
};
|
|
1977
1986
|
const GENERATED_LOGICALID_PREFIX_PATHS = {
|
|
1978
1987
|
"AWS::Cognito::UserPoolClient": new Set(["ClientName"]),
|
|
@@ -3671,6 +3680,25 @@ function alignCompositeKeySubset(declared, live, spec) {
|
|
|
3671
3680
|
});
|
|
3672
3681
|
}
|
|
3673
3682
|
const isNestedObject = (x) => x !== null && typeof x === "object" && !Array.isArray(x);
|
|
3683
|
+
const DDB_TABLE_TYPES = new Set(["AWS::DynamoDB::Table", "AWS::DynamoDB::GlobalTable"]);
|
|
3684
|
+
function warmThroughputDefault(provisionedThroughput) {
|
|
3685
|
+
if (isNestedObject(provisionedThroughput) && typeof provisionedThroughput.ReadCapacityUnits === "number" && typeof provisionedThroughput.WriteCapacityUnits === "number") return {
|
|
3686
|
+
ReadUnitsPerSecond: provisionedThroughput.ReadCapacityUnits,
|
|
3687
|
+
WriteUnitsPerSecond: provisionedThroughput.WriteCapacityUnits
|
|
3688
|
+
};
|
|
3689
|
+
return {
|
|
3690
|
+
ReadUnitsPerSecond: 12e3,
|
|
3691
|
+
WriteUnitsPerSecond: 4e3
|
|
3692
|
+
};
|
|
3693
|
+
}
|
|
3694
|
+
function dynamoGsiWarmThroughputAtDefault(resourceType, path, value, live) {
|
|
3695
|
+
if (!DDB_TABLE_TYPES.has(resourceType)) return false;
|
|
3696
|
+
const m = /^GlobalSecondaryIndexes\[(.*)\]\.WarmThroughput$/.exec(path);
|
|
3697
|
+
if (m === null || !Array.isArray(live.GlobalSecondaryIndexes)) return false;
|
|
3698
|
+
const gsi = live.GlobalSecondaryIndexes.find((g) => isNestedObject(g) && g.IndexName === m[1]);
|
|
3699
|
+
if (!isNestedObject(gsi)) return false;
|
|
3700
|
+
return deepEqual(value, warmThroughputDefault(gsi.ProvisionedThroughput));
|
|
3701
|
+
}
|
|
3674
3702
|
const CFN_RANDOM_SUFFIX = /-[0-9A-Za-z]{12,}$/;
|
|
3675
3703
|
function stripInjectedJsonStringDefaults(declared, live, defaults) {
|
|
3676
3704
|
const stripObject = (d, l) => {
|
|
@@ -3885,7 +3913,7 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
|
|
|
3885
3913
|
const emitNested = (path, value) => {
|
|
3886
3914
|
if (isAllAwsTags(value) || isTrivialEmpty(value)) return;
|
|
3887
3915
|
const schemaPath = path.replace(/\[[^\]]*\]/g, ".*");
|
|
3888
|
-
const tier = schemaPath in schema.defaultPaths && matchesKnownDefault(value, schema.defaultPaths[schemaPath]) || schemaPath in knownDefPaths && matchesKnownDefault(value, knownDefPaths[schemaPath]) ? "atDefault" : generatedPaths.includes(schemaPath) && isPhysicalIdSegment(value, physicalId) || generatedNestedPaths?.has(schemaPath) ? "generated" : "undeclared";
|
|
3916
|
+
const tier = schemaPath in schema.defaultPaths && matchesKnownDefault(value, schema.defaultPaths[schemaPath]) || schemaPath in knownDefPaths && matchesKnownDefault(value, knownDefPaths[schemaPath]) || dynamoGsiWarmThroughputAtDefault(resourceType, path, value, live) ? "atDefault" : generatedPaths.includes(schemaPath) && isPhysicalIdSegment(value, physicalId) || generatedNestedPaths?.has(schemaPath) ? "generated" : "undeclared";
|
|
3889
3917
|
const freeFormKey = tier === "undeclared" && underFreeFormMap(schemaPath);
|
|
3890
3918
|
findings.push({
|
|
3891
3919
|
tier,
|
|
@@ -4258,6 +4286,16 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
|
|
|
4258
4286
|
continue;
|
|
4259
4287
|
}
|
|
4260
4288
|
}
|
|
4289
|
+
if (DDB_TABLE_TYPES.has(resourceType) && k === "WarmThroughput" && deepEqual(v, warmThroughputDefault(live.ProvisionedThroughput))) {
|
|
4290
|
+
findings.push({
|
|
4291
|
+
tier: "atDefault",
|
|
4292
|
+
logicalId,
|
|
4293
|
+
resourceType,
|
|
4294
|
+
path: k,
|
|
4295
|
+
actual: v
|
|
4296
|
+
});
|
|
4297
|
+
continue;
|
|
4298
|
+
}
|
|
4261
4299
|
const namePattern = DEFAULT_MANAGED_NAME_PATHS[resourceType]?.[k];
|
|
4262
4300
|
if (namePattern !== void 0 && typeof v === "string" && namePattern.test(v)) {
|
|
4263
4301
|
findings.push({
|
|
@@ -4332,6 +4370,35 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
|
|
|
4332
4370
|
collectNestedUndeclared({}, v, k, emitNested, NESTED_ARRAY_IDENTITY[resourceType]);
|
|
4333
4371
|
continue;
|
|
4334
4372
|
}
|
|
4373
|
+
const subsetSpecU = IDENTITY_KEYED_SUBSET_ARRAYS[resourceType]?.[k];
|
|
4374
|
+
const defaultElsU = IDENTITY_KEYED_DEFAULT_ELEMENTS[resourceType]?.[k];
|
|
4375
|
+
if (subsetSpecU !== void 0 && defaultElsU !== void 0 && Array.isArray(v)) {
|
|
4376
|
+
const { idField, normalizeId } = subsetSpecU;
|
|
4377
|
+
for (const lEl of v) {
|
|
4378
|
+
if (!isNestedObject(lEl) || typeof lEl[idField] !== "string") {
|
|
4379
|
+
findings.push({
|
|
4380
|
+
tier: "undeclared",
|
|
4381
|
+
logicalId,
|
|
4382
|
+
resourceType,
|
|
4383
|
+
path: k,
|
|
4384
|
+
actual: lEl
|
|
4385
|
+
});
|
|
4386
|
+
continue;
|
|
4387
|
+
}
|
|
4388
|
+
const raw = lEl[idField];
|
|
4389
|
+
const id = normalizeId ? normalizeId(raw) : raw;
|
|
4390
|
+
const atDefault = id in defaultElsU && deepEqual(lEl, defaultElsU[id]);
|
|
4391
|
+
findings.push({
|
|
4392
|
+
tier: atDefault ? "atDefault" : "undeclared",
|
|
4393
|
+
logicalId,
|
|
4394
|
+
resourceType,
|
|
4395
|
+
path: `${k}[${id}]`,
|
|
4396
|
+
actual: lEl,
|
|
4397
|
+
nested: true
|
|
4398
|
+
});
|
|
4399
|
+
}
|
|
4400
|
+
continue;
|
|
4401
|
+
}
|
|
4335
4402
|
findings.push({
|
|
4336
4403
|
tier: "undeclared",
|
|
4337
4404
|
logicalId,
|