@go-to-k/cdkd 0.288.0 → 0.288.2

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.
@@ -1,4 +1,4 @@
1
- import { Cr as displaySafe, Ct as normalizeAwsTagsToCfn, Tt as assertRegionMatch, X as clearOnUpdateRemoval, Yr as ProvisioningError, Zr as ResourceUpdateNotSupportedError, _n as shellQuote, ft as disableInstanceApiTermination, pi as __exportAll } from "./deploy-engine-DF3fAY6q.js";
1
+ import { Cr as displaySafe, Ct as normalizeAwsTagsToCfn, Tt as assertRegionMatch, X as clearOnUpdateRemoval, Yr as ProvisioningError, Zr as ResourceUpdateNotSupportedError, _n as shellQuote, ft as disableInstanceApiTermination, pi as __exportAll } from "./deploy-engine-Cxt3gn8N.js";
2
2
  import { f as generateResourceName, n as getLogger } from "./logger-Dw-3y48G.js";
3
3
  import { t as awsClientDefaults } from "./aws-client-defaults-D-iYiIJ6.js";
4
4
  import { EC2Client } from "@aws-sdk/client-ec2";
@@ -337,15 +337,18 @@ var ASGProvider = class ASGProvider {
337
337
  if (resourceType !== "AWS::AutoScaling::AutoScalingGroup") throw new ProvisioningError(`Unsupported resource type: ${resourceType}`, resourceType, logicalId, physicalId);
338
338
  this.logger.debug(`Updating AutoScalingGroup ${logicalId}: ${physicalId}`);
339
339
  const stringEq = (a, b) => JSON.stringify(a) === JSON.stringify(b);
340
- if (!stringEq(properties["AutoScalingGroupName"], previousProperties["AutoScalingGroupName"])) throw new ResourceUpdateNotSupportedError(resourceType, logicalId, "AutoScalingGroupName is immutable on AWS — UpdateAutoScalingGroup does not accept a new name; the name is fixed at creation. " + (previousProperties["DeletionProtection"] === "prevent-all-deletion" ? protectedReplacementAdvice({
341
- evidence: "cdkd's recorded properties for this group carry DeletionProtection: prevent-all-deletion",
342
- replaceFlags: "cdkd deploy --replace",
343
- disable: {
344
- before: "aws autoscaling update-auto-scaling-group --auto-scaling-group-name",
345
- identifier: physicalId,
346
- after: "--deletion-protection none"
347
- }
348
- }) : "Use cdkd deploy --replace to replace the group."));
340
+ if (!stringEq(properties["AutoScalingGroupName"], previousProperties["AutoScalingGroupName"])) {
341
+ const remedy = previousProperties["DeletionProtection"] === "prevent-all-deletion" ? protectedReplacementAdvice({
342
+ evidence: "cdkd's recorded properties for this group carry DeletionProtection: prevent-all-deletion",
343
+ replaceFlags: "cdkd deploy --replace",
344
+ disable: {
345
+ before: "aws autoscaling update-auto-scaling-group --auto-scaling-group-name",
346
+ identifier: physicalId,
347
+ after: "--deletion-protection none"
348
+ }
349
+ }) : "Use cdkd deploy --replace to replace the group.";
350
+ throw new ResourceUpdateNotSupportedError(resourceType, logicalId, "AutoScalingGroupName is immutable on AWS — UpdateAutoScalingGroup does not accept a new name; the name is fixed at creation. " + remedy);
351
+ }
349
352
  try {
350
353
  await this.applyTagsDiff(physicalId, properties["Tags"], previousProperties["Tags"]);
351
354
  await this.applyLoadBalancerNamesDiff(physicalId, properties["LoadBalancerNames"], previousProperties["LoadBalancerNames"]);
@@ -440,7 +443,8 @@ var ASGProvider = class ASGProvider {
440
443
  await this.waitForGroupDeleted(physicalId);
441
444
  } catch (error) {
442
445
  if (this.isNotFoundError(error)) {
443
- assertRegionMatch(await this.getClient().config.region(), context?.expectedRegion, resourceType, logicalId, physicalId);
446
+ const clientRegion = await this.getClient().config.region();
447
+ assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
444
448
  this.logger.debug(`AutoScalingGroup ${physicalId} does not exist, skipping deletion`);
445
449
  return;
446
450
  }
@@ -994,4 +998,4 @@ function mapNotificationsToCfn(configurations) {
994
998
 
995
999
  //#endregion
996
1000
  export { asg_provider_exports as n, protectedReplacementAdvice as r, ASGProvider as t };
997
- //# sourceMappingURL=asg-provider-DQCVYO5-.js.map
1001
+ //# sourceMappingURL=asg-provider-DUlRn84u.js.map