cdk-real-drift 0.12.60 → 0.12.62

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
@@ -9687,6 +9687,24 @@ const readEc2Eip = async ({ physicalId, region }) => {
9687
9687
  if (tags && tags.length > 0) model.Tags = tags;
9688
9688
  return model;
9689
9689
  };
9690
+ const resolveEc2EipCcIdentifier = async (physicalId, region) => {
9691
+ const id = str$1(physicalId);
9692
+ if (!id || !region) return void 0;
9693
+ try {
9694
+ const c = new EC2Client({
9695
+ region,
9696
+ ...READ_RETRY
9697
+ });
9698
+ const input = id.startsWith("eipalloc-") ? { AllocationIds: [id] } : { PublicIps: [id] };
9699
+ const addr = (await c.send(new DescribeAddressesCommand(input))).Addresses?.[0];
9700
+ const publicIp = str$1(addr?.PublicIp);
9701
+ const allocationId = str$1(addr?.AllocationId);
9702
+ if (!publicIp || !allocationId) return void 0;
9703
+ return `${publicIp}|${allocationId}`;
9704
+ } catch {
9705
+ return;
9706
+ }
9707
+ };
9690
9708
  const dimSetEqual = (a, b) => {
9691
9709
  const norm = (v) => JSON.stringify((Array.isArray(v) ? v : []).map((d) => [str$1(d.Name) ?? "", str$1(d.Value) ?? ""]).sort((x, y) => x[0] === y[0] ? x[1].localeCompare(y[1]) : x[0].localeCompare(y[0])));
9692
9710
  return norm(a) === norm(b);
@@ -11994,7 +12012,8 @@ const CC_IDENTIFIER_ADAPTERS = {
11994
12012
  const { partition } = partitionForRegion(region);
11995
12013
  return `arn:${partition}:events:${region}:${account}:rule/${busName}/${ruleName}`;
11996
12014
  }
11997
- }
12015
+ },
12016
+ "AWS::EC2::EIP": (physicalId, _declared, region) => resolveEc2EipCcIdentifier(physicalId, region ?? "")
11998
12017
  };
11999
12018
  function scalingPolicyComposite(pid, declared) {
12000
12019
  if (pid.includes("|")) return pid;
@@ -12047,7 +12066,7 @@ async function readLive(cc, resource, region, accountId) {
12047
12066
  return { skippedReason: `SDK override (${resourceType}): ${e.name}` };
12048
12067
  }
12049
12068
  try {
12050
- const identifier = CC_IDENTIFIER_ADAPTERS[resourceType]?.(physicalId ?? "", declared, region, accountId) ?? physicalId ?? "";
12069
+ const identifier = await CC_IDENTIFIER_ADAPTERS[resourceType]?.(physicalId ?? "", declared, region, accountId) ?? physicalId ?? "";
12051
12070
  const g = await cc.send(new GetResourceCommand({
12052
12071
  TypeName: resourceType,
12053
12072
  Identifier: identifier
@@ -16152,7 +16171,11 @@ const SYNTHETIC_READ_SIGNAL_PATHS = {
16152
16171
  "AWS::Lambda::Function": ["CodeSha256"],
16153
16172
  "AWS::Glue::Job": ["ScriptSha256"]
16154
16173
  };
16155
- const CC_REVERTABLE_DESPITE_READ_OVERRIDE = new Set(["AWS::Scheduler::Schedule", "AWS::Cognito::IdentityPool"]);
16174
+ const CC_REVERTABLE_DESPITE_READ_OVERRIDE = new Set([
16175
+ "AWS::Scheduler::Schedule",
16176
+ "AWS::Cognito::IdentityPool",
16177
+ "AWS::EC2::EIP"
16178
+ ]);
16156
16179
  const REVERT_SET_DEFAULT_PATHS = new Set([
16157
16180
  "AWS::IAM::Role\0MaxSessionDuration",
16158
16181
  "AWS::IAM::Role\0Description",
@@ -16550,6 +16573,15 @@ function buildRevertPlan(findings, baseline, opts = {}) {
16550
16573
  });
16551
16574
  continue;
16552
16575
  }
16576
+ if (CC_UPDATE_REJECTED_TYPES.has(f.resourceType) && !SDK_WRITERS[f.resourceType] && !propScoped && !nestedScoped) {
16577
+ notRevertable.push({
16578
+ displayId,
16579
+ resourceType: f.resourceType,
16580
+ path: f.path,
16581
+ reason: "type rejects any Cloud Control patch (Tags minItems:1) — no SDK writer for this path, detect/record only"
16582
+ });
16583
+ continue;
16584
+ }
16553
16585
  const kind = SDK_WRITERS[f.resourceType] || propScoped || nestedScoped ? "sdk" : "cc";
16554
16586
  let toRevert = f;
16555
16587
  const sgSide = f.tier === "declared" && f.resourceType === "AWS::EC2::SecurityGroup" ? SG_REVERT_SIDE[f.path] : void 0;
@@ -16716,6 +16748,7 @@ function tagPreservingOps(ops, liveRaw) {
16716
16748
  });
16717
16749
  return changed ? out : ops;
16718
16750
  }
16751
+ const CC_UPDATE_REJECTED_TYPES = new Set(["AWS::KinesisVideo::Stream", "AWS::KinesisVideo::SignalingChannel"]);
16719
16752
  const CC_UPDATE_REJECTED_EMPTY_PATHS = {
16720
16753
  "AWS::VpcLattice::Rule": ["/Match/HttpMatch/HeaderMatches"],
16721
16754
  "AWS::ImageBuilder::DistributionConfiguration": [
@@ -17766,7 +17799,7 @@ async function revertStack(p) {
17766
17799
  try {
17767
17800
  const writer = resolveSdkWriter(item.resourceType, item.ops);
17768
17801
  if (!writer) throw new Error(`no SDK writer for ${item.resourceType}`);
17769
- const identifier = CC_IDENTIFIER_ADAPTERS[item.resourceType]?.(item.physicalId, res?.declared ?? {}, region, gathered.desired.accountId) ?? item.physicalId;
17802
+ const identifier = await CC_IDENTIFIER_ADAPTERS[item.resourceType]?.(item.physicalId, res?.declared ?? {}, region, gathered.desired.accountId) ?? item.physicalId;
17770
17803
  await writer({
17771
17804
  physicalId: item.physicalId,
17772
17805
  identifier,
@@ -17785,7 +17818,7 @@ async function revertStack(p) {
17785
17818
  }, buildRetryOpts(item.displayId));
17786
17819
  } else {
17787
17820
  const res = resByLogical.get(item.logicalId);
17788
- r = await applyRevertItem(cc, item, CC_IDENTIFIER_ADAPTERS[item.resourceType]?.(item.physicalId, res?.declared ?? {}, region, gathered.desired.accountId) ?? item.physicalId, buildRetryOpts(item.displayId));
17821
+ r = await applyRevertItem(cc, item, await CC_IDENTIFIER_ADAPTERS[item.resourceType]?.(item.physicalId, res?.declared ?? {}, region, gathered.desired.accountId) ?? item.physicalId, buildRetryOpts(item.displayId));
17789
17822
  }
17790
17823
  applied.push({
17791
17824
  logicalId: item.logicalId,