@go-to-k/cdkd 0.301.2 → 0.301.4

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.
Files changed (31) hide show
  1. package/dist/{asg-provider--t5d-gjf.js → asg-provider--GY-B-zI.js} +8 -15
  2. package/dist/asg-provider--GY-B-zI.js.map +1 -0
  3. package/dist/cli.js +2 -2
  4. package/dist/{deploy-engine--5XWdjW3.js → deploy-engine-BIPU9Xdh.js} +1524 -1184
  5. package/dist/deploy-engine-BIPU9Xdh.js.map +1 -0
  6. package/dist/{iam-policy-targets-DFk7zr0Q.js → iam-policy-targets-BkeM7IXi.js} +6 -3
  7. package/dist/iam-policy-targets-BkeM7IXi.js.map +1 -0
  8. package/dist/{iam-role-provider-Bwgqyn6-.js → iam-role-provider-C58oW5zG.js} +7 -6
  9. package/dist/iam-role-provider-C58oW5zG.js.map +1 -0
  10. package/dist/index.d.ts +3 -5
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +3 -3
  13. package/dist/{neptune-provider-DjEVKBcV.js → neptune-provider-DoKgbZCz.js} +14 -16
  14. package/dist/neptune-provider-DoKgbZCz.js.map +1 -0
  15. package/dist/{program-DEPit8lD.js → program-DYfZCsxM.js} +131 -260
  16. package/dist/program-DYfZCsxM.js.map +1 -0
  17. package/dist/{provider-classes-CDxfoC_T.js → provider-classes-BSUoljqw.js} +383 -414
  18. package/dist/provider-classes-BSUoljqw.js.map +1 -0
  19. package/dist/{rds-provider-BvZhdkOC.js → rds-provider-DI_O0_iG.js} +14 -14
  20. package/dist/rds-provider-DI_O0_iG.js.map +1 -0
  21. package/dist/{version-DUYEmFtp.js → version-Bft5jrTk.js} +2 -2
  22. package/dist/{version-DUYEmFtp.js.map → version-Bft5jrTk.js.map} +1 -1
  23. package/package.json +2 -2
  24. package/dist/asg-provider--t5d-gjf.js.map +0 -1
  25. package/dist/deploy-engine--5XWdjW3.js.map +0 -1
  26. package/dist/iam-policy-targets-DFk7zr0Q.js.map +0 -1
  27. package/dist/iam-role-provider-Bwgqyn6-.js.map +0 -1
  28. package/dist/neptune-provider-DjEVKBcV.js.map +0 -1
  29. package/dist/program-DEPit8lD.js.map +0 -1
  30. package/dist/provider-classes-CDxfoC_T.js.map +0 -1
  31. package/dist/rds-provider-BvZhdkOC.js.map +0 -1
@@ -1,13 +1,13 @@
1
1
  import { r as getAwsClients } from "./aws-clients-B_CEQGE1.js";
2
2
  import { B as safeMsg, F as displaySafe, I as displayStackName, L as isPasteableIdent, O as SECRET_REF_MAX_CODE_POINTS, P as displayIdent, a as getLogger, b as generateResourceNameWithFallback, n as isAwsAuthoredFailure, r as safeStringify, t as describeAwsFailure, y as generateResourceName, z as plainIdentOr } from "./aws-failure-text-BEQfs6za.js";
3
- import { $ as protectedReplacementAdvice, $n as explicitDenyPolicyKind, $t as ambientCredentialConfig, A as isQuotableImportValue, B as isTerminalDeleteFailure, C as setBounded, D as VALUE_NOT_SHOWN, E as assertRegionMatch, F as resolveExplicitPhysicalId, Fn as isInertUnquoted, H as observeThenDisableProtection, Hn as withheldTargetClause, In as pasteableCommand, Kt as injectiveKey, L as ProtectionFlipRegistry, M as quotedRemedyLogicalId, Mt as markCreatedBeforeFailure, N as refusalTypeShown, Nn as commandHole, Nt as markSupersedesEarlierCreate, O as isPlainImportJson, P as remedyLogicalId, Pn as hasClauseBreak, Q as pasteableAwsCommand, Qn as markReplayMayCollide, Qt as ambientClientDefaults, Rn as plainOrDescribed, S as replayedSendWindow, St as withDerivedNameMasks, T as RESOURCE_NOT_FOUND, Tt as clearCreatedBeforeFailure, U as protectionFlipKey, V as logGroupProtectionSite, Vn as shellQuote, W as rdsFamilyProtectionSite, X as WITHHELD_AWS_COMMAND, Y as UNNAMEABLE_ID_CLAUSE, Z as isAwsCliLiteral, Zn as markNameCollision, Zt as withPasteableAwsProfile, _ as RecentIdSet, _t as createMaskedLogSinks, a as onlySecretDerived, ar as isRetryableTransientError, at as startInterruptWatch, b as isInsideWindow, bn as ResourceUpdateNotSupportedError, bt as maskDeep, c as recordedPrincipalsRepair, cr as THROTTLING_ERROR_NAMES, ct as canonicalizeRoute53QueryName, dr as markNonRetryable, dt as compositeIdSkipResult, en as clientDefaultsFor, et as renderDisableCommand, fr as markRedactedCause, ft as logicalIdShown, g as AmbiguousCreateLatch, gt as stateOrphanRecordRemedy, h as AMBIGUOUS_LATCH_TTL_MS, ht as segmentAfterAnchor, i as holdsSecretDerivedEntry, in as CdkdError, it as isInterruptedWaitError, j as normalizeAwsTagsToCfn, jt as markAuxiliaryFailure, k as isPlainImportValue, lr as isMarkedNonRetryable, lt as compositeIdFormatMessage, nn as AccountIdUnavailableError, nr as isAmbiguousOutcomeError, o as readPrincipalLists, or as isTransientServerError, ot as ElapsedBudgetRegistry, p as withRemovalDefaults, pr as wrapMaskedAwsError, pt as packCompositeId, q as userPoolProtectionSite, qt as injectiveKeyPrefix, r as SECRET_DERIVED_READ_LIVE, rr as isExplicitDenyError, tn as credentialFingerprint, u as clearOnUpdateRemoval, ur as isThrottlingError, ut as compositeIdSeparatorRefusal, v as ambiguousAttemptLead, vn as ProvisioningError, vt as createMaskedRetryLogger, w as withoutServerErrorRetries, x as replayFollowedAmbiguousAttempt, xt as maskerOrIdentity, y as createAttemptKey, yt as isSecretDerivedValue, z as deleteWithProtectionCompensation } from "./iam-policy-targets-DFk7zr0Q.js";
3
+ import { $ as protectedReplacementAdvice, $n as explicitDenyPolicyKind, $t as ambientCredentialConfig, A as isQuotableImportValue, B as isTerminalDeleteFailure, C as setBounded, D as VALUE_NOT_SHOWN, E as assertRegionMatch, F as resolveExplicitPhysicalId, Fn as isInertUnquoted, H as observeThenDisableProtection, Hn as withheldTargetClause, In as pasteableCommand, Kt as injectiveKey, L as ProtectionFlipRegistry, M as quotedRemedyLogicalId, Mt as markCreatedBeforeFailure, N as refusalTypeShown, Nn as commandHole, Nt as markSupersedesEarlierCreate, O as isPlainImportJson, P as remedyLogicalId, Pn as hasClauseBreak, Q as pasteableAwsCommand, Qn as markReplayMayCollide, Qt as ambientClientDefaults, Rn as plainOrDescribed, S as replayedSendWindow, St as withDerivedNameMasks, T as RESOURCE_NOT_FOUND, Tt as clearCreatedBeforeFailure, U as protectionFlipKey, V as logGroupProtectionSite, Vn as shellQuote, W as rdsFamilyProtectionSite, X as WITHHELD_AWS_COMMAND, Y as UNNAMEABLE_ID_CLAUSE, Z as isAwsCliLiteral, Zn as markNameCollision, Zt as withPasteableAwsProfile, _ as RecentIdSet, _t as createMaskedLogSinks, a as onlySecretDerived, ar as isRetryableTransientError, at as startInterruptWatch, b as isInsideWindow, bn as ResourceUpdateNotSupportedError, bt as maskDeep, c as recordedPrincipalsRepair, cr as THROTTLING_ERROR_NAMES, ct as canonicalizeRoute53QueryName, dr as markNonRetryable, dt as compositeIdSkipResult, en as clientDefaultsFor, et as renderDisableCommand, fr as markRedactedCause, ft as logicalIdShown, g as AmbiguousCreateLatch, gt as stateOrphanRecordRemedy, h as AMBIGUOUS_LATCH_TTL_MS, ht as segmentAfterAnchor, i as holdsSecretDerivedEntry, in as CdkdError, it as isInterruptedWaitError, j as normalizeAwsTagsToCfn, jt as markAuxiliaryFailure, k as isPlainImportValue, lr as isMarkedNonRetryable, lt as compositeIdFormatMessage, nn as AccountIdUnavailableError, nr as isAmbiguousOutcomeError, o as readPrincipalLists, or as isTransientServerError, ot as ElapsedBudgetRegistry, p as withRemovalDefaults, pr as wrapMaskedAwsError, pt as packCompositeId, q as userPoolProtectionSite, qt as injectiveKeyPrefix, r as SECRET_DERIVED_READ_LIVE, rr as isExplicitDenyError, tn as credentialFingerprint, u as clearOnUpdateRemoval, ur as isThrottlingError, ut as compositeIdSeparatorRefusal, v as ambiguousAttemptLead, vn as ProvisioningError, vt as createMaskedRetryLogger, w as withoutServerErrorRetries, x as replayFollowedAmbiguousAttempt, xt as maskerOrIdentity, y as createAttemptKey, yt as isSecretDerivedValue, z as deleteWithProtectionCompensation } from "./iam-policy-targets-BkeM7IXi.js";
4
4
  import { s as ambientRegion } from "./aws-client-defaults-DBXBcg0J.js";
5
- import { $ as S3_AUTO_DELETE_OBJECTS_TAG, Bl as renderAssemblyPathEscape, Br as deleteSkipReason, C as withApiLimit, Co as configIntegerRefusal, Dl as canonicalizeRegion, Do as requireConfigArray, Ds as recoverMaskedOutput, Eo as replayWarn, Fo as lambdaFunctionNameForMask, Fr as unchangedBehindSecretReference, G as deleteBudgetKey, Gr as ec2InstanceProtectionSite, Gt as awaitInFlightSibling, H as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, Hi as passedParameterClassesOf, Hr as isWaitAbandonedError, Ht as withNestedStackContext, Io as sameLambdaFunctionAddress, J as DELETE_INDEX_WAIT_PROCEED_NOTE, Jo as passedNoEchoParametersOf, Jr as reDisableInstanceApiTermination, K as resolveDynamoDbDeleteBudgetClock, Kr as isTerminationProtectionPropagationError, Lt as revertNestedChildFromJournal, Ms as carriesSecretMask, No as withRetry, Ol as derivePartitionAndUrlSuffix, Oo as requireConfigObject, Or as getCurrentResourceSecrets, Os as physicalNameCopiesOf, Po as canonicalLambdaFunctionName, Pr as slowCcOperationTimeoutMs, Pt as getNestedRevertRun, Q as ECR_AUTO_DELETE_IMAGES_TAG, Rl as describeFileReadFailure, S as lookupEachName, Sc as rewriteTemplateAssetReferences, So as configBooleanRefusal, To as readConfigString, U as beginDeleteWait, Ur as markWaitAbandoned, V as DynamoDBGlobalTableProvider, Vl as resolveAssemblyPath, Vr as withIndeterminateGuard, Vt as getCurrentNestedStackContext, W as compensateRemovedDeletionProtection, Wa as refuseMalformedResourcesForDestroy, X as deleteTableWithIndexBusyRetry, Xt as replacedDeleteFailureVerdict, Y as INDEX_SETTLE_POLL_INTERVAL_MS, Yi as accountArgs, Yr as reEnableInstanceApiTermination, Z as waitForIndexesSettled, _c as stringifyValue, _i as s3BucketArn, _o as isWarmThroughputDecrease, _r as tagPlanWarning, b as chunks, bi as s3BucketRegionalDomainName, bo as coerceCfnBoolean, c as isAbsoluteAssetPath, cr as acquireIdempotencyToken, dn as REDACTED_DELETE_ADDRESS_SKIP_REASON, dr as DBPROXY_TAGS_WHAT, et as hasCdkAutoDeleteTag, fi as isSettledInstanceState, fn as isRedactedRecordedValue, fr as DBPROXY_TAG_OPTIONS, go as coerceWarmThroughput$1, gr as tagMapAsList, gs as redactSecretsForState, ho as WARM_THROUGHPUT_MEMBERS, hr as refuseMalformedDesiredTags, hs as snapshotPassProvenance, io as findSilentDropProperties, ir as earliestDefined, ki as getAccountInfo, ko as requireConfigString, ks as recordAttributeIdCopy, l as listNestedTemplateRows, ln as getCurrentProducerRegions, lr as isRefusedByName, mi as outputReferenceProvenanceOf, mn as redactedDeleteAddressSkip, mr as readTagList, ms as recordReferenceProvenanceEntry, no as withheldAccountClause, nt as getPriorAttempts, oo as withoutSilentDropProperties, or as reserveStackCreateToken, pn as redactedDeleteAddressFields, pr as planTagDiff, ps as markSameGenerationBag, q as resolveDynamoDbDeleteBudgetMs, qr as observeThenDisableInstanceApiTermination, qt as getStackRecords, rt as markRefusedBeforeApplying, s as findNestedTemplateTreeDefect, t as DeployEngine, ts as hasMaskableValues, tt as isTruthyCfnBoolean, u as renderNestedTemplateTreeDefect, ur as markDeleteStarted, vi as s3BucketDomainName, vo as toCfnInteger, vr as definedAttributes, wa as refuseMalformedNestedChildOutputs, wl as decodeListingKey, wo as configStringRefusal, x as isAccessDeniedError, xi as s3BucketWebsiteUrl, xo as coerceCfnInteger, xs as dynamicReferenceTokens, yi as s3BucketDualStackDomainName, yo as toFiniteNumber, yr as stringifyIfAssigned, ys as withoutPhysicalNameCopies, zi as parseWebACLArn, zl as displayAssemblyPath } from "./deploy-engine--5XWdjW3.js";
6
- import { n as collectInlinePolicyNamesManagedBySiblings, r as IamCreateClientCache, t as IAMRoleProvider } from "./iam-role-provider-Bwgqyn6-.js";
7
- import { a as resolveSecretDerivedPrincipals, i as isResolvableSecretPrincipalList, n as runDestroyForStack, o as canonicalizeIpProtocolValue, r as holdsUnprovenSecretPrincipalToken, s as resolvedResourceTimeoutMs, t as canonicalizeIpv4Cidr } from "./program-DEPit8lD.js";
8
- import { RDSProvider } from "./rds-provider-BvZhdkOC.js";
9
- import { NeptuneProvider } from "./neptune-provider-DjEVKBcV.js";
10
- import { ASGProvider } from "./asg-provider--t5d-gjf.js";
5
+ import { $ as markRefusedBeforeApplying, Ao as requireConfigArray, B as compensateRemovedDeletionProtection, Ci as s3BucketRegionalDomainName, Co as coerceCfnBoolean, Cs as withoutPhysicalNameCopies, Da as refuseMalformedNestedChildOutputs, Do as configStringRefusal, Dr as waitForLambdaFunctionActive, Ec as rewriteTemplateAssetReferences, Eo as configIntegerRefusal, G as INDEX_SETTLE_POLL_INTERVAL_MS, Gi as passedParameterClassesOf, Gl as resolveAssemblyPath, Gr as isWaitAbandonedError, Gt as awaitInFlightSibling, H as resolveDynamoDbDeleteBudgetClock, Hi as parseWebACLArn, Hl as describeFileReadFailure, Hn as secretNamedAttributeNamesOf, Ht as withNestedStackContext, Io as withRetry, Is as carriesSecretMask, J as ECR_AUTO_DELETE_IMAGES_TAG, Jr as ec2InstanceProtectionSite, K as deleteTableWithIndexBusyRetry, Kr as markWaitAbandoned, L as DynamoDBGlobalTableProvider, Lo as canonicalLambdaFunctionName, Lr as slowCcOperationTimeoutMs, Lt as revertNestedChildFromJournal, Mi as getAccountInfo, Ml as derivePartitionAndUrlSuffix, Mo as requireConfigString, Ms as physicalNameCopiesOf, Ns as recordAttributeIdCopy, Ol as decodeListingKey, Oo as readConfigString, Pt as getNestedRevertRun, Q as getPriorAttempts, Qi as accountArgs, Qr as reEnableInstanceApiTermination, R as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, Ro as lambdaFunctionNameForMask, Rr as unchangedBehindSecretReference, Si as s3BucketDualStackDomainName, So as toFiniteNumber, To as configBooleanRefusal, Ts as dynamicReferenceTokens, U as resolveDynamoDbDeleteBudgetMs, Ul as displayAssemblyPath, Ur as deleteSkipReason, V as deleteBudgetKey, Vt as getCurrentNestedStackContext, W as DELETE_INDEX_WAIT_PROCEED_NOTE, Wl as renderAssemblyPathEscape, Wr as withIndeterminateGuard, X as hasCdkAutoDeleteTag, Xr as observeThenDisableInstanceApiTermination, Xt as replacedDeleteFailureVerdict, Y as S3_AUTO_DELETE_OBJECTS_TAG, Yr as isTerminationProtectionPropagationError, Z as isTruthyCfnBoolean, Zo as passedNoEchoParametersOf, Zr as reDisableInstanceApiTermination, _i as outputReferenceProvenanceOf, _r as refuseMalformedDesiredTags, _s as markSameGenerationBag, a as findNestedTemplateTreeDefect, ao as withheldAccountClause, as as hasMaskableValues, b as lookupEachName, bi as s3BucketArn, bo as isWarmThroughputDecrease, br as definedAttributes, bs as redactSecretsForState, c as renderNestedTemplateTreeDefect, cr as reserveStackCreateToken, dn as REDACTED_DELETE_ADDRESS_SKIP_REASON, dr as isRefusedByName, fn as isRedactedRecordedValue, fr as markDeleteStarted, gr as readTagList, hi as isSettledInstanceState, hr as planTagDiff, jl as canonicalizeRegion, jo as requireConfigObject, jr as getCurrentResourceSecrets, js as recoverMaskedOutput, ko as replayWarn, ln as getCurrentProducerRegions, lo as withoutSilentDropProperties, mn as redactedDeleteAddressSkip, mr as DBPROXY_TAG_OPTIONS, o as isAbsoluteAssetPath, or as earliestDefined, pn as redactedDeleteAddressFields, pr as DBPROXY_TAGS_WHAT, q as waitForIndexesSettled, qa as refuseMalformedResourcesForDestroy, qt as getStackRecords, s as listNestedTemplateRows, so as findSilentDropProperties, t as DeployEngine, ur as acquireIdempotencyToken, v as chunks, vo as WARM_THROUGHPUT_MEMBERS, vr as tagMapAsList, vs as recordReferenceProvenanceEntry, wi as s3BucketWebsiteUrl, wo as coerceCfnInteger, x as withApiLimit, xc as stringifyValue, xi as s3BucketDomainName, xo as toCfnInteger, xr as stringifyIfAssigned, y as isAccessDeniedError, yo as coerceWarmThroughput$1, yr as tagPlanWarning, ys as snapshotPassProvenance, z as beginDeleteWait, zo as sameLambdaFunctionAddress } from "./deploy-engine-BIPU9Xdh.js";
6
+ import { n as collectInlinePolicyNamesManagedBySiblings, r as IamCreateClientCache, t as IAMRoleProvider } from "./iam-role-provider-C58oW5zG.js";
7
+ import { a as resolveSecretDerivedPrincipals, i as isResolvableSecretPrincipalList, n as runDestroyForStack, o as canonicalizeIpProtocolValue, r as holdsUnprovenSecretPrincipalToken, s as resolvedResourceTimeoutMs, t as canonicalizeIpv4Cidr } from "./program-DYfZCsxM.js";
8
+ import { RDSProvider } from "./rds-provider-DI_O0_iG.js";
9
+ import { NeptuneProvider } from "./neptune-provider-DoKgbZCz.js";
10
+ import { ASGProvider } from "./asg-provider--GY-B-zI.js";
11
11
  import { createHash, randomUUID } from "node:crypto";
12
12
  import { CreateBucketCommand, DeleteBucketAnalyticsConfigurationCommand, DeleteBucketCommand, DeleteBucketCorsCommand, DeleteBucketEncryptionCommand, DeleteBucketIntelligentTieringConfigurationCommand, DeleteBucketInventoryConfigurationCommand, DeleteBucketLifecycleCommand, DeleteBucketMetricsConfigurationCommand, DeleteBucketOwnershipControlsCommand, DeleteBucketPolicyCommand, DeleteBucketReplicationCommand, DeleteBucketTaggingCommand, DeleteBucketWebsiteCommand, DeleteObjectsCommand, GetBucketAccelerateConfigurationCommand, GetBucketCorsCommand, GetBucketEncryptionCommand, GetBucketLifecycleConfigurationCommand, GetBucketLocationCommand, GetBucketLoggingCommand, GetBucketNotificationConfigurationCommand, GetBucketOwnershipControlsCommand, GetBucketPolicyCommand, GetBucketReplicationCommand, GetBucketTaggingCommand, GetBucketVersioningCommand, GetBucketWebsiteCommand, GetObjectCommand, GetObjectLockConfigurationCommand, GetPublicAccessBlockCommand, HeadBucketCommand, ListBucketAnalyticsConfigurationsCommand, ListBucketIntelligentTieringConfigurationsCommand, ListBucketInventoryConfigurationsCommand, ListBucketMetricsConfigurationsCommand, ListBucketsCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchBucket, PutBucketAccelerateConfigurationCommand, PutBucketAnalyticsConfigurationCommand, PutBucketCorsCommand, PutBucketEncryptionCommand, PutBucketIntelligentTieringConfigurationCommand, PutBucketInventoryConfigurationCommand, PutBucketLifecycleConfigurationCommand, PutBucketLoggingCommand, PutBucketMetricsConfigurationCommand, PutBucketNotificationConfigurationCommand, PutBucketOwnershipControlsCommand, PutBucketPolicyCommand, PutBucketReplicationCommand, PutBucketTaggingCommand, PutBucketVersioningCommand, PutBucketWebsiteCommand, PutObjectLockConfigurationCommand, PutPublicAccessBlockCommand, S3Client } from "@aws-sdk/client-s3";
13
13
  import { AddRoleToInstanceProfileCommand, AddUserToGroupCommand, AttachGroupPolicyCommand, AttachRolePolicyCommand, AttachUserPolicyCommand, CreateAccessKeyCommand, CreateGroupCommand, CreateInstanceProfileCommand, CreateLoginProfileCommand, CreatePolicyCommand, CreatePolicyVersionCommand, CreateUserCommand, DeleteAccessKeyCommand, DeleteGroupCommand, DeleteGroupPolicyCommand, DeleteInstanceProfileCommand, DeleteLoginProfileCommand, DeletePolicyCommand, DeletePolicyVersionCommand, DeleteRolePolicyCommand, DeleteUserCommand, DeleteUserPermissionsBoundaryCommand, DeleteUserPolicyCommand, DetachGroupPolicyCommand, DetachRolePolicyCommand, DetachUserPolicyCommand, GetAccessKeyLastUsedCommand, GetGroupCommand, GetGroupPolicyCommand, GetInstanceProfileCommand, GetPolicyCommand, GetPolicyVersionCommand, GetRolePolicyCommand, GetUserCommand, GetUserPolicyCommand, IAMClient, ListAccessKeysCommand, ListAttachedGroupPoliciesCommand, ListAttachedUserPoliciesCommand, ListEntitiesForPolicyCommand, ListGroupPoliciesCommand, ListGroupsForUserCommand, ListPoliciesCommand, ListPolicyTagsCommand, ListPolicyVersionsCommand, ListUserPoliciesCommand, NoSuchEntityException, PutGroupPolicyCommand, PutRolePolicyCommand, PutUserPermissionsBoundaryCommand, PutUserPolicyCommand, RemoveRoleFromInstanceProfileCommand, RemoveUserFromGroupCommand, TagPolicyCommand, TagUserCommand, UntagPolicyCommand, UntagUserCommand, UpdateAccessKeyCommand, UpdateLoginProfileCommand } from "@aws-sdk/client-iam";
@@ -507,7 +507,7 @@ var IAMPolicyProvider = class {
507
507
  this.logger.debug(`Successfully deleted IAM policy ${logicalId}`);
508
508
  } catch (error) {
509
509
  const cause = error instanceof Error ? error : void 0;
510
- const failure = new ProvisioningError(`Failed to delete IAM policy ${logicalId}: ${mask(error instanceof Error ? error.message : String(error))}`, resourceType, logicalId, physicalId, cause);
510
+ const failure = new ProvisioningError(`Failed to delete IAM policy ${logicalId}: ${mask(describeAwsFailure(error).detail)}`, resourceType, logicalId, physicalId, cause);
511
511
  throw maskError(removedAny ? markDeleteStarted(failure) : failure);
512
512
  }
513
513
  }
@@ -1359,7 +1359,7 @@ var IAMInstanceProfileProvider = class {
1359
1359
  return;
1360
1360
  }
1361
1361
  const cause = error instanceof Error ? error : void 0;
1362
- const failure = new ProvisioningError(`Failed to delete IAM instance profile ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
1362
+ const failure = new ProvisioningError(`Failed to delete IAM instance profile ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
1363
1363
  throw stripped ? markDeleteStarted(failure) : failure;
1364
1364
  }
1365
1365
  }
@@ -1610,7 +1610,7 @@ var IAMAccessKeyProvider = class {
1610
1610
  try {
1611
1611
  status = properties["Status"] === void 0 ? "Active" : requireConfigString(properties["Status"], previousStatus, "AWS::IAM::AccessKey Status", stateBorneDesired ? { onUnusable: (message) => log.warn(message) } : {});
1612
1612
  } catch (error) {
1613
- throw new ProvisioningError(`${v(error instanceof Error ? error.message : String(error))}. Nothing was applied to access key ${logicalId}; fix the template value`, resourceType, logicalId, physicalId, error instanceof Error ? error : void 0);
1613
+ throw new ProvisioningError(`${v(describeAwsFailure(error).detail)}. Nothing was applied to access key ${logicalId}; fix the template value`, resourceType, logicalId, physicalId, error instanceof Error ? error : void 0);
1614
1614
  }
1615
1615
  try {
1616
1616
  await this.iamClient.send(new UpdateAccessKeyCommand({
@@ -1648,7 +1648,7 @@ var IAMAccessKeyProvider = class {
1648
1648
  return;
1649
1649
  }
1650
1650
  const cause = error instanceof Error ? error : void 0;
1651
- throw new ProvisioningError(`Failed to delete IAM access key ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
1651
+ throw new ProvisioningError(`Failed to delete IAM access key ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
1652
1652
  }
1653
1653
  }
1654
1654
  async getAttribute(physicalId, resourceType, attributeName, logicalId) {
@@ -2049,7 +2049,7 @@ var IAMUserGroupProvider = class {
2049
2049
  log.debug(`Successfully deleted IAM user ${logicalId}`);
2050
2050
  } catch (error) {
2051
2051
  const cause = error instanceof Error ? error : void 0;
2052
- const failure = new ProvisioningError(log.mask(`Failed to delete IAM user ${logicalId}: ${error instanceof Error ? error.message : String(error)}`), resourceType, logicalId, physicalId, cause);
2052
+ const failure = new ProvisioningError(log.mask(`Failed to delete IAM user ${logicalId}: ${describeAwsFailure(error).detail}`), resourceType, logicalId, physicalId, cause);
2053
2053
  throw progress.stripped ? markDeleteStarted(failure) : failure;
2054
2054
  }
2055
2055
  }
@@ -2330,7 +2330,7 @@ var IAMUserGroupProvider = class {
2330
2330
  return;
2331
2331
  }
2332
2332
  const cause = error instanceof Error ? error : void 0;
2333
- const failure = new ProvisioningError(log.mask(`Failed to delete IAM group ${logicalId}: ${error instanceof Error ? error.message : String(error)}`), resourceType, logicalId, physicalId, cause);
2333
+ const failure = new ProvisioningError(log.mask(`Failed to delete IAM group ${logicalId}: ${describeAwsFailure(error).detail}`), resourceType, logicalId, physicalId, cause);
2334
2334
  throw progress.stripped ? markDeleteStarted(failure) : failure;
2335
2335
  }
2336
2336
  }
@@ -2614,7 +2614,7 @@ var IAMUserGroupProvider = class {
2614
2614
  this.logger.debug(`Successfully deleted IAM UserToGroupAddition ${logicalId}`);
2615
2615
  } catch (error) {
2616
2616
  const cause = error instanceof Error ? error : void 0;
2617
- const failure = new ProvisioningError(`Failed to delete IAM UserToGroupAddition ${logicalId}: ${mask(error instanceof Error ? error.message : String(error))}`, resourceType, logicalId, physicalId, cause);
2617
+ const failure = new ProvisioningError(`Failed to delete IAM UserToGroupAddition ${logicalId}: ${mask(describeAwsFailure(error).detail)}`, resourceType, logicalId, physicalId, cause);
2618
2618
  throw maskError(removedAny ? markDeleteStarted(failure) : failure);
2619
2619
  }
2620
2620
  }
@@ -5707,10 +5707,7 @@ const SQS_ATTRIBUTE_REMOVAL_RESET = {
5707
5707
  DelaySeconds: "0",
5708
5708
  ReceiveMessageWaitTimeSeconds: "0",
5709
5709
  KmsDataKeyReusePeriodSeconds: "300",
5710
- ContentBasedDeduplication: "false",
5711
- SqsManagedSseEnabled: "true",
5712
- DeduplicationScope: "queue",
5713
- FifoThroughputLimit: "perQueue"
5710
+ ContentBasedDeduplication: "false"
5714
5711
  };
5715
5712
  const CDK_TO_SQS_ATTRIBUTES = {
5716
5713
  VisibilityTimeout: "VisibilityTimeout",
@@ -5808,7 +5805,7 @@ var SQSQueueProvider = class {
5808
5805
  };
5809
5806
  } catch (error) {
5810
5807
  const cause = error instanceof Error ? error : void 0;
5811
- throw new ProvisioningError(`Failed to create SQS queue ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, queueName, cause);
5808
+ throw new ProvisioningError(`Failed to create SQS queue ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, queueName, cause);
5812
5809
  }
5813
5810
  }
5814
5811
  async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
@@ -5824,13 +5821,7 @@ var SQSQueueProvider = class {
5824
5821
  if (cdkKey === "RedrivePolicy" && typeof value === "object") attributes[sqsKey] = serializeRedrivePolicy(value);
5825
5822
  else if (cdkKey === "RedriveAllowPolicy") attributes[sqsKey] = serializeRedriveAllowPolicy(value);
5826
5823
  else attributes[sqsKey] = stringifyValue(value);
5827
- } else if (previousProperties[cdkKey] !== void 0 && cdkKey in SQS_ATTRIBUTE_REMOVAL_RESET) {
5828
- if (cdkKey === "SqsManagedSseEnabled") {
5829
- const desiredKmsKey = properties["KmsMasterKeyId"];
5830
- if (desiredKmsKey !== void 0 && desiredKmsKey !== "") continue;
5831
- }
5832
- attributes[sqsKey] = SQS_ATTRIBUTE_REMOVAL_RESET[cdkKey];
5833
- }
5824
+ } else if (previousProperties[cdkKey] !== void 0 && cdkKey in SQS_ATTRIBUTE_REMOVAL_RESET) attributes[sqsKey] = SQS_ATTRIBUTE_REMOVAL_RESET[cdkKey];
5834
5825
  }
5835
5826
  if (Object.keys(attributes).length > 0) {
5836
5827
  await this.sqsClient.send(new SetQueueAttributesCommand({
@@ -5856,7 +5847,7 @@ var SQSQueueProvider = class {
5856
5847
  };
5857
5848
  } catch (error) {
5858
5849
  const cause = error instanceof Error ? error : void 0;
5859
- throw new ProvisioningError(`Failed to update SQS queue ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
5850
+ throw new ProvisioningError(`Failed to update SQS queue ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
5860
5851
  }
5861
5852
  }
5862
5853
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -5872,7 +5863,7 @@ var SQSQueueProvider = class {
5872
5863
  return;
5873
5864
  }
5874
5865
  const cause = error instanceof Error ? error : void 0;
5875
- throw new ProvisioningError(`Failed to delete SQS queue ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
5866
+ throw new ProvisioningError(`Failed to delete SQS queue ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
5876
5867
  }
5877
5868
  }
5878
5869
  async applyTagDiff(queueUrl, resourceType, logicalId, oldTagsRaw, newTagsRaw) {
@@ -6597,7 +6588,7 @@ var SNSTopicProvider = class {
6597
6588
  };
6598
6589
  } catch (error) {
6599
6590
  const cause = error instanceof Error ? error : void 0;
6600
- const thrown = new ProvisioningError(`Failed to create SNS topic ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, topicName, cause);
6591
+ const thrown = new ProvisioningError(`Failed to create SNS topic ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, topicName, cause);
6601
6592
  if (leftBehindArn) markCreatedBeforeFailure(thrown, logicalId, resourceType, leftBehindArn);
6602
6593
  throw thrown;
6603
6594
  }
@@ -6609,7 +6600,7 @@ var SNSTopicProvider = class {
6609
6600
  } catch (error) {
6610
6601
  if (error instanceof CdkdError) throw error;
6611
6602
  const cause = error instanceof Error ? error : void 0;
6612
- throw new ProvisioningError(`Failed to update SNS topic ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
6603
+ throw new ProvisioningError(`Failed to update SNS topic ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
6613
6604
  }
6614
6605
  }
6615
6606
  async applyUpdate(logicalId, physicalId, resourceType, properties, previousProperties, maskSecrets) {
@@ -6775,7 +6766,7 @@ var SNSTopicProvider = class {
6775
6766
  return;
6776
6767
  }
6777
6768
  const cause = error instanceof Error ? error : void 0;
6778
- throw new ProvisioningError(`Failed to delete SNS topic ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
6769
+ throw new ProvisioningError(`Failed to delete SNS topic ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
6779
6770
  }
6780
6771
  }
6781
6772
  async getAttribute(physicalId, _resourceType, attributeName) {
@@ -7217,7 +7208,7 @@ var SNSSubscriptionProvider = class {
7217
7208
  return;
7218
7209
  }
7219
7210
  const cause = error instanceof Error ? error : void 0;
7220
- throw new ProvisioningError(mask(`Failed to delete SNS subscription ${logicalId}: ${error instanceof Error ? error.message : String(error)}`), resourceType, logicalId, physicalId, cause);
7211
+ throw new ProvisioningError(mask(`Failed to delete SNS subscription ${logicalId}: ${describeAwsFailure(error).detail}`), resourceType, logicalId, physicalId, cause);
7221
7212
  }
7222
7213
  }
7223
7214
  logPendingConfirmationSkip(logicalId, physicalId) {
@@ -7948,7 +7939,7 @@ var LambdaFunctionProvider = class {
7948
7939
  } catch (error) {
7949
7940
  if (functionCreated) markAuxiliaryFailure(error, logicalId);
7950
7941
  const cause = error instanceof Error ? error : void 0;
7951
- const thrown = this.wrapMaskedError(log, error, (text) => new ProvisioningError(`Failed to create Lambda function ${logicalId}: ${text}`, resourceType, logicalId, functionName, cause ?? new Error(String(error))));
7942
+ const thrown = this.wrapMaskedError(log, error, (text) => new ProvisioningError(`Failed to create Lambda function ${logicalId}: ${text}`, resourceType, logicalId, functionName, cause ?? new Error(safeStringify(error))));
7952
7943
  if (createdFunctionName !== void 0 && !postCreateCleanup.deleted) markCreatedBeforeFailure(thrown, logicalId, resourceType, createdFunctionName, createdFunctionIdentity);
7953
7944
  throw thrown;
7954
7945
  }
@@ -8126,7 +8117,7 @@ var LambdaFunctionProvider = class {
8126
8117
  } catch (error) {
8127
8118
  if (error instanceof ProvisioningError) throw error;
8128
8119
  const cause = error instanceof Error ? error : void 0;
8129
- throw this.wrapMaskedError(log, error, (text) => new ProvisioningError(`Failed to update Lambda function ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause ?? new Error(String(error))));
8120
+ throw this.wrapMaskedError(log, error, (text) => new ProvisioningError(`Failed to update Lambda function ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause ?? new Error(safeStringify(error))));
8130
8121
  }
8131
8122
  }
8132
8123
  async delete(logicalId, physicalId, resourceType, properties, context) {
@@ -8167,7 +8158,7 @@ var LambdaFunctionProvider = class {
8167
8158
  return;
8168
8159
  }
8169
8160
  const cause = error instanceof Error ? error : void 0;
8170
- const failure = new ProvisioningError(`Failed to delete Lambda function ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
8161
+ const failure = new ProvisioningError(`Failed to delete Lambda function ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
8171
8162
  throw stripped ? markDeleteStarted(failure) : failure;
8172
8163
  }
8173
8164
  if (hasVpcConfig) await this.cleanupLambdaEnis(physicalId);
@@ -8232,7 +8223,7 @@ var LambdaFunctionProvider = class {
8232
8223
  }, { FunctionName: functionName });
8233
8224
  } catch (error) {
8234
8225
  const cause = error instanceof Error ? error : void 0;
8235
- throw this.wrapMaskedError(log, error, (text) => new ProvisioningError(`Lambda function ${logicalId} update did not complete: ${text}`, resourceType, logicalId, functionName, cause ?? new Error(String(error))));
8226
+ throw this.wrapMaskedError(log, error, (text) => new ProvisioningError(`Lambda function ${logicalId} update did not complete: ${text}`, resourceType, logicalId, functionName, cause ?? new Error(safeStringify(error))));
8236
8227
  }
8237
8228
  }
8238
8229
  async waitForLambdaUpdateCompleted(functionName) {
@@ -8724,7 +8715,7 @@ var LambdaPermissionProvider = class {
8724
8715
  return;
8725
8716
  }
8726
8717
  const cause = error instanceof Error ? error : void 0;
8727
- throw new ProvisioningError(`Failed to delete Lambda permission ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
8718
+ throw new ProvisioningError(`Failed to delete Lambda permission ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
8728
8719
  }
8729
8720
  }
8730
8721
  async readCurrentState(physicalId, _logicalId, _resourceType, properties) {
@@ -8861,7 +8852,7 @@ var LambdaUrlProvider = class {
8861
8852
  log.warn(`${message} The function URL's existing auth type is kept for this update rather than reset to the default (NONE), which would make the URL public.`);
8862
8853
  } } : {});
8863
8854
  } catch (error) {
8864
- throw new ProvisioningError(`${log.mask(error instanceof Error ? error.message : String(error))}. Nothing was applied to Lambda URL ${logicalId}; fix the template value`, resourceType, logicalId, physicalId, error instanceof Error ? error : void 0);
8855
+ throw new ProvisioningError(`${log.mask(describeAwsFailure(error).detail)}. Nothing was applied to Lambda URL ${logicalId}; fix the template value`, resourceType, logicalId, physicalId, error instanceof Error ? error : void 0);
8865
8856
  }
8866
8857
  const previousAuthType = previousProperties["AuthType"];
8867
8858
  const authType = authTypeUnusable ? typeof previousAuthType === "string" && previousAuthType.trim() !== "" ? previousAuthType : void 0 : requestedAuthType;
@@ -8875,7 +8866,7 @@ var LambdaUrlProvider = class {
8875
8866
  FunctionName: physicalId,
8876
8867
  ...authType !== void 0 && { AuthType: authType }
8877
8868
  };
8878
- const invokeMode = clearOnUpdateRemoval(properties["InvokeMode"], previousProperties["InvokeMode"], "BUFFERED");
8869
+ const invokeMode = properties["InvokeMode"];
8879
8870
  if (invokeMode !== void 0) updateParams.InvokeMode = invokeMode;
8880
8871
  const newCorsRaw = properties["Cors"];
8881
8872
  const prevCorsRaw = previousProperties["Cors"];
@@ -8912,7 +8903,7 @@ var LambdaUrlProvider = class {
8912
8903
  return;
8913
8904
  }
8914
8905
  const cause = error instanceof Error ? error : void 0;
8915
- throw new ProvisioningError(`Failed to delete Lambda URL ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
8906
+ throw new ProvisioningError(`Failed to delete Lambda URL ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
8916
8907
  }
8917
8908
  }
8918
8909
  async getAttribute(physicalId, _resourceType, attributeName) {
@@ -9411,7 +9402,7 @@ var LambdaEventSourceMappingProvider = class {
9411
9402
  return;
9412
9403
  }
9413
9404
  const cause = error instanceof Error ? error : void 0;
9414
- throw new ProvisioningError(`Failed to delete event source mapping ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
9405
+ throw new ProvisioningError(`Failed to delete event source mapping ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
9415
9406
  }
9416
9407
  }
9417
9408
  async readCurrentState(physicalId, _logicalId, _resourceType, properties) {
@@ -9639,7 +9630,7 @@ var LambdaLayerVersionProvider = class {
9639
9630
  return;
9640
9631
  }
9641
9632
  const cause = error instanceof Error ? error : void 0;
9642
- throw new ProvisioningError(`Failed to delete Lambda layer version ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
9633
+ throw new ProvisioningError(`Failed to delete Lambda layer version ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
9643
9634
  }
9644
9635
  }
9645
9636
  async readCurrentState(physicalId, _logicalId, _resourceType) {
@@ -9853,7 +9844,7 @@ var LambdaEventInvokeConfigProvider = class {
9853
9844
  return;
9854
9845
  }
9855
9846
  const cause = error instanceof Error ? error : void 0;
9856
- throw new ProvisioningError(`Failed to delete Lambda EventInvokeConfig ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
9847
+ throw new ProvisioningError(`Failed to delete Lambda EventInvokeConfig ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
9857
9848
  }
9858
9849
  }
9859
9850
  async getAttribute(_physicalId, _resourceType, _attributeName) {}
@@ -12055,7 +12046,7 @@ var DynamoDBTableProvider = class {
12055
12046
  }
12056
12047
  markAuxiliaryFailure(error, logicalId);
12057
12048
  }
12058
- const thrown = error instanceof ProvisioningError ? error : new ProvisioningError(`Failed to create DynamoDB table ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, tableName, error instanceof Error ? error : void 0);
12049
+ const thrown = error instanceof ProvisioningError ? error : new ProvisioningError(`Failed to create DynamoDB table ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, tableName, error instanceof Error ? error : void 0);
12059
12050
  if (tableLeftBehind) markCreatedBeforeFailure(thrown, logicalId, resourceType, tableName, createdTableId);
12060
12051
  throw thrown;
12061
12052
  }
@@ -12078,7 +12069,7 @@ var DynamoDBTableProvider = class {
12078
12069
  if (context?.replayingState !== true && context?.desiredFromAwsReadback !== true && JSON.stringify(properties["BillingMode"]) !== JSON.stringify(previousProperties["BillingMode"])) try {
12079
12070
  requireConfigString(properties["BillingMode"], "PROVISIONED", "AWS::DynamoDB::Table BillingMode");
12080
12071
  } catch (error) {
12081
- throw new ProvisioningError(`AWS::DynamoDB::Table ${logicalId}: ${error instanceof Error ? error.message : String(error)}. Nothing was applied to the table; fix the template value`, resourceType, logicalId, physicalId, error instanceof Error ? error : void 0);
12072
+ throw new ProvisioningError(`AWS::DynamoDB::Table ${logicalId}: ${describeAwsFailure(error).detail}. Nothing was applied to the table; fix the template value`, resourceType, logicalId, physicalId, error instanceof Error ? error : void 0);
12082
12073
  }
12083
12074
  if (context?.replayingState !== true && context?.desiredFromAwsReadback !== true && JSON.stringify(properties["PointInTimeRecoverySpecification"]) !== JSON.stringify(previousProperties["PointInTimeRecoverySpecification"])) {
12084
12075
  const pitrRefusal = pointInTimeRecoveryRefusal(properties["PointInTimeRecoverySpecification"]);
@@ -12310,7 +12301,7 @@ var DynamoDBTableProvider = class {
12310
12301
  } catch (error) {
12311
12302
  if (error instanceof ProvisioningError) throw error;
12312
12303
  const cause = error instanceof Error ? error : void 0;
12313
- throw new ProvisioningError(`Failed to update DynamoDB table ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
12304
+ throw new ProvisioningError(`Failed to update DynamoDB table ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
12314
12305
  }
12315
12306
  }
12316
12307
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -12411,7 +12402,7 @@ var DynamoDBTableProvider = class {
12411
12402
  return;
12412
12403
  }
12413
12404
  const cause = error instanceof Error ? error : void 0;
12414
- throw new ProvisioningError(`Failed to delete DynamoDB table ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
12405
+ throw new ProvisioningError(`Failed to delete DynamoDB table ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
12415
12406
  }
12416
12407
  }
12417
12408
  async applyTagDiff(tableArn, resourceType, logicalId, oldTagsRaw, newTagsRaw) {
@@ -13685,7 +13676,7 @@ var LogsLogGroupProvider = class {
13685
13676
  return;
13686
13677
  }
13687
13678
  const cause = error instanceof Error ? error : void 0;
13688
- throw new ProvisioningError(`Failed to delete log group ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
13679
+ throw new ProvisioningError(`Failed to delete log group ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
13689
13680
  }
13690
13681
  }
13691
13682
  logGoneOnDelete(logicalId, physicalId, context) {
@@ -13867,7 +13858,7 @@ var CloudWatchAlarmProvider = class {
13867
13858
  };
13868
13859
  } catch (error) {
13869
13860
  const cause = error instanceof Error ? error : void 0;
13870
- throw new ProvisioningError(`Failed to create CloudWatch alarm ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
13861
+ throw new ProvisioningError(`Failed to create CloudWatch alarm ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
13871
13862
  }
13872
13863
  }
13873
13864
  async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
@@ -13886,7 +13877,7 @@ var CloudWatchAlarmProvider = class {
13886
13877
  };
13887
13878
  } catch (error) {
13888
13879
  const cause = error instanceof Error ? error : void 0;
13889
- throw new ProvisioningError(`Failed to update CloudWatch alarm ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
13880
+ throw new ProvisioningError(`Failed to update CloudWatch alarm ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
13890
13881
  }
13891
13882
  }
13892
13883
  throttleDelaysMs = [
@@ -13926,7 +13917,7 @@ var CloudWatchAlarmProvider = class {
13926
13917
  return;
13927
13918
  }
13928
13919
  const cause = error instanceof Error ? error : void 0;
13929
- throw new ProvisioningError(`Failed to delete CloudWatch alarm ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
13920
+ throw new ProvisioningError(`Failed to delete CloudWatch alarm ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
13930
13921
  }
13931
13922
  }
13932
13923
  async getAlarmArn(alarmName) {
@@ -14147,7 +14138,7 @@ var CloudWatchAnomalyDetectorProvider = class {
14147
14138
  };
14148
14139
  } catch (error) {
14149
14140
  const cause = error instanceof Error ? error : void 0;
14150
- throw new ProvisioningError(`Failed to create CloudWatch anomaly detector ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
14141
+ throw new ProvisioningError(`Failed to create CloudWatch anomaly detector ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
14151
14142
  }
14152
14143
  }
14153
14144
  async update(logicalId, physicalId, resourceType, properties, _previousProperties, context) {
@@ -14165,7 +14156,7 @@ var CloudWatchAnomalyDetectorProvider = class {
14165
14156
  };
14166
14157
  } catch (error) {
14167
14158
  const cause = error instanceof Error ? error : void 0;
14168
- throw new ProvisioningError(`Failed to update CloudWatch anomaly detector ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
14159
+ throw new ProvisioningError(`Failed to update CloudWatch anomaly detector ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
14169
14160
  }
14170
14161
  }
14171
14162
  async delete(logicalId, physicalId, resourceType, properties, context) {
@@ -14191,7 +14182,7 @@ var CloudWatchAnomalyDetectorProvider = class {
14191
14182
  return;
14192
14183
  }
14193
14184
  const cause = error instanceof Error ? error : void 0;
14194
- throw new ProvisioningError(`Failed to delete CloudWatch anomaly detector ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
14185
+ throw new ProvisioningError(`Failed to delete CloudWatch anomaly detector ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
14195
14186
  }
14196
14187
  }
14197
14188
  async getAttribute(physicalId, resourceType, attributeName, logicalId) {
@@ -14377,7 +14368,6 @@ var SecretsManagerSecretProvider = class {
14377
14368
  "ReplicaRegions",
14378
14369
  "Type"
14379
14370
  ])]]);
14380
- removalDefaults = /* @__PURE__ */ new Map([["AWS::SecretsManager::Secret", /* @__PURE__ */ new Map([["Description", ""]])]]);
14381
14371
  constructor() {
14382
14372
  const awsClients = getAwsClients();
14383
14373
  this.smClient = awsClients.secretsManager;
@@ -14422,7 +14412,6 @@ var SecretsManagerSecretProvider = class {
14422
14412
  }
14423
14413
  }
14424
14414
  async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
14425
- properties = withRemovalDefaults(this.removalDefaults, resourceType, properties, previousProperties, context);
14426
14415
  const log = this.operationSinks(context?.maskSecrets, [
14427
14416
  [properties["Name"], properties["Name"]],
14428
14417
  [properties["Name"], physicalId],
@@ -14436,7 +14425,7 @@ var SecretsManagerSecretProvider = class {
14436
14425
  try {
14437
14426
  changedValue = this.changedSecretValue(properties, previousProperties, stateBorneDesired, log.warn);
14438
14427
  } catch (error) {
14439
- const message = v(error instanceof Error ? error.message : String(error));
14428
+ const message = v(describeAwsFailure(error).detail);
14440
14429
  throw new ProvisioningError(stateBorneDesired ? `Failed to update secret ${logicalId}: ${message}` : `${message}. Nothing was applied to secret ${logicalId}; fix the template value`, resourceType, logicalId, physicalId, error instanceof Error ? error : void 0);
14441
14430
  }
14442
14431
  try {
@@ -14447,7 +14436,7 @@ var SecretsManagerSecretProvider = class {
14447
14436
  if (description !== void 0) updateParams.Description = description;
14448
14437
  const newKmsKeyId = properties["KmsKeyId"];
14449
14438
  const prevKmsKeyId = previousProperties["KmsKeyId"];
14450
- const kmsKeyId = clearOnUpdateRemoval(newKmsKeyId === "" ? void 0 : newKmsKeyId, prevKmsKeyId === "" ? void 0 : prevKmsKeyId, "");
14439
+ const kmsKeyId = newKmsKeyId === void 0 ? void 0 : newKmsKeyId === "" ? prevKmsKeyId !== void 0 && prevKmsKeyId !== "" ? "" : void 0 : newKmsKeyId;
14451
14440
  if (kmsKeyId !== void 0) updateParams.KmsKeyId = kmsKeyId;
14452
14441
  if (properties["Type"]) updateParams.Type = properties["Type"];
14453
14442
  await this.smClient.send(new UpdateSecretCommand(updateParams));
@@ -14547,7 +14536,7 @@ var SecretsManagerSecretProvider = class {
14547
14536
  return;
14548
14537
  }
14549
14538
  const cause = error instanceof Error ? error : void 0;
14550
- throw new ProvisioningError(`Failed to delete secret ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
14539
+ throw new ProvisioningError(`Failed to delete secret ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
14551
14540
  }
14552
14541
  }
14553
14542
  retainPreviousGenerateBlock(logicalId, properties, previousProperties) {
@@ -14847,7 +14836,7 @@ var SSMParameterProvider = class SSMParameterProvider {
14847
14836
  return;
14848
14837
  }
14849
14838
  const cause = error instanceof Error ? error : void 0;
14850
- throw new ProvisioningError(`Failed to delete SSM parameter ${displaySafe(logicalId)}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
14839
+ throw new ProvisioningError(`Failed to delete SSM parameter ${displaySafe(logicalId)}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
14851
14840
  }
14852
14841
  }
14853
14842
  async readCurrentState(physicalId, _logicalId, _resourceType) {
@@ -15121,7 +15110,7 @@ var EventBridgeRuleProvider = class {
15121
15110
  };
15122
15111
  } catch (error) {
15123
15112
  const cause = error instanceof Error ? error : void 0;
15124
- const thrown = new ProvisioningError(`Failed to create EventBridge rule ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, ruleName, cause);
15113
+ const thrown = new ProvisioningError(`Failed to create EventBridge rule ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, ruleName, cause);
15125
15114
  if (leftLiveArn) markCreatedBeforeFailure(thrown, logicalId, resourceType, leftLiveArn);
15126
15115
  throw thrown;
15127
15116
  }
@@ -15191,7 +15180,7 @@ var EventBridgeRuleProvider = class {
15191
15180
  };
15192
15181
  } catch (error) {
15193
15182
  const cause = error instanceof Error ? error : void 0;
15194
- throw new ProvisioningError(`Failed to update EventBridge rule ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
15183
+ throw new ProvisioningError(`Failed to update EventBridge rule ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
15195
15184
  }
15196
15185
  }
15197
15186
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -15237,7 +15226,7 @@ var EventBridgeRuleProvider = class {
15237
15226
  return;
15238
15227
  }
15239
15228
  const cause = error instanceof Error ? error : void 0;
15240
- const failure = new ProvisioningError(`Failed to delete EventBridge rule ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
15229
+ const failure = new ProvisioningError(`Failed to delete EventBridge rule ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
15241
15230
  throw stripped ? markDeleteStarted(failure) : failure;
15242
15231
  }
15243
15232
  }
@@ -15442,7 +15431,7 @@ var EventBridgeBusProvider = class {
15442
15431
  };
15443
15432
  } catch (error) {
15444
15433
  const cause = error instanceof Error ? error : void 0;
15445
- throw new ProvisioningError(`Failed to create EventBus ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
15434
+ throw new ProvisioningError(`Failed to create EventBus ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
15446
15435
  }
15447
15436
  }
15448
15437
  async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
@@ -15453,7 +15442,7 @@ var EventBridgeBusProvider = class {
15453
15442
  } catch (error) {
15454
15443
  if (error instanceof CdkdError) throw error;
15455
15444
  const cause = error instanceof Error ? error : void 0;
15456
- throw new ProvisioningError(`Failed to update EventBus ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
15445
+ throw new ProvisioningError(`Failed to update EventBus ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
15457
15446
  }
15458
15447
  }
15459
15448
  async applyUpdate(logicalId, physicalId, resourceType, properties, previousProperties) {
@@ -16037,7 +16026,7 @@ var EC2Provider = class {
16037
16026
  } catch (error) {
16038
16027
  if (error instanceof CdkdError) throw error;
16039
16028
  const cause = error instanceof Error ? error : void 0;
16040
- throw new ProvisioningError(`Failed to update EC2 resource ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
16029
+ throw new ProvisioningError(`Failed to update EC2 resource ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
16041
16030
  }
16042
16031
  }
16043
16032
  async applyUpdate(logicalId, physicalId, resourceType, properties, previousProperties, context) {
@@ -16278,7 +16267,7 @@ var EC2Provider = class {
16278
16267
  };
16279
16268
  } catch (error) {
16280
16269
  const cause = error instanceof Error ? error : void 0;
16281
- const thrown = new ProvisioningError(`Failed to create VPC ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
16270
+ const thrown = new ProvisioningError(`Failed to create VPC ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
16282
16271
  if (leftBehindId !== void 0) {
16283
16272
  markCreatedBeforeFailure(thrown, logicalId, resourceType, leftBehindId);
16284
16273
  markNonRetryable(thrown);
@@ -16318,7 +16307,7 @@ var EC2Provider = class {
16318
16307
  };
16319
16308
  } catch (error) {
16320
16309
  const cause = error instanceof Error ? error : void 0;
16321
- throw new ProvisioningError(`Failed to update VPC ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
16310
+ throw new ProvisioningError(`Failed to update VPC ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
16322
16311
  }
16323
16312
  }
16324
16313
  async deleteVpc(logicalId, physicalId, resourceType, context) {
@@ -16438,7 +16427,7 @@ var EC2Provider = class {
16438
16427
  };
16439
16428
  } catch (error) {
16440
16429
  const cause = error instanceof Error ? error : void 0;
16441
- const thrown = new ProvisioningError(`Failed to create Subnet ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
16430
+ const thrown = new ProvisioningError(`Failed to create Subnet ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
16442
16431
  if (leftBehindId !== void 0) markCreatedBeforeFailure(thrown, logicalId, resourceType, leftBehindId);
16443
16432
  throw thrown;
16444
16433
  }
@@ -16474,7 +16463,7 @@ var EC2Provider = class {
16474
16463
  } catch (error) {
16475
16464
  if (error instanceof CdkdError) throw error;
16476
16465
  const cause = error instanceof Error ? error : void 0;
16477
- throw new ProvisioningError(`Failed to update Subnet ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
16466
+ throw new ProvisioningError(`Failed to update Subnet ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
16478
16467
  }
16479
16468
  }
16480
16469
  async waitForSubnetMapPublicIp(subnetId, expected) {
@@ -16582,7 +16571,7 @@ var EC2Provider = class {
16582
16571
  };
16583
16572
  } catch (error) {
16584
16573
  const cause = error instanceof Error ? error : void 0;
16585
- throw new ProvisioningError(`Failed to create InternetGateway ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
16574
+ throw new ProvisioningError(`Failed to create InternetGateway ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
16586
16575
  }
16587
16576
  }
16588
16577
  updateInternetGateway(logicalId, physicalId) {
@@ -16601,7 +16590,7 @@ var EC2Provider = class {
16601
16590
  return;
16602
16591
  }
16603
16592
  const cause = error instanceof Error ? error : void 0;
16604
- throw new ProvisioningError(`Failed to delete InternetGateway ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
16593
+ throw new ProvisioningError(`Failed to delete InternetGateway ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
16605
16594
  }
16606
16595
  }
16607
16596
  eipPhysicalId(logicalId, publicIp, allocationId, options) {
@@ -16700,7 +16689,7 @@ var EC2Provider = class {
16700
16689
  this.logger.warn(safeMsg`Failed to release partially-created EIP ${logicalId} (${allocatedId}): ${describeAwsFailure(cleanupError).detail}. Manual release may be required: ${pasteableAwsCommand(context?.maskSecrets)`aws ec2 release-address --allocation-id ${allocatedId}`.render()}`);
16701
16690
  }
16702
16691
  const cause = error instanceof Error ? error : void 0;
16703
- const thrown = new ProvisioningError(`Failed to create EIP ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
16692
+ const thrown = new ProvisioningError(`Failed to create EIP ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
16704
16693
  if (createdId !== void 0) {
16705
16694
  markCreatedBeforeFailure(thrown, logicalId, resourceType, createdId);
16706
16695
  markNonRetryable(thrown);
@@ -16771,7 +16760,7 @@ var EC2Provider = class {
16771
16760
  return;
16772
16761
  }
16773
16762
  const cause = error instanceof Error ? error : void 0;
16774
- throw new ProvisioningError(`Failed to delete EIP ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
16763
+ throw new ProvisioningError(`Failed to delete EIP ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
16775
16764
  }
16776
16765
  }
16777
16766
  async getEipAttribute(physicalId, attributeName) {
@@ -16814,7 +16803,7 @@ var EC2Provider = class {
16814
16803
  };
16815
16804
  } catch (error) {
16816
16805
  const cause = error instanceof Error ? error : void 0;
16817
- throw new ProvisioningError(`Failed to create VPCGatewayAttachment ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
16806
+ throw new ProvisioningError(`Failed to create VPCGatewayAttachment ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
16818
16807
  }
16819
16808
  }
16820
16809
  updateVpcGatewayAttachment(logicalId, physicalId) {
@@ -16839,7 +16828,7 @@ var EC2Provider = class {
16839
16828
  return;
16840
16829
  }
16841
16830
  const cause = error instanceof Error ? error : void 0;
16842
- throw new ProvisioningError(`Failed to delete VPCGatewayAttachment ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
16831
+ throw new ProvisioningError(`Failed to delete VPCGatewayAttachment ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
16843
16832
  }
16844
16833
  }
16845
16834
  async createNatGateway(logicalId, resourceType, properties) {
@@ -16885,7 +16874,7 @@ var EC2Provider = class {
16885
16874
  };
16886
16875
  } catch (error) {
16887
16876
  const cause = error instanceof Error ? error : void 0;
16888
- const thrown = new ProvisioningError(`Failed to create NatGateway ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
16877
+ const thrown = new ProvisioningError(`Failed to create NatGateway ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
16889
16878
  if (createdId !== void 0) markCreatedBeforeFailure(thrown, logicalId, resourceType, createdId);
16890
16879
  throw thrown;
16891
16880
  }
@@ -16906,7 +16895,7 @@ var EC2Provider = class {
16906
16895
  return;
16907
16896
  }
16908
16897
  const cause = error instanceof Error ? error : void 0;
16909
- throw new ProvisioningError(`Failed to delete NatGateway ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
16898
+ throw new ProvisioningError(`Failed to delete NatGateway ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
16910
16899
  }
16911
16900
  this.logger.debug(`Waiting for NatGateway ${physicalId} to reach deleted state...`);
16912
16901
  try {
@@ -16946,7 +16935,7 @@ var EC2Provider = class {
16946
16935
  };
16947
16936
  } catch (error) {
16948
16937
  const cause = error instanceof Error ? error : void 0;
16949
- throw new ProvisioningError(`Failed to create RouteTable ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
16938
+ throw new ProvisioningError(`Failed to create RouteTable ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
16950
16939
  }
16951
16940
  }
16952
16941
  updateRouteTable(logicalId, physicalId) {
@@ -16965,7 +16954,7 @@ var EC2Provider = class {
16965
16954
  return;
16966
16955
  }
16967
16956
  const cause = error instanceof Error ? error : void 0;
16968
- throw new ProvisioningError(`Failed to delete RouteTable ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
16957
+ throw new ProvisioningError(`Failed to delete RouteTable ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
16969
16958
  }
16970
16959
  }
16971
16960
  async createRoute(logicalId, resourceType, properties, onMultipleDestinations, maskSecrets) {
@@ -17020,7 +17009,7 @@ var EC2Provider = class {
17020
17009
  };
17021
17010
  } catch (error) {
17022
17011
  const cause = error instanceof Error ? error : void 0;
17023
- throw new ProvisioningError(`Failed to create Route ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
17012
+ throw new ProvisioningError(`Failed to create Route ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
17024
17013
  }
17025
17014
  }
17026
17015
  async updateRoute(logicalId, physicalId, resourceType, properties, previousProperties, context) {
@@ -17046,7 +17035,7 @@ var EC2Provider = class {
17046
17035
  } catch (error) {
17047
17036
  if (error instanceof CdkdError) throw error;
17048
17037
  const cause = error instanceof Error ? error : void 0;
17049
- throw new ProvisioningError(`Failed to update Route ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
17038
+ throw new ProvisioningError(`Failed to update Route ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
17050
17039
  }
17051
17040
  }
17052
17041
  async deleteRoute(logicalId, physicalId, resourceType, context) {
@@ -17069,7 +17058,7 @@ var EC2Provider = class {
17069
17058
  return;
17070
17059
  }
17071
17060
  const cause = error instanceof Error ? error : void 0;
17072
- throw new ProvisioningError(`Failed to delete Route ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
17061
+ throw new ProvisioningError(`Failed to delete Route ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
17073
17062
  }
17074
17063
  }
17075
17064
  async createSubnetRouteTableAssociation(logicalId, resourceType, properties) {
@@ -17089,7 +17078,7 @@ var EC2Provider = class {
17089
17078
  };
17090
17079
  } catch (error) {
17091
17080
  const cause = error instanceof Error ? error : void 0;
17092
- throw new ProvisioningError(`Failed to create SubnetRouteTableAssociation ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
17081
+ throw new ProvisioningError(`Failed to create SubnetRouteTableAssociation ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
17093
17082
  }
17094
17083
  }
17095
17084
  updateSubnetRouteTableAssociation(logicalId, physicalId) {
@@ -17108,7 +17097,7 @@ var EC2Provider = class {
17108
17097
  return;
17109
17098
  }
17110
17099
  const cause = error instanceof Error ? error : void 0;
17111
- throw new ProvisioningError(`Failed to delete SubnetRouteTableAssociation ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
17100
+ throw new ProvisioningError(`Failed to delete SubnetRouteTableAssociation ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
17112
17101
  }
17113
17102
  }
17114
17103
  async createSecurityGroup(logicalId, resourceType, properties) {
@@ -17159,7 +17148,7 @@ var EC2Provider = class {
17159
17148
  };
17160
17149
  } catch (error) {
17161
17150
  const cause = error instanceof Error ? error : void 0;
17162
- const thrown = new ProvisioningError(`Failed to create SecurityGroup ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
17151
+ const thrown = new ProvisioningError(`Failed to create SecurityGroup ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
17163
17152
  if (leftBehindId !== void 0) markCreatedBeforeFailure(thrown, logicalId, resourceType, leftBehindId);
17164
17153
  throw thrown;
17165
17154
  }
@@ -17212,7 +17201,7 @@ var EC2Provider = class {
17212
17201
  };
17213
17202
  } catch (error) {
17214
17203
  const cause = error instanceof Error ? error : void 0;
17215
- throw new ProvisioningError(`Failed to update SecurityGroup ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
17204
+ throw new ProvisioningError(`Failed to update SecurityGroup ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
17216
17205
  }
17217
17206
  }
17218
17207
  async deleteSecurityGroup(logicalId, physicalId, resourceType, context) {
@@ -17367,7 +17356,7 @@ var EC2Provider = class {
17367
17356
  };
17368
17357
  }
17369
17358
  const cause = error instanceof Error ? error : void 0;
17370
- const failure = new ProvisioningError(`Failed to create SecurityGroupIngress ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
17359
+ const failure = new ProvisioningError(`Failed to create SecurityGroupIngress ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
17371
17360
  const lookup = getPriorAttempts(logicalId);
17372
17361
  if (authorizeDefinitelyNotApplied(error) && !earlierSendAmbiguous && lookup?.possiblyLanded() !== true) markRefusedBeforeApplying(failure);
17373
17362
  else lookup?.notePossiblyLanded();
@@ -17561,7 +17550,7 @@ var EC2Provider = class {
17561
17550
  } catch (error) {
17562
17551
  if (error instanceof CdkdError) throw error;
17563
17552
  const cause = error instanceof Error ? error : void 0;
17564
- throw new ProvisioningError(`Failed to update SecurityGroupIngress ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
17553
+ throw new ProvisioningError(`Failed to update SecurityGroupIngress ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
17565
17554
  }
17566
17555
  }
17567
17556
  withoutDescription(value) {
@@ -17637,7 +17626,7 @@ var EC2Provider = class {
17637
17626
  return notMatched();
17638
17627
  }
17639
17628
  const cause = error instanceof Error ? error : void 0;
17640
- throw new ProvisioningError(`Failed to delete SecurityGroupIngress ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
17629
+ throw new ProvisioningError(`Failed to delete SecurityGroupIngress ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
17641
17630
  }
17642
17631
  }
17643
17632
  async createInstance(logicalId, resourceType, properties, context) {
@@ -17722,7 +17711,7 @@ var EC2Provider = class {
17722
17711
  throw markAuxiliaryFailure(innerError, logicalId);
17723
17712
  }
17724
17713
  } catch (error) {
17725
- const thrown = error instanceof ProvisioningError ? error : new ProvisioningError(`Failed to create EC2 Instance ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, error instanceof Error ? error : void 0);
17714
+ const thrown = error instanceof ProvisioningError ? error : new ProvisioningError(`Failed to create EC2 Instance ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, error instanceof Error ? error : void 0);
17726
17715
  if (leftBehindId !== void 0) markCreatedBeforeFailure(thrown, logicalId, resourceType, leftBehindId);
17727
17716
  throw thrown;
17728
17717
  }
@@ -17820,7 +17809,7 @@ var EC2Provider = class {
17820
17809
  };
17821
17810
  } catch (error) {
17822
17811
  const cause = error instanceof Error ? error : void 0;
17823
- throw new ProvisioningError(`Failed to update EC2 Instance ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
17812
+ throw new ProvisioningError(`Failed to update EC2 Instance ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
17824
17813
  }
17825
17814
  }
17826
17815
  async updateInstanceSecurityProps(physicalId, properties, previousProperties) {
@@ -18131,7 +18120,7 @@ var EC2Provider = class {
18131
18120
  };
18132
18121
  } catch (error) {
18133
18122
  const cause = error instanceof Error ? error : void 0;
18134
- throw new ProvisioningError(`Failed to create NetworkAcl ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
18123
+ throw new ProvisioningError(`Failed to create NetworkAcl ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
18135
18124
  }
18136
18125
  }
18137
18126
  async deleteNetworkAcl(logicalId, physicalId, resourceType, context) {
@@ -18147,7 +18136,7 @@ var EC2Provider = class {
18147
18136
  return;
18148
18137
  }
18149
18138
  const cause = error instanceof Error ? error : void 0;
18150
- throw new ProvisioningError(`Failed to delete NetworkAcl ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
18139
+ throw new ProvisioningError(`Failed to delete NetworkAcl ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
18151
18140
  }
18152
18141
  }
18153
18142
  async createNetworkAclEntry(logicalId, resourceType, properties, context) {
@@ -18204,7 +18193,7 @@ var EC2Provider = class {
18204
18193
  };
18205
18194
  } catch (error) {
18206
18195
  const cause = error instanceof Error ? error : void 0;
18207
- throw new ProvisioningError(`Failed to create NetworkAclEntry ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
18196
+ throw new ProvisioningError(`Failed to create NetworkAclEntry ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
18208
18197
  }
18209
18198
  }
18210
18199
  async deleteNetworkAclEntry(logicalId, physicalId, resourceType, context) {
@@ -18235,7 +18224,7 @@ var EC2Provider = class {
18235
18224
  return;
18236
18225
  }
18237
18226
  const cause = error instanceof Error ? error : void 0;
18238
- throw new ProvisioningError(`Failed to delete NetworkAclEntry ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
18227
+ throw new ProvisioningError(`Failed to delete NetworkAclEntry ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
18239
18228
  }
18240
18229
  }
18241
18230
  async createSubnetNetworkAclAssociation(logicalId, resourceType, properties) {
@@ -18269,7 +18258,7 @@ var EC2Provider = class {
18269
18258
  } catch (error) {
18270
18259
  if (error instanceof ProvisioningError) throw error;
18271
18260
  const cause = error instanceof Error ? error : void 0;
18272
- throw new ProvisioningError(`Failed to create SubnetNetworkAclAssociation ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
18261
+ throw new ProvisioningError(`Failed to create SubnetNetworkAclAssociation ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
18273
18262
  }
18274
18263
  }
18275
18264
  async sendTaggedCreate(logicalId, tagResourceType, tags, send) {
@@ -19463,7 +19452,7 @@ var ApiGatewayProvider = class ApiGatewayProvider {
19463
19452
  this.logger.debug(`Successfully deleted API Gateway Account ${logicalId}`);
19464
19453
  } catch (error) {
19465
19454
  const cause = error instanceof Error ? error : void 0;
19466
- throw new ProvisioningError(`Failed to delete API Gateway Account ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
19455
+ throw new ProvisioningError(`Failed to delete API Gateway Account ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
19467
19456
  }
19468
19457
  }
19469
19458
  async updateAccountWithRetry(cloudWatchRoleArn, logicalId, _resourceType, log) {
@@ -19641,7 +19630,7 @@ var ApiGatewayProvider = class ApiGatewayProvider {
19641
19630
  return;
19642
19631
  }
19643
19632
  const cause = error instanceof Error ? error : void 0;
19644
- throw new ProvisioningError(`Failed to delete API Gateway Authorizer ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
19633
+ throw new ProvisioningError(`Failed to delete API Gateway Authorizer ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
19645
19634
  }
19646
19635
  }
19647
19636
  getAuthorizerAttribute(physicalId, attributeName) {
@@ -19726,7 +19715,7 @@ var ApiGatewayProvider = class ApiGatewayProvider {
19726
19715
  return;
19727
19716
  }
19728
19717
  const cause = error instanceof Error ? error : void 0;
19729
- throw new ProvisioningError(`Failed to delete API Gateway Resource ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
19718
+ throw new ProvisioningError(`Failed to delete API Gateway Resource ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
19730
19719
  }
19731
19720
  }
19732
19721
  getResourceAttribute(physicalId, _resourceType, attributeName) {
@@ -19811,7 +19800,7 @@ var ApiGatewayProvider = class ApiGatewayProvider {
19811
19800
  return;
19812
19801
  }
19813
19802
  const cause = error instanceof Error ? error : void 0;
19814
- throw new ProvisioningError(`Failed to delete API Gateway Deployment ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
19803
+ throw new ProvisioningError(`Failed to delete API Gateway Deployment ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
19815
19804
  }
19816
19805
  }
19817
19806
  getDeploymentAttribute(physicalId, attributeName) {
@@ -20055,7 +20044,7 @@ var ApiGatewayProvider = class ApiGatewayProvider {
20055
20044
  return;
20056
20045
  }
20057
20046
  const cause = error instanceof Error ? error : void 0;
20058
- throw new ProvisioningError(`Failed to delete API Gateway Stage ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
20047
+ throw new ProvisioningError(`Failed to delete API Gateway Stage ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
20059
20048
  }
20060
20049
  }
20061
20050
  getStageAttribute(physicalId, attributeName) {
@@ -20279,7 +20268,7 @@ var ApiGatewayProvider = class ApiGatewayProvider {
20279
20268
  return;
20280
20269
  }
20281
20270
  const cause = error instanceof Error ? error : void 0;
20282
- throw new ProvisioningError(`Failed to delete API Gateway Method ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
20271
+ throw new ProvisioningError(`Failed to delete API Gateway Method ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
20283
20272
  }
20284
20273
  }
20285
20274
  getMethodAttribute(physicalId, attributeName) {
@@ -20758,9 +20747,9 @@ var ApiGatewayV2Provider = class {
20758
20747
  const log = resourceType === "AWS::ApiGatewayV2::Stage" ? stageSinks(this.logger, context, [[properties["StageName"], physicalId], [previousProperties["StageName"], physicalId]]) : createMaskedLogSinks(this.logger, context?.maskSecrets);
20759
20748
  switch (resourceType) {
20760
20749
  case "AWS::ApiGatewayV2::Api": return this.updateApi(logicalId, physicalId, resourceType, properties, previousProperties, log);
20761
- case "AWS::ApiGatewayV2::Stage": return this.updateStage(logicalId, physicalId, resourceType, properties, previousProperties, log);
20762
- case "AWS::ApiGatewayV2::Integration": return this.updateIntegration(logicalId, physicalId, resourceType, properties, previousProperties, log);
20763
- case "AWS::ApiGatewayV2::Route": return this.updateRoute(logicalId, physicalId, resourceType, properties, previousProperties, log);
20750
+ case "AWS::ApiGatewayV2::Stage": return this.updateStage(logicalId, physicalId, resourceType, properties, previousProperties, log, context?.desiredFromAwsReadback === true);
20751
+ case "AWS::ApiGatewayV2::Integration": return this.updateIntegration(logicalId, physicalId, resourceType, properties, previousProperties, log, context?.desiredFromAwsReadback === true);
20752
+ case "AWS::ApiGatewayV2::Route": return this.updateRoute(logicalId, physicalId, resourceType, properties, previousProperties, log, context?.desiredFromAwsReadback === true);
20764
20753
  case "AWS::ApiGatewayV2::Authorizer": return this.updateAuthorizer(logicalId, physicalId, resourceType, properties, previousProperties, log);
20765
20754
  default: throw new ResourceUpdateNotSupportedError(resourceType, logicalId, "Unsupported API Gateway V2 resource type for in-place update in cdkd; re-deploy with cdkd deploy --replace, or destroy + redeploy the stack.");
20766
20755
  }
@@ -20873,7 +20862,7 @@ var ApiGatewayV2Provider = class {
20873
20862
  return;
20874
20863
  }
20875
20864
  const cause = error instanceof Error ? error : void 0;
20876
- throw new ProvisioningError(`Failed to delete API Gateway V2 Api ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
20865
+ throw new ProvisioningError(`Failed to delete API Gateway V2 Api ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
20877
20866
  }
20878
20867
  }
20879
20868
  async buildExecuteApiArn(apiId, log = createMaskedLogSinks(this.logger, void 0)) {
@@ -20944,7 +20933,7 @@ var ApiGatewayV2Provider = class {
20944
20933
  return;
20945
20934
  }
20946
20935
  const cause = error instanceof Error ? error : void 0;
20947
- throw new ProvisioningError(`Failed to delete API Gateway V2 Stage ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
20936
+ throw new ProvisioningError(`Failed to delete API Gateway V2 Stage ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
20948
20937
  }
20949
20938
  }
20950
20939
  getStageAttribute(physicalId, attributeName) {
@@ -21041,7 +21030,7 @@ var ApiGatewayV2Provider = class {
21041
21030
  return;
21042
21031
  }
21043
21032
  const cause = error instanceof Error ? error : void 0;
21044
- throw new ProvisioningError(`Failed to delete API Gateway V2 Integration ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
21033
+ throw new ProvisioningError(`Failed to delete API Gateway V2 Integration ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
21045
21034
  }
21046
21035
  }
21047
21036
  getIntegrationAttribute(physicalId, attributeName) {
@@ -21095,7 +21084,7 @@ var ApiGatewayV2Provider = class {
21095
21084
  return;
21096
21085
  }
21097
21086
  const cause = error instanceof Error ? error : void 0;
21098
- throw new ProvisioningError(`Failed to delete API Gateway V2 Route ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
21087
+ throw new ProvisioningError(`Failed to delete API Gateway V2 Route ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
21099
21088
  }
21100
21089
  }
21101
21090
  getRouteAttribute(physicalId, attributeName) {
@@ -21184,7 +21173,7 @@ var ApiGatewayV2Provider = class {
21184
21173
  return;
21185
21174
  }
21186
21175
  const cause = error instanceof Error ? error : void 0;
21187
- throw new ProvisioningError(`Failed to delete API Gateway V2 Authorizer ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
21176
+ throw new ProvisioningError(`Failed to delete API Gateway V2 Authorizer ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
21188
21177
  }
21189
21178
  }
21190
21179
  getDriftUnknownPaths(resourceType, properties) {
@@ -21366,49 +21355,34 @@ var ApiGatewayV2Provider = class {
21366
21355
  input.Name = properties["Name"];
21367
21356
  changed = true;
21368
21357
  }
21369
- {
21370
- const r = this.clearableUpdate(properties["Description"], previousProperties["Description"], "");
21371
- if (r.changed) {
21372
- input.Description = r.value;
21373
- changed = true;
21374
- }
21358
+ if (properties["Description"] !== void 0 && properties["Description"] !== previousProperties["Description"]) {
21359
+ input.Description = properties["Description"];
21360
+ changed = true;
21375
21361
  }
21376
21362
  if (properties["CorsConfiguration"] !== void 0 && !this.deepEqual(properties["CorsConfiguration"], previousProperties["CorsConfiguration"])) {
21377
21363
  input.CorsConfiguration = properties["CorsConfiguration"];
21378
21364
  changed = true;
21379
21365
  }
21380
21366
  const corsRemoved = properties["CorsConfiguration"] === void 0 && previousProperties["CorsConfiguration"] !== void 0;
21381
- {
21382
- const r = this.clearableUpdate(properties["DisableExecuteApiEndpoint"], previousProperties["DisableExecuteApiEndpoint"], false);
21383
- if (r.changed) {
21384
- input.DisableExecuteApiEndpoint = r.value;
21385
- changed = true;
21386
- }
21367
+ if (properties["DisableExecuteApiEndpoint"] !== void 0 && properties["DisableExecuteApiEndpoint"] !== previousProperties["DisableExecuteApiEndpoint"]) {
21368
+ input.DisableExecuteApiEndpoint = properties["DisableExecuteApiEndpoint"];
21369
+ changed = true;
21387
21370
  }
21388
- {
21389
- const r = this.clearableUpdate(properties["Version"], previousProperties["Version"], "");
21390
- if (r.changed) {
21391
- input.Version = r.value;
21392
- changed = true;
21393
- }
21371
+ if (properties["Version"] !== void 0 && properties["Version"] !== previousProperties["Version"]) {
21372
+ input.Version = properties["Version"];
21373
+ changed = true;
21394
21374
  }
21395
21375
  if (properties["RouteSelectionExpression"] !== void 0 && properties["RouteSelectionExpression"] !== previousProperties["RouteSelectionExpression"]) {
21396
21376
  input.RouteSelectionExpression = properties["RouteSelectionExpression"];
21397
21377
  changed = true;
21398
21378
  }
21399
- {
21400
- const r = this.clearableUpdate(properties["ApiKeySelectionExpression"], previousProperties["ApiKeySelectionExpression"], "$request.header.x-api-key");
21401
- if (r.changed) {
21402
- input.ApiKeySelectionExpression = r.value;
21403
- changed = true;
21404
- }
21379
+ if (properties["ApiKeySelectionExpression"] !== void 0 && properties["ApiKeySelectionExpression"] !== previousProperties["ApiKeySelectionExpression"]) {
21380
+ input.ApiKeySelectionExpression = properties["ApiKeySelectionExpression"];
21381
+ changed = true;
21405
21382
  }
21406
- {
21407
- const r = this.clearableUpdate(properties["IpAddressType"], previousProperties["IpAddressType"], "ipv4");
21408
- if (r.changed) {
21409
- input.IpAddressType = r.value;
21410
- changed = true;
21411
- }
21383
+ if (properties["IpAddressType"] !== void 0 && properties["IpAddressType"] !== previousProperties["IpAddressType"]) {
21384
+ input.IpAddressType = properties["IpAddressType"];
21385
+ changed = true;
21412
21386
  }
21413
21387
  if (!changed && !corsRemoved) {
21414
21388
  log.debug(`No mutable Api fields changed for ${logicalId}; skipping UpdateApi`);
@@ -21447,7 +21421,7 @@ var ApiGatewayV2Provider = class {
21447
21421
  throw this.wrapMaskedError(log, error, (text) => new ProvisioningError(`Failed to update API Gateway V2 Api ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
21448
21422
  }
21449
21423
  }
21450
- async updateStage(logicalId, physicalId, resourceType, properties, previousProperties, log) {
21424
+ async updateStage(logicalId, physicalId, resourceType, properties, previousProperties, log, restoreFromAws = false) {
21451
21425
  const apiId = properties["ApiId"] ?? previousProperties["ApiId"];
21452
21426
  if (!apiId) throw new ProvisioningError(`ApiId is required to update Stage ${logicalId}`, resourceType, logicalId, physicalId);
21453
21427
  if (properties["ApiId"] !== void 0 && previousProperties["ApiId"] !== void 0 && properties["ApiId"] !== previousProperties["ApiId"]) throw new ResourceUpdateNotSupportedError(resourceType, logicalId, "ApiId is immutable on AWS::ApiGatewayV2::Stage; re-deploy with cdkd deploy --replace");
@@ -21474,12 +21448,15 @@ var ApiGatewayV2Provider = class {
21474
21448
  input.Description = properties["Description"];
21475
21449
  changed = true;
21476
21450
  }
21477
- {
21451
+ if (restoreFromAws) {
21478
21452
  const merged = this.mapWithRemovals(properties["StageVariables"], previousProperties["StageVariables"]);
21479
21453
  if (merged !== void 0) {
21480
21454
  input.StageVariables = merged;
21481
21455
  changed = true;
21482
21456
  }
21457
+ } else if (this.mapEntryAddedOrChanged(properties["StageVariables"], previousProperties["StageVariables"])) {
21458
+ input.StageVariables = properties["StageVariables"];
21459
+ changed = true;
21483
21460
  }
21484
21461
  if (properties["DefaultRouteSettings"] !== void 0 && !this.deepEqual(properties["DefaultRouteSettings"], previousProperties["DefaultRouteSettings"])) {
21485
21462
  input.DefaultRouteSettings = properties["DefaultRouteSettings"];
@@ -21495,12 +21472,9 @@ var ApiGatewayV2Provider = class {
21495
21472
  changed = true;
21496
21473
  }
21497
21474
  const droppedRouteSettingKeys = this.droppedKeys(properties["RouteSettings"], previousProperties["RouteSettings"]);
21498
- {
21499
- const r = this.clearableUpdate(properties["ClientCertificateId"], previousProperties["ClientCertificateId"], "");
21500
- if (r.changed) {
21501
- input.ClientCertificateId = r.value;
21502
- changed = true;
21503
- }
21475
+ if (properties["ClientCertificateId"] !== void 0 && properties["ClientCertificateId"] !== previousProperties["ClientCertificateId"]) {
21476
+ input.ClientCertificateId = properties["ClientCertificateId"];
21477
+ changed = true;
21504
21478
  }
21505
21479
  if (properties["DeploymentId"] !== void 0 && properties["DeploymentId"] !== previousProperties["DeploymentId"]) {
21506
21480
  input.DeploymentId = properties["DeploymentId"];
@@ -21538,7 +21512,7 @@ var ApiGatewayV2Provider = class {
21538
21512
  throw this.wrapMaskedError(log, error, (text) => new ProvisioningError(`Failed to update API Gateway V2 Stage ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
21539
21513
  }
21540
21514
  }
21541
- async updateIntegration(logicalId, physicalId, resourceType, properties, previousProperties, log) {
21515
+ async updateIntegration(logicalId, physicalId, resourceType, properties, previousProperties, log, restoreFromAws = false) {
21542
21516
  const apiId = properties["ApiId"] ?? previousProperties["ApiId"];
21543
21517
  if (!apiId) throw new ProvisioningError(`ApiId is required to update Integration ${logicalId}`, resourceType, logicalId, physicalId);
21544
21518
  if (properties["ApiId"] !== void 0 && previousProperties["ApiId"] !== void 0 && properties["ApiId"] !== previousProperties["ApiId"]) throw new ResourceUpdateNotSupportedError(resourceType, logicalId, "ApiId is immutable on AWS::ApiGatewayV2::Integration; re-deploy with cdkd deploy --replace");
@@ -21567,19 +21541,19 @@ var ApiGatewayV2Provider = class {
21567
21541
  input.TimeoutInMillis = properties["TimeoutInMillis"];
21568
21542
  changed = true;
21569
21543
  }
21570
- {
21544
+ if (restoreFromAws) {
21571
21545
  const merged = this.mapWithRemovals(properties["RequestParameters"], previousProperties["RequestParameters"]);
21572
21546
  if (merged !== void 0) {
21573
21547
  input.RequestParameters = merged;
21574
21548
  changed = true;
21575
21549
  }
21550
+ } else if (this.mapEntryAddedOrChanged(properties["RequestParameters"], previousProperties["RequestParameters"])) {
21551
+ input.RequestParameters = properties["RequestParameters"];
21552
+ changed = true;
21576
21553
  }
21577
- {
21578
- const r = this.clearableUpdate(properties["Description"], previousProperties["Description"], "");
21579
- if (r.changed) {
21580
- input.Description = r.value;
21581
- changed = true;
21582
- }
21554
+ if (properties["Description"] !== void 0 && properties["Description"] !== previousProperties["Description"]) {
21555
+ input.Description = properties["Description"];
21556
+ changed = true;
21583
21557
  }
21584
21558
  if (properties["ConnectionId"] != null && properties["ConnectionId"] !== previousProperties["ConnectionId"]) {
21585
21559
  input.ConnectionId = properties["ConnectionId"];
@@ -21645,7 +21619,7 @@ var ApiGatewayV2Provider = class {
21645
21619
  throw this.wrapMaskedError(log, error, (text) => new ProvisioningError(`Failed to update API Gateway V2 Integration ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
21646
21620
  }
21647
21621
  }
21648
- async updateRoute(logicalId, physicalId, resourceType, properties, previousProperties, log) {
21622
+ async updateRoute(logicalId, physicalId, resourceType, properties, previousProperties, log, restoreFromAws = false) {
21649
21623
  const apiId = properties["ApiId"] ?? previousProperties["ApiId"];
21650
21624
  if (!apiId) throw new ProvisioningError(`ApiId is required to update Route ${logicalId}`, resourceType, logicalId, physicalId);
21651
21625
  if (properties["ApiId"] !== void 0 && previousProperties["ApiId"] !== void 0 && properties["ApiId"] !== previousProperties["ApiId"]) throw new ResourceUpdateNotSupportedError(resourceType, logicalId, "ApiId is immutable on AWS::ApiGatewayV2::Route; re-deploy with cdkd deploy --replace");
@@ -21662,19 +21636,13 @@ var ApiGatewayV2Provider = class {
21662
21636
  input.Target = properties["Target"];
21663
21637
  changed = true;
21664
21638
  }
21665
- {
21666
- const r = this.clearableUpdate(properties["AuthorizationType"], previousProperties["AuthorizationType"], "NONE");
21667
- if (r.changed) {
21668
- input.AuthorizationType = r.value;
21669
- changed = true;
21670
- }
21639
+ if (properties["AuthorizationType"] !== void 0 && properties["AuthorizationType"] !== previousProperties["AuthorizationType"]) {
21640
+ input.AuthorizationType = properties["AuthorizationType"];
21641
+ changed = true;
21671
21642
  }
21672
- {
21673
- const r = this.clearableUpdate(properties["AuthorizerId"], previousProperties["AuthorizerId"], "");
21674
- if (r.changed) {
21675
- input.AuthorizerId = r.value;
21676
- changed = true;
21677
- }
21643
+ if (properties["AuthorizerId"] !== void 0 && properties["AuthorizerId"] !== previousProperties["AuthorizerId"]) {
21644
+ input.AuthorizerId = properties["AuthorizerId"];
21645
+ changed = true;
21678
21646
  }
21679
21647
  {
21680
21648
  const r = this.clearableUpdate(properties["AuthorizationScopes"], previousProperties["AuthorizationScopes"], []);
@@ -21683,12 +21651,9 @@ var ApiGatewayV2Provider = class {
21683
21651
  changed = true;
21684
21652
  }
21685
21653
  }
21686
- {
21687
- const r = this.clearableUpdate(properties["OperationName"], previousProperties["OperationName"], "");
21688
- if (r.changed) {
21689
- input.OperationName = r.value;
21690
- changed = true;
21691
- }
21654
+ if (properties["OperationName"] !== void 0 && properties["OperationName"] !== previousProperties["OperationName"]) {
21655
+ input.OperationName = properties["OperationName"];
21656
+ changed = true;
21692
21657
  }
21693
21658
  {
21694
21659
  const r = this.clearableUpdate(properties["ApiKeyRequired"], previousProperties["ApiKeyRequired"], false);
@@ -21697,18 +21662,21 @@ var ApiGatewayV2Provider = class {
21697
21662
  changed = true;
21698
21663
  }
21699
21664
  }
21700
- {
21665
+ if (restoreFromAws) {
21701
21666
  const merged = this.mapWithRemovals(properties["RequestModels"], previousProperties["RequestModels"]);
21702
21667
  if (merged !== void 0) {
21703
21668
  input.RequestModels = merged;
21704
21669
  changed = true;
21705
21670
  }
21671
+ } else if (this.mapEntryAddedOrChanged(properties["RequestModels"], previousProperties["RequestModels"])) {
21672
+ input.RequestModels = properties["RequestModels"];
21673
+ changed = true;
21706
21674
  }
21707
- if (properties["RequestParameters"] !== void 0 && !this.deepEqual(properties["RequestParameters"], previousProperties["RequestParameters"])) {
21675
+ if (restoreFromAws ? properties["RequestParameters"] !== void 0 && !this.deepEqual(properties["RequestParameters"], previousProperties["RequestParameters"]) : this.mapEntryAddedOrChanged(properties["RequestParameters"], previousProperties["RequestParameters"])) {
21708
21676
  input.RequestParameters = properties["RequestParameters"];
21709
21677
  changed = true;
21710
21678
  }
21711
- const droppedRequestParameterKeys = this.droppedKeys(properties["RequestParameters"], previousProperties["RequestParameters"]);
21679
+ const droppedRequestParameterKeys = restoreFromAws ? this.droppedKeys(properties["RequestParameters"], previousProperties["RequestParameters"]) : [];
21712
21680
  if (properties["ModelSelectionExpression"] !== void 0 && properties["ModelSelectionExpression"] !== previousProperties["ModelSelectionExpression"]) {
21713
21681
  input.ModelSelectionExpression = properties["ModelSelectionExpression"];
21714
21682
  changed = true;
@@ -21782,37 +21750,25 @@ var ApiGatewayV2Provider = class {
21782
21750
  input.AuthorizerUri = properties["AuthorizerUri"];
21783
21751
  changed = true;
21784
21752
  }
21785
- {
21786
- const r = this.clearableUpdate(properties["AuthorizerCredentialsArn"], previousProperties["AuthorizerCredentialsArn"], "");
21787
- if (r.changed) {
21788
- input.AuthorizerCredentialsArn = r.value;
21789
- changed = true;
21790
- }
21753
+ if (properties["AuthorizerCredentialsArn"] !== void 0 && properties["AuthorizerCredentialsArn"] !== previousProperties["AuthorizerCredentialsArn"]) {
21754
+ input.AuthorizerCredentialsArn = properties["AuthorizerCredentialsArn"];
21755
+ changed = true;
21791
21756
  }
21792
- {
21793
- const r = this.clearableUpdate(properties["AuthorizerPayloadFormatVersion"], previousProperties["AuthorizerPayloadFormatVersion"], "");
21794
- if (r.changed) {
21795
- input.AuthorizerPayloadFormatVersion = r.value;
21796
- changed = true;
21797
- }
21757
+ if (properties["AuthorizerPayloadFormatVersion"] !== void 0 && properties["AuthorizerPayloadFormatVersion"] !== previousProperties["AuthorizerPayloadFormatVersion"]) {
21758
+ input.AuthorizerPayloadFormatVersion = properties["AuthorizerPayloadFormatVersion"];
21759
+ changed = true;
21798
21760
  }
21799
- {
21800
- const r = this.clearableUpdate(properties["AuthorizerResultTtlInSeconds"], previousProperties["AuthorizerResultTtlInSeconds"], 0);
21801
- if (r.changed) {
21802
- input.AuthorizerResultTtlInSeconds = r.value;
21803
- changed = true;
21804
- }
21761
+ if (properties["AuthorizerResultTtlInSeconds"] !== void 0 && properties["AuthorizerResultTtlInSeconds"] !== previousProperties["AuthorizerResultTtlInSeconds"]) {
21762
+ input.AuthorizerResultTtlInSeconds = properties["AuthorizerResultTtlInSeconds"];
21763
+ changed = true;
21805
21764
  }
21806
21765
  if (properties["EnableSimpleResponses"] !== void 0 && properties["EnableSimpleResponses"] !== previousProperties["EnableSimpleResponses"]) {
21807
21766
  input.EnableSimpleResponses = properties["EnableSimpleResponses"];
21808
21767
  changed = true;
21809
21768
  }
21810
- {
21811
- const r = this.clearableUpdate(properties["IdentityValidationExpression"], previousProperties["IdentityValidationExpression"], "");
21812
- if (r.changed) {
21813
- input.IdentityValidationExpression = r.value;
21814
- changed = true;
21815
- }
21769
+ if (properties["IdentityValidationExpression"] !== void 0 && properties["IdentityValidationExpression"] !== previousProperties["IdentityValidationExpression"]) {
21770
+ input.IdentityValidationExpression = properties["IdentityValidationExpression"];
21771
+ changed = true;
21816
21772
  }
21817
21773
  if (!changed) {
21818
21774
  log.debug(`No mutable Authorizer fields changed for ${logicalId}; skipping UpdateAuthorizer`);
@@ -21880,6 +21836,11 @@ var ApiGatewayV2Provider = class {
21880
21836
  for (const key of Object.keys(prevMap)) if (!Object.hasOwn(nextMap, key)) merged[key] = "";
21881
21837
  return merged;
21882
21838
  }
21839
+ mapEntryAddedOrChanged(next, previous) {
21840
+ if (next == null || typeof next !== "object" || Array.isArray(next)) return false;
21841
+ const prevMap = previous != null && typeof previous === "object" && !Array.isArray(previous) ? previous : {};
21842
+ return Object.entries(next).some(([key, value]) => !Object.prototype.hasOwnProperty.call(prevMap, key) || !this.deepEqual(value, prevMap[key]));
21843
+ }
21883
21844
  warnTlsConfigIgnoredIfPublic(logicalId, properties, log) {
21884
21845
  if (properties["TlsConfig"] != null && properties["ConnectionType"] !== "VPC_LINK") log.warn(`AWS::ApiGatewayV2::Integration ${logicalId}: TlsConfig is only honored on a VPC_LINK (private) integration — AWS silently ignores it on a public one, and the value will never be readable back from AWS.`);
21885
21846
  }
@@ -22006,7 +21967,7 @@ var CloudFrontOAIProvider = class {
22006
21967
  };
22007
21968
  } catch (error) {
22008
21969
  const cause = error instanceof Error ? error : void 0;
22009
- throw new ProvisioningError(`Failed to create CloudFront OAI ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
21970
+ throw new ProvisioningError(`Failed to create CloudFront OAI ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
22010
21971
  }
22011
21972
  }
22012
21973
  async update(logicalId, physicalId, resourceType, properties, _previousProperties, context) {
@@ -22040,7 +22001,7 @@ var CloudFrontOAIProvider = class {
22040
22001
  } catch (error) {
22041
22002
  if (error instanceof CdkdError) throw error;
22042
22003
  const cause = error instanceof Error ? error : void 0;
22043
- throw new ProvisioningError(`Failed to update CloudFront OAI ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
22004
+ throw new ProvisioningError(`Failed to update CloudFront OAI ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
22044
22005
  }
22045
22006
  }
22046
22007
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -22071,7 +22032,7 @@ var CloudFrontOAIProvider = class {
22071
22032
  return;
22072
22033
  }
22073
22034
  const cause = error instanceof Error ? error : void 0;
22074
- throw new ProvisioningError(`Failed to delete CloudFront OAI ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
22035
+ throw new ProvisioningError(`Failed to delete CloudFront OAI ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
22075
22036
  }
22076
22037
  }
22077
22038
  async getAttribute(physicalId, _resourceType, attributeName) {
@@ -22151,7 +22112,7 @@ var CloudFrontOACProvider = class {
22151
22112
  } catch (error) {
22152
22113
  if (error instanceof CdkdError) throw error;
22153
22114
  const cause = error instanceof Error ? error : void 0;
22154
- throw new ProvisioningError(`Failed to create CloudFront Origin Access Control ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
22115
+ throw new ProvisioningError(`Failed to create CloudFront Origin Access Control ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
22155
22116
  }
22156
22117
  }
22157
22118
  async update(logicalId, physicalId, resourceType, properties, _previousProperties, context) {
@@ -22174,7 +22135,7 @@ var CloudFrontOACProvider = class {
22174
22135
  } catch (error) {
22175
22136
  if (error instanceof CdkdError) throw error;
22176
22137
  const cause = error instanceof Error ? error : void 0;
22177
- throw new ProvisioningError(`Failed to update CloudFront Origin Access Control ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
22138
+ throw new ProvisioningError(`Failed to update CloudFront Origin Access Control ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
22178
22139
  }
22179
22140
  }
22180
22141
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -22205,7 +22166,7 @@ var CloudFrontOACProvider = class {
22205
22166
  }
22206
22167
  if (error instanceof CdkdError) throw error;
22207
22168
  const cause = error instanceof Error ? error : void 0;
22208
- throw new ProvisioningError(`Failed to delete CloudFront Origin Access Control ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
22169
+ throw new ProvisioningError(`Failed to delete CloudFront Origin Access Control ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
22209
22170
  }
22210
22171
  }
22211
22172
  async getAttribute(physicalId, _resourceType, attributeName) {
@@ -22381,7 +22342,7 @@ var CloudFrontDistributionProvider = class {
22381
22342
  throw markNonRetryable(new ProvisioningError(maskSecrets(`Failed to create CloudFront Distribution ${logicalId}: CloudFront refused the create because this deploy's CallerReference had been used before, which means an EARLIER attempt of this same create succeeded and cdkd never received its response. That distribution is LIVE, is not in cdkd state, and 'cdkd destroy' will not remove it — it bills until you delete it by hand. CloudFront does not return CallerReference from ListDistributions, so find it with 'aws cloudfront list-distributions' and match on ${this.orphanSearchHint(properties, maskSecrets)}; then disable and delete it (or import it with 'cdkd import') before re-running. The AWS error is on this error's cause.`), resourceType, logicalId, void 0, cause));
22382
22343
  }
22383
22344
  const cause = error instanceof Error ? error : void 0;
22384
- throw new ProvisioningError(`Failed to create CloudFront Distribution ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
22345
+ throw new ProvisioningError(`Failed to create CloudFront Distribution ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
22385
22346
  }
22386
22347
  }
22387
22348
  orphanSearchHint(properties, maskSecrets) {
@@ -22428,7 +22389,7 @@ var CloudFrontDistributionProvider = class {
22428
22389
  } catch (error) {
22429
22390
  if (error instanceof CdkdError) throw error;
22430
22391
  const cause = error instanceof Error ? error : void 0;
22431
- throw new ProvisioningError(`Failed to update CloudFront Distribution ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
22392
+ throw new ProvisioningError(`Failed to update CloudFront Distribution ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
22432
22393
  }
22433
22394
  }
22434
22395
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -22479,7 +22440,7 @@ var CloudFrontDistributionProvider = class {
22479
22440
  return;
22480
22441
  }
22481
22442
  const cause = error instanceof Error ? error : void 0;
22482
- const failure = new ProvisioningError(`Failed to delete CloudFront Distribution ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
22443
+ const failure = new ProvisioningError(`Failed to delete CloudFront Distribution ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
22483
22444
  throw stripped ? markDeleteStarted(failure) : failure;
22484
22445
  }
22485
22446
  }
@@ -22897,7 +22858,7 @@ var CloudFrontDistributionProvider = class {
22897
22858
  }
22898
22859
  } catch (err) {
22899
22860
  const cause = err instanceof Error ? err : void 0;
22900
- throw new ProvisioningError(`CloudFront Distribution ${physicalId}: tag diff failed (removed=${removed.length}, upserts=${upserts.length}): ${err instanceof Error ? err.message : String(err)}. UpdateDistribution succeeded but TagResource/UntagResource did not — state has NOT been updated so the next deploy will retry the tag-diff.`, resourceType, logicalId, physicalId, cause);
22861
+ throw new ProvisioningError(`CloudFront Distribution ${physicalId}: tag diff failed (removed=${removed.length}, upserts=${upserts.length}): ${describeAwsFailure(err).detail}. UpdateDistribution succeeded but TagResource/UntagResource did not — state has NOT been updated so the next deploy will retry the tag-diff.`, resourceType, logicalId, physicalId, cause);
22901
22862
  }
22902
22863
  }
22903
22864
  async import(input) {
@@ -22998,7 +22959,7 @@ var AgentCoreRuntimeProvider = class {
22998
22959
  };
22999
22960
  } catch (error) {
23000
22961
  const cause = error instanceof Error ? error : void 0;
23001
- throw new ProvisioningError(`Failed to create BedrockAgentCore Runtime ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
22962
+ throw new ProvisioningError(`Failed to create BedrockAgentCore Runtime ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
23002
22963
  }
23003
22964
  }
23004
22965
  async update(logicalId, physicalId, resourceType, properties, _previousProperties, context) {
@@ -23033,7 +22994,7 @@ var AgentCoreRuntimeProvider = class {
23033
22994
  };
23034
22995
  } catch (error) {
23035
22996
  const cause = error instanceof Error ? error : void 0;
23036
- throw new ProvisioningError(`Failed to update BedrockAgentCore Runtime ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
22997
+ throw new ProvisioningError(`Failed to update BedrockAgentCore Runtime ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
23037
22998
  }
23038
22999
  }
23039
23000
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -23049,7 +23010,7 @@ var AgentCoreRuntimeProvider = class {
23049
23010
  return;
23050
23011
  }
23051
23012
  const cause = error instanceof Error ? error : void 0;
23052
- throw new ProvisioningError(`Failed to delete BedrockAgentCore Runtime ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
23013
+ throw new ProvisioningError(`Failed to delete BedrockAgentCore Runtime ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
23053
23014
  }
23054
23015
  }
23055
23016
  buildAttributes(response, agentRuntimeName) {
@@ -23151,7 +23112,7 @@ var AgentCoreBrowserProvider = class {
23151
23112
  };
23152
23113
  } catch (error) {
23153
23114
  const cause = error instanceof Error ? error : void 0;
23154
- throw new ProvisioningError(`Failed to adopt the AWS-managed default browser for ${logicalId}: ${error instanceof Error ? error.message : String(error)}. Bedrock AgentCore may not be available in this region.`, resourceType, logicalId, void 0, cause);
23115
+ throw new ProvisioningError(`Failed to adopt the AWS-managed default browser for ${logicalId}: ${describeAwsFailure(error).detail}. Bedrock AgentCore may not be available in this region.`, resourceType, logicalId, void 0, cause);
23155
23116
  }
23156
23117
  }
23157
23118
  async update(logicalId, physicalId, _resourceType, _properties, _previousProperties, _context) {
@@ -23218,7 +23179,7 @@ var AgentCoreCodeInterpreterProvider = class {
23218
23179
  };
23219
23180
  } catch (error) {
23220
23181
  const cause = error instanceof Error ? error : void 0;
23221
- throw new ProvisioningError(`Failed to adopt the AWS-managed default code interpreter for ${logicalId}: ${error instanceof Error ? error.message : String(error)}. Bedrock AgentCore may not be available in this region.`, resourceType, logicalId, void 0, cause);
23182
+ throw new ProvisioningError(`Failed to adopt the AWS-managed default code interpreter for ${logicalId}: ${describeAwsFailure(error).detail}. Bedrock AgentCore may not be available in this region.`, resourceType, logicalId, void 0, cause);
23222
23183
  }
23223
23184
  }
23224
23185
  async update(logicalId, physicalId, _resourceType, _properties, _previousProperties, _context) {
@@ -23314,7 +23275,7 @@ var AgentCoreEvaluatorProvider = class {
23314
23275
  };
23315
23276
  } catch (error) {
23316
23277
  const cause = error instanceof Error ? error : void 0;
23317
- throw new ProvisioningError(`Failed to create BedrockAgentCore Evaluator ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
23278
+ throw new ProvisioningError(`Failed to create BedrockAgentCore Evaluator ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
23318
23279
  }
23319
23280
  }
23320
23281
  async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
@@ -23343,7 +23304,7 @@ var AgentCoreEvaluatorProvider = class {
23343
23304
  };
23344
23305
  } catch (error) {
23345
23306
  const cause = error instanceof Error ? error : void 0;
23346
- throw new ProvisioningError(`Failed to update BedrockAgentCore Evaluator ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
23307
+ throw new ProvisioningError(`Failed to update BedrockAgentCore Evaluator ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
23347
23308
  }
23348
23309
  }
23349
23310
  async syncTags(evaluatorArn, resourceType, logicalId, previousTagsRaw, nextTagsRaw) {
@@ -23374,7 +23335,7 @@ var AgentCoreEvaluatorProvider = class {
23374
23335
  return;
23375
23336
  }
23376
23337
  const cause = error instanceof Error ? error : void 0;
23377
- throw new ProvisioningError(`Failed to delete BedrockAgentCore Evaluator ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
23338
+ throw new ProvisioningError(`Failed to delete BedrockAgentCore Evaluator ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
23378
23339
  }
23379
23340
  }
23380
23341
  async getAttribute(physicalId, _resourceType, attributeName) {
@@ -23516,7 +23477,7 @@ var StepFunctionsProvider = class {
23516
23477
  } catch (error) {
23517
23478
  if (error instanceof ProvisioningError) throw error;
23518
23479
  const cause = error instanceof Error ? error : void 0;
23519
- throw new ProvisioningError(`Failed to create Step Functions state machine ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, stateMachineName, cause);
23480
+ throw new ProvisioningError(`Failed to create Step Functions state machine ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, stateMachineName, cause);
23520
23481
  }
23521
23482
  }
23522
23483
  async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
@@ -23550,7 +23511,7 @@ var StepFunctionsProvider = class {
23550
23511
  };
23551
23512
  } catch (error) {
23552
23513
  const cause = error instanceof Error ? error : void 0;
23553
- throw new ProvisioningError(`Failed to update Step Functions state machine ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
23514
+ throw new ProvisioningError(`Failed to update Step Functions state machine ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
23554
23515
  }
23555
23516
  }
23556
23517
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -23566,7 +23527,7 @@ var StepFunctionsProvider = class {
23566
23527
  return;
23567
23528
  }
23568
23529
  const cause = error instanceof Error ? error : void 0;
23569
- throw new ProvisioningError(`Failed to delete Step Functions state machine ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
23530
+ throw new ProvisioningError(`Failed to delete Step Functions state machine ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
23570
23531
  }
23571
23532
  }
23572
23533
  async readCurrentState(physicalId, _logicalId, _resourceType) {
@@ -23840,15 +23801,7 @@ var ECSProvider = class {
23840
23801
  taskDefinitionCreateClient;
23841
23802
  providerRegion = ambientRegion();
23842
23803
  logger = getLogger().child("ECSProvider");
23843
- removalDefaults = /* @__PURE__ */ new Map([["AWS::ECS::Service", /* @__PURE__ */ new Map([
23844
- ["CapacityProviderStrategy", []],
23845
- ["PlacementConstraints", []],
23846
- ["PlatformVersion", "LATEST"],
23847
- ["HealthCheckGracePeriodSeconds", 0],
23848
- ["EnableECSManagedTags", false],
23849
- ["PropagateTags", "NONE"],
23850
- ["EnableExecuteCommand", false]
23851
- ])]]);
23804
+ removalDefaults = /* @__PURE__ */ new Map();
23852
23805
  handledProperties = /* @__PURE__ */ new Map([
23853
23806
  ["AWS::ECS::Cluster", /* @__PURE__ */ new Set([
23854
23807
  "ClusterName",
@@ -24112,7 +24065,7 @@ var ECSProvider = class {
24112
24065
  return;
24113
24066
  }
24114
24067
  const cause = error instanceof Error ? error : void 0;
24115
- throw new ProvisioningError(`Failed to delete ECS cluster ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
24068
+ throw new ProvisioningError(`Failed to delete ECS cluster ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
24116
24069
  }
24117
24070
  }
24118
24071
  async getClusterAttribute(physicalId, attributeName) {
@@ -24188,7 +24141,7 @@ var ECSProvider = class {
24188
24141
  return;
24189
24142
  }
24190
24143
  const cause = error instanceof Error ? error : void 0;
24191
- throw new ProvisioningError(`Failed to delete ECS task definition ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
24144
+ throw new ProvisioningError(`Failed to delete ECS task definition ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
24192
24145
  }
24193
24146
  }
24194
24147
  async getTaskDefinitionAttribute(physicalId, attributeName) {
@@ -24257,7 +24210,7 @@ var ECSProvider = class {
24257
24210
  survivorArn = service.serviceArn;
24258
24211
  log.warn(`Failed to clean up partially-created ECS service ${logicalIdShown(logicalId)} ${isPlainImportValue(service.serviceArn) ? `(${service.serviceArn})` : VALUE_NOT_SHOWN}: ${describeAwsFailure(cleanupError).detail}. Manual deletion may be required before the next deploy: ${deleteCommand.render()}`);
24259
24212
  }
24260
- throw new Error(`ECS service ${logicalIdShown(logicalId)} did not reach steady state under --full-wait: ${waitError instanceof Error ? waitError.message : String(waitError)}. Inspect why its tasks stopped (stopped tasks stay visible for about an hour): ${listStopped.render()}, then ${aws`aws ecs describe-tasks${clusterArg} --tasks '<task-arn>' --query 'tasks[].[stoppedReason,containers[].reason]'`.render()}`, { cause: waitError });
24213
+ throw new Error(`ECS service ${logicalIdShown(logicalId)} did not reach steady state under --full-wait: ${describeAwsFailure(waitError).detail}. Inspect why its tasks stopped (stopped tasks stay visible for about an hour): ${listStopped.render()}, then ${aws`aws ecs describe-tasks${clusterArg} --tasks '<task-arn>' --query 'tasks[].[stoppedReason,containers[].reason]'`.render()}`, { cause: waitError });
24261
24214
  }
24262
24215
  return {
24263
24216
  physicalId: service.serviceArn,
@@ -24348,7 +24301,7 @@ var ECSProvider = class {
24348
24301
  const serviceRegistriesInput = isEcsController && serviceRegistriesChanged ? this.convertServiceRegistries(properties["ServiceRegistries"]) ?? [] : void 0;
24349
24302
  const capacityProviderStrategyInput = this.convertCapacityProviderStrategy(properties["CapacityProviderStrategy"]);
24350
24303
  const placementConstraintsInput = this.convertPlacementConstraints(properties["PlacementConstraints"]);
24351
- const placementStrategyInput = clearOnUpdateRemoval(this.convertPlacementStrategies(properties["PlacementStrategies"] ?? properties["PlacementStrategy"]), previousProperties["PlacementStrategies"] ?? previousProperties["PlacementStrategy"], []);
24304
+ const placementStrategyInput = this.convertPlacementStrategies(properties["PlacementStrategies"] ?? properties["PlacementStrategy"]);
24352
24305
  const platformVersionInput = properties["PlatformVersion"];
24353
24306
  const healthCheckGracePeriodSecondsInput = properties["HealthCheckGracePeriodSeconds"];
24354
24307
  const enableECSManagedTagsInput = properties["EnableECSManagedTags"];
@@ -24449,7 +24402,7 @@ var ECSProvider = class {
24449
24402
  return;
24450
24403
  }
24451
24404
  const cause = error instanceof Error ? error : void 0;
24452
- const failure = new ProvisioningError(`Failed to delete ECS service ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
24405
+ const failure = new ProvisioningError(`Failed to delete ECS service ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
24453
24406
  throw stripped ? markDeleteStarted(failure) : failure;
24454
24407
  }
24455
24408
  }
@@ -25467,6 +25420,7 @@ var ELBv2Provider = class {
25467
25420
  "Tags",
25468
25421
  ...LISTENER_LEFT_IN_PLACE_ON_REMOVAL
25469
25422
  ])]]);
25423
+ lambdaClients = /* @__PURE__ */ new Map();
25470
25424
  getClient() {
25471
25425
  if (!this.elbv2Client) this.elbv2Client = new ElasticLoadBalancingV2Client({
25472
25426
  ...ambientClientDefaults(),
@@ -25474,6 +25428,41 @@ var ELBv2Provider = class {
25474
25428
  });
25475
25429
  return this.elbv2Client;
25476
25430
  }
25431
+ async waitForLambdaTargetsActive(logicalId, targetType, targets) {
25432
+ if (targetType !== "lambda") return;
25433
+ for (const target of targets) {
25434
+ const parts = typeof target.Id === "string" ? target.Id.split(":") : [];
25435
+ if (parts[0] !== "arn" || parts[2] !== "lambda" || !parts[3]) {
25436
+ this.logger.debug(`Skipping the Active wait for target ${String(target.Id)} of ${logicalId}: not a Lambda function ARN`);
25437
+ continue;
25438
+ }
25439
+ const region = parts[3];
25440
+ let client = this.lambdaClients.get(region);
25441
+ if (!client) {
25442
+ client = new LambdaClient({
25443
+ ...ambientClientDefaults(),
25444
+ region
25445
+ });
25446
+ this.lambdaClients.set(region, client);
25447
+ }
25448
+ const watch = startInterruptWatch(`ELBv2 TargetGroup ${logicalId} Lambda target wait`);
25449
+ const abort = new AbortController();
25450
+ const poll = setInterval(() => {
25451
+ if (watch.isInterrupted()) abort.abort();
25452
+ }, 1e3);
25453
+ try {
25454
+ if (watch.isInterrupted()) throw watch.onInterrupted();
25455
+ await waitForLambdaFunctionActive(client, target.Id, abort.signal);
25456
+ } catch (error) {
25457
+ if (watch.isInterrupted()) throw watch.onInterrupted();
25458
+ throw error;
25459
+ } finally {
25460
+ clearInterval(poll);
25461
+ watch.dispose();
25462
+ }
25463
+ this.logger.debug(`Lambda target ${target.Id} of ${logicalId} is Active`);
25464
+ }
25465
+ }
25477
25466
  maskedRetryLogger(maskSecrets) {
25478
25467
  return createMaskedRetryLogger(this.logger, maskSecrets);
25479
25468
  }
@@ -25845,7 +25834,7 @@ var ELBv2Provider = class {
25845
25834
  return;
25846
25835
  }
25847
25836
  const cause = error instanceof Error ? error : void 0;
25848
- throw new ProvisioningError(`Failed to delete LoadBalancer ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
25837
+ throw new ProvisioningError(`Failed to delete LoadBalancer ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
25849
25838
  }
25850
25839
  }
25851
25840
  async createTargetGroup(logicalId, resourceType, properties, maskSecrets) {
@@ -25892,6 +25881,7 @@ var ELBv2Provider = class {
25892
25881
  this.logger.debug(`Applied ${tgAttributes.length} TargetGroup attribute(s) for ${logicalId}`);
25893
25882
  }
25894
25883
  if (targets.length > 0) {
25884
+ await this.waitForLambdaTargetsActive(logicalId, properties["TargetType"], targets);
25895
25885
  await this.getClient().send(new RegisterTargetsCommand({
25896
25886
  TargetGroupArn: tgArn,
25897
25887
  Targets: targets
@@ -25900,12 +25890,15 @@ var ELBv2Provider = class {
25900
25890
  }
25901
25891
  } catch (innerError) {
25902
25892
  if (heldBefore !== "free") this.logger.warn(maskerOrIdentity(maskSecrets)(skippedCleanupText(heldBefore, `TargetGroup ${logicalId} (${tgArn})`, pasteableAwsCommand(maskSecrets)`aws elbv2 delete-target-group --target-group-arn ${tgArn}`.render())));
25903
- else try {
25904
- await this.getClient().send(new DeleteTargetGroupCommand({ TargetGroupArn: tgArn }));
25905
- this.logger.debug(`Cleaned up partially-created TargetGroup ${logicalId} (${tgArn}) after wiring failure`);
25906
- } catch (cleanupError) {
25907
- leftBehindArn = tgArn;
25908
- this.logger.warn(`Failed to clean up partially-created TargetGroup ${logicalId} (${tgArn}): ${this.maskErrorMessage(cleanupError, maskSecrets)}. Manual deletion may be required before the next deploy: ${pasteableAwsCommand(maskSecrets)`aws elbv2 delete-target-group --target-group-arn ${tgArn}`.render()}`);
25893
+ else {
25894
+ if (isInterruptedWaitError(innerError)) this.logger.warn(maskerOrIdentity(maskSecrets)(`Interrupted after creating TargetGroup ${logicalId} (${tgArn}) but before its targets were registered. Nothing in cdkd state refers to it, so cdkd is deleting it now. If that delete fails, remove it yourself: ${pasteableAwsCommand(maskSecrets)`aws elbv2 delete-target-group --target-group-arn ${tgArn}`.render()}`));
25895
+ try {
25896
+ await this.getClient().send(new DeleteTargetGroupCommand({ TargetGroupArn: tgArn }));
25897
+ this.logger.debug(`Cleaned up partially-created TargetGroup ${logicalId} (${tgArn}) after wiring failure`);
25898
+ } catch (cleanupError) {
25899
+ leftBehindArn = tgArn;
25900
+ this.logger.warn(`Failed to clean up partially-created TargetGroup ${logicalId} (${tgArn}): ${this.maskErrorMessage(cleanupError, maskSecrets)}. Manual deletion may be required before the next deploy: ${pasteableAwsCommand(maskSecrets)`aws elbv2 delete-target-group --target-group-arn ${tgArn}`.render()}`);
25901
+ }
25909
25902
  }
25910
25903
  throw markAuxiliaryFailure(innerError, logicalId);
25911
25904
  }
@@ -25973,6 +25966,7 @@ var ELBv2Provider = class {
25973
25966
  const targetsToRegister = newTargets.filter((t) => !oldTargetKeys.has(targetKey(t)));
25974
25967
  const targetsToDeregister = oldTargets.filter((t) => !newTargetKeys.has(targetKey(t)));
25975
25968
  if (targetsToRegister.length > 0) {
25969
+ await this.waitForLambdaTargetsActive(logicalId, properties["TargetType"], targetsToRegister);
25976
25970
  await this.getClient().send(new RegisterTargetsCommand({
25977
25971
  TargetGroupArn: physicalId,
25978
25972
  Targets: targetsToRegister
@@ -26012,7 +26006,7 @@ var ELBv2Provider = class {
26012
26006
  return;
26013
26007
  }
26014
26008
  const cause = error instanceof Error ? error : void 0;
26015
- throw new ProvisioningError(`Failed to delete TargetGroup ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
26009
+ throw new ProvisioningError(`Failed to delete TargetGroup ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
26016
26010
  }
26017
26011
  }
26018
26012
  async listenerPortHeld(loadBalancerArn, port) {
@@ -26164,7 +26158,7 @@ var ELBv2Provider = class {
26164
26158
  return;
26165
26159
  }
26166
26160
  const cause = error instanceof Error ? error : void 0;
26167
- throw new ProvisioningError(`Failed to delete Listener ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
26161
+ throw new ProvisioningError(`Failed to delete Listener ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
26168
26162
  }
26169
26163
  }
26170
26164
  normalizeAttributes(raw) {
@@ -27786,7 +27780,6 @@ var DocDBProvider = class {
27786
27780
  logger = getLogger().child("DocDBProvider");
27787
27781
  protectionFlips = new ProtectionFlipRegistry();
27788
27782
  disableCcApiFallback = true;
27789
- removalDefaults = /* @__PURE__ */ new Map([["AWS::DocDB::DBCluster", /* @__PURE__ */ new Map([["DeletionProtection", false]])]]);
27790
27783
  handledProperties = /* @__PURE__ */ new Map([["AWS::DocDB::DBCluster", /* @__PURE__ */ new Set([
27791
27784
  "DBClusterIdentifier",
27792
27785
  "EngineVersion",
@@ -27836,8 +27829,7 @@ var DocDBProvider = class {
27836
27829
  default: throw new ProvisioningError(`Unsupported resource type: ${resourceType}`, resourceType, logicalId);
27837
27830
  }
27838
27831
  }
27839
- async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
27840
- properties = withRemovalDefaults(this.removalDefaults, resourceType, properties, previousProperties, context);
27832
+ async update(logicalId, physicalId, resourceType, properties, previousProperties, _context) {
27841
27833
  switch (resourceType) {
27842
27834
  case "AWS::DocDB::DBCluster": return this.updateDBCluster(logicalId, physicalId, resourceType, properties, previousProperties);
27843
27835
  case "AWS::DocDB::DBInstance": return this.updateDBInstance(logicalId, physicalId, resourceType, properties, previousProperties);
@@ -27889,7 +27881,7 @@ var DocDBProvider = class {
27889
27881
  attributes: clusterAttributes(await this.describeDBCluster(dbClusterIdentifier))
27890
27882
  };
27891
27883
  } catch (error) {
27892
- const thrown = error instanceof ProvisioningError ? error : new ProvisioningError(`Failed to create DocDB DBCluster ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, dbClusterIdentifier, error instanceof Error ? error : void 0);
27884
+ const thrown = error instanceof ProvisioningError ? error : new ProvisioningError(`Failed to create DocDB DBCluster ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, dbClusterIdentifier, error instanceof Error ? error : void 0);
27893
27885
  if (clusterCreated) markCreatedBeforeFailure(thrown, logicalId, resourceType, dbClusterIdentifier, createdResourceId);
27894
27886
  throw thrown;
27895
27887
  }
@@ -27904,7 +27896,7 @@ var DocDBProvider = class {
27904
27896
  DBClusterIdentifier: physicalId,
27905
27897
  EngineVersion: properties["EngineVersion"],
27906
27898
  DeletionProtection: properties["DeletionProtection"],
27907
- BackupRetentionPeriod: clearOnUpdateRemoval(properties["BackupRetentionPeriod"] != null ? Number(properties["BackupRetentionPeriod"]) : void 0, previousProperties["BackupRetentionPeriod"] != null ? Number(previousProperties["BackupRetentionPeriod"]) : void 0, 1),
27899
+ BackupRetentionPeriod: properties["BackupRetentionPeriod"] != null ? Number(properties["BackupRetentionPeriod"]) : void 0,
27908
27900
  PreferredBackupWindow: properties["PreferredBackupWindow"],
27909
27901
  PreferredMaintenanceWindow: properties["PreferredMaintenanceWindow"],
27910
27902
  DBClusterParameterGroupName: properties["DBClusterParameterGroupName"],
@@ -27923,7 +27915,7 @@ var DocDBProvider = class {
27923
27915
  };
27924
27916
  } catch (error) {
27925
27917
  const cause = error instanceof Error ? error : void 0;
27926
- throw new ProvisioningError(`Failed to update DocDB DBCluster ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
27918
+ throw new ProvisioningError(`Failed to update DocDB DBCluster ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
27927
27919
  }
27928
27920
  }
27929
27921
  async deleteDBCluster(logicalId, physicalId, resourceType, context) {
@@ -27997,7 +27989,7 @@ var DocDBProvider = class {
27997
27989
  return;
27998
27990
  }
27999
27991
  const cause = error instanceof Error ? error : void 0;
28000
- throw new ProvisioningError(`Failed to delete DocDB DBCluster ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
27992
+ throw new ProvisioningError(`Failed to delete DocDB DBCluster ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
28001
27993
  }
28002
27994
  }
28003
27995
  async createDBInstance(logicalId, resourceType, properties) {
@@ -28030,7 +28022,7 @@ var DocDBProvider = class {
28030
28022
  attributes: instanceAttributes(await this.describeDBInstance(dbInstanceIdentifier))
28031
28023
  };
28032
28024
  } catch (error) {
28033
- const thrown = error instanceof ProvisioningError ? error : new ProvisioningError(`Failed to create DocDB DBInstance ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, dbInstanceIdentifier, error instanceof Error ? error : void 0);
28025
+ const thrown = error instanceof ProvisioningError ? error : new ProvisioningError(`Failed to create DocDB DBInstance ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, dbInstanceIdentifier, error instanceof Error ? error : void 0);
28034
28026
  if (instanceCreated) markCreatedBeforeFailure(thrown, logicalId, resourceType, dbInstanceIdentifier, createdResourceId);
28035
28027
  throw thrown;
28036
28028
  }
@@ -28056,7 +28048,7 @@ var DocDBProvider = class {
28056
28048
  };
28057
28049
  } catch (error) {
28058
28050
  const cause = error instanceof Error ? error : void 0;
28059
- throw new ProvisioningError(`Failed to update DocDB DBInstance ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
28051
+ throw new ProvisioningError(`Failed to update DocDB DBInstance ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
28060
28052
  }
28061
28053
  }
28062
28054
  async deleteDBInstance(logicalId, physicalId, resourceType, context) {
@@ -28074,7 +28066,7 @@ var DocDBProvider = class {
28074
28066
  return;
28075
28067
  }
28076
28068
  const cause = error instanceof Error ? error : void 0;
28077
- throw new ProvisioningError(`Failed to delete DocDB DBInstance ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
28069
+ throw new ProvisioningError(`Failed to delete DocDB DBInstance ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
28078
28070
  }
28079
28071
  }
28080
28072
  async describeDBCluster(dbClusterIdentifier) {
@@ -28340,7 +28332,7 @@ var DocDBSubnetGroupProvider = class {
28340
28332
  };
28341
28333
  } catch (error) {
28342
28334
  const cause = error instanceof Error ? error : void 0;
28343
- throw new ProvisioningError(`Failed to create DocDB DBSubnetGroup ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, dbSubnetGroupName, cause);
28335
+ throw new ProvisioningError(`Failed to create DocDB DBSubnetGroup ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, dbSubnetGroupName, cause);
28344
28336
  }
28345
28337
  }
28346
28338
  async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
@@ -28367,7 +28359,7 @@ var DocDBSubnetGroupProvider = class {
28367
28359
  };
28368
28360
  } catch (error) {
28369
28361
  const cause = error instanceof Error ? error : void 0;
28370
- throw new ProvisioningError(`Failed to update DocDB DBSubnetGroup ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
28362
+ throw new ProvisioningError(`Failed to update DocDB DBSubnetGroup ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
28371
28363
  }
28372
28364
  }
28373
28365
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -28384,7 +28376,7 @@ var DocDBSubnetGroupProvider = class {
28384
28376
  return;
28385
28377
  }
28386
28378
  const cause = error instanceof Error ? error : void 0;
28387
- throw new ProvisioningError(`Failed to delete DocDB DBSubnetGroup ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
28379
+ throw new ProvisioningError(`Failed to delete DocDB DBSubnetGroup ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
28388
28380
  }
28389
28381
  }
28390
28382
  async import(input) {
@@ -28624,7 +28616,7 @@ var Route53Provider = class {
28624
28616
  this.logger.warn(`Best-effort rollback DeleteHostedZone for ${zoneId} also failed: ${describeAwsFailure(deleteError).detail} — operator may need to clean up the orphan zone`);
28625
28617
  }
28626
28618
  const cause = uhfError instanceof Error ? uhfError : void 0;
28627
- throw new ProvisioningError(`Failed to enable Accelerated Recovery on hosted zone ${logicalId} (${zoneId}): ${uhfError instanceof Error ? uhfError.message : String(uhfError)}`, resourceType, logicalId, zoneId, cause);
28619
+ throw new ProvisioningError(`Failed to enable Accelerated Recovery on hosted zone ${logicalId} (${zoneId}): ${describeAwsFailure(uhfError).detail}`, resourceType, logicalId, zoneId, cause);
28628
28620
  }
28629
28621
  const nameServers = response.DelegationSet?.NameServers ?? [];
28630
28622
  this.logger.debug(`Successfully created hosted zone ${logicalId}: ${zoneId}`);
@@ -28638,7 +28630,7 @@ var Route53Provider = class {
28638
28630
  };
28639
28631
  } catch (error) {
28640
28632
  if (zoneCreated) markAuxiliaryFailure(error, logicalId);
28641
- const thrown = error instanceof ProvisioningError ? error : new ProvisioningError(`Failed to create hosted zone ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, error instanceof Error ? error : void 0);
28633
+ const thrown = error instanceof ProvisioningError ? error : new ProvisioningError(`Failed to create hosted zone ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, error instanceof Error ? error : void 0);
28642
28634
  if (createdZoneId !== void 0 && !zoneRolledBack) markCreatedBeforeFailure(thrown, logicalId, resourceType, createdZoneId);
28643
28635
  throw thrown;
28644
28636
  }
@@ -28652,7 +28644,7 @@ var Route53Provider = class {
28652
28644
  try {
28653
28645
  adopted = await this.findHostedZoneByCallerReference(input.Name, input.CallerReference);
28654
28646
  } catch (lookupError) {
28655
- this.logger.warn(`CreateHostedZone for ${input.Name} was refused as already-existing, and the lookup that would have adopted the existing zone failed: ${lookupError instanceof Error ? lookupError.message : String(lookupError)}. Reporting the original error.`);
28647
+ this.logger.warn(`CreateHostedZone for ${input.Name} was refused as already-existing, and the lookup that would have adopted the existing zone failed: ${describeAwsFailure(lookupError).detail}. Reporting the original error.`);
28656
28648
  throw error;
28657
28649
  }
28658
28650
  if (!adopted?.Id) throw error;
@@ -28664,7 +28656,7 @@ var Route53Provider = class {
28664
28656
  ...described.DelegationSet ? { DelegationSet: described.DelegationSet } : {}
28665
28657
  };
28666
28658
  } catch (describeError) {
28667
- this.logger.warn(`Adopted hosted zone ${adopted.Id} but could not read it back: ${describeError instanceof Error ? describeError.message : String(describeError)}. Reporting the original error rather than returning a zone with no NameServers.`);
28659
+ this.logger.warn(`Adopted hosted zone ${adopted.Id} but could not read it back: ${describeAwsFailure(describeError).detail}. Reporting the original error rather than returning a zone with no NameServers.`);
28668
28660
  throw error;
28669
28661
  }
28670
28662
  }
@@ -28718,7 +28710,7 @@ var Route53Provider = class {
28718
28710
  } catch (error) {
28719
28711
  if (error instanceof CdkdError) throw error;
28720
28712
  const cause = error instanceof Error ? error : void 0;
28721
- throw new ProvisioningError(`Failed to update hosted zone ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
28713
+ throw new ProvisioningError(`Failed to update hosted zone ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
28722
28714
  }
28723
28715
  }
28724
28716
  async deleteHostedZone(logicalId, physicalId, resourceType, context) {
@@ -28737,7 +28729,7 @@ var Route53Provider = class {
28737
28729
  return;
28738
28730
  }
28739
28731
  const cause = error instanceof Error ? error : void 0;
28740
- const failure = error instanceof ProvisioningError ? error : new ProvisioningError(`Failed to delete hosted zone ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
28732
+ const failure = error instanceof ProvisioningError ? error : new ProvisioningError(`Failed to delete hosted zone ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
28741
28733
  throw progress.stripped ? markDeleteStarted(failure) : failure;
28742
28734
  }
28743
28735
  }
@@ -28824,7 +28816,7 @@ var Route53Provider = class {
28824
28816
  if (error instanceof ProvisioningError) throw error;
28825
28817
  const cause = error instanceof Error ? error : void 0;
28826
28818
  const cnameConflict = isCnameConflictRefusal(error);
28827
- const wrapped = new ProvisioningError(`Failed to create record set ${logicalId}: ${error instanceof Error ? error.message : String(error)}` + (cnameConflict ? CNAME_CONFLICT_COLLISION_NOTE : ""), resourceType, logicalId, void 0, cause);
28819
+ const wrapped = new ProvisioningError(`Failed to create record set ${logicalId}: ${describeAwsFailure(error).detail}` + (cnameConflict ? CNAME_CONFLICT_COLLISION_NOTE : ""), resourceType, logicalId, void 0, cause);
28828
28820
  throw cnameConflict ? markNameCollision(wrapped) : wrapped;
28829
28821
  }
28830
28822
  }
@@ -28865,7 +28857,7 @@ var Route53Provider = class {
28865
28857
  };
28866
28858
  } catch (error) {
28867
28859
  const cause = error instanceof Error ? error : void 0;
28868
- throw new ProvisioningError(`Failed to update record set ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
28860
+ throw new ProvisioningError(`Failed to update record set ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
28869
28861
  }
28870
28862
  }
28871
28863
  async findLiveRecordSet(hostedZoneId, properties) {
@@ -28955,7 +28947,7 @@ var Route53Provider = class {
28955
28947
  }
28956
28948
  if (error instanceof ProvisioningError) throw error;
28957
28949
  const cause = error instanceof Error ? error : void 0;
28958
- throw new ProvisioningError(`Failed to delete record set ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
28950
+ throw new ProvisioningError(`Failed to delete record set ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
28959
28951
  }
28960
28952
  }
28961
28953
  async waitForAcceleratedRecoveryMutable(zoneId, logicalId, resourceType) {
@@ -29752,7 +29744,7 @@ var WAFv2WebACLProvider = class {
29752
29744
  } catch (error) {
29753
29745
  if (error instanceof ProvisioningError) throw error;
29754
29746
  const cause = error instanceof Error ? error : void 0;
29755
- throw new ProvisioningError(`Failed to create WAFv2 WebACL ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
29747
+ throw new ProvisioningError(`Failed to create WAFv2 WebACL ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
29756
29748
  }
29757
29749
  }
29758
29750
  async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
@@ -29798,7 +29790,7 @@ var WAFv2WebACLProvider = class {
29798
29790
  } catch (error) {
29799
29791
  if (error instanceof ProvisioningError) throw error;
29800
29792
  const cause = error instanceof Error ? error : void 0;
29801
- throw new ProvisioningError(`Failed to update WAFv2 WebACL ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
29793
+ throw new ProvisioningError(`Failed to update WAFv2 WebACL ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
29802
29794
  }
29803
29795
  }
29804
29796
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -29827,7 +29819,7 @@ var WAFv2WebACLProvider = class {
29827
29819
  return;
29828
29820
  }
29829
29821
  const cause = error instanceof Error ? error : void 0;
29830
- throw new ProvisioningError(`Failed to delete WAFv2 WebACL ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
29822
+ throw new ProvisioningError(`Failed to delete WAFv2 WebACL ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
29831
29823
  }
29832
29824
  }
29833
29825
  warnOnSdkUnsupportedRuleKeys(logicalId, rules) {
@@ -30252,7 +30244,7 @@ var CognitoUserPoolProvider = class {
30252
30244
  mfaConfiguration = readDeclaredMfaConfiguration(properties["MfaConfiguration"], replayWarn(this.logger, context));
30253
30245
  this.warnOnBlankMfaConfiguration(properties["MfaConfiguration"]);
30254
30246
  } catch (error) {
30255
- throw new ProvisioningError(error instanceof Error ? error.message : String(error), resourceType, logicalId, poolName, error instanceof Error ? error : void 0);
30247
+ throw new ProvisioningError(describeAwsFailure(error).detail, resourceType, logicalId, poolName, error instanceof Error ? error : void 0);
30256
30248
  }
30257
30249
  this.assertMfaCombinationApplicable(logicalId, resourceType, poolName, properties, mfaConfiguration);
30258
30250
  let createdUserPoolId;
@@ -30332,7 +30324,7 @@ var CognitoUserPoolProvider = class {
30332
30324
  }
30333
30325
  }
30334
30326
  const cause = error instanceof Error ? error : void 0;
30335
- const thrown = new ProvisioningError(`Failed to create Cognito User Pool ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, poolName, cause);
30327
+ const thrown = new ProvisioningError(`Failed to create Cognito User Pool ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, poolName, cause);
30336
30328
  if (poolLeftBehind && createdUserPoolId) {
30337
30329
  markCreatedBeforeFailure(thrown, logicalId, resourceType, createdUserPoolId);
30338
30330
  markNonRetryable(thrown);
@@ -30484,7 +30476,7 @@ var CognitoUserPoolProvider = class {
30484
30476
  try {
30485
30477
  mfaConfiguration = readDeclaredMfaConfiguration(properties["MfaConfiguration"], stateBorneDesired ? { onUnusable: (message) => this.logger.warn(message) } : {});
30486
30478
  } catch (error) {
30487
- throw new ProvisioningError(`${error instanceof Error ? error.message : String(error)}. Nothing was applied to user pool ${physicalId}`, resourceType, logicalId, physicalId, error instanceof Error ? error : void 0);
30479
+ throw new ProvisioningError(`${describeAwsFailure(error).detail}. Nothing was applied to user pool ${physicalId}`, resourceType, logicalId, physicalId, error instanceof Error ? error : void 0);
30488
30480
  }
30489
30481
  this.warnOnBlankMfaConfiguration(properties["MfaConfiguration"]);
30490
30482
  const liveFirstAuthFactors = mfaPreflightNeedsLiveSignInPolicy(properties, mfaConfiguration) ? await this.readLiveAllowedFirstAuthFactors(physicalId) : void 0;
@@ -30554,7 +30546,7 @@ var CognitoUserPoolProvider = class {
30554
30546
  } catch (error) {
30555
30547
  if (error instanceof ResourceUpdateNotSupportedError || error instanceof ProvisioningError) throw error;
30556
30548
  const cause = error instanceof Error ? error : void 0;
30557
- throw new ProvisioningError(`Failed to update Cognito User Pool ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
30549
+ throw new ProvisioningError(`Failed to update Cognito User Pool ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
30558
30550
  }
30559
30551
  }
30560
30552
  async reconcileSchemaCustomAttributes(logicalId, physicalId, resourceType, newSchema, oldSchema, deletionProtected = false) {
@@ -30740,7 +30732,7 @@ var CognitoUserPoolProvider = class {
30740
30732
  return;
30741
30733
  }
30742
30734
  const cause = error instanceof Error ? error : void 0;
30743
- throw new ProvisioningError(`Failed to delete Cognito User Pool ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
30735
+ throw new ProvisioningError(`Failed to delete Cognito User Pool ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
30744
30736
  }
30745
30737
  }
30746
30738
  async sendEchoedDeletionProtection(physicalId, pool, value, opts = {}) {
@@ -30936,7 +30928,6 @@ var ElastiCacheProvider = class {
30936
30928
  createClient;
30937
30929
  providerRegion = ambientRegion();
30938
30930
  logger = getLogger().child("ElastiCacheProvider");
30939
- removalDefaults = /* @__PURE__ */ new Map([["AWS::ElastiCache::CacheCluster", /* @__PURE__ */ new Map([["AutoMinorVersionUpgrade", true]])]]);
30940
30931
  handledProperties = /* @__PURE__ */ new Map([["AWS::ElastiCache::SubnetGroup", /* @__PURE__ */ new Set([
30941
30932
  "CacheSubnetGroupName",
30942
30933
  "CacheSubnetGroupDescription",
@@ -30993,8 +30984,7 @@ var ElastiCacheProvider = class {
30993
30984
  default: throw new ProvisioningError(`Unsupported resource type: ${resourceType}`, resourceType, logicalId);
30994
30985
  }
30995
30986
  }
30996
- async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
30997
- properties = withRemovalDefaults(this.removalDefaults, resourceType, properties, previousProperties, context);
30987
+ async update(logicalId, physicalId, resourceType, properties, previousProperties, _context) {
30998
30988
  switch (resourceType) {
30999
30989
  case "AWS::ElastiCache::SubnetGroup": return this.updateSubnetGroup(logicalId, physicalId, resourceType, properties, previousProperties);
31000
30990
  case "AWS::ElastiCache::CacheCluster": return this.updateCacheCluster(logicalId, physicalId, resourceType, properties, previousProperties);
@@ -31029,7 +31019,7 @@ var ElastiCacheProvider = class {
31029
31019
  };
31030
31020
  } catch (error) {
31031
31021
  const cause = error instanceof Error ? error : void 0;
31032
- throw new ProvisioningError(`Failed to create CacheSubnetGroup ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, cacheSubnetGroupName, cause);
31022
+ throw new ProvisioningError(`Failed to create CacheSubnetGroup ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, cacheSubnetGroupName, cause);
31033
31023
  }
31034
31024
  }
31035
31025
  async updateSubnetGroup(logicalId, physicalId, resourceType, properties, previousProperties) {
@@ -31056,7 +31046,7 @@ var ElastiCacheProvider = class {
31056
31046
  } catch (error) {
31057
31047
  if (error instanceof ProvisioningError) throw error;
31058
31048
  const cause = error instanceof Error ? error : void 0;
31059
- throw new ProvisioningError(`Failed to update CacheSubnetGroup ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
31049
+ throw new ProvisioningError(`Failed to update CacheSubnetGroup ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
31060
31050
  }
31061
31051
  }
31062
31052
  async deleteSubnetGroup(logicalId, physicalId, resourceType, context) {
@@ -31072,7 +31062,7 @@ var ElastiCacheProvider = class {
31072
31062
  return;
31073
31063
  }
31074
31064
  const cause = error instanceof Error ? error : void 0;
31075
- throw new ProvisioningError(`Failed to delete CacheSubnetGroup ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
31065
+ throw new ProvisioningError(`Failed to delete CacheSubnetGroup ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
31076
31066
  }
31077
31067
  }
31078
31068
  async createCacheCluster(logicalId, resourceType, properties) {
@@ -31129,7 +31119,7 @@ var ElastiCacheProvider = class {
31129
31119
  attributes
31130
31120
  };
31131
31121
  } catch (error) {
31132
- const thrown = error instanceof ProvisioningError ? error : new ProvisioningError(`Failed to create CacheCluster ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, cacheClusterId, error instanceof Error ? error : void 0);
31122
+ const thrown = error instanceof ProvisioningError ? error : new ProvisioningError(`Failed to create CacheCluster ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, cacheClusterId, error instanceof Error ? error : void 0);
31133
31123
  if (clusterCreated) markCreatedBeforeFailure(thrown, logicalId, resourceType, cacheClusterId);
31134
31124
  throw thrown;
31135
31125
  }
@@ -31141,7 +31131,6 @@ var ElastiCacheProvider = class {
31141
31131
  const rawSgIds = properties["VpcSecurityGroupIds"];
31142
31132
  const sgIds = rawSgIds && rawSgIds.length > 0 ? rawSgIds : void 0;
31143
31133
  const notificationTopicArn = properties["NotificationTopicArn"];
31144
- const notificationRemoved = notificationTopicArn === void 0 && previousProperties["NotificationTopicArn"] != null;
31145
31134
  await this.getClient().send(new ModifyCacheClusterCommand({
31146
31135
  CacheClusterId: physicalId,
31147
31136
  NumCacheNodes: properties["NumCacheNodes"] != null ? Number(properties["NumCacheNodes"]) : void 0,
@@ -31149,11 +31138,10 @@ var ElastiCacheProvider = class {
31149
31138
  CacheParameterGroupName: properties["CacheParameterGroupName"],
31150
31139
  EngineVersion: properties["EngineVersion"],
31151
31140
  PreferredMaintenanceWindow: properties["PreferredMaintenanceWindow"],
31152
- SnapshotRetentionLimit: clearOnUpdateRemoval(properties["SnapshotRetentionLimit"] != null ? Number(properties["SnapshotRetentionLimit"]) : void 0, previousProperties["SnapshotRetentionLimit"] != null ? Number(previousProperties["SnapshotRetentionLimit"]) : void 0, 0),
31141
+ SnapshotRetentionLimit: properties["SnapshotRetentionLimit"] != null ? Number(properties["SnapshotRetentionLimit"]) : void 0,
31153
31142
  SnapshotWindow: properties["SnapshotWindow"],
31154
31143
  AutoMinorVersionUpgrade: properties["AutoMinorVersionUpgrade"],
31155
31144
  NotificationTopicArn: notificationTopicArn,
31156
- ...notificationRemoved && { NotificationTopicStatus: "inactive" },
31157
31145
  ...notificationTopicArn !== void 0 && { NotificationTopicStatus: "active" },
31158
31146
  LogDeliveryConfigurations: this.buildLogDeliveryConfigurationsForUpdate(properties["LogDeliveryConfigurations"], previousProperties["LogDeliveryConfigurations"]),
31159
31147
  IpDiscovery: properties["IpDiscovery"],
@@ -31182,7 +31170,7 @@ var ElastiCacheProvider = class {
31182
31170
  } catch (error) {
31183
31171
  if (error instanceof ProvisioningError) throw error;
31184
31172
  const cause = error instanceof Error ? error : void 0;
31185
- throw new ProvisioningError(`Failed to update CacheCluster ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
31173
+ throw new ProvisioningError(`Failed to update CacheCluster ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
31186
31174
  }
31187
31175
  }
31188
31176
  async deleteCacheCluster(logicalId, physicalId, resourceType, context) {
@@ -31209,7 +31197,7 @@ var ElastiCacheProvider = class {
31209
31197
  return;
31210
31198
  }
31211
31199
  const cause = error instanceof Error ? error : void 0;
31212
- throw new ProvisioningError(`Failed to delete CacheCluster ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
31200
+ throw new ProvisioningError(`Failed to delete CacheCluster ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
31213
31201
  }
31214
31202
  }
31215
31203
  buildLogDeliveryConfigurationsForUpdate(newConfigs, previousConfigs) {
@@ -31631,7 +31619,7 @@ var ServiceDiscoveryProvider = class ServiceDiscoveryProvider {
31631
31619
  }
31632
31620
  if (error instanceof ProvisioningError) throw error;
31633
31621
  const cause = error instanceof Error ? error : void 0;
31634
- throw new ProvisioningError(`Failed to delete Cloud Map namespace ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
31622
+ throw new ProvisioningError(`Failed to delete Cloud Map namespace ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
31635
31623
  }
31636
31624
  }
31637
31625
  async createHttpNamespace(logicalId, resourceType, properties, maskSecrets) {
@@ -31944,7 +31932,7 @@ var ServiceDiscoveryProvider = class ServiceDiscoveryProvider {
31944
31932
  return;
31945
31933
  }
31946
31934
  const cause = error instanceof Error ? error : void 0;
31947
- throw new ProvisioningError(`Failed to delete service discovery service ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
31935
+ throw new ProvisioningError(`Failed to delete service discovery service ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
31948
31936
  }
31949
31937
  }
31950
31938
  extractSoaTtlProperties(properties) {
@@ -33026,7 +33014,7 @@ var AppSyncProvider = class {
33026
33014
  body = await resp.Body.transformToString();
33027
33015
  } catch (error) {
33028
33016
  if (error instanceof ProvisioningError) throw error;
33029
- throw new ProvisioningError(`Failed to fetch ${propertyPath} s3://${bucket}/${key} for ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, error instanceof Error ? error : void 0);
33017
+ throw new ProvisioningError(`Failed to fetch ${propertyPath} s3://${bucket}/${key} for ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, error instanceof Error ? error : void 0);
33030
33018
  }
33031
33019
  if (body.length === 0) throw new ProvisioningError(`${propertyPath} object s3://${bucket}/${key} returned an empty body`, resourceType, logicalId);
33032
33020
  return body;
@@ -33201,7 +33189,7 @@ var AppSyncProvider = class {
33201
33189
  }
33202
33190
  }
33203
33191
  const cause = error instanceof Error ? error : void 0;
33204
- const thrown = new ProvisioningError(`Failed to create GraphQL API ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
33192
+ const thrown = new ProvisioningError(`Failed to create GraphQL API ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
33205
33193
  if (apiLeftBehind && createdApiId) {
33206
33194
  markCreatedBeforeFailure(thrown, logicalId, resourceType, createdApiId);
33207
33195
  markNonRetryable(thrown);
@@ -33270,7 +33258,7 @@ var AppSyncProvider = class {
33270
33258
  return;
33271
33259
  }
33272
33260
  const cause = error instanceof Error ? error : void 0;
33273
- throw new ProvisioningError(`Failed to delete GraphQL API ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
33261
+ throw new ProvisioningError(`Failed to delete GraphQL API ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
33274
33262
  }
33275
33263
  }
33276
33264
  async createGraphQLSchema(logicalId, resourceType, properties) {
@@ -33300,7 +33288,7 @@ var AppSyncProvider = class {
33300
33288
  };
33301
33289
  } catch (error) {
33302
33290
  const cause = error instanceof Error ? error : void 0;
33303
- throw new ProvisioningError(`Failed to create GraphQL Schema ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
33291
+ throw new ProvisioningError(`Failed to create GraphQL Schema ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
33304
33292
  }
33305
33293
  }
33306
33294
  async createDataSource(logicalId, resourceType, properties, context) {
@@ -33331,7 +33319,7 @@ var AppSyncProvider = class {
33331
33319
  this.logger.debug(`Successfully created DataSource ${logicalId}: ${physicalId}`);
33332
33320
  } catch (error) {
33333
33321
  const cause = error instanceof Error ? error : void 0;
33334
- throw new ProvisioningError(`Failed to create DataSource ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
33322
+ throw new ProvisioningError(`Failed to create DataSource ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
33335
33323
  }
33336
33324
  const dataSourceArn = reportedArn ?? await this.buildAppSyncArnOrWarn(`apis/${apiId}/datasources/${name}`, logicalId, physicalId);
33337
33325
  return {
@@ -33363,7 +33351,7 @@ var AppSyncProvider = class {
33363
33351
  return;
33364
33352
  }
33365
33353
  const cause = error instanceof Error ? error : void 0;
33366
- throw new ProvisioningError(`Failed to delete DataSource ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
33354
+ throw new ProvisioningError(`Failed to delete DataSource ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
33367
33355
  }
33368
33356
  }
33369
33357
  async createResolver(logicalId, resourceType, properties, context) {
@@ -33401,7 +33389,7 @@ var AppSyncProvider = class {
33401
33389
  this.logger.debug(`Successfully created Resolver ${logicalId}: ${physicalId}`);
33402
33390
  } catch (error) {
33403
33391
  const cause = error instanceof Error ? error : void 0;
33404
- throw new ProvisioningError(`Failed to create Resolver ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
33392
+ throw new ProvisioningError(`Failed to create Resolver ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
33405
33393
  }
33406
33394
  const resolverArn = reportedArn ?? await this.buildAppSyncArnOrWarn(`apis/${apiId}/types/${typeName}/resolvers/${fieldName}`, logicalId, physicalId);
33407
33395
  return {
@@ -33432,7 +33420,7 @@ var AppSyncProvider = class {
33432
33420
  return;
33433
33421
  }
33434
33422
  const cause = error instanceof Error ? error : void 0;
33435
- throw new ProvisioningError(`Failed to delete Resolver ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
33423
+ throw new ProvisioningError(`Failed to delete Resolver ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
33436
33424
  }
33437
33425
  }
33438
33426
  async createApiKey(logicalId, resourceType, properties, context) {
@@ -33461,7 +33449,7 @@ var AppSyncProvider = class {
33461
33449
  this.logger.debug(`Successfully created ApiKey ${logicalId}: ${apiKeyId}`);
33462
33450
  } catch (error) {
33463
33451
  const cause = error instanceof Error ? error : void 0;
33464
- throw new ProvisioningError(`Failed to create ApiKey ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
33452
+ throw new ProvisioningError(`Failed to create ApiKey ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
33465
33453
  }
33466
33454
  const physicalId = packCompositeId(resourceType, logicalId, [{
33467
33455
  name: "apiId",
@@ -33528,7 +33516,7 @@ var AppSyncProvider = class {
33528
33516
  return;
33529
33517
  }
33530
33518
  const cause = error instanceof Error ? error : void 0;
33531
- throw new ProvisioningError(`Failed to delete ApiKey ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
33519
+ throw new ProvisioningError(`Failed to delete ApiKey ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
33532
33520
  }
33533
33521
  }
33534
33522
  isNotFoundError(error) {
@@ -34189,7 +34177,7 @@ var GlueProvider = class {
34189
34177
  previousDatabaseInput
34190
34178
  });
34191
34179
  } catch (error) {
34192
- throw new ProvisioningError(`${v(error instanceof Error ? error.message : String(error))}. Nothing was applied to Glue Database ${logicalId}; fix the template value`, resourceType, logicalId, physicalId, error instanceof Error ? error : void 0);
34180
+ throw new ProvisioningError(`${v(describeAwsFailure(error).detail)}. Nothing was applied to Glue Database ${logicalId}; fix the template value`, resourceType, logicalId, physicalId, error instanceof Error ? error : void 0);
34193
34181
  }
34194
34182
  const liveParameters = await this.readLiveDatabaseParameters(logicalId, resourceType, physicalId, catalogId, log.mask);
34195
34183
  try {
@@ -34230,7 +34218,7 @@ var GlueProvider = class {
34230
34218
  return;
34231
34219
  }
34232
34220
  const cause = error instanceof Error ? error : void 0;
34233
- throw new ProvisioningError(log.mask(`Failed to delete Glue Database ${logicalId}: ${error instanceof Error ? error.message : String(error)}`), resourceType, logicalId, physicalId, cause);
34221
+ throw new ProvisioningError(log.mask(`Failed to delete Glue Database ${logicalId}: ${describeAwsFailure(error).detail}`), resourceType, logicalId, physicalId, cause);
34234
34222
  }
34235
34223
  }
34236
34224
  async createTable(logicalId, resourceType, properties, context) {
@@ -34373,7 +34361,7 @@ var GlueProvider = class {
34373
34361
  return;
34374
34362
  }
34375
34363
  const cause = error instanceof Error ? error : void 0;
34376
- throw new ProvisioningError(log.mask(`Failed to delete Glue Table ${logicalId}: ${error instanceof Error ? error.message : String(error)}`), resourceType, logicalId, physicalId, cause);
34364
+ throw new ProvisioningError(log.mask(`Failed to delete Glue Table ${logicalId}: ${describeAwsFailure(error).detail}`), resourceType, logicalId, physicalId, cause);
34377
34365
  }
34378
34366
  }
34379
34367
  preserveAwsManagedParameters(built, desiredParameters, previousParameters, liveParameters) {
@@ -34832,7 +34820,7 @@ var GlueWorkflowProvider = class {
34832
34820
  return;
34833
34821
  }
34834
34822
  const cause = error instanceof Error ? error : void 0;
34835
- throw new ProvisioningError(`Failed to delete Glue Workflow ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
34823
+ throw new ProvisioningError(`Failed to delete Glue Workflow ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
34836
34824
  }
34837
34825
  }
34838
34826
  async getAttribute(physicalId, _resourceType, attributeName) {
@@ -34960,7 +34948,7 @@ var GlueSecurityConfigurationProvider = class {
34960
34948
  return;
34961
34949
  }
34962
34950
  const cause = error instanceof Error ? error : void 0;
34963
- throw new ProvisioningError(`Failed to delete Glue SecurityConfiguration ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
34951
+ throw new ProvisioningError(`Failed to delete Glue SecurityConfiguration ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
34964
34952
  }
34965
34953
  }
34966
34954
  async getAttribute(physicalId, _resourceType, attributeName) {
@@ -35211,7 +35199,7 @@ var GlueJobProvider = class {
35211
35199
  return;
35212
35200
  }
35213
35201
  const cause = error instanceof Error ? error : void 0;
35214
- throw new ProvisioningError(`Failed to delete Glue Job ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
35202
+ throw new ProvisioningError(`Failed to delete Glue Job ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
35215
35203
  }
35216
35204
  }
35217
35205
  async getAttribute(physicalId, _resourceType, attributeName) {
@@ -35509,7 +35497,7 @@ var GlueCrawlerProvider = class {
35509
35497
  return;
35510
35498
  }
35511
35499
  const cause = error instanceof Error ? error : void 0;
35512
- throw new ProvisioningError(log.mask(`Failed to delete Glue Crawler ${logicalId}: ${error instanceof Error ? error.message : String(error)}`), resourceType, logicalId, physicalId, cause);
35500
+ throw new ProvisioningError(log.mask(`Failed to delete Glue Crawler ${logicalId}: ${describeAwsFailure(error).detail}`), resourceType, logicalId, physicalId, cause);
35513
35501
  }
35514
35502
  }
35515
35503
  async stopCrawlerAndWait(physicalId, log = {
@@ -35758,7 +35746,7 @@ var GlueConnectionProvider = class {
35758
35746
  return;
35759
35747
  }
35760
35748
  const cause = error instanceof Error ? error : void 0;
35761
- throw new ProvisioningError(log.mask(`Failed to delete Glue Connection ${logicalId}: ${error instanceof Error ? error.message : String(error)}`), resourceType, logicalId, physicalId, cause);
35749
+ throw new ProvisioningError(log.mask(`Failed to delete Glue Connection ${logicalId}: ${describeAwsFailure(error).detail}`), resourceType, logicalId, physicalId, cause);
35762
35750
  }
35763
35751
  }
35764
35752
  async getAttribute(physicalId, _resourceType, attributeName) {
@@ -35983,7 +35971,7 @@ var GlueTriggerProvider = class {
35983
35971
  return;
35984
35972
  }
35985
35973
  const cause = error instanceof Error ? error : void 0;
35986
- const failure = new ProvisioningError(`Failed to delete Glue Trigger ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
35974
+ const failure = new ProvisioningError(`Failed to delete Glue Trigger ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
35987
35975
  throw stripped ? markDeleteStarted(failure) : failure;
35988
35976
  }
35989
35977
  }
@@ -36197,7 +36185,7 @@ var KMSProvider = class {
36197
36185
  this.logger.warn(safeMsg`KMS key ${createdKeyId} was created for ${logicalId}, but a follow-up call failed. A retry of this create reuses that key instead of creating another, so do not delete it while the deploy is still retrying. If the deploy then FAILS (outside a rollback's re-create), its rollback journal records the key for \`cdkd rollback --revert-failed\` to schedule its deletion; otherwise schedule it yourself with: ${aws`aws kms schedule-key-deletion --key-id ${createdKeyId}${region} --pending-window-in-days 7`.render()}`);
36198
36186
  }
36199
36187
  const cause = error instanceof Error ? error : void 0;
36200
- const thrown = new ProvisioningError(`Failed to create KMS Key ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
36188
+ const thrown = new ProvisioningError(`Failed to create KMS Key ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
36201
36189
  if (createdKeyId !== void 0) {
36202
36190
  markCreatedBeforeFailure(thrown, logicalId, resourceType, createdKeyId);
36203
36191
  if (supersededPending) markSupersedesEarlierCreate(thrown);
@@ -36370,7 +36358,7 @@ var KMSProvider = class {
36370
36358
  };
36371
36359
  } catch (error) {
36372
36360
  const cause = error instanceof Error ? error : void 0;
36373
- throw new ProvisioningError(`Failed to update KMS Key ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
36361
+ throw new ProvisioningError(`Failed to update KMS Key ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
36374
36362
  }
36375
36363
  }
36376
36364
  async deleteKey(logicalId, physicalId, resourceType, properties, context) {
@@ -36390,7 +36378,7 @@ var KMSProvider = class {
36390
36378
  return;
36391
36379
  }
36392
36380
  const cause = error instanceof Error ? error : void 0;
36393
- throw new ProvisioningError(`Failed to schedule deletion for KMS Key ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
36381
+ throw new ProvisioningError(`Failed to schedule deletion for KMS Key ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
36394
36382
  }
36395
36383
  }
36396
36384
  async applyTagDiff(keyId, resourceType, logicalId, oldTagsRaw, newTagsRaw) {
@@ -36435,7 +36423,7 @@ var KMSProvider = class {
36435
36423
  };
36436
36424
  } catch (error) {
36437
36425
  const cause = error instanceof Error ? error : void 0;
36438
- throw new ProvisioningError(`Failed to create KMS Alias ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
36426
+ throw new ProvisioningError(`Failed to create KMS Alias ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
36439
36427
  }
36440
36428
  }
36441
36429
  async updateAlias(logicalId, physicalId, resourceType, properties) {
@@ -36454,7 +36442,7 @@ var KMSProvider = class {
36454
36442
  };
36455
36443
  } catch (error) {
36456
36444
  const cause = error instanceof Error ? error : void 0;
36457
- throw new ProvisioningError(`Failed to update KMS Alias ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
36445
+ throw new ProvisioningError(`Failed to update KMS Alias ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
36458
36446
  }
36459
36447
  }
36460
36448
  async deleteAlias(logicalId, physicalId, resourceType, context) {
@@ -36470,7 +36458,7 @@ var KMSProvider = class {
36470
36458
  return;
36471
36459
  }
36472
36460
  const cause = error instanceof Error ? error : void 0;
36473
- throw new ProvisioningError(`Failed to delete KMS Alias ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
36461
+ throw new ProvisioningError(`Failed to delete KMS Alias ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
36474
36462
  }
36475
36463
  }
36476
36464
  async readCurrentState(physicalId, _logicalId, resourceType) {
@@ -36820,7 +36808,7 @@ var BudgetsBudgetProvider = class {
36820
36808
  try {
36821
36809
  await this.addNotificationsOnly(accountId, physicalId, newNotifications);
36822
36810
  } catch (error) {
36823
- throw new ProvisioningError(`Failed to update budget ${logicalId}: adding ${newNotifications.length} desired notification(s) beside every notification the budget already holds (the recorded NotificationsWithSubscribers is not a list cdkd can read, so none was deleted; a budget allows at most 5 notifications and 10 email subscribers each): ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, error instanceof Error ? error : void 0);
36811
+ throw new ProvisioningError(`Failed to update budget ${logicalId}: adding ${newNotifications.length} desired notification(s) beside every notification the budget already holds (the recorded NotificationsWithSubscribers is not a list cdkd can read, so none was deleted; a budget allows at most 5 notifications and 10 email subscribers each): ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, error instanceof Error ? error : void 0);
36824
36812
  }
36825
36813
  this.logger.warn(safeMsg`The recorded NotificationsWithSubscribers of budget ${logicalId} is not a list cdkd can read, so cdkd deleted no notification or subscriber and only added the desired ones. Delete any the template no longer names yourself.`);
36826
36814
  }
@@ -36998,7 +36986,7 @@ var BudgetsBudgetProvider = class {
36998
36986
  return;
36999
36987
  }
37000
36988
  const cause = error instanceof Error ? error : void 0;
37001
- throw new ProvisioningError(`Failed to delete budget ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
36989
+ throw new ProvisioningError(`Failed to delete budget ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
37002
36990
  }
37003
36991
  }
37004
36992
  async getAttribute(physicalId, resourceType, attributeName, logicalId) {
@@ -37012,7 +37000,7 @@ var BudgetsBudgetProvider = class {
37012
37000
  return await this.budgetArn(accountId, physicalId);
37013
37001
  } catch (error) {
37014
37002
  const cause = error instanceof Error ? error : void 0;
37015
- throw new ProvisioningError(`Failed to resolve Arn for budget ${physicalId}: ${cause?.message ?? String(error)}`, resourceType, logicalId, physicalId, cause);
37003
+ throw new ProvisioningError(`Failed to resolve Arn for budget ${physicalId}: ${cause?.message ?? safeStringify(error)}`, resourceType, logicalId, physicalId, cause);
37016
37004
  }
37017
37005
  }
37018
37006
  async import(input) {
@@ -37301,7 +37289,7 @@ var KinesisStreamProvider = class {
37301
37289
  };
37302
37290
  } catch (error) {
37303
37291
  if (streamCreated) markAuxiliaryFailure(error, logicalId);
37304
- const thrown = error instanceof ProvisioningError ? error : new ProvisioningError(`Failed to create Kinesis stream ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, streamName, error instanceof Error ? error : void 0);
37292
+ const thrown = error instanceof ProvisioningError ? error : new ProvisioningError(`Failed to create Kinesis stream ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, streamName, error instanceof Error ? error : void 0);
37305
37293
  if (streamCreated) markCreatedBeforeFailure(thrown, logicalId, resourceType, streamName);
37306
37294
  throw thrown;
37307
37295
  }
@@ -37427,7 +37415,7 @@ var KinesisStreamProvider = class {
37427
37415
  };
37428
37416
  } catch (error) {
37429
37417
  const cause = error instanceof Error ? error : void 0;
37430
- throw new ProvisioningError(`Failed to update Kinesis stream ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
37418
+ throw new ProvisioningError(`Failed to update Kinesis stream ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
37431
37419
  }
37432
37420
  }
37433
37421
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -37446,7 +37434,7 @@ var KinesisStreamProvider = class {
37446
37434
  return;
37447
37435
  }
37448
37436
  const cause = error instanceof Error ? error : void 0;
37449
- throw new ProvisioningError(`Failed to delete Kinesis stream ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
37437
+ throw new ProvisioningError(`Failed to delete Kinesis stream ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
37450
37438
  }
37451
37439
  await waitForGoneAfterDelete({
37452
37440
  what: `Kinesis stream ${physicalId}`,
@@ -37693,7 +37681,7 @@ var KinesisStreamConsumerProvider = class {
37693
37681
  }
37694
37682
  };
37695
37683
  } catch (error) {
37696
- const thrown = error instanceof ProvisioningError ? error : new ProvisioningError(`Failed to register Kinesis stream consumer ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, consumerName, error instanceof Error ? error : void 0);
37684
+ const thrown = error instanceof ProvisioningError ? error : new ProvisioningError(`Failed to register Kinesis stream consumer ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, consumerName, error instanceof Error ? error : void 0);
37697
37685
  if (createdArn) markCreatedBeforeFailure(thrown, logicalId, resourceType, createdArn);
37698
37686
  throw thrown;
37699
37687
  }
@@ -37761,7 +37749,7 @@ var KinesisStreamConsumerProvider = class {
37761
37749
  return;
37762
37750
  }
37763
37751
  const cause = error instanceof Error ? error : void 0;
37764
- throw new ProvisioningError(`Failed to deregister Kinesis stream consumer ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
37752
+ throw new ProvisioningError(`Failed to deregister Kinesis stream consumer ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
37765
37753
  }
37766
37754
  }
37767
37755
  async getAttribute(physicalId, _resourceType, attributeName) {
@@ -37988,7 +37976,7 @@ var SchedulerScheduleProvider = class {
37988
37976
  };
37989
37977
  } catch (error) {
37990
37978
  const cause = error instanceof Error ? error : void 0;
37991
- throw new ProvisioningError(`Failed to create Schedule ${logicalId}: ${cause?.message ?? String(error)}`, resourceType, logicalId, void 0, cause);
37979
+ throw new ProvisioningError(`Failed to create Schedule ${logicalId}: ${cause?.message ?? safeStringify(error)}`, resourceType, logicalId, void 0, cause);
37992
37980
  }
37993
37981
  }
37994
37982
  async readIdentity(name, groupName) {
@@ -38089,7 +38077,7 @@ var SchedulerScheduleProvider = class {
38089
38077
  } catch (error) {
38090
38078
  if (error instanceof ResourceUpdateNotSupportedError) throw error;
38091
38079
  const cause = error instanceof Error ? error : void 0;
38092
- throw new ProvisioningError(`Failed to update Schedule ${logicalId}: ${cause?.message ?? String(error)}`, resourceType, logicalId, physicalId, cause);
38080
+ throw new ProvisioningError(`Failed to update Schedule ${logicalId}: ${cause?.message ?? safeStringify(error)}`, resourceType, logicalId, physicalId, cause);
38093
38081
  }
38094
38082
  }
38095
38083
  async deleteByRecordedIdentity(logicalId, physicalId, resourceType, recorded, context) {
@@ -38200,7 +38188,7 @@ var SchedulerScheduleProvider = class {
38200
38188
  return;
38201
38189
  }
38202
38190
  const cause = error instanceof Error ? error : void 0;
38203
- throw new ProvisioningError(`Failed to delete Schedule ${logicalId}: ${cause?.message ?? String(error)}`, resourceType, logicalId, physicalId, cause);
38191
+ throw new ProvisioningError(`Failed to delete Schedule ${logicalId}: ${cause?.message ?? safeStringify(error)}`, resourceType, logicalId, physicalId, cause);
38204
38192
  }
38205
38193
  }
38206
38194
  async getAttribute(physicalId, resourceType, attributeName, logicalId) {
@@ -38210,7 +38198,7 @@ var SchedulerScheduleProvider = class {
38210
38198
  } catch (error) {
38211
38199
  const cause = error instanceof Error ? error : void 0;
38212
38200
  const customGroupHint = error instanceof ResourceNotFoundException$13 ? " Schedules in a custom group cannot be looked up by bare name; the Arn is normally served from cdkd state attributes." : "";
38213
- throw new ProvisioningError(`Failed to resolve Arn for Schedule ${physicalId}: ${cause?.message ?? String(error)}.${customGroupHint}`, resourceType, logicalId, physicalId, cause);
38201
+ throw new ProvisioningError(`Failed to resolve Arn for Schedule ${physicalId}: ${cause?.message ?? safeStringify(error)}.${customGroupHint}`, resourceType, logicalId, physicalId, cause);
38214
38202
  }
38215
38203
  }
38216
38204
  async readCurrentState(physicalId, _logicalId, _resourceType, properties) {
@@ -38529,7 +38517,7 @@ var PipesPipeProvider = class {
38529
38517
  createdIdentity = pipeIdentityToken(name, created?.Arn, created?.CreationTime);
38530
38518
  } catch (error) {
38531
38519
  const cause = error instanceof Error ? error : void 0;
38532
- throw new ProvisioningError(`Failed to create Pipe ${logicalId}: ${mask(cause?.message ?? String(error))}`, resourceType, logicalId, void 0, cause);
38520
+ throw new ProvisioningError(`Failed to create Pipe ${logicalId}: ${mask(cause?.message ?? safeStringify(error))}`, resourceType, logicalId, void 0, cause);
38533
38521
  }
38534
38522
  let settled;
38535
38523
  try {
@@ -38601,7 +38589,7 @@ var PipesPipeProvider = class {
38601
38589
  if (error instanceof ProvisioningError) throw error;
38602
38590
  if (error instanceof NotFoundException$6) assertRegionMatch(await this.getClient().config.region(), context?.expectedRegion, resourceType, logicalId, physicalId);
38603
38591
  const cause = error instanceof Error ? error : void 0;
38604
- throw new ProvisioningError(`Failed to update Pipe ${logicalId}: ${mask(cause?.message ?? String(error))}`, resourceType, logicalId, physicalId, cause);
38592
+ throw new ProvisioningError(`Failed to update Pipe ${logicalId}: ${mask(cause?.message ?? safeStringify(error))}`, resourceType, logicalId, physicalId, cause);
38605
38593
  }
38606
38594
  return {
38607
38595
  physicalId,
@@ -38622,7 +38610,7 @@ var PipesPipeProvider = class {
38622
38610
  return;
38623
38611
  }
38624
38612
  const cause = error instanceof Error ? error : void 0;
38625
- throw new ProvisioningError(`Failed to delete Pipe ${logicalId}: ${cause?.message ?? String(error)}`, resourceType, logicalId, physicalId, cause);
38613
+ throw new ProvisioningError(`Failed to delete Pipe ${logicalId}: ${cause?.message ?? safeStringify(error)}`, resourceType, logicalId, physicalId, cause);
38626
38614
  }
38627
38615
  await waitForGoneAfterDelete({
38628
38616
  what: `Pipe ${physicalId}`,
@@ -39255,7 +39243,7 @@ var EFSProvider = class {
39255
39243
  return;
39256
39244
  }
39257
39245
  const cause = error instanceof Error ? error : void 0;
39258
- throw new ProvisioningError(`Failed to delete EFS FileSystem ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
39246
+ throw new ProvisioningError(`Failed to delete EFS FileSystem ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
39259
39247
  }
39260
39248
  }
39261
39249
  async waitForFileSystemAvailable(fileSystemId, logicalId, resourceType, log) {
@@ -39325,7 +39313,7 @@ var EFSProvider = class {
39325
39313
  return;
39326
39314
  }
39327
39315
  const cause = error instanceof Error ? error : void 0;
39328
- throw new ProvisioningError(`Failed to delete EFS MountTarget ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
39316
+ throw new ProvisioningError(`Failed to delete EFS MountTarget ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
39329
39317
  }
39330
39318
  }
39331
39319
  async waitForMountTargetDeleted(mountTargetId, logicalId) {
@@ -39454,7 +39442,7 @@ var EFSProvider = class {
39454
39442
  return;
39455
39443
  }
39456
39444
  const cause = error instanceof Error ? error : void 0;
39457
- throw new ProvisioningError(`Failed to delete EFS AccessPoint ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
39445
+ throw new ProvisioningError(`Failed to delete EFS AccessPoint ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
39458
39446
  }
39459
39447
  }
39460
39448
  async readCurrentState(physicalId, _logicalId, resourceType) {
@@ -39852,7 +39840,7 @@ var FSxFileSystemProvider = class {
39852
39840
  throw error;
39853
39841
  }
39854
39842
  const cause = error instanceof Error ? error : void 0;
39855
- const message = `Failed to create FSx FileSystem ${logicalId}: ${error instanceof Error ? error.message : String(error)}`;
39843
+ const message = `Failed to create FSx FileSystem ${logicalId}: ${describeAwsFailure(error).detail}`;
39856
39844
  if (survivorId !== void 0) {
39857
39845
  const thrown = new ProvisioningError(message, resourceType, logicalId, void 0, cause);
39858
39846
  markCreatedBeforeFailure(thrown, logicalId, resourceType, survivorId);
@@ -40088,7 +40076,7 @@ var FSxFileSystemProvider = class {
40088
40076
  } catch (error) {
40089
40077
  if (error instanceof ProvisioningError) throw error;
40090
40078
  const cause = error instanceof Error ? error : void 0;
40091
- throw new ProvisioningError(`Failed to update FSx FileSystem ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
40079
+ throw new ProvisioningError(`Failed to update FSx FileSystem ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
40092
40080
  }
40093
40081
  }
40094
40082
  detectVariantConfigKey(properties, previousProperties) {
@@ -40281,7 +40269,7 @@ var FSxFileSystemProvider = class {
40281
40269
  return;
40282
40270
  }
40283
40271
  const cause = error instanceof Error ? error : void 0;
40284
- throw new ProvisioningError(`Failed to delete FSx FileSystem ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
40272
+ throw new ProvisioningError(`Failed to delete FSx FileSystem ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
40285
40273
  }
40286
40274
  await this.waitForFileSystemDeleted(physicalId, logicalId, resourceType);
40287
40275
  this.logger.debug(`Successfully deleted FSx FileSystem ${logicalId}`);
@@ -40375,7 +40363,7 @@ var FSxFileSystemProvider = class {
40375
40363
  } catch (error) {
40376
40364
  if (error instanceof FileSystemNotFound$1) return;
40377
40365
  const cause = error instanceof Error ? error : void 0;
40378
- throw new ProvisioningError(`Failed to poll FSx FileSystem ${fileSystemId} deletion: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, fileSystemId, cause);
40366
+ throw new ProvisioningError(`Failed to poll FSx FileSystem ${fileSystemId} deletion: ${describeAwsFailure(error).detail}`, resourceType, logicalId, fileSystemId, cause);
40379
40367
  }
40380
40368
  if (!fs && sawResponse) return;
40381
40369
  if (!fs) {
@@ -40885,7 +40873,7 @@ var EMRClusterProvider = class {
40885
40873
  throw error;
40886
40874
  }
40887
40875
  const cause = error instanceof Error ? error : void 0;
40888
- const message = `Failed to create EMR Cluster ${logicalId}: ${error instanceof Error ? error.message : String(error)}`;
40876
+ const message = `Failed to create EMR Cluster ${logicalId}: ${describeAwsFailure(error).detail}`;
40889
40877
  if (survivorId !== void 0) {
40890
40878
  const thrown = new ProvisioningError(message, resourceType, logicalId, void 0, cause);
40891
40879
  markCreatedBeforeFailure(thrown, logicalId, resourceType, survivorId);
@@ -41083,7 +41071,7 @@ var EMRClusterProvider = class {
41083
41071
  } catch (error) {
41084
41072
  if (error instanceof ProvisioningError) throw error;
41085
41073
  const cause = error instanceof Error ? error : void 0;
41086
- throw new ProvisioningError(`Failed to update EMR Cluster ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
41074
+ throw new ProvisioningError(`Failed to update EMR Cluster ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
41087
41075
  }
41088
41076
  }
41089
41077
  async applyTagDiff(physicalId, resourceType, logicalId, prevTagsRaw, nextTagsRaw) {
@@ -41137,7 +41125,7 @@ var EMRClusterProvider = class {
41137
41125
  return;
41138
41126
  }
41139
41127
  const cause = error instanceof Error ? error : void 0;
41140
- throw new ProvisioningError(`Failed to describe EMR Cluster ${logicalId} before deletion: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
41128
+ throw new ProvisioningError(`Failed to describe EMR Cluster ${logicalId} before deletion: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
41141
41129
  }
41142
41130
  const currentState = current?.Status?.State;
41143
41131
  if (currentState && TERMINAL_STATES.has(currentState)) {
@@ -41166,7 +41154,7 @@ var EMRClusterProvider = class {
41166
41154
  flip.deleteAccepted = true;
41167
41155
  } catch (error) {
41168
41156
  const cause = error instanceof Error ? error : void 0;
41169
- throw new ProvisioningError(`Failed to terminate EMR Cluster ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
41157
+ throw new ProvisioningError(`Failed to terminate EMR Cluster ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
41170
41158
  }
41171
41159
  await this.waitForClusterTerminated(physicalId, logicalId, resourceType);
41172
41160
  this.logger.debug(`Successfully deleted EMR Cluster ${logicalId}`);
@@ -41213,7 +41201,7 @@ var EMRClusterProvider = class {
41213
41201
  } catch (error) {
41214
41202
  if (error instanceof InvalidRequestException) return;
41215
41203
  const cause = error instanceof Error ? error : void 0;
41216
- throw new ProvisioningError(`Failed to poll EMR Cluster ${clusterId} termination: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, clusterId, cause);
41204
+ throw new ProvisioningError(`Failed to poll EMR Cluster ${clusterId} termination: ${describeAwsFailure(error).detail}`, resourceType, logicalId, clusterId, cause);
41217
41205
  }
41218
41206
  const state = cluster?.Status?.State;
41219
41207
  if (state && TERMINAL_STATES.has(state)) {
@@ -41557,7 +41545,7 @@ var EMRInstanceGroupConfigProvider = class {
41557
41545
  }
41558
41546
  };
41559
41547
  } catch (error) {
41560
- const thrown = error instanceof ProvisioningError ? error : new ProvisioningError(`Failed to add EMR instance group ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, error instanceof Error ? error : void 0);
41548
+ const thrown = error instanceof ProvisioningError ? error : new ProvisioningError(`Failed to add EMR instance group ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, error instanceof Error ? error : void 0);
41561
41549
  let leftBehindGroupId = createdGroupId;
41562
41550
  if (leftBehindGroupId && properties["InstanceRole"] === "TASK") {
41563
41551
  const log = createMaskedLogSinks(this.logger, context?.maskSecrets);
@@ -41663,7 +41651,7 @@ var EMRInstanceGroupConfigProvider = class {
41663
41651
  } catch (error) {
41664
41652
  if (error instanceof ProvisioningError || error instanceof ResourceUpdateNotSupportedError) throw error;
41665
41653
  const cause = error instanceof Error ? error : void 0;
41666
- throw new ProvisioningError(`Failed to update EMR instance group ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
41654
+ throw new ProvisioningError(`Failed to update EMR instance group ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
41667
41655
  }
41668
41656
  }
41669
41657
  async delete(logicalId, physicalId, resourceType, properties, context) {
@@ -41883,7 +41871,7 @@ var EMRInstanceFleetConfigProvider = class {
41883
41871
  }
41884
41872
  };
41885
41873
  } catch (error) {
41886
- const thrown = error instanceof ProvisioningError ? error : new ProvisioningError(`Failed to add EMR instance fleet ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, error instanceof Error ? error : void 0);
41874
+ const thrown = error instanceof ProvisioningError ? error : new ProvisioningError(`Failed to add EMR instance fleet ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, error instanceof Error ? error : void 0);
41887
41875
  if (createdFleetId) {
41888
41876
  markCreatedBeforeFailure(thrown, logicalId, resourceType, createdFleetId);
41889
41877
  markNonRetryable(thrown);
@@ -41971,7 +41959,7 @@ var EMRInstanceFleetConfigProvider = class {
41971
41959
  } catch (error) {
41972
41960
  if (error instanceof ProvisioningError || error instanceof ResourceUpdateNotSupportedError) throw error;
41973
41961
  const cause = error instanceof Error ? error : void 0;
41974
- throw new ProvisioningError(`Failed to update EMR instance fleet ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
41962
+ throw new ProvisioningError(`Failed to update EMR instance fleet ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
41975
41963
  }
41976
41964
  }
41977
41965
  async delete(logicalId, physicalId, resourceType, properties, context) {
@@ -42267,7 +42255,7 @@ var FirehoseProvider = class {
42267
42255
  attributes: { Arn: arn }
42268
42256
  };
42269
42257
  } catch (error) {
42270
- const thrown = error instanceof ProvisioningError ? error : new ProvisioningError(`Failed to create Firehose delivery stream ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, error instanceof Error ? error : void 0);
42258
+ const thrown = error instanceof ProvisioningError ? error : new ProvisioningError(`Failed to create Firehose delivery stream ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, error instanceof Error ? error : void 0);
42271
42259
  if (createdStreamName !== void 0) markCreatedBeforeFailure(thrown, logicalId, resourceType, createdStreamName);
42272
42260
  throw thrown;
42273
42261
  }
@@ -42279,7 +42267,7 @@ var FirehoseProvider = class {
42279
42267
  } catch (error) {
42280
42268
  if (error instanceof CdkdError) throw error;
42281
42269
  const cause = error instanceof Error ? error : void 0;
42282
- throw new ProvisioningError(`Failed to update Firehose delivery stream ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
42270
+ throw new ProvisioningError(`Failed to update Firehose delivery stream ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
42283
42271
  }
42284
42272
  }
42285
42273
  async applyUpdate(logicalId, physicalId, resourceType, properties, previousProperties) {
@@ -42418,7 +42406,7 @@ var FirehoseProvider = class {
42418
42406
  return;
42419
42407
  }
42420
42408
  const cause = error instanceof Error ? error : void 0;
42421
- throw new ProvisioningError(`Failed to delete Firehose delivery stream ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
42409
+ throw new ProvisioningError(`Failed to delete Firehose delivery stream ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
42422
42410
  }
42423
42411
  await waitForGoneAfterDelete({
42424
42412
  what: `Firehose delivery stream ${physicalId}`,
@@ -43073,7 +43061,7 @@ var CloudTrailProvider = class {
43073
43061
  } catch (error) {
43074
43062
  if (trailCreated) markAuxiliaryFailure(error, logicalId);
43075
43063
  const cause = error instanceof Error ? error : void 0;
43076
- const thrown = new ProvisioningError(`Failed to create CloudTrail Trail ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
43064
+ const thrown = new ProvisioningError(`Failed to create CloudTrail Trail ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
43077
43065
  if (createdTrailArn) markCreatedBeforeFailure(thrown, logicalId, resourceType, createdTrailArn);
43078
43066
  throw thrown;
43079
43067
  }
@@ -43161,7 +43149,7 @@ var CloudTrailProvider = class {
43161
43149
  };
43162
43150
  } catch (error) {
43163
43151
  const cause = error instanceof Error ? error : void 0;
43164
- throw new ProvisioningError(`Failed to update CloudTrail Trail ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
43152
+ throw new ProvisioningError(`Failed to update CloudTrail Trail ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
43165
43153
  }
43166
43154
  }
43167
43155
  async delete(logicalId, physicalId, resourceType, properties, context) {
@@ -43186,7 +43174,7 @@ var CloudTrailProvider = class {
43186
43174
  return;
43187
43175
  }
43188
43176
  const cause = error instanceof Error ? error : void 0;
43189
- const failure = new ProvisioningError(`Failed to delete CloudTrail Trail ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
43177
+ const failure = new ProvisioningError(`Failed to delete CloudTrail Trail ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
43190
43178
  throw stripped ? markDeleteStarted(failure) : failure;
43191
43179
  }
43192
43180
  }
@@ -43514,7 +43502,7 @@ var CodeBuildProvider = class {
43514
43502
  };
43515
43503
  } catch (error) {
43516
43504
  const cause = error instanceof Error ? error : void 0;
43517
- throw new ProvisioningError(`Failed to create CodeBuild Project ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
43505
+ throw new ProvisioningError(`Failed to create CodeBuild Project ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
43518
43506
  }
43519
43507
  }
43520
43508
  async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
@@ -43532,7 +43520,7 @@ var CodeBuildProvider = class {
43532
43520
  };
43533
43521
  } catch (error) {
43534
43522
  const cause = error instanceof Error ? error : void 0;
43535
- throw new ProvisioningError(`Failed to update CodeBuild Project ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
43523
+ throw new ProvisioningError(`Failed to update CodeBuild Project ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
43536
43524
  }
43537
43525
  }
43538
43526
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -43548,7 +43536,7 @@ var CodeBuildProvider = class {
43548
43536
  return;
43549
43537
  }
43550
43538
  const cause = error instanceof Error ? error : void 0;
43551
- throw new ProvisioningError(`Failed to delete CodeBuild Project ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
43539
+ throw new ProvisioningError(`Failed to delete CodeBuild Project ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
43552
43540
  }
43553
43541
  }
43554
43542
  getAttribute(_physicalId, _resourceType, attributeName) {
@@ -43917,7 +43905,7 @@ var CodeCommitRepositoryProvider = class {
43917
43905
  };
43918
43906
  } catch (error) {
43919
43907
  const cause = error instanceof Error ? error : void 0;
43920
- const thrown = new ProvisioningError(`Failed to create CodeCommit Repository ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, repositoryName, cause);
43908
+ const thrown = new ProvisioningError(`Failed to create CodeCommit Repository ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, repositoryName, cause);
43921
43909
  if (leftLiveName !== void 0) markCreatedBeforeFailure(thrown, logicalId, resourceType, leftLiveName);
43922
43910
  throw thrown;
43923
43911
  }
@@ -44022,7 +44010,7 @@ var CodeCommitRepositoryProvider = class {
44022
44010
  }));
44023
44011
  } catch (error) {
44024
44012
  if (retainedCount === 0) throw error;
44025
- throw new Error(`PutRepositoryTriggers failed with ${retainedCount} live trigger(s) the desired Triggers does not name kept beside the desired ones (the recorded Triggers is not a list cdkd can read; CodeCommit allows at most 10 triggers per repository): ${error instanceof Error ? error.message : String(error)}`, { cause: error });
44013
+ throw new Error(`PutRepositoryTriggers failed with ${retainedCount} live trigger(s) the desired Triggers does not name kept beside the desired ones (the recorded Triggers is not a list cdkd can read; CodeCommit allows at most 10 triggers per repository): ${describeAwsFailure(error).detail}`, { cause: error });
44026
44014
  }
44027
44015
  this.logger.debug(`Updated triggers for ${currentName} (${newSdkTriggers.length} trigger(s))`);
44028
44016
  }
@@ -44036,7 +44024,7 @@ var CodeCommitRepositoryProvider = class {
44036
44024
  } catch (error) {
44037
44025
  if (error instanceof ProvisioningError) throw error;
44038
44026
  const cause = error instanceof Error ? error : void 0;
44039
- throw new ProvisioningError(`Failed to update CodeCommit Repository ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
44027
+ throw new ProvisioningError(`Failed to update CodeCommit Repository ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
44040
44028
  }
44041
44029
  }
44042
44030
  readDesiredLists(logicalId, resourceType, values, physicalId) {
@@ -44121,7 +44109,7 @@ var CodeCommitRepositoryProvider = class {
44121
44109
  return withIndeterminateGuard(void 0, guard);
44122
44110
  }
44123
44111
  const cause = error instanceof Error ? error : void 0;
44124
- throw new ProvisioningError(`Failed to delete CodeCommit Repository ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
44112
+ throw new ProvisioningError(`Failed to delete CodeCommit Repository ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
44125
44113
  }
44126
44114
  if (!deletedRepositoryId) {
44127
44115
  const clientRegion = await this.getClient().config.region();
@@ -44349,30 +44337,6 @@ var DLMLifecyclePolicyProvider = class {
44349
44337
  ...properties["Exclusions"] != null && { Exclusions: properties["Exclusions"] }
44350
44338
  };
44351
44339
  }
44352
- buildRemovalResets(properties, previousProperties) {
44353
- const resets = {};
44354
- const createInterval = clearOnUpdateRemoval(properties["CreateInterval"] != null ? Number(properties["CreateInterval"]) : void 0, previousProperties["CreateInterval"] != null ? Number(previousProperties["CreateInterval"]) : void 0, 1);
44355
- if (createInterval !== void 0) resets.CreateInterval = createInterval;
44356
- const retainInterval = clearOnUpdateRemoval(properties["RetainInterval"] != null ? Number(properties["RetainInterval"]) : void 0, previousProperties["RetainInterval"] != null ? Number(previousProperties["RetainInterval"]) : void 0, 7);
44357
- if (retainInterval !== void 0) resets.RetainInterval = retainInterval;
44358
- const copyTags = clearOnUpdateRemoval(properties["CopyTags"] ?? void 0, previousProperties["CopyTags"] ?? void 0, false);
44359
- if (copyTags !== void 0) resets.CopyTags = copyTags;
44360
- const extendDeletion = clearOnUpdateRemoval(properties["ExtendDeletion"] ?? void 0, previousProperties["ExtendDeletion"] ?? void 0, false);
44361
- if (extendDeletion !== void 0) resets.ExtendDeletion = extendDeletion;
44362
- const crossRegionCopyTargets = clearOnUpdateRemoval(properties["CrossRegionCopyTargets"] ?? void 0, previousProperties["CrossRegionCopyTargets"] ?? void 0, []);
44363
- if (crossRegionCopyTargets !== void 0) resets.CrossRegionCopyTargets = crossRegionCopyTargets;
44364
- const defaultPolicy = properties["DefaultPolicy"] ?? previousProperties["DefaultPolicy"];
44365
- const exclusionsClear = defaultPolicy === "VOLUME" ? {
44366
- ExcludeBootVolumes: false,
44367
- ExcludeVolumeTypes: [],
44368
- ExcludeTags: []
44369
- } : defaultPolicy === "INSTANCE" ? { ExcludeTags: [] } : void 0;
44370
- if (exclusionsClear !== void 0) {
44371
- const exclusions = clearOnUpdateRemoval(properties["Exclusions"] ?? void 0, previousProperties["Exclusions"] ?? void 0, exclusionsClear);
44372
- if (exclusions !== void 0) resets.Exclusions = exclusions;
44373
- }
44374
- return resets;
44375
- }
44376
44340
  async fetchPolicyArn(policyId) {
44377
44341
  return (await this.getClient().send(new GetLifecyclePolicyCommand$1({ PolicyId: policyId }))).Policy?.PolicyArn ?? "";
44378
44342
  }
@@ -44414,7 +44378,7 @@ var DLMLifecyclePolicyProvider = class {
44414
44378
  };
44415
44379
  } catch (error) {
44416
44380
  const cause = error instanceof Error ? error : void 0;
44417
- throw new ProvisioningError(`Failed to create DLM Lifecycle Policy ${logicalId}: ${cause?.message ?? String(error)}`, resourceType, logicalId, void 0, cause);
44381
+ throw new ProvisioningError(`Failed to create DLM Lifecycle Policy ${logicalId}: ${cause?.message ?? safeStringify(error)}`, resourceType, logicalId, void 0, cause);
44418
44382
  }
44419
44383
  }
44420
44384
  async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
@@ -44426,7 +44390,8 @@ var DLMLifecyclePolicyProvider = class {
44426
44390
  await this.getClient().send(new UpdateLifecyclePolicyCommand({
44427
44391
  PolicyId: physicalId,
44428
44392
  ...this.toSdkFields(properties),
44429
- ...this.buildRemovalResets(properties, previousProperties)
44393
+ ...properties["CreateInterval"] != null && { CreateInterval: Number(properties["CreateInterval"]) },
44394
+ ...properties["RetainInterval"] != null && { RetainInterval: Number(properties["RetainInterval"]) }
44430
44395
  }));
44431
44396
  const plan = planTagDiff(previousProperties["Tags"], properties["Tags"]);
44432
44397
  const tagWarning = tagPlanWarning(plan, resourceType, logicalId);
@@ -44460,7 +44425,7 @@ var DLMLifecyclePolicyProvider = class {
44460
44425
  } catch (error) {
44461
44426
  if (error instanceof ResourceUpdateNotSupportedError) throw error;
44462
44427
  const cause = error instanceof Error ? error : void 0;
44463
- throw new ProvisioningError(`Failed to update DLM Lifecycle Policy ${logicalId}: ${cause?.message ?? String(error)}`, resourceType, logicalId, physicalId, cause);
44428
+ throw new ProvisioningError(`Failed to update DLM Lifecycle Policy ${logicalId}: ${cause?.message ?? safeStringify(error)}`, resourceType, logicalId, physicalId, cause);
44464
44429
  }
44465
44430
  }
44466
44431
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -44476,7 +44441,7 @@ var DLMLifecyclePolicyProvider = class {
44476
44441
  return;
44477
44442
  }
44478
44443
  const cause = error instanceof Error ? error : void 0;
44479
- throw new ProvisioningError(`Failed to delete DLM Lifecycle Policy ${logicalId}: ${cause?.message ?? String(error)}`, resourceType, logicalId, physicalId, cause);
44444
+ throw new ProvisioningError(`Failed to delete DLM Lifecycle Policy ${logicalId}: ${cause?.message ?? safeStringify(error)}`, resourceType, logicalId, physicalId, cause);
44480
44445
  }
44481
44446
  }
44482
44447
  async getAttribute(physicalId, resourceType, attributeName, logicalId) {
@@ -44486,7 +44451,7 @@ var DLMLifecyclePolicyProvider = class {
44486
44451
  return await this.fetchPolicyArn(physicalId);
44487
44452
  } catch (error) {
44488
44453
  const cause = error instanceof Error ? error : void 0;
44489
- throw new ProvisioningError(`Failed to resolve Arn for DLM Lifecycle Policy ${physicalId}: ${cause?.message ?? String(error)}`, resourceType, logicalId, physicalId, cause);
44454
+ throw new ProvisioningError(`Failed to resolve Arn for DLM Lifecycle Policy ${physicalId}: ${cause?.message ?? safeStringify(error)}`, resourceType, logicalId, physicalId, cause);
44490
44455
  }
44491
44456
  }
44492
44457
  async readCurrentState(physicalId, _logicalId, _resourceType) {
@@ -44652,7 +44617,7 @@ var S3VectorsProvider = class {
44652
44617
  };
44653
44618
  } catch (error) {
44654
44619
  const cause = error instanceof Error ? error : void 0;
44655
- throw new ProvisioningError(`Failed to create S3 VectorBucket ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
44620
+ throw new ProvisioningError(`Failed to create S3 VectorBucket ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
44656
44621
  }
44657
44622
  }
44658
44623
  async deleteVectorBucket(logicalId, physicalId, resourceType, context) {
@@ -44669,7 +44634,7 @@ var S3VectorsProvider = class {
44669
44634
  return;
44670
44635
  }
44671
44636
  const cause = error instanceof Error ? error : void 0;
44672
- throw new ProvisioningError(`Failed to delete S3 VectorBucket ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
44637
+ throw new ProvisioningError(`Failed to delete S3 VectorBucket ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
44673
44638
  }
44674
44639
  }
44675
44640
  async emptyVectorBucket(logicalId, vectorBucketName) {
@@ -44869,7 +44834,7 @@ var S3DirectoryBucketProvider = class {
44869
44834
  };
44870
44835
  } catch (error) {
44871
44836
  const cause = error instanceof Error ? error : void 0;
44872
- throw new ProvisioningError(`Failed to create S3 Express Directory Bucket ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, bucketName, cause);
44837
+ throw new ProvisioningError(`Failed to create S3 Express Directory Bucket ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, bucketName, cause);
44873
44838
  }
44874
44839
  }
44875
44840
  async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
@@ -44905,7 +44870,7 @@ var S3DirectoryBucketProvider = class {
44905
44870
  };
44906
44871
  } catch (error) {
44907
44872
  const cause = error instanceof Error ? error : void 0;
44908
- throw new ProvisioningError(`Failed to update S3 Express Directory Bucket ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
44873
+ throw new ProvisioningError(`Failed to update S3 Express Directory Bucket ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
44909
44874
  }
44910
44875
  }
44911
44876
  async delete(logicalId, physicalId, resourceType, properties, context) {
@@ -44923,7 +44888,7 @@ var S3DirectoryBucketProvider = class {
44923
44888
  return;
44924
44889
  }
44925
44890
  const cause = error instanceof Error ? error : void 0;
44926
- throw new ProvisioningError(mask(`Failed to delete S3 Express Directory Bucket ${logicalId}: ${error instanceof Error ? error.message : String(error)}`), resourceType, logicalId, physicalId, cause);
44891
+ throw new ProvisioningError(mask(`Failed to delete S3 Express Directory Bucket ${logicalId}: ${describeAwsFailure(error).detail}`), resourceType, logicalId, physicalId, cause);
44927
44892
  }
44928
44893
  }
44929
44894
  async deleteBucketWithEmptyRetry(logicalId, bucketName, allowAutoEmpty, maskSecrets) {
@@ -45111,7 +45076,7 @@ var S3TablesProvider = class {
45111
45076
  } catch (error) {
45112
45077
  if (error instanceof CdkdError) throw error;
45113
45078
  const cause = error instanceof Error ? error : void 0;
45114
- throw new ProvisioningError(`Failed to update S3 Tables resource ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
45079
+ throw new ProvisioningError(`Failed to update S3 Tables resource ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
45115
45080
  }
45116
45081
  }
45117
45082
  async applyUpdate(logicalId, physicalId, resourceType, properties, previousProperties) {
@@ -45150,7 +45115,7 @@ var S3TablesProvider = class {
45150
45115
  };
45151
45116
  } catch (error) {
45152
45117
  const cause = error instanceof Error ? error : void 0;
45153
- throw new ProvisioningError(`Failed to create S3 Table Bucket ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
45118
+ throw new ProvisioningError(`Failed to create S3 Table Bucket ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
45154
45119
  }
45155
45120
  }
45156
45121
  async deleteTableBucket(logicalId, physicalId, resourceType, context) {
@@ -45167,7 +45132,7 @@ var S3TablesProvider = class {
45167
45132
  return;
45168
45133
  }
45169
45134
  const cause = error instanceof Error ? error : void 0;
45170
- throw new ProvisioningError(`Failed to delete S3 Table Bucket ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
45135
+ throw new ProvisioningError(`Failed to delete S3 Table Bucket ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
45171
45136
  }
45172
45137
  }
45173
45138
  async emptyTableBucket(tableBucketARN) {
@@ -45247,7 +45212,7 @@ var S3TablesProvider = class {
45247
45212
  };
45248
45213
  } catch (error) {
45249
45214
  const cause = error instanceof Error ? error : void 0;
45250
- throw new ProvisioningError(`Failed to create S3 Tables Namespace ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
45215
+ throw new ProvisioningError(`Failed to create S3 Tables Namespace ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
45251
45216
  }
45252
45217
  }
45253
45218
  async deleteNamespace(logicalId, physicalId, resourceType, context) {
@@ -45268,7 +45233,7 @@ var S3TablesProvider = class {
45268
45233
  return;
45269
45234
  }
45270
45235
  const cause = error instanceof Error ? error : void 0;
45271
- throw new ProvisioningError(`Failed to delete S3 Tables Namespace ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
45236
+ throw new ProvisioningError(`Failed to delete S3 Tables Namespace ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
45272
45237
  }
45273
45238
  }
45274
45239
  async createTable(logicalId, resourceType, properties, context) {
@@ -45319,7 +45284,7 @@ var S3TablesProvider = class {
45319
45284
  };
45320
45285
  } catch (error) {
45321
45286
  const cause = error instanceof Error ? error : void 0;
45322
- const thrown = new ProvisioningError(`Failed to create S3 Tables Table ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
45287
+ const thrown = new ProvisioningError(`Failed to create S3 Tables Table ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
45323
45288
  if (tableCreated) markCreatedBeforeFailure(thrown, logicalId, resourceType, physicalId);
45324
45289
  throw thrown;
45325
45290
  }
@@ -45582,7 +45547,7 @@ var S3TablesProvider = class {
45582
45547
  resolved = await this.resolveTableParts(physicalId);
45583
45548
  } catch (error) {
45584
45549
  const cause = error instanceof Error ? error : void 0;
45585
- throw new ProvisioningError(`Failed to resolve S3 Tables Table ${logicalId} (${physicalId}): ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
45550
+ throw new ProvisioningError(`Failed to resolve S3 Tables Table ${logicalId} (${physicalId}): ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
45586
45551
  }
45587
45552
  if (resolved === "not-found") {
45588
45553
  const clientRegion = await this.getClient().config.region();
@@ -45607,7 +45572,7 @@ var S3TablesProvider = class {
45607
45572
  return;
45608
45573
  }
45609
45574
  const cause = error instanceof Error ? error : void 0;
45610
- throw new ProvisioningError(`Failed to delete S3 Tables Table ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
45575
+ throw new ProvisioningError(`Failed to delete S3 Tables Table ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
45611
45576
  }
45612
45577
  }
45613
45578
  tagListToSdkMap(tags) {
@@ -45662,7 +45627,7 @@ var S3TablesProvider = class {
45662
45627
  }));
45663
45628
  } catch (err) {
45664
45629
  const cause = err instanceof Error ? err : void 0;
45665
- throw new ProvisioningError(`applyTableTagsDiff: UntagResource failed for ${resourceArn} (keys: ${removedKeys.join(", ")}): ${err instanceof Error ? err.message : String(err)}. State has NOT been updated so the next deploy will retry the tag-diff.`, resourceType, logicalId, physicalId, cause);
45630
+ throw new ProvisioningError(`applyTableTagsDiff: UntagResource failed for ${resourceArn} (keys: ${removedKeys.join(", ")}): ${describeAwsFailure(err).detail}. State has NOT been updated so the next deploy will retry the tag-diff.`, resourceType, logicalId, physicalId, cause);
45666
45631
  }
45667
45632
  if (Object.keys(upserts).length > 0) try {
45668
45633
  await this.getClient().send(new TagResourceCommand$27({
@@ -45671,7 +45636,7 @@ var S3TablesProvider = class {
45671
45636
  }));
45672
45637
  } catch (err) {
45673
45638
  const cause = err instanceof Error ? err : void 0;
45674
- throw new ProvisioningError(`applyTableTagsDiff: TagResource failed for ${resourceArn} (keys: ${Object.keys(upserts).join(", ")}): ${err instanceof Error ? err.message : String(err)}. State has NOT been updated so the next deploy will retry the tag-diff.`, resourceType, logicalId, physicalId, cause);
45639
+ throw new ProvisioningError(`applyTableTagsDiff: TagResource failed for ${resourceArn} (keys: ${Object.keys(upserts).join(", ")}): ${describeAwsFailure(err).detail}. State has NOT been updated so the next deploy will retry the tag-diff.`, resourceType, logicalId, physicalId, cause);
45675
45640
  }
45676
45641
  }
45677
45642
  async applyTableBucketTagsDiff(logicalId, physicalId, resourceType, previousTags, newTags) {
@@ -45689,7 +45654,7 @@ var S3TablesProvider = class {
45689
45654
  }));
45690
45655
  } catch (err) {
45691
45656
  const cause = err instanceof Error ? err : void 0;
45692
- throw new ProvisioningError(`applyTableBucketTagsDiff: UntagResource failed for ${resourceArn} (keys: ${removedKeys.join(", ")}): ${err instanceof Error ? err.message : String(err)}. State has NOT been updated so the next deploy will retry the tag-diff.`, resourceType, logicalId, physicalId, cause);
45657
+ throw new ProvisioningError(`applyTableBucketTagsDiff: UntagResource failed for ${resourceArn} (keys: ${removedKeys.join(", ")}): ${describeAwsFailure(err).detail}. State has NOT been updated so the next deploy will retry the tag-diff.`, resourceType, logicalId, physicalId, cause);
45693
45658
  }
45694
45659
  if (Object.keys(upserts).length > 0) try {
45695
45660
  await this.getClient().send(new TagResourceCommand$27({
@@ -45698,7 +45663,7 @@ var S3TablesProvider = class {
45698
45663
  }));
45699
45664
  } catch (err) {
45700
45665
  const cause = err instanceof Error ? err : void 0;
45701
- throw new ProvisioningError(`applyTableBucketTagsDiff: TagResource failed for ${resourceArn} (keys: ${Object.keys(upserts).join(", ")}): ${err instanceof Error ? err.message : String(err)}. State has NOT been updated so the next deploy will retry the tag-diff.`, resourceType, logicalId, physicalId, cause);
45666
+ throw new ProvisioningError(`applyTableBucketTagsDiff: TagResource failed for ${resourceArn} (keys: ${Object.keys(upserts).join(", ")}): ${describeAwsFailure(err).detail}. State has NOT been updated so the next deploy will retry the tag-diff.`, resourceType, logicalId, physicalId, cause);
45702
45667
  }
45703
45668
  }
45704
45669
  };
@@ -45813,7 +45778,7 @@ var ECRProvider = class {
45813
45778
  } catch (error) {
45814
45779
  if (repositoryCreated) markAuxiliaryFailure(error, logicalId);
45815
45780
  const cause = error instanceof Error ? error : void 0;
45816
- const thrown = new ProvisioningError(`Failed to create ECR Repository ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, repositoryName, cause);
45781
+ const thrown = new ProvisioningError(`Failed to create ECR Repository ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, repositoryName, cause);
45817
45782
  if (repositoryCreated) markCreatedBeforeFailure(thrown, logicalId, resourceType, repositoryName);
45818
45783
  throw thrown;
45819
45784
  }
@@ -45909,7 +45874,7 @@ var ECRProvider = class {
45909
45874
  };
45910
45875
  } catch (error) {
45911
45876
  const cause = error instanceof Error ? error : void 0;
45912
- throw new ProvisioningError(`Failed to update ECR Repository ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
45877
+ throw new ProvisioningError(`Failed to update ECR Repository ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
45913
45878
  }
45914
45879
  }
45915
45880
  async delete(logicalId, physicalId, resourceType, properties, context) {
@@ -45931,7 +45896,7 @@ var ECRProvider = class {
45931
45896
  return;
45932
45897
  }
45933
45898
  const cause = error instanceof Error ? error : void 0;
45934
- throw new ProvisioningError(`Failed to delete ECR Repository ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
45899
+ throw new ProvisioningError(`Failed to delete ECR Repository ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
45935
45900
  }
45936
45901
  }
45937
45902
  async readCurrentState(physicalId, _logicalId, _resourceType) {
@@ -46057,6 +46022,7 @@ var NestedStackProvider = class {
46057
46022
  physicalId,
46058
46023
  attributes: childOutputs.attributes,
46059
46024
  ...childOutputs.noEchoAttributeNames.length > 0 && { noEchoAttributeNames: childOutputs.noEchoAttributeNames },
46025
+ secretNamedAttributeNames: childOutputs.secretNamedAttributeNames,
46060
46026
  ...pendingRecord && { effectiveProperties: pendingRecord }
46061
46027
  };
46062
46028
  } catch (error) {
@@ -46084,6 +46050,7 @@ var NestedStackProvider = class {
46084
46050
  wasReplaced: false,
46085
46051
  attributes: updatedOutputs.attributes,
46086
46052
  ...updatedOutputs.noEchoAttributeNames.length > 0 && { noEchoAttributeNames: updatedOutputs.noEchoAttributeNames },
46053
+ secretNamedAttributeNames: updatedOutputs.secretNamedAttributeNames,
46087
46054
  ...pendingRecord && { effectiveProperties: pendingRecord }
46088
46055
  };
46089
46056
  }
@@ -46267,9 +46234,11 @@ var NestedStackProvider = class {
46267
46234
  attributes[attributeName] = recovered;
46268
46235
  noEchoAttributeNames.push(attributeName);
46269
46236
  }
46237
+ const childResources = childStateData.state.resources;
46270
46238
  return {
46271
46239
  attributes,
46272
- noEchoAttributeNames
46240
+ noEchoAttributeNames,
46241
+ secretNamedAttributeNames: childResources !== null && typeof childResources === "object" ? secretNamedAttributeNamesOf(attributes, childResources, rowSecrets) : []
46273
46242
  };
46274
46243
  }
46275
46244
  requireContext() {
@@ -46497,7 +46466,7 @@ var ACMCertificateProvider = class {
46497
46466
  throw thrown;
46498
46467
  }
46499
46468
  const cause = error instanceof Error ? error : void 0;
46500
- const detail = error instanceof Error ? error.message : String(error);
46469
+ const detail = describeAwsFailure(error).detail;
46501
46470
  const message = `Failed to create ACM certificate ${logicalIdShown(logicalId)}: ${detail}`;
46502
46471
  if (requestedArn && survivorNote !== void 0) {
46503
46472
  const thrown = new ProvisioningError(`${message} ${survivorNote}`, resourceType, logicalId, requestedArn, cause);
@@ -46605,7 +46574,7 @@ var ACMCertificateProvider = class {
46605
46574
  };
46606
46575
  } catch (error) {
46607
46576
  const cause = error instanceof Error ? error : void 0;
46608
- throw new ProvisioningError(`Failed to update ACM certificate ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
46577
+ throw new ProvisioningError(`Failed to update ACM certificate ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
46609
46578
  }
46610
46579
  }
46611
46580
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -46625,7 +46594,7 @@ var ACMCertificateProvider = class {
46625
46594
  this.logger.debug(`Successfully deleted ACM certificate ${logicalId}`);
46626
46595
  } catch (error) {
46627
46596
  const cause = error instanceof Error ? error : void 0;
46628
- throw new ProvisioningError(`Failed to delete ACM certificate ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
46597
+ throw new ProvisioningError(`Failed to delete ACM certificate ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
46629
46598
  }
46630
46599
  }
46631
46600
  async getAttribute(physicalId, _resourceType, attributeName) {
@@ -46747,4 +46716,4 @@ var ACMCertificateProvider = class {
46747
46716
 
46748
46717
  //#endregion
46749
46718
  export { ACMCertificateProvider, ASGProvider, AgentCoreBrowserProvider, AgentCoreCodeInterpreterProvider, AgentCoreEvaluatorProvider, AgentCoreRuntimeProvider, ApiGatewayProvider, ApiGatewayV2Provider, AppSyncProvider, BudgetsBudgetProvider, CloudFrontDistributionProvider, CloudFrontOACProvider, CloudFrontOAIProvider, CloudTrailProvider, CloudWatchAlarmProvider, CloudWatchAnomalyDetectorProvider, CodeBuildProvider, CodeCommitRepositoryProvider, CognitoUserPoolProvider, DLMLifecyclePolicyProvider, DocDBProvider, DocDBSubnetGroupProvider, DynamoDBGlobalTableProvider, DynamoDBTableProvider, EC2Provider, ECRProvider, ECSProvider, EFSProvider, ELBv2Provider, EMRClusterProvider, EMRInstanceFleetConfigProvider, EMRInstanceGroupConfigProvider, ElastiCacheProvider, EventBridgeBusProvider, EventBridgeRuleProvider, FSxFileSystemProvider, FirehoseProvider, GlueConnectionProvider, GlueCrawlerProvider, GlueJobProvider, GlueProvider, GlueSecurityConfigurationProvider, GlueTriggerProvider, GlueWorkflowProvider, IAMAccessKeyProvider, IAMInstanceProfileProvider, IAMManagedPolicyProvider, IAMPolicyProvider, IAMRoleProvider, IAMUserGroupProvider, KMSProvider, KinesisStreamConsumerProvider, KinesisStreamProvider, LambdaEventInvokeConfigProvider, LambdaEventSourceMappingProvider, LambdaFunctionProvider, LambdaLayerVersionProvider, LambdaMicrovmImageProvider, LambdaNetworkConnectorProvider, LambdaPermissionProvider, LambdaUrlProvider, LambdaWebFunctionEndpointProvider, LambdaWebFunctionRevisionProvider, LogsLogGroupProvider, NeptuneProvider, NestedStackProvider, PipesPipeProvider, RDSDBProxyEndpointProvider, RDSDBProxyProvider, RDSDBProxyTargetGroupProvider, RDSProvider, Route53Provider, S3BucketPolicyProvider, S3BucketProvider, S3DirectoryBucketProvider, S3TablesProvider, S3VectorsProvider, SNSSubscriptionProvider, SNSTopicPolicyProvider, SNSTopicProvider, SQSQueuePolicyProvider, SQSQueueProvider, SSMParameterProvider, SchedulerScheduleProvider, SecretsManagerSecretProvider, ServiceDiscoveryProvider, StepFunctionsProvider, WAFv2WebACLProvider, WaitConditionHandleProvider };
46750
- //# sourceMappingURL=provider-classes-CDxfoC_T.js.map
46719
+ //# sourceMappingURL=provider-classes-BSUoljqw.js.map