@go-to-k/cdkd 0.301.2 → 0.301.3

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 (30) hide show
  1. package/dist/{asg-provider--t5d-gjf.js → asg-provider-Di3xOH3L.js} +8 -15
  2. package/dist/asg-provider-Di3xOH3L.js.map +1 -0
  3. package/dist/cli.js +2 -2
  4. package/dist/{deploy-engine--5XWdjW3.js → deploy-engine-CZaafy9R.js} +299 -102
  5. package/dist/deploy-engine-CZaafy9R.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-De0ZPOAF.js} +4 -4
  9. package/dist/iam-role-provider-De0ZPOAF.js.map +1 -0
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +3 -3
  12. package/dist/{neptune-provider-DjEVKBcV.js → neptune-provider-DTUriVz3.js} +12 -12
  13. package/dist/neptune-provider-DTUriVz3.js.map +1 -0
  14. package/dist/{program-DEPit8lD.js → program-CYtSW-WU.js} +29 -208
  15. package/dist/program-CYtSW-WU.js.map +1 -0
  16. package/dist/{provider-classes-CDxfoC_T.js → provider-classes-59TTNMFB.js} +301 -268
  17. package/dist/provider-classes-59TTNMFB.js.map +1 -0
  18. package/dist/{rds-provider-BvZhdkOC.js → rds-provider-Dadp11aB.js} +12 -12
  19. package/dist/rds-provider-Dadp11aB.js.map +1 -0
  20. package/dist/{version-DUYEmFtp.js → version-Cx2pAgJv.js} +2 -2
  21. package/dist/{version-DUYEmFtp.js.map → version-Cx2pAgJv.js.map} +1 -1
  22. package/package.json +2 -2
  23. package/dist/asg-provider--t5d-gjf.js.map +0 -1
  24. package/dist/deploy-engine--5XWdjW3.js.map +0 -1
  25. package/dist/iam-policy-targets-DFk7zr0Q.js.map +0 -1
  26. package/dist/iam-role-provider-Bwgqyn6-.js.map +0 -1
  27. package/dist/neptune-provider-DjEVKBcV.js.map +0 -1
  28. package/dist/program-DEPit8lD.js.map +0 -1
  29. package/dist/provider-classes-CDxfoC_T.js.map +0 -1
  30. 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 S3_AUTO_DELETE_OBJECTS_TAG, Ai as getAccountInfo, Ao as requireConfigString, As as recordAttributeIdCopy, Bi as parseWebACLArn, Bl as displayAssemblyPath, C as withApiLimit, Cc as rewriteTemplateAssetReferences, Co as configBooleanRefusal, Do as replayWarn, Eo as readConfigString, Fo as canonicalLambdaFunctionName, Fr as slowCcOperationTimeoutMs, G as deleteBudgetKey, Ga as refuseMalformedResourcesForDestroy, Gt as awaitInFlightSibling, H as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, Hl as resolveAssemblyPath, Hr as withIndeterminateGuard, Ht as withNestedStackContext, Io as lambdaFunctionNameForMask, Ir as unchangedBehindSecretReference, J as DELETE_INDEX_WAIT_PROCEED_NOTE, Jr as observeThenDisableInstanceApiTermination, K as resolveDynamoDbDeleteBudgetClock, Kr as ec2InstanceProtectionSite, Lo as sameLambdaFunctionAddress, Lt as revertNestedChildFromJournal, Ns as carriesSecretMask, Ol as canonicalizeRegion, Oo as requireConfigArray, Os as recoverMaskedOutput, Po as withRetry, Pt as getNestedRevertRun, Q as ECR_AUTO_DELETE_IMAGES_TAG, S as lookupEachName, Si as s3BucketWebsiteUrl, So as coerceCfnInteger, Ss as dynamicReferenceTokens, Ta as refuseMalformedNestedChildOutputs, Tl as decodeListingKey, To as configStringRefusal, Tr as waitForLambdaFunctionActive, U as beginDeleteWait, Ui as passedParameterClassesOf, Ur as isWaitAbandonedError, V as DynamoDBGlobalTableProvider, Vl as renderAssemblyPathEscape, Vr as deleteSkipReason, Vt as getCurrentNestedStackContext, W as compensateRemovedDeletionProtection, Wr as markWaitAbandoned, X as deleteTableWithIndexBusyRetry, Xi as accountArgs, Xr as reEnableInstanceApiTermination, Xt as replacedDeleteFailureVerdict, Y as INDEX_SETTLE_POLL_INTERVAL_MS, Yo as passedNoEchoParametersOf, Yr as reDisableInstanceApiTermination, Z as waitForIndexesSettled, _o as coerceWarmThroughput$1, _r as tagPlanWarning, _s as redactSecretsForState, ao as findSilentDropProperties, b as chunks, bi as s3BucketDualStackDomainName, bo as toFiniteNumber, bs as withoutPhysicalNameCopies, c as isAbsoluteAssetPath, cr as acquireIdempotencyToken, dn as REDACTED_DELETE_ADDRESS_SKIP_REASON, dr as DBPROXY_TAGS_WHAT, et as hasCdkAutoDeleteTag, fn as isRedactedRecordedValue, fr as DBPROXY_TAG_OPTIONS, go as WARM_THROUGHPUT_MEMBERS, gr as tagMapAsList, gs as snapshotPassProvenance, hi as outputReferenceProvenanceOf, hr as refuseMalformedDesiredTags, hs as recordReferenceProvenanceEntry, ir as earliestDefined, kl as derivePartitionAndUrlSuffix, ko as requireConfigObject, kr as getCurrentResourceSecrets, ks as physicalNameCopiesOf, l as listNestedTemplateRows, ln as getCurrentProducerRegions, lr as isRefusedByName, mn as redactedDeleteAddressSkip, mr as readTagList, ms as markSameGenerationBag, ns as hasMaskableValues, nt as getPriorAttempts, or as reserveStackCreateToken, pi as isSettledInstanceState, pn as redactedDeleteAddressFields, pr as planTagDiff, q as resolveDynamoDbDeleteBudgetMs, qr as isTerminationProtectionPropagationError, qt as getStackRecords, ro as withheldAccountClause, rt as markRefusedBeforeApplying, s as findNestedTemplateTreeDefect, so as withoutSilentDropProperties, t as DeployEngine, tt as isTruthyCfnBoolean, u as renderNestedTemplateTreeDefect, ur as markDeleteStarted, vc as stringifyValue, vi as s3BucketArn, vo as isWarmThroughputDecrease, vr as definedAttributes, wo as configIntegerRefusal, x as isAccessDeniedError, xi as s3BucketRegionalDomainName, xo as coerceCfnBoolean, yi as s3BucketDomainName, yo as toCfnInteger, yr as stringifyIfAssigned, zl as describeFileReadFailure } from "./deploy-engine-CZaafy9R.js";
6
+ import { n as collectInlinePolicyNamesManagedBySiblings, r as IamCreateClientCache, t as IAMRoleProvider } from "./iam-role-provider-De0ZPOAF.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-CYtSW-WU.js";
8
+ import { RDSProvider } from "./rds-provider-Dadp11aB.js";
9
+ import { NeptuneProvider } from "./neptune-provider-DTUriVz3.js";
10
+ import { ASGProvider } from "./asg-provider-Di3xOH3L.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
  }
@@ -5808,7 +5808,7 @@ var SQSQueueProvider = class {
5808
5808
  };
5809
5809
  } catch (error) {
5810
5810
  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);
5811
+ throw new ProvisioningError(`Failed to create SQS queue ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, queueName, cause);
5812
5812
  }
5813
5813
  }
5814
5814
  async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
@@ -5856,7 +5856,7 @@ var SQSQueueProvider = class {
5856
5856
  };
5857
5857
  } catch (error) {
5858
5858
  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);
5859
+ throw new ProvisioningError(`Failed to update SQS queue ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
5860
5860
  }
5861
5861
  }
5862
5862
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -5872,7 +5872,7 @@ var SQSQueueProvider = class {
5872
5872
  return;
5873
5873
  }
5874
5874
  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);
5875
+ throw new ProvisioningError(`Failed to delete SQS queue ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
5876
5876
  }
5877
5877
  }
5878
5878
  async applyTagDiff(queueUrl, resourceType, logicalId, oldTagsRaw, newTagsRaw) {
@@ -6597,7 +6597,7 @@ var SNSTopicProvider = class {
6597
6597
  };
6598
6598
  } catch (error) {
6599
6599
  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);
6600
+ const thrown = new ProvisioningError(`Failed to create SNS topic ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, topicName, cause);
6601
6601
  if (leftBehindArn) markCreatedBeforeFailure(thrown, logicalId, resourceType, leftBehindArn);
6602
6602
  throw thrown;
6603
6603
  }
@@ -6609,7 +6609,7 @@ var SNSTopicProvider = class {
6609
6609
  } catch (error) {
6610
6610
  if (error instanceof CdkdError) throw error;
6611
6611
  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);
6612
+ throw new ProvisioningError(`Failed to update SNS topic ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
6613
6613
  }
6614
6614
  }
6615
6615
  async applyUpdate(logicalId, physicalId, resourceType, properties, previousProperties, maskSecrets) {
@@ -6775,7 +6775,7 @@ var SNSTopicProvider = class {
6775
6775
  return;
6776
6776
  }
6777
6777
  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);
6778
+ throw new ProvisioningError(`Failed to delete SNS topic ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
6779
6779
  }
6780
6780
  }
6781
6781
  async getAttribute(physicalId, _resourceType, attributeName) {
@@ -7217,7 +7217,7 @@ var SNSSubscriptionProvider = class {
7217
7217
  return;
7218
7218
  }
7219
7219
  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);
7220
+ throw new ProvisioningError(mask(`Failed to delete SNS subscription ${logicalId}: ${describeAwsFailure(error).detail}`), resourceType, logicalId, physicalId, cause);
7221
7221
  }
7222
7222
  }
7223
7223
  logPendingConfirmationSkip(logicalId, physicalId) {
@@ -7948,7 +7948,7 @@ var LambdaFunctionProvider = class {
7948
7948
  } catch (error) {
7949
7949
  if (functionCreated) markAuxiliaryFailure(error, logicalId);
7950
7950
  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))));
7951
+ 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
7952
  if (createdFunctionName !== void 0 && !postCreateCleanup.deleted) markCreatedBeforeFailure(thrown, logicalId, resourceType, createdFunctionName, createdFunctionIdentity);
7953
7953
  throw thrown;
7954
7954
  }
@@ -8126,7 +8126,7 @@ var LambdaFunctionProvider = class {
8126
8126
  } catch (error) {
8127
8127
  if (error instanceof ProvisioningError) throw error;
8128
8128
  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))));
8129
+ throw this.wrapMaskedError(log, error, (text) => new ProvisioningError(`Failed to update Lambda function ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause ?? new Error(safeStringify(error))));
8130
8130
  }
8131
8131
  }
8132
8132
  async delete(logicalId, physicalId, resourceType, properties, context) {
@@ -8167,7 +8167,7 @@ var LambdaFunctionProvider = class {
8167
8167
  return;
8168
8168
  }
8169
8169
  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);
8170
+ const failure = new ProvisioningError(`Failed to delete Lambda function ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
8171
8171
  throw stripped ? markDeleteStarted(failure) : failure;
8172
8172
  }
8173
8173
  if (hasVpcConfig) await this.cleanupLambdaEnis(physicalId);
@@ -8232,7 +8232,7 @@ var LambdaFunctionProvider = class {
8232
8232
  }, { FunctionName: functionName });
8233
8233
  } catch (error) {
8234
8234
  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))));
8235
+ 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
8236
  }
8237
8237
  }
8238
8238
  async waitForLambdaUpdateCompleted(functionName) {
@@ -8724,7 +8724,7 @@ var LambdaPermissionProvider = class {
8724
8724
  return;
8725
8725
  }
8726
8726
  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);
8727
+ throw new ProvisioningError(`Failed to delete Lambda permission ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
8728
8728
  }
8729
8729
  }
8730
8730
  async readCurrentState(physicalId, _logicalId, _resourceType, properties) {
@@ -8861,7 +8861,7 @@ var LambdaUrlProvider = class {
8861
8861
  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
8862
  } } : {});
8863
8863
  } 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);
8864
+ 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
8865
  }
8866
8866
  const previousAuthType = previousProperties["AuthType"];
8867
8867
  const authType = authTypeUnusable ? typeof previousAuthType === "string" && previousAuthType.trim() !== "" ? previousAuthType : void 0 : requestedAuthType;
@@ -8912,7 +8912,7 @@ var LambdaUrlProvider = class {
8912
8912
  return;
8913
8913
  }
8914
8914
  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);
8915
+ throw new ProvisioningError(`Failed to delete Lambda URL ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
8916
8916
  }
8917
8917
  }
8918
8918
  async getAttribute(physicalId, _resourceType, attributeName) {
@@ -9411,7 +9411,7 @@ var LambdaEventSourceMappingProvider = class {
9411
9411
  return;
9412
9412
  }
9413
9413
  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);
9414
+ throw new ProvisioningError(`Failed to delete event source mapping ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
9415
9415
  }
9416
9416
  }
9417
9417
  async readCurrentState(physicalId, _logicalId, _resourceType, properties) {
@@ -9639,7 +9639,7 @@ var LambdaLayerVersionProvider = class {
9639
9639
  return;
9640
9640
  }
9641
9641
  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);
9642
+ throw new ProvisioningError(`Failed to delete Lambda layer version ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
9643
9643
  }
9644
9644
  }
9645
9645
  async readCurrentState(physicalId, _logicalId, _resourceType) {
@@ -9853,7 +9853,7 @@ var LambdaEventInvokeConfigProvider = class {
9853
9853
  return;
9854
9854
  }
9855
9855
  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);
9856
+ throw new ProvisioningError(`Failed to delete Lambda EventInvokeConfig ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
9857
9857
  }
9858
9858
  }
9859
9859
  async getAttribute(_physicalId, _resourceType, _attributeName) {}
@@ -12055,7 +12055,7 @@ var DynamoDBTableProvider = class {
12055
12055
  }
12056
12056
  markAuxiliaryFailure(error, logicalId);
12057
12057
  }
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);
12058
+ 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
12059
  if (tableLeftBehind) markCreatedBeforeFailure(thrown, logicalId, resourceType, tableName, createdTableId);
12060
12060
  throw thrown;
12061
12061
  }
@@ -12078,7 +12078,7 @@ var DynamoDBTableProvider = class {
12078
12078
  if (context?.replayingState !== true && context?.desiredFromAwsReadback !== true && JSON.stringify(properties["BillingMode"]) !== JSON.stringify(previousProperties["BillingMode"])) try {
12079
12079
  requireConfigString(properties["BillingMode"], "PROVISIONED", "AWS::DynamoDB::Table BillingMode");
12080
12080
  } 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);
12081
+ 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
12082
  }
12083
12083
  if (context?.replayingState !== true && context?.desiredFromAwsReadback !== true && JSON.stringify(properties["PointInTimeRecoverySpecification"]) !== JSON.stringify(previousProperties["PointInTimeRecoverySpecification"])) {
12084
12084
  const pitrRefusal = pointInTimeRecoveryRefusal(properties["PointInTimeRecoverySpecification"]);
@@ -12310,7 +12310,7 @@ var DynamoDBTableProvider = class {
12310
12310
  } catch (error) {
12311
12311
  if (error instanceof ProvisioningError) throw error;
12312
12312
  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);
12313
+ throw new ProvisioningError(`Failed to update DynamoDB table ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
12314
12314
  }
12315
12315
  }
12316
12316
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -12411,7 +12411,7 @@ var DynamoDBTableProvider = class {
12411
12411
  return;
12412
12412
  }
12413
12413
  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);
12414
+ throw new ProvisioningError(`Failed to delete DynamoDB table ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
12415
12415
  }
12416
12416
  }
12417
12417
  async applyTagDiff(tableArn, resourceType, logicalId, oldTagsRaw, newTagsRaw) {
@@ -13685,7 +13685,7 @@ var LogsLogGroupProvider = class {
13685
13685
  return;
13686
13686
  }
13687
13687
  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);
13688
+ throw new ProvisioningError(`Failed to delete log group ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
13689
13689
  }
13690
13690
  }
13691
13691
  logGoneOnDelete(logicalId, physicalId, context) {
@@ -13867,7 +13867,7 @@ var CloudWatchAlarmProvider = class {
13867
13867
  };
13868
13868
  } catch (error) {
13869
13869
  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);
13870
+ throw new ProvisioningError(`Failed to create CloudWatch alarm ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
13871
13871
  }
13872
13872
  }
13873
13873
  async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
@@ -13886,7 +13886,7 @@ var CloudWatchAlarmProvider = class {
13886
13886
  };
13887
13887
  } catch (error) {
13888
13888
  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);
13889
+ throw new ProvisioningError(`Failed to update CloudWatch alarm ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
13890
13890
  }
13891
13891
  }
13892
13892
  throttleDelaysMs = [
@@ -13926,7 +13926,7 @@ var CloudWatchAlarmProvider = class {
13926
13926
  return;
13927
13927
  }
13928
13928
  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);
13929
+ throw new ProvisioningError(`Failed to delete CloudWatch alarm ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
13930
13930
  }
13931
13931
  }
13932
13932
  async getAlarmArn(alarmName) {
@@ -14147,7 +14147,7 @@ var CloudWatchAnomalyDetectorProvider = class {
14147
14147
  };
14148
14148
  } catch (error) {
14149
14149
  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);
14150
+ throw new ProvisioningError(`Failed to create CloudWatch anomaly detector ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
14151
14151
  }
14152
14152
  }
14153
14153
  async update(logicalId, physicalId, resourceType, properties, _previousProperties, context) {
@@ -14165,7 +14165,7 @@ var CloudWatchAnomalyDetectorProvider = class {
14165
14165
  };
14166
14166
  } catch (error) {
14167
14167
  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);
14168
+ throw new ProvisioningError(`Failed to update CloudWatch anomaly detector ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
14169
14169
  }
14170
14170
  }
14171
14171
  async delete(logicalId, physicalId, resourceType, properties, context) {
@@ -14191,7 +14191,7 @@ var CloudWatchAnomalyDetectorProvider = class {
14191
14191
  return;
14192
14192
  }
14193
14193
  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);
14194
+ throw new ProvisioningError(`Failed to delete CloudWatch anomaly detector ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
14195
14195
  }
14196
14196
  }
14197
14197
  async getAttribute(physicalId, resourceType, attributeName, logicalId) {
@@ -14436,7 +14436,7 @@ var SecretsManagerSecretProvider = class {
14436
14436
  try {
14437
14437
  changedValue = this.changedSecretValue(properties, previousProperties, stateBorneDesired, log.warn);
14438
14438
  } catch (error) {
14439
- const message = v(error instanceof Error ? error.message : String(error));
14439
+ const message = v(describeAwsFailure(error).detail);
14440
14440
  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
14441
  }
14442
14442
  try {
@@ -14547,7 +14547,7 @@ var SecretsManagerSecretProvider = class {
14547
14547
  return;
14548
14548
  }
14549
14549
  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);
14550
+ throw new ProvisioningError(`Failed to delete secret ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
14551
14551
  }
14552
14552
  }
14553
14553
  retainPreviousGenerateBlock(logicalId, properties, previousProperties) {
@@ -14847,7 +14847,7 @@ var SSMParameterProvider = class SSMParameterProvider {
14847
14847
  return;
14848
14848
  }
14849
14849
  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);
14850
+ throw new ProvisioningError(`Failed to delete SSM parameter ${displaySafe(logicalId)}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
14851
14851
  }
14852
14852
  }
14853
14853
  async readCurrentState(physicalId, _logicalId, _resourceType) {
@@ -15121,7 +15121,7 @@ var EventBridgeRuleProvider = class {
15121
15121
  };
15122
15122
  } catch (error) {
15123
15123
  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);
15124
+ const thrown = new ProvisioningError(`Failed to create EventBridge rule ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, ruleName, cause);
15125
15125
  if (leftLiveArn) markCreatedBeforeFailure(thrown, logicalId, resourceType, leftLiveArn);
15126
15126
  throw thrown;
15127
15127
  }
@@ -15191,7 +15191,7 @@ var EventBridgeRuleProvider = class {
15191
15191
  };
15192
15192
  } catch (error) {
15193
15193
  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);
15194
+ throw new ProvisioningError(`Failed to update EventBridge rule ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
15195
15195
  }
15196
15196
  }
15197
15197
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -15237,7 +15237,7 @@ var EventBridgeRuleProvider = class {
15237
15237
  return;
15238
15238
  }
15239
15239
  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);
15240
+ const failure = new ProvisioningError(`Failed to delete EventBridge rule ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
15241
15241
  throw stripped ? markDeleteStarted(failure) : failure;
15242
15242
  }
15243
15243
  }
@@ -15442,7 +15442,7 @@ var EventBridgeBusProvider = class {
15442
15442
  };
15443
15443
  } catch (error) {
15444
15444
  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);
15445
+ throw new ProvisioningError(`Failed to create EventBus ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
15446
15446
  }
15447
15447
  }
15448
15448
  async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
@@ -15453,7 +15453,7 @@ var EventBridgeBusProvider = class {
15453
15453
  } catch (error) {
15454
15454
  if (error instanceof CdkdError) throw error;
15455
15455
  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);
15456
+ throw new ProvisioningError(`Failed to update EventBus ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
15457
15457
  }
15458
15458
  }
15459
15459
  async applyUpdate(logicalId, physicalId, resourceType, properties, previousProperties) {
@@ -16037,7 +16037,7 @@ var EC2Provider = class {
16037
16037
  } catch (error) {
16038
16038
  if (error instanceof CdkdError) throw error;
16039
16039
  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);
16040
+ throw new ProvisioningError(`Failed to update EC2 resource ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
16041
16041
  }
16042
16042
  }
16043
16043
  async applyUpdate(logicalId, physicalId, resourceType, properties, previousProperties, context) {
@@ -16278,7 +16278,7 @@ var EC2Provider = class {
16278
16278
  };
16279
16279
  } catch (error) {
16280
16280
  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);
16281
+ const thrown = new ProvisioningError(`Failed to create VPC ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
16282
16282
  if (leftBehindId !== void 0) {
16283
16283
  markCreatedBeforeFailure(thrown, logicalId, resourceType, leftBehindId);
16284
16284
  markNonRetryable(thrown);
@@ -16318,7 +16318,7 @@ var EC2Provider = class {
16318
16318
  };
16319
16319
  } catch (error) {
16320
16320
  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);
16321
+ throw new ProvisioningError(`Failed to update VPC ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
16322
16322
  }
16323
16323
  }
16324
16324
  async deleteVpc(logicalId, physicalId, resourceType, context) {
@@ -16438,7 +16438,7 @@ var EC2Provider = class {
16438
16438
  };
16439
16439
  } catch (error) {
16440
16440
  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);
16441
+ const thrown = new ProvisioningError(`Failed to create Subnet ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
16442
16442
  if (leftBehindId !== void 0) markCreatedBeforeFailure(thrown, logicalId, resourceType, leftBehindId);
16443
16443
  throw thrown;
16444
16444
  }
@@ -16474,7 +16474,7 @@ var EC2Provider = class {
16474
16474
  } catch (error) {
16475
16475
  if (error instanceof CdkdError) throw error;
16476
16476
  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);
16477
+ throw new ProvisioningError(`Failed to update Subnet ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
16478
16478
  }
16479
16479
  }
16480
16480
  async waitForSubnetMapPublicIp(subnetId, expected) {
@@ -16582,7 +16582,7 @@ var EC2Provider = class {
16582
16582
  };
16583
16583
  } catch (error) {
16584
16584
  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);
16585
+ throw new ProvisioningError(`Failed to create InternetGateway ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
16586
16586
  }
16587
16587
  }
16588
16588
  updateInternetGateway(logicalId, physicalId) {
@@ -16601,7 +16601,7 @@ var EC2Provider = class {
16601
16601
  return;
16602
16602
  }
16603
16603
  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);
16604
+ throw new ProvisioningError(`Failed to delete InternetGateway ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
16605
16605
  }
16606
16606
  }
16607
16607
  eipPhysicalId(logicalId, publicIp, allocationId, options) {
@@ -16700,7 +16700,7 @@ var EC2Provider = class {
16700
16700
  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
16701
  }
16702
16702
  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);
16703
+ const thrown = new ProvisioningError(`Failed to create EIP ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
16704
16704
  if (createdId !== void 0) {
16705
16705
  markCreatedBeforeFailure(thrown, logicalId, resourceType, createdId);
16706
16706
  markNonRetryable(thrown);
@@ -16771,7 +16771,7 @@ var EC2Provider = class {
16771
16771
  return;
16772
16772
  }
16773
16773
  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);
16774
+ throw new ProvisioningError(`Failed to delete EIP ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
16775
16775
  }
16776
16776
  }
16777
16777
  async getEipAttribute(physicalId, attributeName) {
@@ -16814,7 +16814,7 @@ var EC2Provider = class {
16814
16814
  };
16815
16815
  } catch (error) {
16816
16816
  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);
16817
+ throw new ProvisioningError(`Failed to create VPCGatewayAttachment ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
16818
16818
  }
16819
16819
  }
16820
16820
  updateVpcGatewayAttachment(logicalId, physicalId) {
@@ -16839,7 +16839,7 @@ var EC2Provider = class {
16839
16839
  return;
16840
16840
  }
16841
16841
  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);
16842
+ throw new ProvisioningError(`Failed to delete VPCGatewayAttachment ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
16843
16843
  }
16844
16844
  }
16845
16845
  async createNatGateway(logicalId, resourceType, properties) {
@@ -16885,7 +16885,7 @@ var EC2Provider = class {
16885
16885
  };
16886
16886
  } catch (error) {
16887
16887
  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);
16888
+ const thrown = new ProvisioningError(`Failed to create NatGateway ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
16889
16889
  if (createdId !== void 0) markCreatedBeforeFailure(thrown, logicalId, resourceType, createdId);
16890
16890
  throw thrown;
16891
16891
  }
@@ -16906,7 +16906,7 @@ var EC2Provider = class {
16906
16906
  return;
16907
16907
  }
16908
16908
  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);
16909
+ throw new ProvisioningError(`Failed to delete NatGateway ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
16910
16910
  }
16911
16911
  this.logger.debug(`Waiting for NatGateway ${physicalId} to reach deleted state...`);
16912
16912
  try {
@@ -16946,7 +16946,7 @@ var EC2Provider = class {
16946
16946
  };
16947
16947
  } catch (error) {
16948
16948
  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);
16949
+ throw new ProvisioningError(`Failed to create RouteTable ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
16950
16950
  }
16951
16951
  }
16952
16952
  updateRouteTable(logicalId, physicalId) {
@@ -16965,7 +16965,7 @@ var EC2Provider = class {
16965
16965
  return;
16966
16966
  }
16967
16967
  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);
16968
+ throw new ProvisioningError(`Failed to delete RouteTable ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
16969
16969
  }
16970
16970
  }
16971
16971
  async createRoute(logicalId, resourceType, properties, onMultipleDestinations, maskSecrets) {
@@ -17020,7 +17020,7 @@ var EC2Provider = class {
17020
17020
  };
17021
17021
  } catch (error) {
17022
17022
  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);
17023
+ throw new ProvisioningError(`Failed to create Route ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
17024
17024
  }
17025
17025
  }
17026
17026
  async updateRoute(logicalId, physicalId, resourceType, properties, previousProperties, context) {
@@ -17046,7 +17046,7 @@ var EC2Provider = class {
17046
17046
  } catch (error) {
17047
17047
  if (error instanceof CdkdError) throw error;
17048
17048
  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);
17049
+ throw new ProvisioningError(`Failed to update Route ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
17050
17050
  }
17051
17051
  }
17052
17052
  async deleteRoute(logicalId, physicalId, resourceType, context) {
@@ -17069,7 +17069,7 @@ var EC2Provider = class {
17069
17069
  return;
17070
17070
  }
17071
17071
  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);
17072
+ throw new ProvisioningError(`Failed to delete Route ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
17073
17073
  }
17074
17074
  }
17075
17075
  async createSubnetRouteTableAssociation(logicalId, resourceType, properties) {
@@ -17089,7 +17089,7 @@ var EC2Provider = class {
17089
17089
  };
17090
17090
  } catch (error) {
17091
17091
  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);
17092
+ throw new ProvisioningError(`Failed to create SubnetRouteTableAssociation ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
17093
17093
  }
17094
17094
  }
17095
17095
  updateSubnetRouteTableAssociation(logicalId, physicalId) {
@@ -17108,7 +17108,7 @@ var EC2Provider = class {
17108
17108
  return;
17109
17109
  }
17110
17110
  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);
17111
+ throw new ProvisioningError(`Failed to delete SubnetRouteTableAssociation ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
17112
17112
  }
17113
17113
  }
17114
17114
  async createSecurityGroup(logicalId, resourceType, properties) {
@@ -17159,7 +17159,7 @@ var EC2Provider = class {
17159
17159
  };
17160
17160
  } catch (error) {
17161
17161
  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);
17162
+ const thrown = new ProvisioningError(`Failed to create SecurityGroup ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
17163
17163
  if (leftBehindId !== void 0) markCreatedBeforeFailure(thrown, logicalId, resourceType, leftBehindId);
17164
17164
  throw thrown;
17165
17165
  }
@@ -17212,7 +17212,7 @@ var EC2Provider = class {
17212
17212
  };
17213
17213
  } catch (error) {
17214
17214
  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);
17215
+ throw new ProvisioningError(`Failed to update SecurityGroup ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
17216
17216
  }
17217
17217
  }
17218
17218
  async deleteSecurityGroup(logicalId, physicalId, resourceType, context) {
@@ -17367,7 +17367,7 @@ var EC2Provider = class {
17367
17367
  };
17368
17368
  }
17369
17369
  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);
17370
+ const failure = new ProvisioningError(`Failed to create SecurityGroupIngress ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
17371
17371
  const lookup = getPriorAttempts(logicalId);
17372
17372
  if (authorizeDefinitelyNotApplied(error) && !earlierSendAmbiguous && lookup?.possiblyLanded() !== true) markRefusedBeforeApplying(failure);
17373
17373
  else lookup?.notePossiblyLanded();
@@ -17561,7 +17561,7 @@ var EC2Provider = class {
17561
17561
  } catch (error) {
17562
17562
  if (error instanceof CdkdError) throw error;
17563
17563
  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);
17564
+ throw new ProvisioningError(`Failed to update SecurityGroupIngress ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
17565
17565
  }
17566
17566
  }
17567
17567
  withoutDescription(value) {
@@ -17637,7 +17637,7 @@ var EC2Provider = class {
17637
17637
  return notMatched();
17638
17638
  }
17639
17639
  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);
17640
+ throw new ProvisioningError(`Failed to delete SecurityGroupIngress ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
17641
17641
  }
17642
17642
  }
17643
17643
  async createInstance(logicalId, resourceType, properties, context) {
@@ -17722,7 +17722,7 @@ var EC2Provider = class {
17722
17722
  throw markAuxiliaryFailure(innerError, logicalId);
17723
17723
  }
17724
17724
  } 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);
17725
+ 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
17726
  if (leftBehindId !== void 0) markCreatedBeforeFailure(thrown, logicalId, resourceType, leftBehindId);
17727
17727
  throw thrown;
17728
17728
  }
@@ -17820,7 +17820,7 @@ var EC2Provider = class {
17820
17820
  };
17821
17821
  } catch (error) {
17822
17822
  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);
17823
+ throw new ProvisioningError(`Failed to update EC2 Instance ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
17824
17824
  }
17825
17825
  }
17826
17826
  async updateInstanceSecurityProps(physicalId, properties, previousProperties) {
@@ -18131,7 +18131,7 @@ var EC2Provider = class {
18131
18131
  };
18132
18132
  } catch (error) {
18133
18133
  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);
18134
+ throw new ProvisioningError(`Failed to create NetworkAcl ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
18135
18135
  }
18136
18136
  }
18137
18137
  async deleteNetworkAcl(logicalId, physicalId, resourceType, context) {
@@ -18147,7 +18147,7 @@ var EC2Provider = class {
18147
18147
  return;
18148
18148
  }
18149
18149
  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);
18150
+ throw new ProvisioningError(`Failed to delete NetworkAcl ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
18151
18151
  }
18152
18152
  }
18153
18153
  async createNetworkAclEntry(logicalId, resourceType, properties, context) {
@@ -18204,7 +18204,7 @@ var EC2Provider = class {
18204
18204
  };
18205
18205
  } catch (error) {
18206
18206
  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);
18207
+ throw new ProvisioningError(`Failed to create NetworkAclEntry ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
18208
18208
  }
18209
18209
  }
18210
18210
  async deleteNetworkAclEntry(logicalId, physicalId, resourceType, context) {
@@ -18235,7 +18235,7 @@ var EC2Provider = class {
18235
18235
  return;
18236
18236
  }
18237
18237
  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);
18238
+ throw new ProvisioningError(`Failed to delete NetworkAclEntry ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
18239
18239
  }
18240
18240
  }
18241
18241
  async createSubnetNetworkAclAssociation(logicalId, resourceType, properties) {
@@ -18269,7 +18269,7 @@ var EC2Provider = class {
18269
18269
  } catch (error) {
18270
18270
  if (error instanceof ProvisioningError) throw error;
18271
18271
  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);
18272
+ throw new ProvisioningError(`Failed to create SubnetNetworkAclAssociation ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
18273
18273
  }
18274
18274
  }
18275
18275
  async sendTaggedCreate(logicalId, tagResourceType, tags, send) {
@@ -19463,7 +19463,7 @@ var ApiGatewayProvider = class ApiGatewayProvider {
19463
19463
  this.logger.debug(`Successfully deleted API Gateway Account ${logicalId}`);
19464
19464
  } catch (error) {
19465
19465
  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);
19466
+ throw new ProvisioningError(`Failed to delete API Gateway Account ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
19467
19467
  }
19468
19468
  }
19469
19469
  async updateAccountWithRetry(cloudWatchRoleArn, logicalId, _resourceType, log) {
@@ -19641,7 +19641,7 @@ var ApiGatewayProvider = class ApiGatewayProvider {
19641
19641
  return;
19642
19642
  }
19643
19643
  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);
19644
+ throw new ProvisioningError(`Failed to delete API Gateway Authorizer ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
19645
19645
  }
19646
19646
  }
19647
19647
  getAuthorizerAttribute(physicalId, attributeName) {
@@ -19726,7 +19726,7 @@ var ApiGatewayProvider = class ApiGatewayProvider {
19726
19726
  return;
19727
19727
  }
19728
19728
  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);
19729
+ throw new ProvisioningError(`Failed to delete API Gateway Resource ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
19730
19730
  }
19731
19731
  }
19732
19732
  getResourceAttribute(physicalId, _resourceType, attributeName) {
@@ -19811,7 +19811,7 @@ var ApiGatewayProvider = class ApiGatewayProvider {
19811
19811
  return;
19812
19812
  }
19813
19813
  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);
19814
+ throw new ProvisioningError(`Failed to delete API Gateway Deployment ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
19815
19815
  }
19816
19816
  }
19817
19817
  getDeploymentAttribute(physicalId, attributeName) {
@@ -20055,7 +20055,7 @@ var ApiGatewayProvider = class ApiGatewayProvider {
20055
20055
  return;
20056
20056
  }
20057
20057
  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);
20058
+ throw new ProvisioningError(`Failed to delete API Gateway Stage ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
20059
20059
  }
20060
20060
  }
20061
20061
  getStageAttribute(physicalId, attributeName) {
@@ -20279,7 +20279,7 @@ var ApiGatewayProvider = class ApiGatewayProvider {
20279
20279
  return;
20280
20280
  }
20281
20281
  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);
20282
+ throw new ProvisioningError(`Failed to delete API Gateway Method ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
20283
20283
  }
20284
20284
  }
20285
20285
  getMethodAttribute(physicalId, attributeName) {
@@ -20873,7 +20873,7 @@ var ApiGatewayV2Provider = class {
20873
20873
  return;
20874
20874
  }
20875
20875
  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);
20876
+ throw new ProvisioningError(`Failed to delete API Gateway V2 Api ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
20877
20877
  }
20878
20878
  }
20879
20879
  async buildExecuteApiArn(apiId, log = createMaskedLogSinks(this.logger, void 0)) {
@@ -20944,7 +20944,7 @@ var ApiGatewayV2Provider = class {
20944
20944
  return;
20945
20945
  }
20946
20946
  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);
20947
+ throw new ProvisioningError(`Failed to delete API Gateway V2 Stage ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
20948
20948
  }
20949
20949
  }
20950
20950
  getStageAttribute(physicalId, attributeName) {
@@ -21041,7 +21041,7 @@ var ApiGatewayV2Provider = class {
21041
21041
  return;
21042
21042
  }
21043
21043
  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);
21044
+ throw new ProvisioningError(`Failed to delete API Gateway V2 Integration ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
21045
21045
  }
21046
21046
  }
21047
21047
  getIntegrationAttribute(physicalId, attributeName) {
@@ -21095,7 +21095,7 @@ var ApiGatewayV2Provider = class {
21095
21095
  return;
21096
21096
  }
21097
21097
  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);
21098
+ throw new ProvisioningError(`Failed to delete API Gateway V2 Route ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
21099
21099
  }
21100
21100
  }
21101
21101
  getRouteAttribute(physicalId, attributeName) {
@@ -21184,7 +21184,7 @@ var ApiGatewayV2Provider = class {
21184
21184
  return;
21185
21185
  }
21186
21186
  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);
21187
+ throw new ProvisioningError(`Failed to delete API Gateway V2 Authorizer ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
21188
21188
  }
21189
21189
  }
21190
21190
  getDriftUnknownPaths(resourceType, properties) {
@@ -22006,7 +22006,7 @@ var CloudFrontOAIProvider = class {
22006
22006
  };
22007
22007
  } catch (error) {
22008
22008
  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);
22009
+ throw new ProvisioningError(`Failed to create CloudFront OAI ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
22010
22010
  }
22011
22011
  }
22012
22012
  async update(logicalId, physicalId, resourceType, properties, _previousProperties, context) {
@@ -22040,7 +22040,7 @@ var CloudFrontOAIProvider = class {
22040
22040
  } catch (error) {
22041
22041
  if (error instanceof CdkdError) throw error;
22042
22042
  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);
22043
+ throw new ProvisioningError(`Failed to update CloudFront OAI ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
22044
22044
  }
22045
22045
  }
22046
22046
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -22071,7 +22071,7 @@ var CloudFrontOAIProvider = class {
22071
22071
  return;
22072
22072
  }
22073
22073
  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);
22074
+ throw new ProvisioningError(`Failed to delete CloudFront OAI ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
22075
22075
  }
22076
22076
  }
22077
22077
  async getAttribute(physicalId, _resourceType, attributeName) {
@@ -22151,7 +22151,7 @@ var CloudFrontOACProvider = class {
22151
22151
  } catch (error) {
22152
22152
  if (error instanceof CdkdError) throw error;
22153
22153
  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);
22154
+ throw new ProvisioningError(`Failed to create CloudFront Origin Access Control ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
22155
22155
  }
22156
22156
  }
22157
22157
  async update(logicalId, physicalId, resourceType, properties, _previousProperties, context) {
@@ -22174,7 +22174,7 @@ var CloudFrontOACProvider = class {
22174
22174
  } catch (error) {
22175
22175
  if (error instanceof CdkdError) throw error;
22176
22176
  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);
22177
+ throw new ProvisioningError(`Failed to update CloudFront Origin Access Control ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
22178
22178
  }
22179
22179
  }
22180
22180
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -22205,7 +22205,7 @@ var CloudFrontOACProvider = class {
22205
22205
  }
22206
22206
  if (error instanceof CdkdError) throw error;
22207
22207
  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);
22208
+ throw new ProvisioningError(`Failed to delete CloudFront Origin Access Control ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
22209
22209
  }
22210
22210
  }
22211
22211
  async getAttribute(physicalId, _resourceType, attributeName) {
@@ -22381,7 +22381,7 @@ var CloudFrontDistributionProvider = class {
22381
22381
  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
22382
  }
22383
22383
  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);
22384
+ throw new ProvisioningError(`Failed to create CloudFront Distribution ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
22385
22385
  }
22386
22386
  }
22387
22387
  orphanSearchHint(properties, maskSecrets) {
@@ -22428,7 +22428,7 @@ var CloudFrontDistributionProvider = class {
22428
22428
  } catch (error) {
22429
22429
  if (error instanceof CdkdError) throw error;
22430
22430
  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);
22431
+ throw new ProvisioningError(`Failed to update CloudFront Distribution ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
22432
22432
  }
22433
22433
  }
22434
22434
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -22479,7 +22479,7 @@ var CloudFrontDistributionProvider = class {
22479
22479
  return;
22480
22480
  }
22481
22481
  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);
22482
+ const failure = new ProvisioningError(`Failed to delete CloudFront Distribution ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
22483
22483
  throw stripped ? markDeleteStarted(failure) : failure;
22484
22484
  }
22485
22485
  }
@@ -22897,7 +22897,7 @@ var CloudFrontDistributionProvider = class {
22897
22897
  }
22898
22898
  } catch (err) {
22899
22899
  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);
22900
+ 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
22901
  }
22902
22902
  }
22903
22903
  async import(input) {
@@ -22998,7 +22998,7 @@ var AgentCoreRuntimeProvider = class {
22998
22998
  };
22999
22999
  } catch (error) {
23000
23000
  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);
23001
+ throw new ProvisioningError(`Failed to create BedrockAgentCore Runtime ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
23002
23002
  }
23003
23003
  }
23004
23004
  async update(logicalId, physicalId, resourceType, properties, _previousProperties, context) {
@@ -23033,7 +23033,7 @@ var AgentCoreRuntimeProvider = class {
23033
23033
  };
23034
23034
  } catch (error) {
23035
23035
  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);
23036
+ throw new ProvisioningError(`Failed to update BedrockAgentCore Runtime ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
23037
23037
  }
23038
23038
  }
23039
23039
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -23049,7 +23049,7 @@ var AgentCoreRuntimeProvider = class {
23049
23049
  return;
23050
23050
  }
23051
23051
  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);
23052
+ throw new ProvisioningError(`Failed to delete BedrockAgentCore Runtime ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
23053
23053
  }
23054
23054
  }
23055
23055
  buildAttributes(response, agentRuntimeName) {
@@ -23151,7 +23151,7 @@ var AgentCoreBrowserProvider = class {
23151
23151
  };
23152
23152
  } catch (error) {
23153
23153
  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);
23154
+ 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
23155
  }
23156
23156
  }
23157
23157
  async update(logicalId, physicalId, _resourceType, _properties, _previousProperties, _context) {
@@ -23218,7 +23218,7 @@ var AgentCoreCodeInterpreterProvider = class {
23218
23218
  };
23219
23219
  } catch (error) {
23220
23220
  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);
23221
+ 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
23222
  }
23223
23223
  }
23224
23224
  async update(logicalId, physicalId, _resourceType, _properties, _previousProperties, _context) {
@@ -23314,7 +23314,7 @@ var AgentCoreEvaluatorProvider = class {
23314
23314
  };
23315
23315
  } catch (error) {
23316
23316
  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);
23317
+ throw new ProvisioningError(`Failed to create BedrockAgentCore Evaluator ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
23318
23318
  }
23319
23319
  }
23320
23320
  async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
@@ -23343,7 +23343,7 @@ var AgentCoreEvaluatorProvider = class {
23343
23343
  };
23344
23344
  } catch (error) {
23345
23345
  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);
23346
+ throw new ProvisioningError(`Failed to update BedrockAgentCore Evaluator ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
23347
23347
  }
23348
23348
  }
23349
23349
  async syncTags(evaluatorArn, resourceType, logicalId, previousTagsRaw, nextTagsRaw) {
@@ -23374,7 +23374,7 @@ var AgentCoreEvaluatorProvider = class {
23374
23374
  return;
23375
23375
  }
23376
23376
  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);
23377
+ throw new ProvisioningError(`Failed to delete BedrockAgentCore Evaluator ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
23378
23378
  }
23379
23379
  }
23380
23380
  async getAttribute(physicalId, _resourceType, attributeName) {
@@ -23516,7 +23516,7 @@ var StepFunctionsProvider = class {
23516
23516
  } catch (error) {
23517
23517
  if (error instanceof ProvisioningError) throw error;
23518
23518
  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);
23519
+ throw new ProvisioningError(`Failed to create Step Functions state machine ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, stateMachineName, cause);
23520
23520
  }
23521
23521
  }
23522
23522
  async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
@@ -23550,7 +23550,7 @@ var StepFunctionsProvider = class {
23550
23550
  };
23551
23551
  } catch (error) {
23552
23552
  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);
23553
+ throw new ProvisioningError(`Failed to update Step Functions state machine ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
23554
23554
  }
23555
23555
  }
23556
23556
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -23566,7 +23566,7 @@ var StepFunctionsProvider = class {
23566
23566
  return;
23567
23567
  }
23568
23568
  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);
23569
+ throw new ProvisioningError(`Failed to delete Step Functions state machine ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
23570
23570
  }
23571
23571
  }
23572
23572
  async readCurrentState(physicalId, _logicalId, _resourceType) {
@@ -23840,15 +23840,7 @@ var ECSProvider = class {
23840
23840
  taskDefinitionCreateClient;
23841
23841
  providerRegion = ambientRegion();
23842
23842
  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
- ])]]);
23843
+ removalDefaults = /* @__PURE__ */ new Map();
23852
23844
  handledProperties = /* @__PURE__ */ new Map([
23853
23845
  ["AWS::ECS::Cluster", /* @__PURE__ */ new Set([
23854
23846
  "ClusterName",
@@ -24112,7 +24104,7 @@ var ECSProvider = class {
24112
24104
  return;
24113
24105
  }
24114
24106
  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);
24107
+ throw new ProvisioningError(`Failed to delete ECS cluster ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
24116
24108
  }
24117
24109
  }
24118
24110
  async getClusterAttribute(physicalId, attributeName) {
@@ -24188,7 +24180,7 @@ var ECSProvider = class {
24188
24180
  return;
24189
24181
  }
24190
24182
  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);
24183
+ throw new ProvisioningError(`Failed to delete ECS task definition ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
24192
24184
  }
24193
24185
  }
24194
24186
  async getTaskDefinitionAttribute(physicalId, attributeName) {
@@ -24257,7 +24249,7 @@ var ECSProvider = class {
24257
24249
  survivorArn = service.serviceArn;
24258
24250
  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
24251
  }
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 });
24252
+ 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
24253
  }
24262
24254
  return {
24263
24255
  physicalId: service.serviceArn,
@@ -24348,7 +24340,7 @@ var ECSProvider = class {
24348
24340
  const serviceRegistriesInput = isEcsController && serviceRegistriesChanged ? this.convertServiceRegistries(properties["ServiceRegistries"]) ?? [] : void 0;
24349
24341
  const capacityProviderStrategyInput = this.convertCapacityProviderStrategy(properties["CapacityProviderStrategy"]);
24350
24342
  const placementConstraintsInput = this.convertPlacementConstraints(properties["PlacementConstraints"]);
24351
- const placementStrategyInput = clearOnUpdateRemoval(this.convertPlacementStrategies(properties["PlacementStrategies"] ?? properties["PlacementStrategy"]), previousProperties["PlacementStrategies"] ?? previousProperties["PlacementStrategy"], []);
24343
+ const placementStrategyInput = this.convertPlacementStrategies(properties["PlacementStrategies"] ?? properties["PlacementStrategy"]);
24352
24344
  const platformVersionInput = properties["PlatformVersion"];
24353
24345
  const healthCheckGracePeriodSecondsInput = properties["HealthCheckGracePeriodSeconds"];
24354
24346
  const enableECSManagedTagsInput = properties["EnableECSManagedTags"];
@@ -24449,7 +24441,7 @@ var ECSProvider = class {
24449
24441
  return;
24450
24442
  }
24451
24443
  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);
24444
+ const failure = new ProvisioningError(`Failed to delete ECS service ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
24453
24445
  throw stripped ? markDeleteStarted(failure) : failure;
24454
24446
  }
24455
24447
  }
@@ -25467,6 +25459,7 @@ var ELBv2Provider = class {
25467
25459
  "Tags",
25468
25460
  ...LISTENER_LEFT_IN_PLACE_ON_REMOVAL
25469
25461
  ])]]);
25462
+ lambdaClients = /* @__PURE__ */ new Map();
25470
25463
  getClient() {
25471
25464
  if (!this.elbv2Client) this.elbv2Client = new ElasticLoadBalancingV2Client({
25472
25465
  ...ambientClientDefaults(),
@@ -25474,6 +25467,41 @@ var ELBv2Provider = class {
25474
25467
  });
25475
25468
  return this.elbv2Client;
25476
25469
  }
25470
+ async waitForLambdaTargetsActive(logicalId, targetType, targets) {
25471
+ if (targetType !== "lambda") return;
25472
+ for (const target of targets) {
25473
+ const parts = typeof target.Id === "string" ? target.Id.split(":") : [];
25474
+ if (parts[0] !== "arn" || parts[2] !== "lambda" || !parts[3]) {
25475
+ this.logger.debug(`Skipping the Active wait for target ${String(target.Id)} of ${logicalId}: not a Lambda function ARN`);
25476
+ continue;
25477
+ }
25478
+ const region = parts[3];
25479
+ let client = this.lambdaClients.get(region);
25480
+ if (!client) {
25481
+ client = new LambdaClient({
25482
+ ...ambientClientDefaults(),
25483
+ region
25484
+ });
25485
+ this.lambdaClients.set(region, client);
25486
+ }
25487
+ const watch = startInterruptWatch(`ELBv2 TargetGroup ${logicalId} Lambda target wait`);
25488
+ const abort = new AbortController();
25489
+ const poll = setInterval(() => {
25490
+ if (watch.isInterrupted()) abort.abort();
25491
+ }, 1e3);
25492
+ try {
25493
+ if (watch.isInterrupted()) throw watch.onInterrupted();
25494
+ await waitForLambdaFunctionActive(client, target.Id, abort.signal);
25495
+ } catch (error) {
25496
+ if (watch.isInterrupted()) throw watch.onInterrupted();
25497
+ throw error;
25498
+ } finally {
25499
+ clearInterval(poll);
25500
+ watch.dispose();
25501
+ }
25502
+ this.logger.debug(`Lambda target ${target.Id} of ${logicalId} is Active`);
25503
+ }
25504
+ }
25477
25505
  maskedRetryLogger(maskSecrets) {
25478
25506
  return createMaskedRetryLogger(this.logger, maskSecrets);
25479
25507
  }
@@ -25845,7 +25873,7 @@ var ELBv2Provider = class {
25845
25873
  return;
25846
25874
  }
25847
25875
  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);
25876
+ throw new ProvisioningError(`Failed to delete LoadBalancer ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
25849
25877
  }
25850
25878
  }
25851
25879
  async createTargetGroup(logicalId, resourceType, properties, maskSecrets) {
@@ -25892,6 +25920,7 @@ var ELBv2Provider = class {
25892
25920
  this.logger.debug(`Applied ${tgAttributes.length} TargetGroup attribute(s) for ${logicalId}`);
25893
25921
  }
25894
25922
  if (targets.length > 0) {
25923
+ await this.waitForLambdaTargetsActive(logicalId, properties["TargetType"], targets);
25895
25924
  await this.getClient().send(new RegisterTargetsCommand({
25896
25925
  TargetGroupArn: tgArn,
25897
25926
  Targets: targets
@@ -25900,12 +25929,15 @@ var ELBv2Provider = class {
25900
25929
  }
25901
25930
  } catch (innerError) {
25902
25931
  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()}`);
25932
+ else {
25933
+ 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()}`));
25934
+ try {
25935
+ await this.getClient().send(new DeleteTargetGroupCommand({ TargetGroupArn: tgArn }));
25936
+ this.logger.debug(`Cleaned up partially-created TargetGroup ${logicalId} (${tgArn}) after wiring failure`);
25937
+ } catch (cleanupError) {
25938
+ leftBehindArn = tgArn;
25939
+ 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()}`);
25940
+ }
25909
25941
  }
25910
25942
  throw markAuxiliaryFailure(innerError, logicalId);
25911
25943
  }
@@ -25973,6 +26005,7 @@ var ELBv2Provider = class {
25973
26005
  const targetsToRegister = newTargets.filter((t) => !oldTargetKeys.has(targetKey(t)));
25974
26006
  const targetsToDeregister = oldTargets.filter((t) => !newTargetKeys.has(targetKey(t)));
25975
26007
  if (targetsToRegister.length > 0) {
26008
+ await this.waitForLambdaTargetsActive(logicalId, properties["TargetType"], targetsToRegister);
25976
26009
  await this.getClient().send(new RegisterTargetsCommand({
25977
26010
  TargetGroupArn: physicalId,
25978
26011
  Targets: targetsToRegister
@@ -26012,7 +26045,7 @@ var ELBv2Provider = class {
26012
26045
  return;
26013
26046
  }
26014
26047
  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);
26048
+ throw new ProvisioningError(`Failed to delete TargetGroup ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
26016
26049
  }
26017
26050
  }
26018
26051
  async listenerPortHeld(loadBalancerArn, port) {
@@ -26164,7 +26197,7 @@ var ELBv2Provider = class {
26164
26197
  return;
26165
26198
  }
26166
26199
  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);
26200
+ throw new ProvisioningError(`Failed to delete Listener ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
26168
26201
  }
26169
26202
  }
26170
26203
  normalizeAttributes(raw) {
@@ -27889,7 +27922,7 @@ var DocDBProvider = class {
27889
27922
  attributes: clusterAttributes(await this.describeDBCluster(dbClusterIdentifier))
27890
27923
  };
27891
27924
  } 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);
27925
+ 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
27926
  if (clusterCreated) markCreatedBeforeFailure(thrown, logicalId, resourceType, dbClusterIdentifier, createdResourceId);
27894
27927
  throw thrown;
27895
27928
  }
@@ -27923,7 +27956,7 @@ var DocDBProvider = class {
27923
27956
  };
27924
27957
  } catch (error) {
27925
27958
  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);
27959
+ throw new ProvisioningError(`Failed to update DocDB DBCluster ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
27927
27960
  }
27928
27961
  }
27929
27962
  async deleteDBCluster(logicalId, physicalId, resourceType, context) {
@@ -27997,7 +28030,7 @@ var DocDBProvider = class {
27997
28030
  return;
27998
28031
  }
27999
28032
  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);
28033
+ throw new ProvisioningError(`Failed to delete DocDB DBCluster ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
28001
28034
  }
28002
28035
  }
28003
28036
  async createDBInstance(logicalId, resourceType, properties) {
@@ -28030,7 +28063,7 @@ var DocDBProvider = class {
28030
28063
  attributes: instanceAttributes(await this.describeDBInstance(dbInstanceIdentifier))
28031
28064
  };
28032
28065
  } 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);
28066
+ 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
28067
  if (instanceCreated) markCreatedBeforeFailure(thrown, logicalId, resourceType, dbInstanceIdentifier, createdResourceId);
28035
28068
  throw thrown;
28036
28069
  }
@@ -28056,7 +28089,7 @@ var DocDBProvider = class {
28056
28089
  };
28057
28090
  } catch (error) {
28058
28091
  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);
28092
+ throw new ProvisioningError(`Failed to update DocDB DBInstance ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
28060
28093
  }
28061
28094
  }
28062
28095
  async deleteDBInstance(logicalId, physicalId, resourceType, context) {
@@ -28074,7 +28107,7 @@ var DocDBProvider = class {
28074
28107
  return;
28075
28108
  }
28076
28109
  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);
28110
+ throw new ProvisioningError(`Failed to delete DocDB DBInstance ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
28078
28111
  }
28079
28112
  }
28080
28113
  async describeDBCluster(dbClusterIdentifier) {
@@ -28340,7 +28373,7 @@ var DocDBSubnetGroupProvider = class {
28340
28373
  };
28341
28374
  } catch (error) {
28342
28375
  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);
28376
+ throw new ProvisioningError(`Failed to create DocDB DBSubnetGroup ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, dbSubnetGroupName, cause);
28344
28377
  }
28345
28378
  }
28346
28379
  async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
@@ -28367,7 +28400,7 @@ var DocDBSubnetGroupProvider = class {
28367
28400
  };
28368
28401
  } catch (error) {
28369
28402
  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);
28403
+ throw new ProvisioningError(`Failed to update DocDB DBSubnetGroup ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
28371
28404
  }
28372
28405
  }
28373
28406
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -28384,7 +28417,7 @@ var DocDBSubnetGroupProvider = class {
28384
28417
  return;
28385
28418
  }
28386
28419
  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);
28420
+ throw new ProvisioningError(`Failed to delete DocDB DBSubnetGroup ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
28388
28421
  }
28389
28422
  }
28390
28423
  async import(input) {
@@ -28624,7 +28657,7 @@ var Route53Provider = class {
28624
28657
  this.logger.warn(`Best-effort rollback DeleteHostedZone for ${zoneId} also failed: ${describeAwsFailure(deleteError).detail} — operator may need to clean up the orphan zone`);
28625
28658
  }
28626
28659
  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);
28660
+ throw new ProvisioningError(`Failed to enable Accelerated Recovery on hosted zone ${logicalId} (${zoneId}): ${describeAwsFailure(uhfError).detail}`, resourceType, logicalId, zoneId, cause);
28628
28661
  }
28629
28662
  const nameServers = response.DelegationSet?.NameServers ?? [];
28630
28663
  this.logger.debug(`Successfully created hosted zone ${logicalId}: ${zoneId}`);
@@ -28638,7 +28671,7 @@ var Route53Provider = class {
28638
28671
  };
28639
28672
  } catch (error) {
28640
28673
  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);
28674
+ 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
28675
  if (createdZoneId !== void 0 && !zoneRolledBack) markCreatedBeforeFailure(thrown, logicalId, resourceType, createdZoneId);
28643
28676
  throw thrown;
28644
28677
  }
@@ -28652,7 +28685,7 @@ var Route53Provider = class {
28652
28685
  try {
28653
28686
  adopted = await this.findHostedZoneByCallerReference(input.Name, input.CallerReference);
28654
28687
  } 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.`);
28688
+ 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
28689
  throw error;
28657
28690
  }
28658
28691
  if (!adopted?.Id) throw error;
@@ -28664,7 +28697,7 @@ var Route53Provider = class {
28664
28697
  ...described.DelegationSet ? { DelegationSet: described.DelegationSet } : {}
28665
28698
  };
28666
28699
  } 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.`);
28700
+ 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
28701
  throw error;
28669
28702
  }
28670
28703
  }
@@ -28718,7 +28751,7 @@ var Route53Provider = class {
28718
28751
  } catch (error) {
28719
28752
  if (error instanceof CdkdError) throw error;
28720
28753
  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);
28754
+ throw new ProvisioningError(`Failed to update hosted zone ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
28722
28755
  }
28723
28756
  }
28724
28757
  async deleteHostedZone(logicalId, physicalId, resourceType, context) {
@@ -28737,7 +28770,7 @@ var Route53Provider = class {
28737
28770
  return;
28738
28771
  }
28739
28772
  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);
28773
+ const failure = error instanceof ProvisioningError ? error : new ProvisioningError(`Failed to delete hosted zone ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
28741
28774
  throw progress.stripped ? markDeleteStarted(failure) : failure;
28742
28775
  }
28743
28776
  }
@@ -28824,7 +28857,7 @@ var Route53Provider = class {
28824
28857
  if (error instanceof ProvisioningError) throw error;
28825
28858
  const cause = error instanceof Error ? error : void 0;
28826
28859
  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);
28860
+ const wrapped = new ProvisioningError(`Failed to create record set ${logicalId}: ${describeAwsFailure(error).detail}` + (cnameConflict ? CNAME_CONFLICT_COLLISION_NOTE : ""), resourceType, logicalId, void 0, cause);
28828
28861
  throw cnameConflict ? markNameCollision(wrapped) : wrapped;
28829
28862
  }
28830
28863
  }
@@ -28865,7 +28898,7 @@ var Route53Provider = class {
28865
28898
  };
28866
28899
  } catch (error) {
28867
28900
  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);
28901
+ throw new ProvisioningError(`Failed to update record set ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
28869
28902
  }
28870
28903
  }
28871
28904
  async findLiveRecordSet(hostedZoneId, properties) {
@@ -28955,7 +28988,7 @@ var Route53Provider = class {
28955
28988
  }
28956
28989
  if (error instanceof ProvisioningError) throw error;
28957
28990
  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);
28991
+ throw new ProvisioningError(`Failed to delete record set ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
28959
28992
  }
28960
28993
  }
28961
28994
  async waitForAcceleratedRecoveryMutable(zoneId, logicalId, resourceType) {
@@ -29752,7 +29785,7 @@ var WAFv2WebACLProvider = class {
29752
29785
  } catch (error) {
29753
29786
  if (error instanceof ProvisioningError) throw error;
29754
29787
  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);
29788
+ throw new ProvisioningError(`Failed to create WAFv2 WebACL ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
29756
29789
  }
29757
29790
  }
29758
29791
  async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
@@ -29798,7 +29831,7 @@ var WAFv2WebACLProvider = class {
29798
29831
  } catch (error) {
29799
29832
  if (error instanceof ProvisioningError) throw error;
29800
29833
  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);
29834
+ throw new ProvisioningError(`Failed to update WAFv2 WebACL ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
29802
29835
  }
29803
29836
  }
29804
29837
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -29827,7 +29860,7 @@ var WAFv2WebACLProvider = class {
29827
29860
  return;
29828
29861
  }
29829
29862
  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);
29863
+ throw new ProvisioningError(`Failed to delete WAFv2 WebACL ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
29831
29864
  }
29832
29865
  }
29833
29866
  warnOnSdkUnsupportedRuleKeys(logicalId, rules) {
@@ -30252,7 +30285,7 @@ var CognitoUserPoolProvider = class {
30252
30285
  mfaConfiguration = readDeclaredMfaConfiguration(properties["MfaConfiguration"], replayWarn(this.logger, context));
30253
30286
  this.warnOnBlankMfaConfiguration(properties["MfaConfiguration"]);
30254
30287
  } catch (error) {
30255
- throw new ProvisioningError(error instanceof Error ? error.message : String(error), resourceType, logicalId, poolName, error instanceof Error ? error : void 0);
30288
+ throw new ProvisioningError(describeAwsFailure(error).detail, resourceType, logicalId, poolName, error instanceof Error ? error : void 0);
30256
30289
  }
30257
30290
  this.assertMfaCombinationApplicable(logicalId, resourceType, poolName, properties, mfaConfiguration);
30258
30291
  let createdUserPoolId;
@@ -30332,7 +30365,7 @@ var CognitoUserPoolProvider = class {
30332
30365
  }
30333
30366
  }
30334
30367
  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);
30368
+ const thrown = new ProvisioningError(`Failed to create Cognito User Pool ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, poolName, cause);
30336
30369
  if (poolLeftBehind && createdUserPoolId) {
30337
30370
  markCreatedBeforeFailure(thrown, logicalId, resourceType, createdUserPoolId);
30338
30371
  markNonRetryable(thrown);
@@ -30484,7 +30517,7 @@ var CognitoUserPoolProvider = class {
30484
30517
  try {
30485
30518
  mfaConfiguration = readDeclaredMfaConfiguration(properties["MfaConfiguration"], stateBorneDesired ? { onUnusable: (message) => this.logger.warn(message) } : {});
30486
30519
  } 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);
30520
+ throw new ProvisioningError(`${describeAwsFailure(error).detail}. Nothing was applied to user pool ${physicalId}`, resourceType, logicalId, physicalId, error instanceof Error ? error : void 0);
30488
30521
  }
30489
30522
  this.warnOnBlankMfaConfiguration(properties["MfaConfiguration"]);
30490
30523
  const liveFirstAuthFactors = mfaPreflightNeedsLiveSignInPolicy(properties, mfaConfiguration) ? await this.readLiveAllowedFirstAuthFactors(physicalId) : void 0;
@@ -30554,7 +30587,7 @@ var CognitoUserPoolProvider = class {
30554
30587
  } catch (error) {
30555
30588
  if (error instanceof ResourceUpdateNotSupportedError || error instanceof ProvisioningError) throw error;
30556
30589
  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);
30590
+ throw new ProvisioningError(`Failed to update Cognito User Pool ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
30558
30591
  }
30559
30592
  }
30560
30593
  async reconcileSchemaCustomAttributes(logicalId, physicalId, resourceType, newSchema, oldSchema, deletionProtected = false) {
@@ -30740,7 +30773,7 @@ var CognitoUserPoolProvider = class {
30740
30773
  return;
30741
30774
  }
30742
30775
  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);
30776
+ throw new ProvisioningError(`Failed to delete Cognito User Pool ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
30744
30777
  }
30745
30778
  }
30746
30779
  async sendEchoedDeletionProtection(physicalId, pool, value, opts = {}) {
@@ -31029,7 +31062,7 @@ var ElastiCacheProvider = class {
31029
31062
  };
31030
31063
  } catch (error) {
31031
31064
  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);
31065
+ throw new ProvisioningError(`Failed to create CacheSubnetGroup ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, cacheSubnetGroupName, cause);
31033
31066
  }
31034
31067
  }
31035
31068
  async updateSubnetGroup(logicalId, physicalId, resourceType, properties, previousProperties) {
@@ -31056,7 +31089,7 @@ var ElastiCacheProvider = class {
31056
31089
  } catch (error) {
31057
31090
  if (error instanceof ProvisioningError) throw error;
31058
31091
  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);
31092
+ throw new ProvisioningError(`Failed to update CacheSubnetGroup ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
31060
31093
  }
31061
31094
  }
31062
31095
  async deleteSubnetGroup(logicalId, physicalId, resourceType, context) {
@@ -31072,7 +31105,7 @@ var ElastiCacheProvider = class {
31072
31105
  return;
31073
31106
  }
31074
31107
  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);
31108
+ throw new ProvisioningError(`Failed to delete CacheSubnetGroup ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
31076
31109
  }
31077
31110
  }
31078
31111
  async createCacheCluster(logicalId, resourceType, properties) {
@@ -31129,7 +31162,7 @@ var ElastiCacheProvider = class {
31129
31162
  attributes
31130
31163
  };
31131
31164
  } 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);
31165
+ 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
31166
  if (clusterCreated) markCreatedBeforeFailure(thrown, logicalId, resourceType, cacheClusterId);
31134
31167
  throw thrown;
31135
31168
  }
@@ -31182,7 +31215,7 @@ var ElastiCacheProvider = class {
31182
31215
  } catch (error) {
31183
31216
  if (error instanceof ProvisioningError) throw error;
31184
31217
  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);
31218
+ throw new ProvisioningError(`Failed to update CacheCluster ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
31186
31219
  }
31187
31220
  }
31188
31221
  async deleteCacheCluster(logicalId, physicalId, resourceType, context) {
@@ -31209,7 +31242,7 @@ var ElastiCacheProvider = class {
31209
31242
  return;
31210
31243
  }
31211
31244
  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);
31245
+ throw new ProvisioningError(`Failed to delete CacheCluster ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
31213
31246
  }
31214
31247
  }
31215
31248
  buildLogDeliveryConfigurationsForUpdate(newConfigs, previousConfigs) {
@@ -31631,7 +31664,7 @@ var ServiceDiscoveryProvider = class ServiceDiscoveryProvider {
31631
31664
  }
31632
31665
  if (error instanceof ProvisioningError) throw error;
31633
31666
  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);
31667
+ throw new ProvisioningError(`Failed to delete Cloud Map namespace ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
31635
31668
  }
31636
31669
  }
31637
31670
  async createHttpNamespace(logicalId, resourceType, properties, maskSecrets) {
@@ -31944,7 +31977,7 @@ var ServiceDiscoveryProvider = class ServiceDiscoveryProvider {
31944
31977
  return;
31945
31978
  }
31946
31979
  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);
31980
+ throw new ProvisioningError(`Failed to delete service discovery service ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
31948
31981
  }
31949
31982
  }
31950
31983
  extractSoaTtlProperties(properties) {
@@ -33026,7 +33059,7 @@ var AppSyncProvider = class {
33026
33059
  body = await resp.Body.transformToString();
33027
33060
  } catch (error) {
33028
33061
  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);
33062
+ 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
33063
  }
33031
33064
  if (body.length === 0) throw new ProvisioningError(`${propertyPath} object s3://${bucket}/${key} returned an empty body`, resourceType, logicalId);
33032
33065
  return body;
@@ -33201,7 +33234,7 @@ var AppSyncProvider = class {
33201
33234
  }
33202
33235
  }
33203
33236
  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);
33237
+ const thrown = new ProvisioningError(`Failed to create GraphQL API ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
33205
33238
  if (apiLeftBehind && createdApiId) {
33206
33239
  markCreatedBeforeFailure(thrown, logicalId, resourceType, createdApiId);
33207
33240
  markNonRetryable(thrown);
@@ -33270,7 +33303,7 @@ var AppSyncProvider = class {
33270
33303
  return;
33271
33304
  }
33272
33305
  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);
33306
+ throw new ProvisioningError(`Failed to delete GraphQL API ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
33274
33307
  }
33275
33308
  }
33276
33309
  async createGraphQLSchema(logicalId, resourceType, properties) {
@@ -33300,7 +33333,7 @@ var AppSyncProvider = class {
33300
33333
  };
33301
33334
  } catch (error) {
33302
33335
  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);
33336
+ throw new ProvisioningError(`Failed to create GraphQL Schema ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
33304
33337
  }
33305
33338
  }
33306
33339
  async createDataSource(logicalId, resourceType, properties, context) {
@@ -33331,7 +33364,7 @@ var AppSyncProvider = class {
33331
33364
  this.logger.debug(`Successfully created DataSource ${logicalId}: ${physicalId}`);
33332
33365
  } catch (error) {
33333
33366
  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);
33367
+ throw new ProvisioningError(`Failed to create DataSource ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
33335
33368
  }
33336
33369
  const dataSourceArn = reportedArn ?? await this.buildAppSyncArnOrWarn(`apis/${apiId}/datasources/${name}`, logicalId, physicalId);
33337
33370
  return {
@@ -33363,7 +33396,7 @@ var AppSyncProvider = class {
33363
33396
  return;
33364
33397
  }
33365
33398
  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);
33399
+ throw new ProvisioningError(`Failed to delete DataSource ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
33367
33400
  }
33368
33401
  }
33369
33402
  async createResolver(logicalId, resourceType, properties, context) {
@@ -33401,7 +33434,7 @@ var AppSyncProvider = class {
33401
33434
  this.logger.debug(`Successfully created Resolver ${logicalId}: ${physicalId}`);
33402
33435
  } catch (error) {
33403
33436
  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);
33437
+ throw new ProvisioningError(`Failed to create Resolver ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
33405
33438
  }
33406
33439
  const resolverArn = reportedArn ?? await this.buildAppSyncArnOrWarn(`apis/${apiId}/types/${typeName}/resolvers/${fieldName}`, logicalId, physicalId);
33407
33440
  return {
@@ -33432,7 +33465,7 @@ var AppSyncProvider = class {
33432
33465
  return;
33433
33466
  }
33434
33467
  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);
33468
+ throw new ProvisioningError(`Failed to delete Resolver ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
33436
33469
  }
33437
33470
  }
33438
33471
  async createApiKey(logicalId, resourceType, properties, context) {
@@ -33461,7 +33494,7 @@ var AppSyncProvider = class {
33461
33494
  this.logger.debug(`Successfully created ApiKey ${logicalId}: ${apiKeyId}`);
33462
33495
  } catch (error) {
33463
33496
  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);
33497
+ throw new ProvisioningError(`Failed to create ApiKey ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
33465
33498
  }
33466
33499
  const physicalId = packCompositeId(resourceType, logicalId, [{
33467
33500
  name: "apiId",
@@ -33528,7 +33561,7 @@ var AppSyncProvider = class {
33528
33561
  return;
33529
33562
  }
33530
33563
  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);
33564
+ throw new ProvisioningError(`Failed to delete ApiKey ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
33532
33565
  }
33533
33566
  }
33534
33567
  isNotFoundError(error) {
@@ -34189,7 +34222,7 @@ var GlueProvider = class {
34189
34222
  previousDatabaseInput
34190
34223
  });
34191
34224
  } 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);
34225
+ 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
34226
  }
34194
34227
  const liveParameters = await this.readLiveDatabaseParameters(logicalId, resourceType, physicalId, catalogId, log.mask);
34195
34228
  try {
@@ -34230,7 +34263,7 @@ var GlueProvider = class {
34230
34263
  return;
34231
34264
  }
34232
34265
  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);
34266
+ throw new ProvisioningError(log.mask(`Failed to delete Glue Database ${logicalId}: ${describeAwsFailure(error).detail}`), resourceType, logicalId, physicalId, cause);
34234
34267
  }
34235
34268
  }
34236
34269
  async createTable(logicalId, resourceType, properties, context) {
@@ -34373,7 +34406,7 @@ var GlueProvider = class {
34373
34406
  return;
34374
34407
  }
34375
34408
  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);
34409
+ throw new ProvisioningError(log.mask(`Failed to delete Glue Table ${logicalId}: ${describeAwsFailure(error).detail}`), resourceType, logicalId, physicalId, cause);
34377
34410
  }
34378
34411
  }
34379
34412
  preserveAwsManagedParameters(built, desiredParameters, previousParameters, liveParameters) {
@@ -34832,7 +34865,7 @@ var GlueWorkflowProvider = class {
34832
34865
  return;
34833
34866
  }
34834
34867
  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);
34868
+ throw new ProvisioningError(`Failed to delete Glue Workflow ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
34836
34869
  }
34837
34870
  }
34838
34871
  async getAttribute(physicalId, _resourceType, attributeName) {
@@ -34960,7 +34993,7 @@ var GlueSecurityConfigurationProvider = class {
34960
34993
  return;
34961
34994
  }
34962
34995
  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);
34996
+ throw new ProvisioningError(`Failed to delete Glue SecurityConfiguration ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
34964
34997
  }
34965
34998
  }
34966
34999
  async getAttribute(physicalId, _resourceType, attributeName) {
@@ -35211,7 +35244,7 @@ var GlueJobProvider = class {
35211
35244
  return;
35212
35245
  }
35213
35246
  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);
35247
+ throw new ProvisioningError(`Failed to delete Glue Job ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
35215
35248
  }
35216
35249
  }
35217
35250
  async getAttribute(physicalId, _resourceType, attributeName) {
@@ -35509,7 +35542,7 @@ var GlueCrawlerProvider = class {
35509
35542
  return;
35510
35543
  }
35511
35544
  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);
35545
+ throw new ProvisioningError(log.mask(`Failed to delete Glue Crawler ${logicalId}: ${describeAwsFailure(error).detail}`), resourceType, logicalId, physicalId, cause);
35513
35546
  }
35514
35547
  }
35515
35548
  async stopCrawlerAndWait(physicalId, log = {
@@ -35758,7 +35791,7 @@ var GlueConnectionProvider = class {
35758
35791
  return;
35759
35792
  }
35760
35793
  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);
35794
+ throw new ProvisioningError(log.mask(`Failed to delete Glue Connection ${logicalId}: ${describeAwsFailure(error).detail}`), resourceType, logicalId, physicalId, cause);
35762
35795
  }
35763
35796
  }
35764
35797
  async getAttribute(physicalId, _resourceType, attributeName) {
@@ -35983,7 +36016,7 @@ var GlueTriggerProvider = class {
35983
36016
  return;
35984
36017
  }
35985
36018
  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);
36019
+ const failure = new ProvisioningError(`Failed to delete Glue Trigger ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
35987
36020
  throw stripped ? markDeleteStarted(failure) : failure;
35988
36021
  }
35989
36022
  }
@@ -36197,7 +36230,7 @@ var KMSProvider = class {
36197
36230
  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
36231
  }
36199
36232
  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);
36233
+ const thrown = new ProvisioningError(`Failed to create KMS Key ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
36201
36234
  if (createdKeyId !== void 0) {
36202
36235
  markCreatedBeforeFailure(thrown, logicalId, resourceType, createdKeyId);
36203
36236
  if (supersededPending) markSupersedesEarlierCreate(thrown);
@@ -36370,7 +36403,7 @@ var KMSProvider = class {
36370
36403
  };
36371
36404
  } catch (error) {
36372
36405
  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);
36406
+ throw new ProvisioningError(`Failed to update KMS Key ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
36374
36407
  }
36375
36408
  }
36376
36409
  async deleteKey(logicalId, physicalId, resourceType, properties, context) {
@@ -36390,7 +36423,7 @@ var KMSProvider = class {
36390
36423
  return;
36391
36424
  }
36392
36425
  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);
36426
+ throw new ProvisioningError(`Failed to schedule deletion for KMS Key ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
36394
36427
  }
36395
36428
  }
36396
36429
  async applyTagDiff(keyId, resourceType, logicalId, oldTagsRaw, newTagsRaw) {
@@ -36435,7 +36468,7 @@ var KMSProvider = class {
36435
36468
  };
36436
36469
  } catch (error) {
36437
36470
  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);
36471
+ throw new ProvisioningError(`Failed to create KMS Alias ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
36439
36472
  }
36440
36473
  }
36441
36474
  async updateAlias(logicalId, physicalId, resourceType, properties) {
@@ -36454,7 +36487,7 @@ var KMSProvider = class {
36454
36487
  };
36455
36488
  } catch (error) {
36456
36489
  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);
36490
+ throw new ProvisioningError(`Failed to update KMS Alias ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
36458
36491
  }
36459
36492
  }
36460
36493
  async deleteAlias(logicalId, physicalId, resourceType, context) {
@@ -36470,7 +36503,7 @@ var KMSProvider = class {
36470
36503
  return;
36471
36504
  }
36472
36505
  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);
36506
+ throw new ProvisioningError(`Failed to delete KMS Alias ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
36474
36507
  }
36475
36508
  }
36476
36509
  async readCurrentState(physicalId, _logicalId, resourceType) {
@@ -36820,7 +36853,7 @@ var BudgetsBudgetProvider = class {
36820
36853
  try {
36821
36854
  await this.addNotificationsOnly(accountId, physicalId, newNotifications);
36822
36855
  } 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);
36856
+ 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
36857
  }
36825
36858
  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
36859
  }
@@ -36998,7 +37031,7 @@ var BudgetsBudgetProvider = class {
36998
37031
  return;
36999
37032
  }
37000
37033
  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);
37034
+ throw new ProvisioningError(`Failed to delete budget ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
37002
37035
  }
37003
37036
  }
37004
37037
  async getAttribute(physicalId, resourceType, attributeName, logicalId) {
@@ -37012,7 +37045,7 @@ var BudgetsBudgetProvider = class {
37012
37045
  return await this.budgetArn(accountId, physicalId);
37013
37046
  } catch (error) {
37014
37047
  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);
37048
+ throw new ProvisioningError(`Failed to resolve Arn for budget ${physicalId}: ${cause?.message ?? safeStringify(error)}`, resourceType, logicalId, physicalId, cause);
37016
37049
  }
37017
37050
  }
37018
37051
  async import(input) {
@@ -37301,7 +37334,7 @@ var KinesisStreamProvider = class {
37301
37334
  };
37302
37335
  } catch (error) {
37303
37336
  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);
37337
+ 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
37338
  if (streamCreated) markCreatedBeforeFailure(thrown, logicalId, resourceType, streamName);
37306
37339
  throw thrown;
37307
37340
  }
@@ -37427,7 +37460,7 @@ var KinesisStreamProvider = class {
37427
37460
  };
37428
37461
  } catch (error) {
37429
37462
  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);
37463
+ throw new ProvisioningError(`Failed to update Kinesis stream ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
37431
37464
  }
37432
37465
  }
37433
37466
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -37446,7 +37479,7 @@ var KinesisStreamProvider = class {
37446
37479
  return;
37447
37480
  }
37448
37481
  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);
37482
+ throw new ProvisioningError(`Failed to delete Kinesis stream ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
37450
37483
  }
37451
37484
  await waitForGoneAfterDelete({
37452
37485
  what: `Kinesis stream ${physicalId}`,
@@ -37693,7 +37726,7 @@ var KinesisStreamConsumerProvider = class {
37693
37726
  }
37694
37727
  };
37695
37728
  } 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);
37729
+ 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
37730
  if (createdArn) markCreatedBeforeFailure(thrown, logicalId, resourceType, createdArn);
37698
37731
  throw thrown;
37699
37732
  }
@@ -37761,7 +37794,7 @@ var KinesisStreamConsumerProvider = class {
37761
37794
  return;
37762
37795
  }
37763
37796
  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);
37797
+ throw new ProvisioningError(`Failed to deregister Kinesis stream consumer ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
37765
37798
  }
37766
37799
  }
37767
37800
  async getAttribute(physicalId, _resourceType, attributeName) {
@@ -37988,7 +38021,7 @@ var SchedulerScheduleProvider = class {
37988
38021
  };
37989
38022
  } catch (error) {
37990
38023
  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);
38024
+ throw new ProvisioningError(`Failed to create Schedule ${logicalId}: ${cause?.message ?? safeStringify(error)}`, resourceType, logicalId, void 0, cause);
37992
38025
  }
37993
38026
  }
37994
38027
  async readIdentity(name, groupName) {
@@ -38089,7 +38122,7 @@ var SchedulerScheduleProvider = class {
38089
38122
  } catch (error) {
38090
38123
  if (error instanceof ResourceUpdateNotSupportedError) throw error;
38091
38124
  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);
38125
+ throw new ProvisioningError(`Failed to update Schedule ${logicalId}: ${cause?.message ?? safeStringify(error)}`, resourceType, logicalId, physicalId, cause);
38093
38126
  }
38094
38127
  }
38095
38128
  async deleteByRecordedIdentity(logicalId, physicalId, resourceType, recorded, context) {
@@ -38200,7 +38233,7 @@ var SchedulerScheduleProvider = class {
38200
38233
  return;
38201
38234
  }
38202
38235
  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);
38236
+ throw new ProvisioningError(`Failed to delete Schedule ${logicalId}: ${cause?.message ?? safeStringify(error)}`, resourceType, logicalId, physicalId, cause);
38204
38237
  }
38205
38238
  }
38206
38239
  async getAttribute(physicalId, resourceType, attributeName, logicalId) {
@@ -38210,7 +38243,7 @@ var SchedulerScheduleProvider = class {
38210
38243
  } catch (error) {
38211
38244
  const cause = error instanceof Error ? error : void 0;
38212
38245
  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);
38246
+ throw new ProvisioningError(`Failed to resolve Arn for Schedule ${physicalId}: ${cause?.message ?? safeStringify(error)}.${customGroupHint}`, resourceType, logicalId, physicalId, cause);
38214
38247
  }
38215
38248
  }
38216
38249
  async readCurrentState(physicalId, _logicalId, _resourceType, properties) {
@@ -38529,7 +38562,7 @@ var PipesPipeProvider = class {
38529
38562
  createdIdentity = pipeIdentityToken(name, created?.Arn, created?.CreationTime);
38530
38563
  } catch (error) {
38531
38564
  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);
38565
+ throw new ProvisioningError(`Failed to create Pipe ${logicalId}: ${mask(cause?.message ?? safeStringify(error))}`, resourceType, logicalId, void 0, cause);
38533
38566
  }
38534
38567
  let settled;
38535
38568
  try {
@@ -38601,7 +38634,7 @@ var PipesPipeProvider = class {
38601
38634
  if (error instanceof ProvisioningError) throw error;
38602
38635
  if (error instanceof NotFoundException$6) assertRegionMatch(await this.getClient().config.region(), context?.expectedRegion, resourceType, logicalId, physicalId);
38603
38636
  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);
38637
+ throw new ProvisioningError(`Failed to update Pipe ${logicalId}: ${mask(cause?.message ?? safeStringify(error))}`, resourceType, logicalId, physicalId, cause);
38605
38638
  }
38606
38639
  return {
38607
38640
  physicalId,
@@ -38622,7 +38655,7 @@ var PipesPipeProvider = class {
38622
38655
  return;
38623
38656
  }
38624
38657
  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);
38658
+ throw new ProvisioningError(`Failed to delete Pipe ${logicalId}: ${cause?.message ?? safeStringify(error)}`, resourceType, logicalId, physicalId, cause);
38626
38659
  }
38627
38660
  await waitForGoneAfterDelete({
38628
38661
  what: `Pipe ${physicalId}`,
@@ -39255,7 +39288,7 @@ var EFSProvider = class {
39255
39288
  return;
39256
39289
  }
39257
39290
  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);
39291
+ throw new ProvisioningError(`Failed to delete EFS FileSystem ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
39259
39292
  }
39260
39293
  }
39261
39294
  async waitForFileSystemAvailable(fileSystemId, logicalId, resourceType, log) {
@@ -39325,7 +39358,7 @@ var EFSProvider = class {
39325
39358
  return;
39326
39359
  }
39327
39360
  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);
39361
+ throw new ProvisioningError(`Failed to delete EFS MountTarget ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
39329
39362
  }
39330
39363
  }
39331
39364
  async waitForMountTargetDeleted(mountTargetId, logicalId) {
@@ -39454,7 +39487,7 @@ var EFSProvider = class {
39454
39487
  return;
39455
39488
  }
39456
39489
  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);
39490
+ throw new ProvisioningError(`Failed to delete EFS AccessPoint ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
39458
39491
  }
39459
39492
  }
39460
39493
  async readCurrentState(physicalId, _logicalId, resourceType) {
@@ -39852,7 +39885,7 @@ var FSxFileSystemProvider = class {
39852
39885
  throw error;
39853
39886
  }
39854
39887
  const cause = error instanceof Error ? error : void 0;
39855
- const message = `Failed to create FSx FileSystem ${logicalId}: ${error instanceof Error ? error.message : String(error)}`;
39888
+ const message = `Failed to create FSx FileSystem ${logicalId}: ${describeAwsFailure(error).detail}`;
39856
39889
  if (survivorId !== void 0) {
39857
39890
  const thrown = new ProvisioningError(message, resourceType, logicalId, void 0, cause);
39858
39891
  markCreatedBeforeFailure(thrown, logicalId, resourceType, survivorId);
@@ -40088,7 +40121,7 @@ var FSxFileSystemProvider = class {
40088
40121
  } catch (error) {
40089
40122
  if (error instanceof ProvisioningError) throw error;
40090
40123
  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);
40124
+ throw new ProvisioningError(`Failed to update FSx FileSystem ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
40092
40125
  }
40093
40126
  }
40094
40127
  detectVariantConfigKey(properties, previousProperties) {
@@ -40281,7 +40314,7 @@ var FSxFileSystemProvider = class {
40281
40314
  return;
40282
40315
  }
40283
40316
  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);
40317
+ throw new ProvisioningError(`Failed to delete FSx FileSystem ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
40285
40318
  }
40286
40319
  await this.waitForFileSystemDeleted(physicalId, logicalId, resourceType);
40287
40320
  this.logger.debug(`Successfully deleted FSx FileSystem ${logicalId}`);
@@ -40375,7 +40408,7 @@ var FSxFileSystemProvider = class {
40375
40408
  } catch (error) {
40376
40409
  if (error instanceof FileSystemNotFound$1) return;
40377
40410
  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);
40411
+ throw new ProvisioningError(`Failed to poll FSx FileSystem ${fileSystemId} deletion: ${describeAwsFailure(error).detail}`, resourceType, logicalId, fileSystemId, cause);
40379
40412
  }
40380
40413
  if (!fs && sawResponse) return;
40381
40414
  if (!fs) {
@@ -40885,7 +40918,7 @@ var EMRClusterProvider = class {
40885
40918
  throw error;
40886
40919
  }
40887
40920
  const cause = error instanceof Error ? error : void 0;
40888
- const message = `Failed to create EMR Cluster ${logicalId}: ${error instanceof Error ? error.message : String(error)}`;
40921
+ const message = `Failed to create EMR Cluster ${logicalId}: ${describeAwsFailure(error).detail}`;
40889
40922
  if (survivorId !== void 0) {
40890
40923
  const thrown = new ProvisioningError(message, resourceType, logicalId, void 0, cause);
40891
40924
  markCreatedBeforeFailure(thrown, logicalId, resourceType, survivorId);
@@ -41083,7 +41116,7 @@ var EMRClusterProvider = class {
41083
41116
  } catch (error) {
41084
41117
  if (error instanceof ProvisioningError) throw error;
41085
41118
  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);
41119
+ throw new ProvisioningError(`Failed to update EMR Cluster ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
41087
41120
  }
41088
41121
  }
41089
41122
  async applyTagDiff(physicalId, resourceType, logicalId, prevTagsRaw, nextTagsRaw) {
@@ -41137,7 +41170,7 @@ var EMRClusterProvider = class {
41137
41170
  return;
41138
41171
  }
41139
41172
  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);
41173
+ throw new ProvisioningError(`Failed to describe EMR Cluster ${logicalId} before deletion: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
41141
41174
  }
41142
41175
  const currentState = current?.Status?.State;
41143
41176
  if (currentState && TERMINAL_STATES.has(currentState)) {
@@ -41166,7 +41199,7 @@ var EMRClusterProvider = class {
41166
41199
  flip.deleteAccepted = true;
41167
41200
  } catch (error) {
41168
41201
  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);
41202
+ throw new ProvisioningError(`Failed to terminate EMR Cluster ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
41170
41203
  }
41171
41204
  await this.waitForClusterTerminated(physicalId, logicalId, resourceType);
41172
41205
  this.logger.debug(`Successfully deleted EMR Cluster ${logicalId}`);
@@ -41213,7 +41246,7 @@ var EMRClusterProvider = class {
41213
41246
  } catch (error) {
41214
41247
  if (error instanceof InvalidRequestException) return;
41215
41248
  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);
41249
+ throw new ProvisioningError(`Failed to poll EMR Cluster ${clusterId} termination: ${describeAwsFailure(error).detail}`, resourceType, logicalId, clusterId, cause);
41217
41250
  }
41218
41251
  const state = cluster?.Status?.State;
41219
41252
  if (state && TERMINAL_STATES.has(state)) {
@@ -41557,7 +41590,7 @@ var EMRInstanceGroupConfigProvider = class {
41557
41590
  }
41558
41591
  };
41559
41592
  } 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);
41593
+ 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
41594
  let leftBehindGroupId = createdGroupId;
41562
41595
  if (leftBehindGroupId && properties["InstanceRole"] === "TASK") {
41563
41596
  const log = createMaskedLogSinks(this.logger, context?.maskSecrets);
@@ -41663,7 +41696,7 @@ var EMRInstanceGroupConfigProvider = class {
41663
41696
  } catch (error) {
41664
41697
  if (error instanceof ProvisioningError || error instanceof ResourceUpdateNotSupportedError) throw error;
41665
41698
  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);
41699
+ throw new ProvisioningError(`Failed to update EMR instance group ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
41667
41700
  }
41668
41701
  }
41669
41702
  async delete(logicalId, physicalId, resourceType, properties, context) {
@@ -41883,7 +41916,7 @@ var EMRInstanceFleetConfigProvider = class {
41883
41916
  }
41884
41917
  };
41885
41918
  } 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);
41919
+ 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
41920
  if (createdFleetId) {
41888
41921
  markCreatedBeforeFailure(thrown, logicalId, resourceType, createdFleetId);
41889
41922
  markNonRetryable(thrown);
@@ -41971,7 +42004,7 @@ var EMRInstanceFleetConfigProvider = class {
41971
42004
  } catch (error) {
41972
42005
  if (error instanceof ProvisioningError || error instanceof ResourceUpdateNotSupportedError) throw error;
41973
42006
  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);
42007
+ throw new ProvisioningError(`Failed to update EMR instance fleet ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
41975
42008
  }
41976
42009
  }
41977
42010
  async delete(logicalId, physicalId, resourceType, properties, context) {
@@ -42267,7 +42300,7 @@ var FirehoseProvider = class {
42267
42300
  attributes: { Arn: arn }
42268
42301
  };
42269
42302
  } 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);
42303
+ 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
42304
  if (createdStreamName !== void 0) markCreatedBeforeFailure(thrown, logicalId, resourceType, createdStreamName);
42272
42305
  throw thrown;
42273
42306
  }
@@ -42279,7 +42312,7 @@ var FirehoseProvider = class {
42279
42312
  } catch (error) {
42280
42313
  if (error instanceof CdkdError) throw error;
42281
42314
  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);
42315
+ throw new ProvisioningError(`Failed to update Firehose delivery stream ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
42283
42316
  }
42284
42317
  }
42285
42318
  async applyUpdate(logicalId, physicalId, resourceType, properties, previousProperties) {
@@ -42418,7 +42451,7 @@ var FirehoseProvider = class {
42418
42451
  return;
42419
42452
  }
42420
42453
  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);
42454
+ throw new ProvisioningError(`Failed to delete Firehose delivery stream ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
42422
42455
  }
42423
42456
  await waitForGoneAfterDelete({
42424
42457
  what: `Firehose delivery stream ${physicalId}`,
@@ -43073,7 +43106,7 @@ var CloudTrailProvider = class {
43073
43106
  } catch (error) {
43074
43107
  if (trailCreated) markAuxiliaryFailure(error, logicalId);
43075
43108
  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);
43109
+ const thrown = new ProvisioningError(`Failed to create CloudTrail Trail ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
43077
43110
  if (createdTrailArn) markCreatedBeforeFailure(thrown, logicalId, resourceType, createdTrailArn);
43078
43111
  throw thrown;
43079
43112
  }
@@ -43161,7 +43194,7 @@ var CloudTrailProvider = class {
43161
43194
  };
43162
43195
  } catch (error) {
43163
43196
  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);
43197
+ throw new ProvisioningError(`Failed to update CloudTrail Trail ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
43165
43198
  }
43166
43199
  }
43167
43200
  async delete(logicalId, physicalId, resourceType, properties, context) {
@@ -43186,7 +43219,7 @@ var CloudTrailProvider = class {
43186
43219
  return;
43187
43220
  }
43188
43221
  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);
43222
+ const failure = new ProvisioningError(`Failed to delete CloudTrail Trail ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
43190
43223
  throw stripped ? markDeleteStarted(failure) : failure;
43191
43224
  }
43192
43225
  }
@@ -43514,7 +43547,7 @@ var CodeBuildProvider = class {
43514
43547
  };
43515
43548
  } catch (error) {
43516
43549
  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);
43550
+ throw new ProvisioningError(`Failed to create CodeBuild Project ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
43518
43551
  }
43519
43552
  }
43520
43553
  async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
@@ -43532,7 +43565,7 @@ var CodeBuildProvider = class {
43532
43565
  };
43533
43566
  } catch (error) {
43534
43567
  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);
43568
+ throw new ProvisioningError(`Failed to update CodeBuild Project ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
43536
43569
  }
43537
43570
  }
43538
43571
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -43548,7 +43581,7 @@ var CodeBuildProvider = class {
43548
43581
  return;
43549
43582
  }
43550
43583
  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);
43584
+ throw new ProvisioningError(`Failed to delete CodeBuild Project ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
43552
43585
  }
43553
43586
  }
43554
43587
  getAttribute(_physicalId, _resourceType, attributeName) {
@@ -43917,7 +43950,7 @@ var CodeCommitRepositoryProvider = class {
43917
43950
  };
43918
43951
  } catch (error) {
43919
43952
  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);
43953
+ const thrown = new ProvisioningError(`Failed to create CodeCommit Repository ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, repositoryName, cause);
43921
43954
  if (leftLiveName !== void 0) markCreatedBeforeFailure(thrown, logicalId, resourceType, leftLiveName);
43922
43955
  throw thrown;
43923
43956
  }
@@ -44022,7 +44055,7 @@ var CodeCommitRepositoryProvider = class {
44022
44055
  }));
44023
44056
  } catch (error) {
44024
44057
  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 });
44058
+ 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
44059
  }
44027
44060
  this.logger.debug(`Updated triggers for ${currentName} (${newSdkTriggers.length} trigger(s))`);
44028
44061
  }
@@ -44036,7 +44069,7 @@ var CodeCommitRepositoryProvider = class {
44036
44069
  } catch (error) {
44037
44070
  if (error instanceof ProvisioningError) throw error;
44038
44071
  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);
44072
+ throw new ProvisioningError(`Failed to update CodeCommit Repository ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
44040
44073
  }
44041
44074
  }
44042
44075
  readDesiredLists(logicalId, resourceType, values, physicalId) {
@@ -44121,7 +44154,7 @@ var CodeCommitRepositoryProvider = class {
44121
44154
  return withIndeterminateGuard(void 0, guard);
44122
44155
  }
44123
44156
  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);
44157
+ throw new ProvisioningError(`Failed to delete CodeCommit Repository ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
44125
44158
  }
44126
44159
  if (!deletedRepositoryId) {
44127
44160
  const clientRegion = await this.getClient().config.region();
@@ -44414,7 +44447,7 @@ var DLMLifecyclePolicyProvider = class {
44414
44447
  };
44415
44448
  } catch (error) {
44416
44449
  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);
44450
+ throw new ProvisioningError(`Failed to create DLM Lifecycle Policy ${logicalId}: ${cause?.message ?? safeStringify(error)}`, resourceType, logicalId, void 0, cause);
44418
44451
  }
44419
44452
  }
44420
44453
  async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
@@ -44460,7 +44493,7 @@ var DLMLifecyclePolicyProvider = class {
44460
44493
  } catch (error) {
44461
44494
  if (error instanceof ResourceUpdateNotSupportedError) throw error;
44462
44495
  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);
44496
+ throw new ProvisioningError(`Failed to update DLM Lifecycle Policy ${logicalId}: ${cause?.message ?? safeStringify(error)}`, resourceType, logicalId, physicalId, cause);
44464
44497
  }
44465
44498
  }
44466
44499
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -44476,7 +44509,7 @@ var DLMLifecyclePolicyProvider = class {
44476
44509
  return;
44477
44510
  }
44478
44511
  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);
44512
+ throw new ProvisioningError(`Failed to delete DLM Lifecycle Policy ${logicalId}: ${cause?.message ?? safeStringify(error)}`, resourceType, logicalId, physicalId, cause);
44480
44513
  }
44481
44514
  }
44482
44515
  async getAttribute(physicalId, resourceType, attributeName, logicalId) {
@@ -44486,7 +44519,7 @@ var DLMLifecyclePolicyProvider = class {
44486
44519
  return await this.fetchPolicyArn(physicalId);
44487
44520
  } catch (error) {
44488
44521
  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);
44522
+ throw new ProvisioningError(`Failed to resolve Arn for DLM Lifecycle Policy ${physicalId}: ${cause?.message ?? safeStringify(error)}`, resourceType, logicalId, physicalId, cause);
44490
44523
  }
44491
44524
  }
44492
44525
  async readCurrentState(physicalId, _logicalId, _resourceType) {
@@ -44652,7 +44685,7 @@ var S3VectorsProvider = class {
44652
44685
  };
44653
44686
  } catch (error) {
44654
44687
  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);
44688
+ throw new ProvisioningError(`Failed to create S3 VectorBucket ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
44656
44689
  }
44657
44690
  }
44658
44691
  async deleteVectorBucket(logicalId, physicalId, resourceType, context) {
@@ -44669,7 +44702,7 @@ var S3VectorsProvider = class {
44669
44702
  return;
44670
44703
  }
44671
44704
  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);
44705
+ throw new ProvisioningError(`Failed to delete S3 VectorBucket ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
44673
44706
  }
44674
44707
  }
44675
44708
  async emptyVectorBucket(logicalId, vectorBucketName) {
@@ -44869,7 +44902,7 @@ var S3DirectoryBucketProvider = class {
44869
44902
  };
44870
44903
  } catch (error) {
44871
44904
  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);
44905
+ throw new ProvisioningError(`Failed to create S3 Express Directory Bucket ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, bucketName, cause);
44873
44906
  }
44874
44907
  }
44875
44908
  async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
@@ -44905,7 +44938,7 @@ var S3DirectoryBucketProvider = class {
44905
44938
  };
44906
44939
  } catch (error) {
44907
44940
  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);
44941
+ throw new ProvisioningError(`Failed to update S3 Express Directory Bucket ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
44909
44942
  }
44910
44943
  }
44911
44944
  async delete(logicalId, physicalId, resourceType, properties, context) {
@@ -44923,7 +44956,7 @@ var S3DirectoryBucketProvider = class {
44923
44956
  return;
44924
44957
  }
44925
44958
  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);
44959
+ throw new ProvisioningError(mask(`Failed to delete S3 Express Directory Bucket ${logicalId}: ${describeAwsFailure(error).detail}`), resourceType, logicalId, physicalId, cause);
44927
44960
  }
44928
44961
  }
44929
44962
  async deleteBucketWithEmptyRetry(logicalId, bucketName, allowAutoEmpty, maskSecrets) {
@@ -45111,7 +45144,7 @@ var S3TablesProvider = class {
45111
45144
  } catch (error) {
45112
45145
  if (error instanceof CdkdError) throw error;
45113
45146
  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);
45147
+ throw new ProvisioningError(`Failed to update S3 Tables resource ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
45115
45148
  }
45116
45149
  }
45117
45150
  async applyUpdate(logicalId, physicalId, resourceType, properties, previousProperties) {
@@ -45150,7 +45183,7 @@ var S3TablesProvider = class {
45150
45183
  };
45151
45184
  } catch (error) {
45152
45185
  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);
45186
+ throw new ProvisioningError(`Failed to create S3 Table Bucket ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
45154
45187
  }
45155
45188
  }
45156
45189
  async deleteTableBucket(logicalId, physicalId, resourceType, context) {
@@ -45167,7 +45200,7 @@ var S3TablesProvider = class {
45167
45200
  return;
45168
45201
  }
45169
45202
  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);
45203
+ throw new ProvisioningError(`Failed to delete S3 Table Bucket ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
45171
45204
  }
45172
45205
  }
45173
45206
  async emptyTableBucket(tableBucketARN) {
@@ -45247,7 +45280,7 @@ var S3TablesProvider = class {
45247
45280
  };
45248
45281
  } catch (error) {
45249
45282
  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);
45283
+ throw new ProvisioningError(`Failed to create S3 Tables Namespace ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
45251
45284
  }
45252
45285
  }
45253
45286
  async deleteNamespace(logicalId, physicalId, resourceType, context) {
@@ -45268,7 +45301,7 @@ var S3TablesProvider = class {
45268
45301
  return;
45269
45302
  }
45270
45303
  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);
45304
+ throw new ProvisioningError(`Failed to delete S3 Tables Namespace ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
45272
45305
  }
45273
45306
  }
45274
45307
  async createTable(logicalId, resourceType, properties, context) {
@@ -45319,7 +45352,7 @@ var S3TablesProvider = class {
45319
45352
  };
45320
45353
  } catch (error) {
45321
45354
  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);
45355
+ const thrown = new ProvisioningError(`Failed to create S3 Tables Table ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, void 0, cause);
45323
45356
  if (tableCreated) markCreatedBeforeFailure(thrown, logicalId, resourceType, physicalId);
45324
45357
  throw thrown;
45325
45358
  }
@@ -45582,7 +45615,7 @@ var S3TablesProvider = class {
45582
45615
  resolved = await this.resolveTableParts(physicalId);
45583
45616
  } catch (error) {
45584
45617
  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);
45618
+ throw new ProvisioningError(`Failed to resolve S3 Tables Table ${logicalId} (${physicalId}): ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
45586
45619
  }
45587
45620
  if (resolved === "not-found") {
45588
45621
  const clientRegion = await this.getClient().config.region();
@@ -45607,7 +45640,7 @@ var S3TablesProvider = class {
45607
45640
  return;
45608
45641
  }
45609
45642
  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);
45643
+ throw new ProvisioningError(`Failed to delete S3 Tables Table ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
45611
45644
  }
45612
45645
  }
45613
45646
  tagListToSdkMap(tags) {
@@ -45662,7 +45695,7 @@ var S3TablesProvider = class {
45662
45695
  }));
45663
45696
  } catch (err) {
45664
45697
  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);
45698
+ 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
45699
  }
45667
45700
  if (Object.keys(upserts).length > 0) try {
45668
45701
  await this.getClient().send(new TagResourceCommand$27({
@@ -45671,7 +45704,7 @@ var S3TablesProvider = class {
45671
45704
  }));
45672
45705
  } catch (err) {
45673
45706
  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);
45707
+ 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
45708
  }
45676
45709
  }
45677
45710
  async applyTableBucketTagsDiff(logicalId, physicalId, resourceType, previousTags, newTags) {
@@ -45689,7 +45722,7 @@ var S3TablesProvider = class {
45689
45722
  }));
45690
45723
  } catch (err) {
45691
45724
  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);
45725
+ 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
45726
  }
45694
45727
  if (Object.keys(upserts).length > 0) try {
45695
45728
  await this.getClient().send(new TagResourceCommand$27({
@@ -45698,7 +45731,7 @@ var S3TablesProvider = class {
45698
45731
  }));
45699
45732
  } catch (err) {
45700
45733
  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);
45734
+ 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
45735
  }
45703
45736
  }
45704
45737
  };
@@ -45813,7 +45846,7 @@ var ECRProvider = class {
45813
45846
  } catch (error) {
45814
45847
  if (repositoryCreated) markAuxiliaryFailure(error, logicalId);
45815
45848
  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);
45849
+ const thrown = new ProvisioningError(`Failed to create ECR Repository ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, repositoryName, cause);
45817
45850
  if (repositoryCreated) markCreatedBeforeFailure(thrown, logicalId, resourceType, repositoryName);
45818
45851
  throw thrown;
45819
45852
  }
@@ -45909,7 +45942,7 @@ var ECRProvider = class {
45909
45942
  };
45910
45943
  } catch (error) {
45911
45944
  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);
45945
+ throw new ProvisioningError(`Failed to update ECR Repository ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
45913
45946
  }
45914
45947
  }
45915
45948
  async delete(logicalId, physicalId, resourceType, properties, context) {
@@ -45931,7 +45964,7 @@ var ECRProvider = class {
45931
45964
  return;
45932
45965
  }
45933
45966
  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);
45967
+ throw new ProvisioningError(`Failed to delete ECR Repository ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
45935
45968
  }
45936
45969
  }
45937
45970
  async readCurrentState(physicalId, _logicalId, _resourceType) {
@@ -46497,7 +46530,7 @@ var ACMCertificateProvider = class {
46497
46530
  throw thrown;
46498
46531
  }
46499
46532
  const cause = error instanceof Error ? error : void 0;
46500
- const detail = error instanceof Error ? error.message : String(error);
46533
+ const detail = describeAwsFailure(error).detail;
46501
46534
  const message = `Failed to create ACM certificate ${logicalIdShown(logicalId)}: ${detail}`;
46502
46535
  if (requestedArn && survivorNote !== void 0) {
46503
46536
  const thrown = new ProvisioningError(`${message} ${survivorNote}`, resourceType, logicalId, requestedArn, cause);
@@ -46605,7 +46638,7 @@ var ACMCertificateProvider = class {
46605
46638
  };
46606
46639
  } catch (error) {
46607
46640
  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);
46641
+ throw new ProvisioningError(`Failed to update ACM certificate ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
46609
46642
  }
46610
46643
  }
46611
46644
  async delete(logicalId, physicalId, resourceType, _properties, context) {
@@ -46625,7 +46658,7 @@ var ACMCertificateProvider = class {
46625
46658
  this.logger.debug(`Successfully deleted ACM certificate ${logicalId}`);
46626
46659
  } catch (error) {
46627
46660
  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);
46661
+ throw new ProvisioningError(`Failed to delete ACM certificate ${logicalId}: ${describeAwsFailure(error).detail}`, resourceType, logicalId, physicalId, cause);
46629
46662
  }
46630
46663
  }
46631
46664
  async getAttribute(physicalId, _resourceType, attributeName) {
@@ -46747,4 +46780,4 @@ var ACMCertificateProvider = class {
46747
46780
 
46748
46781
  //#endregion
46749
46782
  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
46783
+ //# sourceMappingURL=provider-classes-59TTNMFB.js.map