@go-to-k/cdkd 0.141.0 → 0.141.1

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
@@ -30170,7 +30170,7 @@ var ECRProvider = class {
30170
30170
  *
30171
30171
  * Each helper is a no-op when the before/after JSON is identical.
30172
30172
  */
30173
- var ASGProvider = class {
30173
+ var ASGProvider = class ASGProvider {
30174
30174
  asgClient;
30175
30175
  providerRegion = process.env["AWS_REGION"];
30176
30176
  logger = getLogger().child("ASGProvider");
@@ -30459,7 +30459,11 @@ var ASGProvider = class {
30459
30459
  result["Tags"] = normalizeAwsTagsToCfn(group.Tags);
30460
30460
  result["MetricsCollection"] = mapEnabledMetricsToCfn(group.EnabledMetrics);
30461
30461
  result["LifecycleHookSpecificationList"] = mapLifecycleHooksToCfn(lifecycleHooks);
30462
- result["TrafficSources"] = mapTrafficSourcesToCfn(trafficSources);
30462
+ result["TrafficSources"] = mapTrafficSourcesToCfn(trafficSources.filter((t) => {
30463
+ if (t.Identifier === void 0) return false;
30464
+ if (t.Type === "elbv2" || t.Type === "elb") return false;
30465
+ return true;
30466
+ }));
30463
30467
  result["NotificationConfigurations"] = mapNotificationsToCfn(notifications);
30464
30468
  return result;
30465
30469
  }
@@ -30468,7 +30472,7 @@ var ASGProvider = class {
30468
30472
  if (!lt) return void 0;
30469
30473
  const out = {};
30470
30474
  if (lt.LaunchTemplateId !== void 0) out.LaunchTemplateId = lt.LaunchTemplateId;
30471
- if (lt.LaunchTemplateName !== void 0) out.LaunchTemplateName = lt.LaunchTemplateName;
30475
+ else if (lt.LaunchTemplateName !== void 0) out.LaunchTemplateName = lt.LaunchTemplateName;
30472
30476
  if (lt.Version !== void 0) out.Version = String(lt.Version);
30473
30477
  if (out.LaunchTemplateId === void 0 && out.LaunchTemplateName === void 0) return;
30474
30478
  return out;
@@ -30630,6 +30634,27 @@ var ASGProvider = class {
30630
30634
  AutoScalingGroupName: physicalId,
30631
30635
  TargetGroupARNs: toAttach
30632
30636
  }));
30637
+ if (toDetach.length > 0 || toAttach.length > 0) await this.waitForTargetGroupArnsConvergence(physicalId, new Set(nextArns));
30638
+ }
30639
+ static TG_CONVERGENCE_TIMEOUT_MS = 3e4;
30640
+ static TG_CONVERGENCE_POLL_INTERVAL_MS = 1e3;
30641
+ async waitForTargetGroupArnsConvergence(physicalId, expected) {
30642
+ const deadlineMs = Date.now() + ASGProvider.TG_CONVERGENCE_TIMEOUT_MS;
30643
+ let lastObserved = /* @__PURE__ */ new Set();
30644
+ while (Date.now() < deadlineMs) {
30645
+ let resp;
30646
+ try {
30647
+ resp = await this.getClient().send(new DescribeAutoScalingGroupsCommand({ AutoScalingGroupNames: [physicalId] }));
30648
+ } catch (err) {
30649
+ this.logger.debug(`applyTargetGroupArnsDiff convergence poll: transient error, retrying — ${err instanceof Error ? err.message : String(err)}`);
30650
+ await new Promise((r) => setTimeout(r, ASGProvider.TG_CONVERGENCE_POLL_INTERVAL_MS));
30651
+ continue;
30652
+ }
30653
+ lastObserved = new Set(resp.AutoScalingGroups?.[0]?.TargetGroupARNs ?? []);
30654
+ if (lastObserved.size === expected.size && [...expected].every((a) => lastObserved.has(a))) return;
30655
+ await new Promise((r) => setTimeout(r, ASGProvider.TG_CONVERGENCE_POLL_INTERVAL_MS));
30656
+ }
30657
+ this.logger.warn(`applyTargetGroupArnsDiff: TG set did not converge within ${ASGProvider.TG_CONVERGENCE_TIMEOUT_MS}ms for ASG ${physicalId}. expected=${JSON.stringify([...expected])} observed=${JSON.stringify([...lastObserved])}`);
30633
30658
  }
30634
30659
  async applyMetricsCollectionDiff(physicalId, next, prev) {
30635
30660
  if (JSON.stringify(next ?? []) === JSON.stringify(prev ?? [])) return;
@@ -55134,7 +55159,7 @@ function reorderArgs(argv) {
55134
55159
  */
55135
55160
  async function main() {
55136
55161
  const program = new Command();
55137
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.141.0");
55162
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.141.1");
55138
55163
  program.addCommand(createBootstrapCommand());
55139
55164
  program.addCommand(createSynthCommand());
55140
55165
  program.addCommand(createListCommand());