cdk-real-drift 0.9.6 → 0.9.7

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
@@ -2985,12 +2985,18 @@ const VALUE_INDEPENDENT_DEFAULT_TOPLEVEL_PATHS = {
2985
2985
  "AWS::Glue::Job": new Set(["MaxCapacity", "AllocatedCapacity"]),
2986
2986
  "AWS::EC2::SecurityGroupIngress": new Set(["SourceSecurityGroupName"]),
2987
2987
  "AWS::EC2::SecurityGroupEgress": new Set(["DestinationSecurityGroupName"]),
2988
- "AWS::DocDB::DBCluster": new Set(["PreferredMaintenanceWindow", "PreferredBackupWindow"]),
2988
+ "AWS::DocDB::DBCluster": new Set([
2989
+ "PreferredMaintenanceWindow",
2990
+ "PreferredBackupWindow",
2991
+ "EngineVersion",
2992
+ "KmsKeyId"
2993
+ ]),
2989
2994
  "AWS::DocDB::DBInstance": new Set(["PreferredMaintenanceWindow"]),
2990
2995
  "AWS::Neptune::DBCluster": new Set([
2991
2996
  "PreferredMaintenanceWindow",
2992
2997
  "PreferredBackupWindow",
2993
- "EngineVersion"
2998
+ "EngineVersion",
2999
+ "AvailabilityZones"
2994
3000
  ]),
2995
3001
  "AWS::Neptune::DBInstance": new Set(["PreferredMaintenanceWindow", "AvailabilityZone"]),
2996
3002
  "AWS::ElastiCache::CacheCluster": new Set([
@@ -3036,6 +3042,7 @@ const VALUE_INDEPENDENT_DEFAULT_TOPLEVEL_PATHS = {
3036
3042
  "AWS::EC2::VPCEndpoint": new Set(["ServiceRegion", "DnsOptions"]),
3037
3043
  "AWS::EC2::VPCPeeringConnection": new Set(["PeerRegion"]),
3038
3044
  "AWS::EC2::VPCCidrBlock": new Set(["Ipv6CidrBlock", "Ipv6CidrBlockNetworkBorderGroup"]),
3045
+ "AWS::EC2::TransitGateway": new Set(["AssociationDefaultRouteTableId", "PropagationDefaultRouteTableId"]),
3039
3046
  "AWS::Grafana::Workspace": new Set(["GrafanaVersion"]),
3040
3047
  "AWS::Bedrock::AgentAlias": new Set(["RoutingConfiguration"]),
3041
3048
  "AWS::AppSync::ApiKey": new Set(["Expires"]),
@@ -6549,8 +6556,15 @@ async function getAllGatewayResponses(client, apiId) {
6549
6556
  } while (position);
6550
6557
  return out;
6551
6558
  }
6559
+ function isBodyDefinedHttpApi(declared) {
6560
+ return declared.Body != null || declared.BodyS3Location != null;
6561
+ }
6562
+ function isQuickCreateHttpApi(declared) {
6563
+ return declared.Target != null;
6564
+ }
6552
6565
  function diffApiGatewayV2Children(input) {
6553
- const { apiId, declaredRouteIds, declaredIntegrationIds, liveRoutes, liveIntegrations } = input;
6566
+ const { apiId, declaredRouteIds, declaredIntegrationIds, liveRoutes, liveIntegrations, specMaterialized } = input;
6567
+ if (specMaterialized) return [];
6554
6568
  const declaredRoutes = new Set(declaredRouteIds);
6555
6569
  const declaredIntegrations = new Set(declaredIntegrationIds);
6556
6570
  const added = [];
@@ -6608,7 +6622,8 @@ async function pageIntegrations(client, apiId) {
6608
6622
  return out;
6609
6623
  }
6610
6624
  function diffApiGatewayV2Authorizers(input) {
6611
- const { apiId, declaredAuthorizerIds, liveAuthorizers } = input;
6625
+ const { apiId, declaredAuthorizerIds, liveAuthorizers, bodyDefined } = input;
6626
+ if (bodyDefined) return [];
6612
6627
  const declared = new Set(declaredAuthorizerIds);
6613
6628
  const added = [];
6614
6629
  for (const a of liveAuthorizers) {
@@ -6639,11 +6654,12 @@ async function pageV2Authorizers(client, apiId) {
6639
6654
  return out;
6640
6655
  }
6641
6656
  function diffApiGatewayV2Stages(input) {
6642
- const { apiId, declaredStageNames, liveStages } = input;
6657
+ const { apiId, declaredStageNames, liveStages, quickCreate } = input;
6643
6658
  const declared = new Set(declaredStageNames);
6644
6659
  const added = [];
6645
6660
  for (const s of liveStages) {
6646
6661
  if (declared.has(s.name)) continue;
6662
+ if (quickCreate && s.name === "$default") continue;
6647
6663
  added.push({
6648
6664
  resourceType: "AWS::ApiGatewayV2::Stage",
6649
6665
  identifier: `${apiId}|${s.name}`,
@@ -6673,6 +6689,9 @@ async function enumerateHttpApiChildren(ctx) {
6673
6689
  const { parent, desired, region } = ctx;
6674
6690
  const apiId = parent.physicalId;
6675
6691
  if (!apiId) return [];
6692
+ const bodyDefined = isBodyDefinedHttpApi(parent.declared);
6693
+ const quickCreate = isQuickCreateHttpApi(parent.declared);
6694
+ const specMaterialized = bodyDefined || quickCreate;
6676
6695
  const declaredRouteIds = [];
6677
6696
  const declaredIntegrationIds = [];
6678
6697
  const declaredAuthorizerIds = [];
@@ -6715,17 +6734,20 @@ async function enumerateHttpApiChildren(ctx) {
6715
6734
  declaredRouteIds,
6716
6735
  declaredIntegrationIds,
6717
6736
  liveRoutes,
6718
- liveIntegrations
6737
+ liveIntegrations,
6738
+ specMaterialized
6719
6739
  });
6720
6740
  const authorizerAdded = diffApiGatewayV2Authorizers({
6721
6741
  apiId,
6722
6742
  declaredAuthorizerIds,
6723
- liveAuthorizers
6743
+ liveAuthorizers,
6744
+ bodyDefined
6724
6745
  });
6725
6746
  const stageAdded = diffApiGatewayV2Stages({
6726
6747
  apiId,
6727
6748
  declaredStageNames,
6728
- liveStages
6749
+ liveStages,
6750
+ quickCreate
6729
6751
  });
6730
6752
  return added.concat(authorizerAdded, stageAdded);
6731
6753
  }
@@ -10417,7 +10439,16 @@ async function readAddedModel(cc, cfn, c, schemas, oaiCanonicalIds) {
10417
10439
  };
10418
10440
  }
10419
10441
  }
10420
- async function isManagedBySiblingStack(cfn, c, cache) {
10442
+ function isDefinitiveNotManaged(physicalId, accountId, region) {
10443
+ if (!physicalId.startsWith("arn:")) return true;
10444
+ const seg = physicalId.split(":");
10445
+ const arnRegion = seg[3] ?? "";
10446
+ const arnAccount = seg[4] ?? "";
10447
+ if (arnRegion !== "" && arnRegion !== region) return false;
10448
+ if (arnAccount !== "" && arnAccount !== accountId) return false;
10449
+ return true;
10450
+ }
10451
+ async function isManagedBySiblingStack(cfn, c, cache, accountId, region) {
10421
10452
  const physicalId = c.siblingLookupId ?? c.identifier;
10422
10453
  if (c.siblingLookupId === void 0 && physicalId.includes("|")) return "notManaged";
10423
10454
  const cached = cache.get(physicalId);
@@ -10446,7 +10477,7 @@ async function isManagedBySiblingStack(cfn, c, cache) {
10446
10477
  }
10447
10478
  }
10448
10479
  } catch (e) {
10449
- if (e.name === "ValidationError") {
10480
+ if (e.name === "ValidationError" && isDefinitiveNotManaged(physicalId, accountId, region)) {
10450
10481
  cache.set(physicalId, "notManaged");
10451
10482
  return "notManaged";
10452
10483
  }
@@ -10737,7 +10768,7 @@ async function gatherFindings(stackName, region, templateOverride, recoveryTempl
10737
10768
  region
10738
10769
  });
10739
10770
  for (const c of children) {
10740
- const sibling = await isManagedBySiblingStack(cfn, c, siblingStackCache);
10771
+ const sibling = await isManagedBySiblingStack(cfn, c, siblingStackCache, desired.accountId, region);
10741
10772
  if (sibling === "managed") continue;
10742
10773
  if (sibling === "unverified") {
10743
10774
  findings.push({