cdk-real-drift 0.12.106 → 0.12.108

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
@@ -1910,6 +1910,7 @@ function buildCorpusCase(resource, liveRaw, schema, opts, findings) {
1910
1910
  const bucketNotif = resource.physicalId && opts.bucketNotificationManaged?.has(resource.physicalId) ? [resource.physicalId] : void 0;
1911
1911
  const eipSiblingId = resource.physicalId && opts.siblingEipAssociations?.has(resource.physicalId) ? resource.physicalId : opts.siblingEipAssociations?.has(resource.logicalId) ? resource.logicalId : void 0;
1912
1912
  const tgRegistrarId = resource.physicalId && opts.siblingTargetGroupRegistrars?.has(resource.physicalId) ? resource.physicalId : opts.siblingTargetGroupRegistrars?.has(resource.logicalId) ? resource.logicalId : void 0;
1913
+ const subnetSiblingId = resource.physicalId && opts.siblingSubnetCidrBlocks?.has(resource.physicalId) ? resource.physicalId : opts.siblingSubnetCidrBlocks?.has(resource.logicalId) ? resource.logicalId : void 0;
1913
1914
  const echoModel = resource.physicalId && opts.clusterEchoModel?.[resource.physicalId] ? opts.clusterEchoModel[resource.physicalId] : void 0;
1914
1915
  const rdsOptCatalog = resource.physicalId && opts.rdsOptionSettingDefaults?.[resource.physicalId] ? opts.rdsOptionSettingDefaults[resource.physicalId] : void 0;
1915
1916
  const listenerArn = resource.resourceType === "AWS::GlobalAccelerator::EndpointGroup" ? resource.declared?.ListenerArn : void 0;
@@ -1946,6 +1947,7 @@ function buildCorpusCase(resource, liveRaw, schema, opts, findings) {
1946
1947
  ...sgSibling && resource.physicalId ? { siblingSgRules: { [resource.physicalId]: sgSibling } } : {},
1947
1948
  ...bucketNotif ? { bucketNotificationManaged: bucketNotif } : {},
1948
1949
  ...eipSiblingId ? { siblingEipAssociations: [eipSiblingId] } : {},
1950
+ ...subnetSiblingId ? { siblingSubnetCidrBlocks: [subnetSiblingId] } : {},
1949
1951
  ...tgRegistrarId ? { siblingTargetGroupRegistrars: [tgRegistrarId] } : {},
1950
1952
  ...echoModel && resource.physicalId ? { clusterEchoModel: { [resource.physicalId]: echoModel } } : {},
1951
1953
  ...rdsOptCatalog && resource.physicalId ? { rdsOptionSettingDefaults: { [resource.physicalId]: rdsOptCatalog } } : {},
@@ -6473,6 +6475,12 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
6473
6475
  const selfDeclared = declaresTarget(declared.InstanceId) || declaresTarget(declared.NetworkInterfaceId);
6474
6476
  if (explained || selfDeclared) delete live.NetworkInterfaceId;
6475
6477
  }
6478
+ if (resourceType === "AWS::EC2::Subnet") {
6479
+ if (physicalId !== void 0 && opts.siblingSubnetCidrBlocks?.has(physicalId) || opts.siblingSubnetCidrBlocks?.has(logicalId)) {
6480
+ if (!("Ipv6CidrBlock" in declared)) delete live.Ipv6CidrBlock;
6481
+ if (!("Ipv6CidrBlocks" in declared)) delete live.Ipv6CidrBlocks;
6482
+ }
6483
+ }
6476
6484
  if (resourceType === "AWS::S3::Bucket" && physicalId && opts.bucketNotificationManaged?.has(physicalId) && !("NotificationConfiguration" in declared)) {
6477
6485
  if (deepEqual(canonicalizeForCompare(canonS3NotifBucketConfig(translateDeclaredBucketNotification(opts.bucketNotificationConfigs?.[physicalId] ?? {})), resourceType), canonicalizeForCompare(canonS3NotifBucketConfig(live.NotificationConfiguration), resourceType))) delete live.NotificationConfiguration;
6478
6486
  }
@@ -13112,7 +13120,11 @@ const DEFAULT_SG_LIST_TYPES = new Set([
13112
13120
  "AWS::Neptune::DBCluster",
13113
13121
  "AWS::AmazonMQ::Broker",
13114
13122
  "AWS::RedshiftServerless::Workgroup",
13115
- "AWS::Redshift::Cluster"
13123
+ "AWS::Redshift::Cluster",
13124
+ "AWS::RDS::DBCluster",
13125
+ "AWS::RDS::DBInstance",
13126
+ "AWS::DocDB::DBCluster",
13127
+ "AWS::EC2::Instance"
13116
13128
  ]);
13117
13129
  const DEFAULT_SUBNET_LIST_TYPES = new Set(["AWS::RedshiftServerless::Workgroup"]);
13118
13130
  const defaultSgIdsCache = /* @__PURE__ */ new Map();
@@ -13595,6 +13607,38 @@ function buildSiblingEipAssociations(desired) {
13595
13607
  }
13596
13608
  return associated;
13597
13609
  }
13610
+ function buildSiblingSubnetCidrBlocks(desired) {
13611
+ const subnetIdentities = /* @__PURE__ */ new Map();
13612
+ for (const r of desired.resources) {
13613
+ if (r.resourceType !== "AWS::EC2::Subnet") continue;
13614
+ const ids = [r.logicalId];
13615
+ if (r.physicalId) ids.push(r.physicalId);
13616
+ subnetIdentities.set(r.logicalId, ids);
13617
+ }
13618
+ const withSibling = /* @__PURE__ */ new Set();
13619
+ const markSubnet = (ref) => {
13620
+ let subnetLogicalId;
13621
+ if (ref && typeof ref === "object") {
13622
+ if ("Ref" in ref && typeof ref.Ref === "string") subnetLogicalId = ref.Ref;
13623
+ else if ("Fn::GetAtt" in ref) {
13624
+ const g = ref["Fn::GetAtt"];
13625
+ if (Array.isArray(g) && typeof g[0] === "string") subnetLogicalId = g[0];
13626
+ }
13627
+ }
13628
+ if (subnetLogicalId !== void 0) {
13629
+ const ids = subnetIdentities.get(subnetLogicalId);
13630
+ if (ids) for (const id of ids) withSibling.add(id);
13631
+ return;
13632
+ }
13633
+ if (typeof ref === "string" && ref) withSibling.add(ref);
13634
+ };
13635
+ for (const r of desired.resources) {
13636
+ if (r.resourceType !== "AWS::EC2::SubnetCidrBlock") continue;
13637
+ const decl = r.declared;
13638
+ if (decl && typeof decl === "object") markSubnet(decl.SubnetId);
13639
+ }
13640
+ return withSibling;
13641
+ }
13598
13642
  const ECS_SERVICE_TYPE = "AWS::ECS::Service";
13599
13643
  const AUTO_SCALING_GROUP_TYPE = "AWS::AutoScaling::AutoScalingGroup";
13600
13644
  const TARGET_GROUP_TYPE = "AWS::ElasticLoadBalancingV2::TargetGroup";
@@ -13979,6 +14023,7 @@ async function gatherFindings(stackName, region, templateOverride, recoveryTempl
13979
14023
  siblingLifecycleHooks: buildSiblingLifecycleHooks(desired),
13980
14024
  siblingListenerPorts: buildSiblingListenerPorts(desired),
13981
14025
  siblingEipAssociations: buildSiblingEipAssociations(desired),
14026
+ siblingSubnetCidrBlocks: buildSiblingSubnetCidrBlocks(desired),
13982
14027
  siblingTargetGroupRegistrars: buildSiblingTargetGroupRegistrars(desired),
13983
14028
  bucketNotificationManaged: buildBucketNotificationManaged(desired),
13984
14029
  bucketNotificationConfigs: buildBucketNotificationConfigs(desired),
@@ -14054,6 +14099,7 @@ async function regatherTouched(gathered, touched, region) {
14054
14099
  siblingLifecycleHooks: buildSiblingLifecycleHooks(desired),
14055
14100
  siblingListenerPorts: buildSiblingListenerPorts(desired),
14056
14101
  siblingEipAssociations: buildSiblingEipAssociations(desired),
14102
+ siblingSubnetCidrBlocks: buildSiblingSubnetCidrBlocks(desired),
14057
14103
  siblingTargetGroupRegistrars: buildSiblingTargetGroupRegistrars(desired),
14058
14104
  bucketNotificationManaged: buildBucketNotificationManaged(desired),
14059
14105
  bucketNotificationConfigs: buildBucketNotificationConfigs(desired),