cdk-real-drift 0.2.35 → 0.2.37

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 CHANGED
@@ -1192,7 +1192,10 @@ const KNOWN_DEFAULTS = {
1192
1192
  },
1193
1193
  "AWS::Lambda::Alias": { Description: "" },
1194
1194
  "AWS::Lambda::Version": { RuntimePolicy: { UpdateRuntimeOn: "Auto" } },
1195
- "AWS::Events::Rule": { EventBusName: "default" },
1195
+ "AWS::Events::Rule": {
1196
+ EventBusName: "default",
1197
+ State: "ENABLED"
1198
+ },
1196
1199
  "AWS::Athena::WorkGroup": {
1197
1200
  State: "ENABLED",
1198
1201
  WorkGroupConfiguration: {
@@ -1253,7 +1256,9 @@ const KNOWN_DEFAULTS = {
1253
1256
  },
1254
1257
  "AWS::ElasticLoadBalancingV2::LoadBalancer": {
1255
1258
  IpAddressType: "ipv4",
1256
- EnablePrefixForIpv6SourceNat: "off"
1259
+ EnablePrefixForIpv6SourceNat: "off",
1260
+ Scheme: "internet-facing",
1261
+ Type: "application"
1257
1262
  },
1258
1263
  "AWS::ElasticLoadBalancingV2::Listener": { MutualAuthentication: { Mode: "off" } },
1259
1264
  "AWS::EC2::NatGateway": {
@@ -1369,6 +1374,14 @@ const KNOWN_DEFAULTS = {
1369
1374
  },
1370
1375
  KeyConfiguration: { KeyType: "AWS_OWNED_KEY" },
1371
1376
  IssuerConfiguration: { Type: "ORIGINAL" },
1377
+ VerificationMessageTemplate: { DefaultEmailOption: "CONFIRM_WITH_CODE" },
1378
+ AccountRecoverySetting: { RecoveryMechanisms: [{
1379
+ Priority: 1,
1380
+ Name: "verified_email"
1381
+ }, {
1382
+ Priority: 2,
1383
+ Name: "verified_phone_number"
1384
+ }] },
1372
1385
  WebAuthnFactorConfiguration: "SINGLE_FACTOR"
1373
1386
  },
1374
1387
  "AWS::Cognito::IdentityPool": { AllowClassicFlow: false },
@@ -1527,7 +1540,10 @@ const KNOWN_DEFAULTS = {
1527
1540
  }]
1528
1541
  }
1529
1542
  },
1530
- "AWS::EC2::EIP": { PublicIpv4Pool: "amazon" },
1543
+ "AWS::EC2::EIP": {
1544
+ PublicIpv4Pool: "amazon",
1545
+ Domain: "vpc"
1546
+ },
1531
1547
  "AWS::EC2::TransitGateway": { SecurityGroupReferencingSupport: "disable" },
1532
1548
  "AWS::EC2::FlowLog": { MaxAggregationInterval: 600 },
1533
1549
  "AWS::EC2::PlacementGroup": { SpreadLevel: "rack" },
@@ -2220,6 +2236,7 @@ function ebOptionSettingTier(namespace, optionName, value, envType) {
2220
2236
  return "undeclared";
2221
2237
  }
2222
2238
  const VALUE_INDEPENDENT_DEFAULT_TOPLEVEL_PATHS = {
2239
+ "AWS::ElasticLoadBalancingV2::LoadBalancer": new Set(["SecurityGroups"]),
2223
2240
  "AWS::Batch::JobQueue": new Set(["JobQueueType"]),
2224
2241
  "AWS::ECS::Service": new Set(["AvailabilityZoneRebalancing", "PlatformVersion"]),
2225
2242
  "AWS::KinesisAnalyticsV2::Application": new Set(["ApplicationMaintenanceConfiguration"]),
@@ -4059,6 +4076,13 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
4059
4076
  ...knownDefPaths,
4060
4077
  "LoggingConfig.LogFormat": "JSON"
4061
4078
  };
4079
+ if (resourceType === "AWS::Lambda::Function") {
4080
+ const genLogGroup = genDef["LoggingConfig"]?.["LogGroup"];
4081
+ if (typeof genLogGroup === "string") knownDefPaths = {
4082
+ ...knownDefPaths,
4083
+ "LoggingConfig.LogGroup": genLogGroup
4084
+ };
4085
+ }
4062
4086
  if (resourceType === "AWS::Glue::Schema") {
4063
4087
  const arn = declared["Registry"]?.["Arn"];
4064
4088
  if (typeof arn === "string") {
@@ -4069,6 +4093,32 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
4069
4093
  };
4070
4094
  }
4071
4095
  }
4096
+ if (resourceType === "AWS::Lambda::EventSourceMapping") {
4097
+ const arn = declared["EventSourceArn"];
4098
+ const service = typeof arn === "string" ? arn.split(":")[2] : void 0;
4099
+ const batchDefault = service === "sqs" ? 10 : service === "kinesis" || service === "dynamodb" || service === "kafka" ? 100 : void 0;
4100
+ if (batchDefault !== void 0) knownDef = {
4101
+ ...knownDef,
4102
+ BatchSize: batchDefault
4103
+ };
4104
+ }
4105
+ if (resourceType === "AWS::KMS::Key" && opts.accountId !== void 0) {
4106
+ const partition = opts.region?.startsWith("cn-") ? "aws-cn" : opts.region?.startsWith("us-gov-") ? "aws-us-gov" : "aws";
4107
+ knownDef = {
4108
+ ...knownDef,
4109
+ KeyPolicy: canonicalizePolicy({
4110
+ Version: "2012-10-17",
4111
+ Id: "key-default-1",
4112
+ Statement: [{
4113
+ Sid: "Enable IAM User Permissions",
4114
+ Effect: "Allow",
4115
+ Principal: { AWS: `arn:${partition}:iam::${opts.accountId}:root` },
4116
+ Action: "kms:*",
4117
+ Resource: "*"
4118
+ }]
4119
+ })
4120
+ };
4121
+ }
4072
4122
  if (resourceType === "AWS::ApiGateway::RestApi") {
4073
4123
  const types = declared["EndpointConfiguration"]?.["Types"];
4074
4124
  if (Array.isArray(types) && types.includes("PRIVATE")) {
@@ -4111,7 +4161,7 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
4111
4161
  const emitNested = (path, value) => {
4112
4162
  if (isAllAwsTags(value) || isTrivialEmpty(value)) return;
4113
4163
  const schemaPath = path.replace(/\[[^\]]*\]/g, ".*");
4114
- 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";
4164
+ 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) && !(schemaPath in knownDefPaths) ? "generated" : "undeclared";
4115
4165
  const freeFormKey = tier === "undeclared" && underFreeFormMap(schemaPath);
4116
4166
  findings.push({
4117
4167
  tier,
@@ -4440,7 +4490,7 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
4440
4490
  }
4441
4491
  continue;
4442
4492
  }
4443
- 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)) {
4493
+ 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)) {
4444
4494
  findings.push({
4445
4495
  tier: "atDefault",
4446
4496
  logicalId,
@@ -10786,6 +10836,7 @@ const REVERT_SET_DEFAULT_PATHS = new Set([
10786
10836
  "AWS::Cognito::UserPool\0DeletionProtection",
10787
10837
  "AWS::Cognito::UserPool\0MfaConfiguration",
10788
10838
  "AWS::Cognito::UserPool\0UserPoolTier",
10839
+ "AWS::Cognito::UserPool\0Policies",
10789
10840
  "AWS::SNS::Subscription\0FilterPolicyScope",
10790
10841
  "AWS::InternetMonitor::Monitor\0Status",
10791
10842
  "AWS::RolesAnywhere::Profile\0DurationSeconds",