cdk-real-drift 0.13.10 → 0.13.12

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
@@ -2616,7 +2616,14 @@ const KNOWN_DEFAULTS = {
2616
2616
  TransportProtocol: "udp",
2617
2617
  SessionTimeoutHours: 24
2618
2618
  },
2619
- "AWS::DAX::Cluster": { ClusterEndpointEncryptionType: "NONE" },
2619
+ "AWS::DAX::Cluster": {
2620
+ ClusterEndpointEncryptionType: "NONE",
2621
+ ParameterGroupName: "default.dax1.0"
2622
+ },
2623
+ "AWS::DAX::ParameterGroup": { ParameterNameValues: {
2624
+ "query-ttl-millis": "300000",
2625
+ "record-ttl-millis": "300000"
2626
+ } },
2620
2627
  "AWS::APS::Workspace": { WorkspaceConfiguration: {
2621
2628
  RuleQueryOffsetInSeconds: 60,
2622
2629
  RetentionPeriodInDays: 150,
@@ -2809,7 +2816,32 @@ const KNOWN_DEFAULTS = {
2809
2816
  MaximumResolution: "FULL_HD",
2810
2817
  Policy: "ALLOW"
2811
2818
  } },
2812
- "AWS::Lightsail::Instance": { KeyPairName: "LightsailDefaultKeyPair" },
2819
+ "AWS::Lightsail::Instance": {
2820
+ KeyPairName: "LightsailDefaultKeyPair",
2821
+ Networking: { Ports: [{
2822
+ FromPort: 22,
2823
+ ToPort: 22,
2824
+ Protocol: "tcp",
2825
+ AccessDirection: "inbound",
2826
+ AccessType: "public",
2827
+ AccessFrom: "Anywhere (0.0.0.0/0 and ::/0)",
2828
+ Cidrs: ["0.0.0.0/0"],
2829
+ Ipv6Cidrs: ["::/0"],
2830
+ CidrListAliases: [],
2831
+ CommonName: ""
2832
+ }, {
2833
+ FromPort: 80,
2834
+ ToPort: 80,
2835
+ Protocol: "tcp",
2836
+ AccessDirection: "inbound",
2837
+ AccessType: "public",
2838
+ AccessFrom: "Anywhere (0.0.0.0/0 and ::/0)",
2839
+ Cidrs: ["0.0.0.0/0"],
2840
+ Ipv6Cidrs: ["::/0"],
2841
+ CidrListAliases: [],
2842
+ CommonName: ""
2843
+ }] }
2844
+ },
2813
2845
  "AWS::Lightsail::Disk": { AddOns: [{
2814
2846
  AddOnType: "AutoSnapshot",
2815
2847
  Status: "Disabled"
@@ -3177,6 +3209,7 @@ const CONTEXT_ARN_DEFAULTS = {
3177
3209
  "AWS::Batch::ComputeEnvironment": { ServiceRole: "arn:{partition}:iam::{accountId}:role/aws-service-role/batch.amazonaws.com/AWSServiceRoleForBatch" },
3178
3210
  "AWS::CodeBuild::Project": { EncryptionKey: "arn:{partition}:kms:{region}:{accountId}:alias/aws/s3" },
3179
3211
  "AWS::SSM::MaintenanceWindowTask": { ServiceRoleArn: "arn:{partition}:iam::{accountId}:role/aws-service-role/ssm.amazonaws.com/AWSServiceRoleForAmazonSSM" },
3212
+ "AWS::LakeFormation::Resource": { RoleArn: "arn:{partition}:iam::{accountId}:role/aws-service-role/lakeformation.amazonaws.com/AWSServiceRoleForLakeFormationDataAccess" },
3180
3213
  "AWS::LakeFormation::Tag": { CatalogId: "{accountId}" },
3181
3214
  "AWS::LakeFormation::PrincipalPermissions": { Catalog: "{accountId}" },
3182
3215
  "AWS::S3::AccessPoint": { BucketAccountId: "{accountId}" },
@@ -3432,6 +3465,8 @@ const VALUE_INDEPENDENT_DEFAULT_TOPLEVEL_PATHS = {
3432
3465
  "AWS::AutoScaling::AutoScalingGroup": new Set(["AvailabilityZones", "AvailabilityZoneIds"]),
3433
3466
  "AWS::ApiGateway::Authorizer": new Set(["AuthType"]),
3434
3467
  "AWS::DMS::Endpoint": new Set(["KmsKeyId"]),
3468
+ "AWS::DAX::Cluster": new Set(["PreferredMaintenanceWindow"]),
3469
+ "AWS::Lightsail::Instance": new Set(["AvailabilityZone"]),
3435
3470
  "AWS::RDS::DBCluster": new Set([
3436
3471
  "KmsKeyId",
3437
3472
  "EngineVersion",
@@ -3738,6 +3773,7 @@ const JSON_STRING_DEFAULT_FILLS = { "AWS::CE::CostCategory": { Rules: { Type: "R
3738
3773
  const CASE_INSENSITIVE_PATHS = {
3739
3774
  "AWS::Route53::RecordSet": new Set(["Name", "AliasTarget.DNSName"]),
3740
3775
  "AWS::Batch::ComputeEnvironment": new Set(["Type"]),
3776
+ "AWS::Batch::JobDefinition": new Set(["Type"]),
3741
3777
  "AWS::EMRServerless::Application": new Set(["Type"]),
3742
3778
  "AWS::RDS::DBInstance": new Set(["DBInstanceIdentifier"]),
3743
3779
  "AWS::RDS::DBCluster": new Set(["DBClusterIdentifier"]),
@@ -3750,6 +3786,14 @@ const CASE_INSENSITIVE_PATHS = {
3750
3786
  "AWS::Neptune::DBCluster": new Set(["DBClusterIdentifier"]),
3751
3787
  "AWS::Neptune::DBInstance": new Set(["DBInstanceIdentifier"]),
3752
3788
  "AWS::Neptune::DBSubnetGroup": new Set(["DBSubnetGroupName"]),
3789
+ "AWS::RDS::DBParameterGroup": new Set(["DBParameterGroupName"]),
3790
+ "AWS::RDS::DBClusterParameterGroup": new Set(["DBClusterParameterGroupName"]),
3791
+ "AWS::RDS::OptionGroup": new Set(["OptionGroupName"]),
3792
+ "AWS::RDS::DBSubnetGroup": new Set(["DBSubnetGroupName"]),
3793
+ "AWS::Neptune::DBParameterGroup": new Set(["Name"]),
3794
+ "AWS::Neptune::DBClusterParameterGroup": new Set(["Name"]),
3795
+ "AWS::DocDB::DBClusterParameterGroup": new Set(["Name"]),
3796
+ "AWS::Redshift::ClusterParameterGroup": new Set(["ParameterGroupName"]),
3753
3797
  "AWS::DMS::ReplicationInstance": new Set(["ReplicationInstanceIdentifier"]),
3754
3798
  "AWS::DMS::ReplicationSubnetGroup": new Set(["ReplicationSubnetGroupIdentifier"]),
3755
3799
  "AWS::DMS::Endpoint": new Set(["EndpointType", "EndpointIdentifier"]),
@@ -5621,7 +5665,10 @@ const MEANINGFUL_WHEN_OFF = {
5621
5665
  "AWS::Neptune::DBInstance": { AutoMinorVersionUpgrade: () => true },
5622
5666
  "AWS::ElastiCache::CacheCluster": { AutoMinorVersionUpgrade: notRestored("SnapshotName", "SnapshotArns") },
5623
5667
  "AWS::ElastiCache::ReplicationGroup": { AutoMinorVersionUpgrade: notRestored("SnapshotName", "SnapshotArns") },
5624
- "AWS::Redshift::Cluster": { AllowVersionUpgrade: notRestored("SnapshotIdentifier") }
5668
+ "AWS::Redshift::Cluster": { AllowVersionUpgrade: notRestored("SnapshotIdentifier") },
5669
+ "AWS::EC2::ClientVpnEndpoint": { DisconnectOnSessionTimeout: () => true },
5670
+ "AWS::ImageBuilder::ImagePipeline": { EnhancedImageMetadataEnabled: () => true },
5671
+ "AWS::ImageBuilder::InfrastructureConfiguration": { TerminateInstanceOnFailure: () => true }
5625
5672
  };
5626
5673
  const MEANINGFUL_WHEN_OFF_NESTED = {
5627
5674
  "AWS::CloudFront::Distribution": { "DistributionConfig.IPV6Enabled": () => true },
@@ -5629,7 +5676,11 @@ const MEANINGFUL_WHEN_OFF_NESTED = {
5629
5676
  "WorkGroupConfiguration.EnforceWorkGroupConfiguration": () => true,
5630
5677
  "WorkGroupConfiguration.PublishCloudWatchMetricsEnabled": () => true
5631
5678
  },
5632
- "AWS::EKS::Cluster": { "ResourcesVpcConfig.EndpointPublicAccess": () => true }
5679
+ "AWS::EKS::Cluster": { "ResourcesVpcConfig.EndpointPublicAccess": () => true },
5680
+ "AWS::ECS::Service": { "DeploymentConfiguration.DeploymentCircuitBreaker.ResetOnHealthyTask": ({ declared, live }) => {
5681
+ const enabled = (v) => typeof v === "object" && v !== null && v["DeploymentCircuitBreaker"]?.["Enable"] === true;
5682
+ return enabled(declared["DeploymentConfiguration"]) || enabled(live["DeploymentConfiguration"]);
5683
+ } }
5633
5684
  };
5634
5685
  const GUARDDUTY_FEATURE_CREATION_STATUS = {
5635
5686
  AI_ANALYST: ["DISABLED"],
@@ -5664,7 +5715,8 @@ const DEFAULT_SG_LIST_PATHS = {
5664
5715
  "AWS::Redshift::Cluster": "VpcSecurityGroupIds",
5665
5716
  "AWS::AmazonMQ::Broker": "SecurityGroups",
5666
5717
  "AWS::RedshiftServerless::Workgroup": "SecurityGroupIds",
5667
- "AWS::EC2::Instance": "SecurityGroupIds"
5718
+ "AWS::EC2::Instance": "SecurityGroupIds",
5719
+ "AWS::DAX::Cluster": "SecurityGroupIds"
5668
5720
  };
5669
5721
  /** #1269 fold decision for an UNDECLARED default-SUBNET list (RedshiftServerless Workgroup
5670
5722
  * SubnetIds). Unlike the SG gate (which folds only a SINGLE default SG), a workgroup placed into
@@ -5954,23 +6006,36 @@ function alignCompositeKeySubset(declared, live, spec) {
5954
6006
  }
5955
6007
  const isNestedObject = (x) => x !== null && typeof x === "object" && !Array.isArray(x);
5956
6008
  const DDB_TABLE_TYPES = new Set(["AWS::DynamoDB::Table", "AWS::DynamoDB::GlobalTable"]);
6009
+ function capacityUnit(x) {
6010
+ if (typeof x === "number") return x;
6011
+ if (typeof x === "string" && x.trim() !== "" && !Number.isNaN(Number(x))) return Number(x);
6012
+ }
5957
6013
  function warmThroughputDefault(provisionedThroughput) {
5958
- if (isNestedObject(provisionedThroughput) && typeof provisionedThroughput.ReadCapacityUnits === "number" && typeof provisionedThroughput.WriteCapacityUnits === "number") return {
5959
- ReadUnitsPerSecond: provisionedThroughput.ReadCapacityUnits,
5960
- WriteUnitsPerSecond: provisionedThroughput.WriteCapacityUnits
5961
- };
6014
+ if (isNestedObject(provisionedThroughput)) {
6015
+ const read = capacityUnit(provisionedThroughput.ReadCapacityUnits);
6016
+ const write = capacityUnit(provisionedThroughput.WriteCapacityUnits);
6017
+ if (read !== void 0 && write !== void 0) return {
6018
+ ReadUnitsPerSecond: read,
6019
+ WriteUnitsPerSecond: write
6020
+ };
6021
+ }
5962
6022
  return {
5963
6023
  ReadUnitsPerSecond: 12e3,
5964
6024
  WriteUnitsPerSecond: 4e3
5965
6025
  };
5966
6026
  }
5967
- function dynamoGsiWarmThroughputAtDefault(resourceType, path, value, live) {
6027
+ function gsiByName(model, indexName) {
6028
+ if (!isNestedObject(model) || !Array.isArray(model.GlobalSecondaryIndexes)) return void 0;
6029
+ const gsi = model.GlobalSecondaryIndexes.find((g) => isNestedObject(g) && g.IndexName === indexName);
6030
+ return isNestedObject(gsi) ? gsi : void 0;
6031
+ }
6032
+ function dynamoGsiWarmThroughputAtDefault(resourceType, path, value, live, declared) {
5968
6033
  if (!DDB_TABLE_TYPES.has(resourceType)) return false;
5969
6034
  const m = /^GlobalSecondaryIndexes\[(.*)\]\.WarmThroughput$/.exec(path);
5970
- if (m === null || !Array.isArray(live.GlobalSecondaryIndexes)) return false;
5971
- const gsi = live.GlobalSecondaryIndexes.find((g) => isNestedObject(g) && g.IndexName === m[1]);
5972
- if (!isNestedObject(gsi)) return false;
5973
- return deepEqual(value, warmThroughputDefault(gsi.ProvisionedThroughput));
6035
+ if (m === null) return false;
6036
+ const liveGsi = gsiByName(live, m[1]);
6037
+ const declaredGsi = gsiByName(declared, m[1]);
6038
+ return liveGsi !== void 0 && deepEqual(value, warmThroughputDefault(liveGsi.ProvisionedThroughput)) || declaredGsi !== void 0 && deepEqual(value, warmThroughputDefault(declaredGsi.ProvisionedThroughput));
5974
6039
  }
5975
6040
  const CLB_DEFAULT_SSL_POLICY_NAME = "ELBSecurityPolicy-2016-08";
5976
6041
  function clbDefaultSslPoliciesAtDefault(resourceType, key, value) {
@@ -6846,7 +6911,7 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6846
6911
  const parentKey = (path.split(".").pop() ?? "").replace(/\[.*$/, "");
6847
6912
  if (!isObjectForm || /tags$/i.test(parentKey)) return;
6848
6913
  }
6849
- const tier = schemaPath in schema.defaultPaths && matchesKnownDefault(value, schema.defaultPaths[schemaPath]) || schemaPath in knownDefPaths && matchesKnownDefault(value, knownDefPaths[schemaPath]) || (KNOWN_DEFAULT_ONE_OF_PATHS[resourceType]?.[schemaPath]?.some((d) => matchesKnownDefault(value, d)) ?? false) || VALUE_INDEPENDENT_DEFAULT_NESTED_PATHS[resourceType]?.has(schemaPath) && !(schemaPath in knownDefPaths) || dynamoGsiWarmThroughputAtDefault(resourceType, path, value, live) || resourceType === "AWS::Events::EventBusPolicy" && schemaPath === "Statement.*.Sid" && typeof value === "string" && value === declared["StatementId"] ? "atDefault" : generatedPaths.includes(schemaPath) && isPhysicalIdSegment(value, physicalId) || generatedNestedPaths?.has(schemaPath) && !(schemaPath in knownDefPaths) && (!(schemaPath in (MANAGED_KEY_ALIAS_PATHS[resourceType] ?? {})) || shouldFoldManagedServiceKey(resourceType, schemaPath, value, opts.kmsAliasTargets)) ? "generated" : "undeclared";
6914
+ const tier = schemaPath in schema.defaultPaths && matchesKnownDefault(value, schema.defaultPaths[schemaPath]) || schemaPath in knownDefPaths && matchesKnownDefault(value, knownDefPaths[schemaPath]) || (KNOWN_DEFAULT_ONE_OF_PATHS[resourceType]?.[schemaPath]?.some((d) => matchesKnownDefault(value, d)) ?? false) || VALUE_INDEPENDENT_DEFAULT_NESTED_PATHS[resourceType]?.has(schemaPath) && !(schemaPath in knownDefPaths) || dynamoGsiWarmThroughputAtDefault(resourceType, path, value, live, declared) || resourceType === "AWS::Events::EventBusPolicy" && schemaPath === "Statement.*.Sid" && typeof value === "string" && value === declared["StatementId"] ? "atDefault" : generatedPaths.includes(schemaPath) && isPhysicalIdSegment(value, physicalId) || generatedNestedPaths?.has(schemaPath) && !(schemaPath in knownDefPaths) && (!(schemaPath in (MANAGED_KEY_ALIAS_PATHS[resourceType] ?? {})) || shouldFoldManagedServiceKey(resourceType, schemaPath, value, opts.kmsAliasTargets)) ? "generated" : "undeclared";
6850
6915
  const freeFormKey = tier === "undeclared" && underFreeFormMap(schemaPath);
6851
6916
  findings.push({
6852
6917
  tier,
@@ -7415,7 +7480,17 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
7415
7480
  continue;
7416
7481
  }
7417
7482
  }
7418
- if (DDB_TABLE_TYPES.has(resourceType) && k === "WarmThroughput" && deepEqual(v, warmThroughputDefault(live.ProvisionedThroughput))) {
7483
+ if (DDB_TABLE_TYPES.has(resourceType) && k === "WarmThroughput" && (deepEqual(v, warmThroughputDefault(live.ProvisionedThroughput)) || deepEqual(v, warmThroughputDefault(declared.ProvisionedThroughput)))) {
7484
+ findings.push({
7485
+ tier: "atDefault",
7486
+ logicalId,
7487
+ resourceType,
7488
+ path: k,
7489
+ actual: v
7490
+ });
7491
+ continue;
7492
+ }
7493
+ if (resourceType === "AWS::ServiceDiscovery::Service" && k === "Type" && v === (declared.DnsConfig !== void 0 ? "DNS_HTTP" : "HTTP")) {
7419
7494
  findings.push({
7420
7495
  tier: "atDefault",
7421
7496
  logicalId,
@@ -11019,8 +11094,10 @@ const readDmsReplicationTask = async ({ physicalId, declared, region }) => {
11019
11094
  return model;
11020
11095
  };
11021
11096
  const readLakeFormationResource = async ({ physicalId, region }) => {
11022
- const arn = str$1(physicalId);
11023
- if (!arn) return void 0;
11097
+ const raw = str$1(physicalId);
11098
+ if (!raw) return void 0;
11099
+ const arnStart = raw.indexOf("arn:");
11100
+ const arn = arnStart >= 0 ? raw.slice(arnStart) : raw;
11024
11101
  const c = new LakeFormationClient({
11025
11102
  region,
11026
11103
  ...READ_RETRY
@@ -11916,13 +11993,17 @@ const readServiceDiscoveryService = async ({ physicalId, declared, region }) =>
11916
11993
  if (s.Description !== void 0) model.Description = s.Description;
11917
11994
  if (s.NamespaceId !== void 0) model.NamespaceId = s.NamespaceId;
11918
11995
  if (s.Type !== void 0) model.Type = s.Type;
11919
- if (s.DnsConfig) model.DnsConfig = {
11920
- ...s.DnsConfig.RoutingPolicy !== void 0 && { RoutingPolicy: s.DnsConfig.RoutingPolicy },
11921
- ...s.DnsConfig.DnsRecords !== void 0 && { DnsRecords: s.DnsConfig.DnsRecords.map((d) => ({
11922
- Type: d.Type,
11923
- TTL: d.TTL
11924
- })) }
11925
- };
11996
+ if (s.DnsConfig) {
11997
+ const declaredDnsConfig = declared?.DnsConfig;
11998
+ model.DnsConfig = {
11999
+ ...declaredDnsConfig !== null && typeof declaredDnsConfig === "object" && declaredDnsConfig.NamespaceId !== void 0 && s.NamespaceId !== void 0 && { NamespaceId: s.NamespaceId },
12000
+ ...s.DnsConfig.RoutingPolicy !== void 0 && { RoutingPolicy: s.DnsConfig.RoutingPolicy },
12001
+ ...s.DnsConfig.DnsRecords !== void 0 && { DnsRecords: s.DnsConfig.DnsRecords.map((d) => ({
12002
+ Type: d.Type,
12003
+ TTL: d.TTL
12004
+ })) }
12005
+ };
12006
+ }
11926
12007
  if (s.HealthCheckConfig) model.HealthCheckConfig = {
11927
12008
  ...s.HealthCheckConfig.Type !== void 0 && { Type: s.HealthCheckConfig.Type },
11928
12009
  ...s.HealthCheckConfig.ResourcePath !== void 0 && { ResourcePath: s.HealthCheckConfig.ResourcePath },
@@ -13213,7 +13294,8 @@ const DEFAULT_SG_LIST_TYPES = new Set([
13213
13294
  "AWS::RDS::DBCluster",
13214
13295
  "AWS::RDS::DBInstance",
13215
13296
  "AWS::DocDB::DBCluster",
13216
- "AWS::EC2::Instance"
13297
+ "AWS::EC2::Instance",
13298
+ "AWS::DAX::Cluster"
13217
13299
  ]);
13218
13300
  const DEFAULT_SUBNET_LIST_TYPES = new Set(["AWS::RedshiftServerless::Workgroup"]);
13219
13301
  const defaultSgIdsCache = /* @__PURE__ */ new Map();
@@ -17758,12 +17840,14 @@ const REVERT_SET_DEFAULT_PATHS = new Set([
17758
17840
  "AWS::OpenSearchService::Domain\0DeploymentStrategyOptions",
17759
17841
  "AWS::EKS::Cluster\0ResourcesVpcConfig.EndpointPrivateAccess",
17760
17842
  "AWS::RDS::DBInstance\0AutoMinorVersionUpgrade",
17843
+ "AWS::RDS::DBInstance\0BackupRetentionPeriod",
17761
17844
  "AWS::RDS::DBCluster\0AutoMinorVersionUpgrade",
17762
17845
  "AWS::Neptune::DBInstance\0AutoMinorVersionUpgrade",
17763
17846
  "AWS::ElastiCache::CacheCluster\0AutoMinorVersionUpgrade",
17764
17847
  "AWS::ElastiCache::ReplicationGroup\0AutoMinorVersionUpgrade",
17765
17848
  "AWS::MemoryDB::Cluster\0AutoMinorVersionUpgrade",
17766
- "AWS::Redshift::Cluster\0AllowVersionUpgrade"
17849
+ "AWS::Redshift::Cluster\0AllowVersionUpgrade",
17850
+ "AWS::DAX::ParameterGroup\0ParameterNameValues"
17767
17851
  ]);
17768
17852
  const REVERT_SET_DEFAULT_VALUES = {
17769
17853
  "AWS::EC2::Subnet\0EnableDns64": false,