@go-to-k/cdkd 0.296.10 → 0.296.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/{asg-provider-Dxc7pRNy.js → asg-provider-DoaukzYL.js} +20 -9
  2. package/dist/asg-provider-DoaukzYL.js.map +1 -0
  3. package/dist/cli.js +2 -2
  4. package/dist/{deploy-engine-CpI6zpP3.js → deploy-engine-CrYi7ta5.js} +6727 -5357
  5. package/dist/deploy-engine-CrYi7ta5.js.map +1 -0
  6. package/dist/{iam-policy-targets-BREzwsG6.js → iam-policy-targets-elNafvpb.js} +116 -10
  7. package/dist/iam-policy-targets-elNafvpb.js.map +1 -0
  8. package/dist/{iam-role-provider-DwUk13DS.js → iam-role-provider-ClAgHnkh.js} +5 -93
  9. package/dist/iam-role-provider-ClAgHnkh.js.map +1 -0
  10. package/dist/index.d.ts +22 -2
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/index.js +3 -3
  13. package/dist/{neptune-provider-Br7yS2dy.js → neptune-provider-ppi8nIX-.js} +21 -10
  14. package/dist/neptune-provider-ppi8nIX-.js.map +1 -0
  15. package/dist/{program-CXEHAcOO.js → program-epAinsMQ.js} +387 -60
  16. package/dist/program-epAinsMQ.js.map +1 -0
  17. package/dist/{provider-classes-DbpGX0KN.js → provider-classes-D76dAHvV.js} +682 -159
  18. package/dist/provider-classes-D76dAHvV.js.map +1 -0
  19. package/dist/{rds-provider-C6t144QY.js → rds-provider-V_uJHUSX.js} +80 -14
  20. package/dist/rds-provider-V_uJHUSX.js.map +1 -0
  21. package/dist/{version-VBHkBg7c.js → version-B8WzrPJT.js} +2 -2
  22. package/dist/{version-VBHkBg7c.js.map → version-B8WzrPJT.js.map} +1 -1
  23. package/package.json +1 -1
  24. package/dist/asg-provider-Dxc7pRNy.js.map +0 -1
  25. package/dist/deploy-engine-CpI6zpP3.js.map +0 -1
  26. package/dist/iam-policy-targets-BREzwsG6.js.map +0 -1
  27. package/dist/iam-role-provider-DwUk13DS.js.map +0 -1
  28. package/dist/neptune-provider-Br7yS2dy.js.map +0 -1
  29. package/dist/program-CXEHAcOO.js.map +0 -1
  30. package/dist/provider-classes-DbpGX0KN.js.map +0 -1
  31. package/dist/rds-provider-C6t144QY.js.map +0 -1
@@ -1,13 +1,13 @@
1
1
  import { r as getAwsClients } from "./aws-clients-CnmtbrxD.js";
2
2
  import { A as displayIdent, F as plainIdentOr, I as safeMsg, M as displayStackName, N as isPasteableIdent, T as SECRET_REF_MAX_CODE_POINTS, _ as generateResourceNameWithFallback, g as generateResourceName, j as displaySafe, n as getLogger } from "./logger-DAaB7GFO.js";
3
- import { $ as compositeIdFormatMessage, $n as markRedactedCause, A as isTerminalDeleteFailure, B as WITHHELD_AWS_COMMAND, C as refusalTypeShown, D as ProtectionFlipRegistry, Dn as shellQuote, H as pasteableAwsCommand, Ht as AccountIdUnavailableError, J as isInterruptedWaitError, Jn as safeStringify, Kn as describeAwsFailure, L as userPoolProtectionSite, Ln as markNameCollision, Lt as withPasteableAwsProfile, M as observeThenDisableProtection, Mt as injectiveKey, N as protectionFlipKey, Nt as injectiveKeyPrefix, On as withheldTargetClause, P as rdsFamilyProtectionSite, Q as canonicalizeRoute53QueryName, Qn as markNonRetryable, Rn as markReplayMayCollide, Rt as ambientClientDefaults, S as quotedRemedyLogicalId, Sn as pasteableCommand, T as resolveExplicitPhysicalId, U as protectedReplacementAdvice, Un as isRetryableTransientError, V as isAwsCliLiteral, Vn as isAmbiguousOutcomeError, Vt as credentialFingerprint, W as renderDisableCommand, Wn as isTransientServerError, Wt as CdkdError, X as ElapsedBudgetRegistry, Xn as isMarkedNonRetryable, Y as startInterruptWatch, Yn as THROTTLING_ERROR_NAMES, Zn as isThrottlingError, _ as VALUE_NOT_SHOWN, a as onlySecretDerived, at as segmentAfterAnchor, b as isQuotableImportValue, bn as hasClauseBreak, bt as markAuxiliaryFailure, c as recordedPrincipalsRepair, ct as createMaskedRetryLogger, dt as maskerOrIdentity, er as wrapMaskedAwsError, et as compositeIdSeparatorRefusal, ft as withDerivedNameMasks, g as assertRegionMatch, h as RESOURCE_NOT_FOUND, ht as clearCreatedBeforeFailure, i as holdsSecretDerivedEntry, in as ProvisioningError, j as logGroupProtectionSite, k as deleteWithProtectionCompensation, lt as isSecretDerivedValue, nt as logicalIdShown, o as readPrincipalLists, on as ResourceUpdateNotSupportedError, ot as stateOrphanRecordRemedy, p as withRemovalDefaults, qn as isAwsAuthoredFailure, r as SECRET_DERIVED_READ_LIVE, rt as packCompositeId, st as createMaskedLogSinks, tt as compositeIdSkipResult, u as clearOnUpdateRemoval, ut as maskDeep, v as isPlainImportJson, w as remedyLogicalId, wn as plainOrDescribed, x as normalizeAwsTagsToCfn, xn as isInertUnquoted, xt as markCreatedBeforeFailure, y as isPlainImportValue, yn as commandHole, z as UNNAMEABLE_ID_CLAUSE, zt as ambientCredentialConfig } from "./iam-policy-targets-BREzwsG6.js";
3
+ import { A as refusalTypeShown, An as pasteableCommand, B as protectionFlipKey, Bt as injectiveKey, C as assertRegionMatch, D as isQuotableImportValue, Dn as commandHole, E as isPlainImportValue, Fn as shellQuote, Gn as markNameCollision, Gt as withPasteableAwsProfile, I as deleteWithProtectionCompensation, In as withheldTargetClause, J as isAwsCliLiteral, Jt as clientDefaultsFor, K as UNNAMEABLE_ID_CLAUSE, Kn as markReplayMayCollide, Kt as ambientClientDefaults, L as isTerminalDeleteFailure, M as resolveExplicitPhysicalId, Mn as plainOrDescribed, O as normalizeAwsTagsToCfn, On as hasClauseBreak, Ot as markAuxiliaryFailure, P as ProtectionFlipRegistry, Qn as isTransientServerError, Qt as CdkdError, R as logGroupProtectionSite, S as RESOURCE_NOT_FOUND, St as clearCreatedBeforeFailure, T as isPlainImportJson, V as rdsFamilyProtectionSite, Vt as injectiveKeyPrefix, W as userPoolProtectionSite, X as protectedReplacementAdvice, Xt as AccountIdUnavailableError, Y as pasteableAwsCommand, Yn as isAmbiguousOutcomeError, Yt as credentialFingerprint, Z as renderDisableCommand, Zn as isRetryableTransientError, _ as RecentIdSet, _t as maskDeep, a as onlySecretDerived, ar as isThrottlingError, at as canonicalizeRoute53QueryName, b as setBounded, c as recordedPrincipalsRepair, cr as wrapMaskedAwsError, ct as compositeIdSkipResult, er as describeAwsFailure, fn as ProvisioningError, ft as segmentAfterAnchor, g as AmbiguousCreateLatch, gt as isSecretDerivedValue, h as AMBIGUOUS_LATCH_TTL_MS, ht as createMaskedRetryLogger, i as holdsSecretDerivedEntry, ir as isMarkedNonRetryable, j as remedyLogicalId, k as quotedRemedyLogicalId, kn as isInertUnquoted, kt as markCreatedBeforeFailure, lt as logicalIdShown, mn as ResourceUpdateNotSupportedError, mt as createMaskedLogSinks, nr as safeStringify, nt as startInterruptWatch, o as readPrincipalLists, or as markNonRetryable, ot as compositeIdFormatMessage, p as withRemovalDefaults, pt as stateOrphanRecordRemedy, q as WITHHELD_AWS_COMMAND, qt as ambientCredentialConfig, r as SECRET_DERIVED_READ_LIVE, rr as THROTTLING_ERROR_NAMES, rt as ElapsedBudgetRegistry, sr as markRedactedCause, st as compositeIdSeparatorRefusal, tr as isAwsAuthoredFailure, tt as isInterruptedWaitError, u as clearOnUpdateRemoval, ut as packCompositeId, v as createAttemptKey, vt as maskerOrIdentity, w as VALUE_NOT_SHOWN, x as withoutServerErrorRetries, y as isInsideWindow, yt as withDerivedNameMasks, z as observeThenDisableProtection } from "./iam-policy-targets-elNafvpb.js";
4
4
  import { s as ambientRegion } from "./aws-client-defaults-D0q0z4dG.js";
5
- import { $n as deleteSkipReason, $r as accountArgs, A as resolveDynamoDbDeleteBudgetClock, Aa as replayWarn, An as acquireIdempotencyToken, Ar as s3BucketWebsiteUrl, B as getPriorAttempts, Ba as sameLambdaFunctionAddress, Ca as toFiniteNumber, Ct as getStackRecords, D as beginDeleteWait, Da as configIntegerRefusal, Dr as s3BucketDomainName, E as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, Ea as configBooleanRefusal, En as earliestDefined, Er as s3BucketArn, F as waitForIndexesSettled, Fn as refuseMalformedDesiredTags, Gn as getCurrentResourceSecrets, I as ECR_AUTO_DELETE_IMAGES_TAG, In as tagMapAsList, It as REDACTED_DELETE_ADDRESS_SKIP_REASON, Ji as refuseMalformedResourcesForDestroy, Jn as slowCcOperationTimeoutMs, Ka as hasMaskableValues, Ko as stringifyValue, L as S3_AUTO_DELETE_OBJECTS_TAG, La as withRetry, Ln as tagPlanWarning, Lt as isRedactedRecordedValue, M as DELETE_INDEX_WAIT_PROCEED_NOTE, Ma as requireConfigObject, Mn as DBPROXY_TAG_OPTIONS, N as INDEX_SETTLE_POLL_INTERVAL_MS, Na as requireConfigString, Nn as planTagDiff, O as compensateRemovedDeletionProtection, Oa as configStringRefusal, Oi as refuseMalformedNestedChildOutputs, On as reserveStackCreateToken, Or as s3BucketDualStackDomainName, P as deleteTableWithIndexBusyRetry, Pn as readTagList, Pr as getAccountInfo, Pt as getCurrentProducerRegions, R as hasCdkAutoDeleteTag, Ra as canonicalLambdaFunctionName, Rn as definedAttributes, Rt as redactedDeleteAddressFields, Sa as toCfnInteger, T as DynamoDBGlobalTableProvider, Ta as coerceCfnInteger, Tr as isSettledInstanceState, V as markRefusedBeforeApplying, Wr as parseWebACLArn, Xn as unchangedBehindSecretReference, Zo as rewriteTemplateAssetReferences, Zs as decodeListingKey, _t as getCurrentNestedStackContext, a as findNestedTemplateTreeDefect, ar as isTerminationProtectionPropagationError, ba as coerceWarmThroughput$1, c as renderNestedTemplateTreeDefect, ca as findSilentDropProperties, cr as reEnableInstanceApiTermination, dc as describeFileReadFailure, dt as getNestedRevertRun, ec as canonicalizeRegion, er as withIndeterminateGuard, fc as displayAssemblyPath, fo as recoverMaskedOutput, io as redactSecretsForState, ir as ec2InstanceProtectionSite, j as resolveDynamoDbDeleteBudgetMs, ja as requireConfigArray, jn as DBPROXY_TAGS_WHAT, k as deleteBudgetKey, ka as readConfigString, kr as s3BucketRegionalDomainName, mc as resolveAssemblyPath, mo as carriesSecretMask, mt as revertNestedChildFromJournal, nr as markWaitAbandoned, o as isAbsoluteAssetPath, oa as withheldAccountClause, or as observeThenDisableInstanceApiTermination, pc as renderAssemblyPathEscape, qr as passedParameterClassesOf, ro as markSameGenerationBag, s as listNestedTemplateRows, so as dynamicReferenceTokens, sr as reDisableInstanceApiTermination, t as DeployEngine, tc as derivePartitionAndUrlSuffix, tr as isWaitAbandonedError, ua as withoutSilentDropProperties, vt as withNestedStackContext, wa as coerceCfnBoolean, xa as isWarmThroughputDecrease, xt as awaitInFlightSibling, ya as WARM_THROUGHPUT_MEMBERS, z as isTruthyCfnBoolean, za as lambdaFunctionNameForMask, zn as stringifyIfAssigned, zt as redactedDeleteAddressSkip } from "./deploy-engine-CpI6zpP3.js";
6
- import { a as AmbiguousCreateLatch, c as isInsideWindow, i as AMBIGUOUS_LATCH_TTL_MS, l as setBounded, n as collectInlinePolicyNamesManagedBySiblings, o as RecentIdSet, r as IamCreateClientCache, s as createAttemptKey, t as IAMRoleProvider, u as withoutServerErrorRetries } from "./iam-role-provider-DwUk13DS.js";
7
- import { a as canonicalizeIpProtocolValue, i as resolveSecretDerivedPrincipals, n as runDestroyForStack, o as resolvedResourceTimeoutMs, r as isResolvableSecretPrincipalList, t as canonicalizeIpv4Cidr } from "./program-CXEHAcOO.js";
8
- import { RDSProvider } from "./rds-provider-C6t144QY.js";
9
- import { NeptuneProvider } from "./neptune-provider-Br7yS2dy.js";
10
- import { ASGProvider } from "./asg-provider-Dxc7pRNy.js";
5
+ import { $r as passedParameterClassesOf, Aa as coerceCfnBoolean, Bn as planTagDiff, Br as getAccountInfo, Ct as INDEX_SETTLE_POLL_INTERVAL_MS, Da as isWarmThroughputDecrease, Dc as renderAssemblyPathEscape, Dt as S3_AUTO_DELETE_OBJECTS_TAG, Ea as coerceWarmThroughput$1, Ec as displayAssemblyPath, Eo as recoverMaskedOutput, Et as ECR_AUTO_DELETE_IMAGES_TAG, Fa as readConfigString, Fn as reserveStackCreateToken, Fr as s3BucketRegionalDomainName, Ga as lambdaFunctionNameForMask, Gn as definedAttributes, Gt as redactedDeleteAddressFields, Hn as refuseMalformedDesiredTags, Ia as replayWarn, Ir as s3BucketWebsiteUrl, Ka as sameLambdaFunctionAddress, Kn as stringifyIfAssigned, Kt as redactedDeleteAddressSkip, La as requireConfigArray, Ln as acquireIdempotencyToken, Ma as configBooleanRefusal, Mr as s3BucketArn, Na as configIntegerRefusal, Nn as earliestDefined, Nr as s3BucketDomainName, Oa as toCfnInteger, Oc as resolveAssemblyPath, Oo as carriesSecretMask, Ot as hasCdkAutoDeleteTag, Pa as configStringRefusal, Pi as refuseMalformedNestedChildOutputs, Pr as s3BucketDualStackDomainName, Qn as getCurrentResourceSecrets, Ra as requireConfigObject, Rn as DBPROXY_TAGS_WHAT, St as DELETE_INDEX_WAIT_PROCEED_NOTE, T as markRefusedBeforeApplying, Ta as WARM_THROUGHPUT_MEMBERS, Tc as describeFileReadFailure, Tt as waitForIndexesSettled, Ua as withRetry, Un as tagMapAsList, Ut as REDACTED_DELETE_ADDRESS_SKIP_REASON, Vn as readTagList, Vt as getCurrentProducerRegions, Wa as canonicalLambdaFunctionName, Wn as tagPlanWarning, Wt as isRedactedRecordedValue, Xr as parseWebACLArn, Z as getNestedRevertRun, _o as markSameGenerationBag, _t as beginDeleteWait, a as findNestedTemplateTreeDefect, ai as accountArgs, ar as deleteSkipReason, bt as resolveDynamoDbDeleteBudgetClock, c as renderNestedTemplateTreeDefect, cr as markWaitAbandoned, dc as decodeListingKey, dr as isTerminationProtectionPropagationError, ds as rewriteTemplateAssetReferences, ea as refuseMalformedResourcesForDestroy, et as revertNestedChildFromJournal, fa as withheldAccountClause, fr as observeThenDisableInstanceApiTermination, ga as withoutSilentDropProperties, gt as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, hc as derivePartitionAndUrlSuffix, ht as DynamoDBGlobalTableProvider, it as withNestedStackContext, ja as coerceCfnInteger, jr as isSettledInstanceState, ka as toFiniteNumber, kt as isTruthyCfnBoolean, lt as getStackRecords, ma as findSilentDropProperties, mc as canonicalizeRegion, mr as reEnableInstanceApiTermination, nr as unchangedBehindSecretReference, o as isAbsoluteAssetPath, oo as hasMaskableValues, or as withIndeterminateGuard, os as stringifyValue, pr as reDisableInstanceApiTermination, rt as getCurrentNestedStackContext, s as listNestedTemplateRows, sr as isWaitAbandonedError, st as awaitInFlightSibling, t as DeployEngine, to as passedNoEchoParametersOf, tr as slowCcOperationTimeoutMs, ur as ec2InstanceProtectionSite, vo as redactSecretsForState, vt as compensateRemovedDeletionProtection, w as getPriorAttempts, wt as deleteTableWithIndexBusyRetry, xo as dynamicReferenceTokens, xt as resolveDynamoDbDeleteBudgetMs, yt as deleteBudgetKey, za as requireConfigString, zn as DBPROXY_TAG_OPTIONS } from "./deploy-engine-CrYi7ta5.js";
6
+ import { n as collectInlinePolicyNamesManagedBySiblings, r as IamCreateClientCache, t as IAMRoleProvider } from "./iam-role-provider-ClAgHnkh.js";
7
+ import { a as canonicalizeIpProtocolValue, i as resolveSecretDerivedPrincipals, n as runDestroyForStack, o as resolvedResourceTimeoutMs, r as isResolvableSecretPrincipalList, t as canonicalizeIpv4Cidr } from "./program-epAinsMQ.js";
8
+ import { RDSProvider } from "./rds-provider-V_uJHUSX.js";
9
+ import { NeptuneProvider } from "./neptune-provider-ppi8nIX-.js";
10
+ import { ASGProvider } from "./asg-provider-DoaukzYL.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, 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";
@@ -3053,8 +3053,31 @@ function noRecordedRegionCause() {
3053
3053
  function shownLifecycleRuleId(id) {
3054
3054
  return id === void 0 || id === null || id === "" ? "(no Id)" : displayIdent(id);
3055
3055
  }
3056
+ const createBucketLatch = new AmbiguousCreateLatch("CreateBucket");
3057
+ const heldCreateBucketWindows = /* @__PURE__ */ new Map();
3058
+ function takeCreateBucketWindow(logicalId) {
3059
+ const latched = createBucketLatch.take(logicalId);
3060
+ const key = createAttemptKey("CreateBucket", logicalId);
3061
+ const held = heldCreateBucketWindows.get(key);
3062
+ heldCreateBucketWindows.delete(key);
3063
+ const kept = held !== void 0 && Date.now() - held.heldAtMs <= 18e5 ? held.window : void 0;
3064
+ if (latched === void 0) return kept;
3065
+ if (kept === void 0) return latched;
3066
+ return {
3067
+ floorMs: Math.min(latched.floorMs, kept.floorMs),
3068
+ ceilingMs: Math.max(latched.ceilingMs, kept.ceilingMs)
3069
+ };
3070
+ }
3071
+ function holdCreateBucketWindow(logicalId, window) {
3072
+ setBounded(heldCreateBucketWindows, createAttemptKey("CreateBucket", logicalId), {
3073
+ window,
3074
+ heldAtMs: Date.now()
3075
+ });
3076
+ }
3056
3077
  var S3BucketProvider = class S3BucketProvider {
3057
3078
  s3Client;
3079
+ createClientHolder = {};
3080
+ credentialConfig;
3058
3081
  logger = getLogger().child("S3BucketProvider");
3059
3082
  opMask = void 0;
3060
3083
  handledProperties = /* @__PURE__ */ new Map([["AWS::S3::Bucket", /* @__PURE__ */ new Set([
@@ -3082,6 +3105,27 @@ var S3BucketProvider = class S3BucketProvider {
3082
3105
  constructor() {
3083
3106
  const awsClients = getAwsClients();
3084
3107
  this.s3Client = awsClients.s3;
3108
+ this.credentialConfig = awsClients.credentialConfig ?? {};
3109
+ }
3110
+ getCreateClient() {
3111
+ const holder = this.createClientHolder;
3112
+ holder.client ??= this.s3Client.config.region().then((region) => withoutServerErrorRetries(new S3Client({
3113
+ ...clientDefaultsFor(this.credentialConfig),
3114
+ region
3115
+ })), (error) => {
3116
+ holder.client = void 0;
3117
+ throw error;
3118
+ });
3119
+ return holder.client;
3120
+ }
3121
+ refuseAmbiguousCreateAdopt(logicalId, resourceType, bucketName, region, via) {
3122
+ const aws = pasteableAwsCommand(this.shownMask);
3123
+ const regionArg = region ? aws` --region ${region}` : aws``;
3124
+ const owned = aws`aws s3api list-buckets --prefix ${bucketName}`.render();
3125
+ const versions = aws`aws s3api list-object-versions --bucket ${bucketName} --max-items 10${regionArg}`.render();
3126
+ const deletion = aws`aws s3api delete-bucket --bucket ${bucketName}${regionArg}`.render();
3127
+ const presence = "preflight" in via && via.preflight === "indeterminate" ? "a bucket of that name may exist (cdkd could not read its location)" : "the bucket now exists";
3128
+ throw markNonRetryable(new ProvisioningError(`Refusing to adopt S3 bucket ${this.shown(bucketName)} for ${displaySafe(logicalId)} (${resourceType}): an earlier attempt of this create ended without a definite answer (a server error or a lost response) after it may have created the bucket, and ${presence}, so cdkd cannot tell whether this deploy or someone else created it. Check whether this account owns it: ${owned} (it lists only this account's buckets; its CreationDate is a hint, not proof, since some bucket changes update it), and whether it holds any object or object version: ${versions}. If it is listed there, its CreationDate matches the failed attempt, it is empty, and nobody else on your team uses this name, it is this deploy's orphan: delete it with ${deletion} (S3 refuses with BucketNotEmpty if anything is left in it) and re-run the deploy. If it is a bucket you mean this stack to own, re-run the deploy to adopt it.`, resourceType, logicalId, bucketName, "cause" in via ? via.cause : void 0));
3085
3129
  }
3086
3130
  async getRegion() {
3087
3131
  return await this.s3Client.config.region() || "us-east-1";
@@ -3827,6 +3871,7 @@ var S3BucketProvider = class S3BucketProvider {
3827
3871
  noWriteProbe() {
3828
3872
  const probe = Object.create(this);
3829
3873
  probe.s3Client = { send: async () => ({}) };
3874
+ Object.defineProperty(probe, "createClientHolder", { value: { client: Promise.resolve(probe.s3Client) } });
3830
3875
  const silent = () => {};
3831
3876
  probe.logger = Object.assign(Object.create(this.logger), {
3832
3877
  debug: silent,
@@ -4241,6 +4286,8 @@ var S3BucketProvider = class S3BucketProvider {
4241
4286
  allowedPattern: /[^a-z0-9.-]/g
4242
4287
  });
4243
4288
  let bucketLeftBehind = false;
4289
+ let ambiguousWindow;
4290
+ let windowSpent = false;
4244
4291
  try {
4245
4292
  const createParams = { Bucket: bucketName };
4246
4293
  const region = await this.getRegion();
@@ -4249,17 +4296,35 @@ var S3BucketProvider = class S3BucketProvider {
4249
4296
  if (declaresBucketObjectLock(properties)) createParams.ObjectLockEnabledForBucket = true;
4250
4297
  const preflight = canonicalizeRegion(region) === "us-east-1" ? await this.probeBucketRegion(bucketName) : { kind: "absent" };
4251
4298
  let createdNewBucket = false;
4299
+ const createClient = await this.getCreateClient();
4300
+ ambiguousWindow = takeCreateBucketWindow(logicalId);
4301
+ if (ambiguousWindow !== void 0 && (preflight.kind === "indeterminate" || preflight.kind === "region" && preflight.region === "us-east-1")) {
4302
+ windowSpent = true;
4303
+ this.refuseAmbiguousCreateAdopt(logicalId, resourceType, bucketName, canonicalRegion, { preflight: preflight.kind });
4304
+ }
4252
4305
  try {
4253
- await this.s3Client.send(new CreateBucketCommand(createParams));
4306
+ const attemptStartMs = Date.now();
4307
+ try {
4308
+ await createClient.send(new CreateBucketCommand(createParams));
4309
+ } catch (sendError) {
4310
+ createBucketLatch.noteFailure(logicalId, sendError, attemptStartMs, ambiguousWindow);
4311
+ throw sendError;
4312
+ }
4254
4313
  createdNewBucket = preflight.kind === "absent";
4255
4314
  bucketLeftBehind = createdNewBucket;
4315
+ if (createdNewBucket) windowSpent = true;
4256
4316
  if (preflight.kind === "region" && preflight.region !== "us-east-1") this.refuseForeignRegionAdopt(logicalId, resourceType, bucketName, "us-east-1", preflight.region);
4257
4317
  if (preflight.kind === "region") this.logger.warn(`S3 bucket ${this.shown(bucketName)} for ${displaySafe(logicalId)} (${resourceType}) already existed in ${preflight.region} and was ADOPTED, not created. In us-east-1 S3 answers a re-create of a bucket you already own with 200 OK and RESETS that bucket's access control lists, so any ACL previously set on ${this.shown(bucketName)} is now the default. cdkd will not delete this bucket if the rest of this create fails.`);
4258
4318
  this.logger.debug(`Created S3 bucket: ${this.shown(bucketName)}`);
4259
4319
  } catch (createError) {
4260
4320
  if (createError instanceof ProvisioningError) throw createError;
4321
+ if (createError instanceof Error && createError.name === "BucketAlreadyExists") windowSpent = true;
4261
4322
  if (createError instanceof Error && (createError.name === "BucketAlreadyOwnedByYou" || createError.message.includes("you already own it"))) {
4262
4323
  await this.assertExistingBucketRegion(logicalId, resourceType, bucketName, region, createError);
4324
+ if (ambiguousWindow !== void 0) {
4325
+ windowSpent = true;
4326
+ this.refuseAmbiguousCreateAdopt(logicalId, resourceType, bucketName, canonicalRegion, { cause: createError });
4327
+ }
4263
4328
  this.logger.debug(`S3 bucket ${this.shown(bucketName)} already exists and is owned by you`);
4264
4329
  } else throw createError;
4265
4330
  }
@@ -4294,6 +4359,7 @@ var S3BucketProvider = class S3BucketProvider {
4294
4359
  ...effectiveProperties ? { effectiveProperties } : {}
4295
4360
  };
4296
4361
  } catch (error) {
4362
+ if (ambiguousWindow !== void 0 && !windowSpent) holdCreateBucketWindow(logicalId, ambiguousWindow);
4297
4363
  const thrown = this.wrapOperationError("create", logicalId, resourceType, bucketName, error);
4298
4364
  if (bucketLeftBehind) markCreatedBeforeFailure(thrown, logicalId, resourceType, bucketName);
4299
4365
  throw thrown;
@@ -10177,6 +10243,8 @@ function maskLeafValue(value, maskSecrets) {
10177
10243
  }
10178
10244
  var DynamoDBTableProvider = class {
10179
10245
  dynamoDBClient;
10246
+ createClient;
10247
+ credentialConfig;
10180
10248
  logger = getLogger().child("DynamoDBTableProvider");
10181
10249
  handledProperties = /* @__PURE__ */ new Map([["AWS::DynamoDB::Table", /* @__PURE__ */ new Set([
10182
10250
  "TableName",
@@ -10205,6 +10273,17 @@ var DynamoDBTableProvider = class {
10205
10273
  constructor() {
10206
10274
  const awsClients = getAwsClients();
10207
10275
  this.dynamoDBClient = awsClients.dynamoDB;
10276
+ this.credentialConfig = awsClients.credentialConfig ?? {};
10277
+ }
10278
+ getCreateClient() {
10279
+ this.createClient ??= this.dynamoDBClient.config.region().then((region) => withoutServerErrorRetries(new DynamoDBClient({
10280
+ ...clientDefaultsFor(this.credentialConfig),
10281
+ region
10282
+ })), (error) => {
10283
+ this.createClient = void 0;
10284
+ throw error;
10285
+ });
10286
+ return this.createClient;
10208
10287
  }
10209
10288
  getMinResourceTimeoutMs() {
10210
10289
  return DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS;
@@ -10268,7 +10347,7 @@ var DynamoDBTableProvider = class {
10268
10347
  if (properties["TableClass"]) createParams.TableClass = properties["TableClass"];
10269
10348
  const createResourcePolicyDoc = this.extractResourcePolicyDocument(properties["ResourcePolicy"]);
10270
10349
  if (createResourcePolicyDoc !== void 0) createParams.ResourcePolicy = createResourcePolicyDoc;
10271
- await this.dynamoDBClient.send(new CreateTableCommand(createParams));
10350
+ await (await this.getCreateClient()).send(new CreateTableCommand(createParams));
10272
10351
  tableCreated = true;
10273
10352
  this.logger.debug(`CreateTable initiated for ${tableName}, waiting for ACTIVE status`);
10274
10353
  const tableInfo = await this.waitForTableActive(tableName);
@@ -12727,6 +12806,8 @@ var SecretsManagerSecretProvider = class {
12727
12806
  //#region src/provisioning/providers/ssm-parameter-provider.ts
12728
12807
  var SSMParameterProvider = class SSMParameterProvider {
12729
12808
  ssmClient;
12809
+ createClient;
12810
+ credentialConfig;
12730
12811
  logger = getLogger().child("SSMParameterProvider");
12731
12812
  wrapMaskedError(mask, error, build) {
12732
12813
  return wrapMaskedAwsError(mask, error, build);
@@ -12745,6 +12826,19 @@ var SSMParameterProvider = class SSMParameterProvider {
12745
12826
  constructor() {
12746
12827
  const awsClients = getAwsClients();
12747
12828
  this.ssmClient = awsClients.ssm;
12829
+ this.credentialConfig = awsClients.credentialConfig ?? {};
12830
+ }
12831
+ getCreateClient() {
12832
+ const shared = this.ssmClient;
12833
+ if (!(shared instanceof SSMClient)) return Promise.resolve(shared);
12834
+ this.createClient ??= shared.config.region().then((region) => withoutServerErrorRetries(new SSMClient({
12835
+ ...clientDefaultsFor(this.credentialConfig),
12836
+ region
12837
+ })), (error) => {
12838
+ this.createClient = void 0;
12839
+ throw error;
12840
+ });
12841
+ return this.createClient;
12748
12842
  }
12749
12843
  static userTags(tags) {
12750
12844
  return tags.filter((t) => !t.Key.startsWith("aws:"));
@@ -12793,7 +12887,7 @@ var SSMParameterProvider = class SSMParameterProvider {
12793
12887
  if (properties["Tier"]) putParams.Tier = properties["Tier"];
12794
12888
  if (properties["Policies"]) putParams.Policies = properties["Policies"];
12795
12889
  if (properties["DataType"]) putParams.DataType = properties["DataType"];
12796
- await this.ssmClient.send(new PutParameterCommand(putParams));
12890
+ await (await this.getCreateClient()).send(new PutParameterCommand(putParams));
12797
12891
  leftBehind = true;
12798
12892
  try {
12799
12893
  if (ssmTags.length > 0) await this.ssmClient.send(new AddTagsToResourceCommand({
@@ -13737,10 +13831,18 @@ function isNamedError(error, names) {
13737
13831
  }
13738
13832
  const NAT_GATEWAY_NOT_FOUND_NAMES = /* @__PURE__ */ new Set(["NatGatewayNotFound"]);
13739
13833
  const EIP_ALLOCATION_NOT_FOUND_NAMES = /* @__PURE__ */ new Set(["InvalidAllocationID.NotFound"]);
13834
+ const INSTANCE_NOT_FOUND_NAMES = /* @__PURE__ */ new Set(["InvalidInstanceID.NotFound"]);
13835
+ const VPC_NOT_FOUND_NAMES = /* @__PURE__ */ new Set(["InvalidVpcID.NotFound"]);
13836
+ const SUBNET_NOT_FOUND_NAMES = /* @__PURE__ */ new Set(["InvalidSubnetID.NotFound"]);
13837
+ const SECURITY_GROUP_NOT_FOUND_NAMES = /* @__PURE__ */ new Set(["InvalidGroup.NotFound"]);
13740
13838
  const NAT_GATEWAY_ID_PATTERN = /^nat-[0-9a-f]+$/;
13741
13839
  const EIP_ALLOCATION_ID_PATTERN = /^eipalloc-[0-9a-f]+$/;
13742
- function natGatewayIdentity(physicalId) {
13743
- return NAT_GATEWAY_ID_PATTERN.test(physicalId) ? physicalId : void 0;
13840
+ const INSTANCE_ID_PATTERN = /^i-[0-9a-f]+$/;
13841
+ const VPC_ID_PATTERN = /^vpc-[0-9a-f]+$/;
13842
+ const SUBNET_ID_PATTERN = /^subnet-[0-9a-f]+$/;
13843
+ const SECURITY_GROUP_ID_PATTERN = /^sg-[0-9a-f]+$/;
13844
+ function generatedIdIdentity(pattern, physicalId) {
13845
+ return pattern.test(physicalId) ? physicalId : void 0;
13744
13846
  }
13745
13847
  function eipAllocationIdentity(physicalId) {
13746
13848
  const segments = physicalId.split("|");
@@ -14080,17 +14182,28 @@ var EC2Provider = class {
14080
14182
  }
14081
14183
  async isSameResource(journaledPhysicalId, record, resourceType, context) {
14082
14184
  let read;
14083
- let journaledId;
14084
- let recordId;
14185
+ let identity;
14085
14186
  if (resourceType === "AWS::EC2::NatGateway") {
14086
- journaledId = natGatewayIdentity(journaledPhysicalId);
14087
- recordId = natGatewayIdentity(record.physicalId);
14187
+ identity = (id) => generatedIdIdentity(NAT_GATEWAY_ID_PATTERN, id);
14088
14188
  read = (id) => this.readNatGatewayIdIfLive(id);
14089
14189
  } else if (resourceType === "AWS::EC2::EIP") {
14090
- journaledId = eipAllocationIdentity(journaledPhysicalId);
14091
- recordId = eipAllocationIdentity(record.physicalId);
14190
+ identity = eipAllocationIdentity;
14092
14191
  read = (id) => this.readEipAllocationIdIfExists(id);
14192
+ } else if (resourceType === "AWS::EC2::Instance") {
14193
+ identity = (id) => generatedIdIdentity(INSTANCE_ID_PATTERN, id);
14194
+ read = (id) => this.readInstanceIdIfLive(id);
14195
+ } else if (resourceType === "AWS::EC2::VPC") {
14196
+ identity = (id) => generatedIdIdentity(VPC_ID_PATTERN, id);
14197
+ read = (id) => this.readVpcIdIfLive(id);
14198
+ } else if (resourceType === "AWS::EC2::Subnet") {
14199
+ identity = (id) => generatedIdIdentity(SUBNET_ID_PATTERN, id);
14200
+ read = (id) => this.readSubnetIdIfLive(id);
14201
+ } else if (resourceType === "AWS::EC2::SecurityGroup") {
14202
+ identity = (id) => generatedIdIdentity(SECURITY_GROUP_ID_PATTERN, id);
14203
+ read = (id) => this.readSecurityGroupIdIfExists(id);
14093
14204
  } else return "unknown";
14205
+ const journaledId = identity(journaledPhysicalId);
14206
+ const recordId = identity(record.physicalId);
14094
14207
  if (journaledId === void 0 || recordId === void 0) return "unknown";
14095
14208
  if (journaledId === recordId) return "same";
14096
14209
  if (resourceType === "AWS::EC2::EIP" && journaledPhysicalId === journaledId) return "unknown";
@@ -14111,6 +14224,65 @@ var EC2Provider = class {
14111
14224
  const gateway = gateways[0];
14112
14225
  return gateway.State === "pending" || gateway.State === "available" ? gateway.NatGatewayId : void 0;
14113
14226
  }
14227
+ async readInstanceIdIfLive(instanceId) {
14228
+ let response;
14229
+ try {
14230
+ response = await this.ec2Client.send(new DescribeInstancesCommand({ InstanceIds: [instanceId] }));
14231
+ } catch (error) {
14232
+ if (isNamedError(error, INSTANCE_NOT_FOUND_NAMES)) return void 0;
14233
+ throw error;
14234
+ }
14235
+ const instances = (response.Reservations ?? []).flatMap((r) => r.Instances ?? []);
14236
+ if (instances.length !== 1 || typeof instances[0]?.InstanceId !== "string") throw new Error("DescribeInstances did not return exactly the instance asked for");
14237
+ const instance = instances[0];
14238
+ const state = instance.State?.Name;
14239
+ if (state === "shutting-down" || state === "terminated") return void 0;
14240
+ if (state === "pending" || state === "running" || state === "stopping" || state === "stopped") return instance.InstanceId;
14241
+ throw new Error("DescribeInstances returned an instance in no known state");
14242
+ }
14243
+ async readVpcIdIfLive(vpcId) {
14244
+ let response;
14245
+ try {
14246
+ response = await this.ec2Client.send(new DescribeVpcsCommand({ VpcIds: [vpcId] }));
14247
+ } catch (error) {
14248
+ if (isNamedError(error, VPC_NOT_FOUND_NAMES)) return void 0;
14249
+ throw error;
14250
+ }
14251
+ const vpcs = response.Vpcs ?? [];
14252
+ if (vpcs.length !== 1 || typeof vpcs[0]?.VpcId !== "string") throw new Error("DescribeVpcs did not return exactly the VPC asked for");
14253
+ const vpc = vpcs[0];
14254
+ if (vpc.State === "deleting") return void 0;
14255
+ if (vpc.State === "pending" || vpc.State === "available") return vpc.VpcId;
14256
+ throw new Error("DescribeVpcs returned a VPC in no known state");
14257
+ }
14258
+ async readSubnetIdIfLive(subnetId) {
14259
+ let response;
14260
+ try {
14261
+ response = await this.ec2Client.send(new DescribeSubnetsCommand({ SubnetIds: [subnetId] }));
14262
+ } catch (error) {
14263
+ if (isNamedError(error, SUBNET_NOT_FOUND_NAMES)) return void 0;
14264
+ throw error;
14265
+ }
14266
+ const subnets = response.Subnets ?? [];
14267
+ if (subnets.length !== 1 || typeof subnets[0]?.SubnetId !== "string") throw new Error("DescribeSubnets did not return exactly the subnet asked for");
14268
+ const subnet = subnets[0];
14269
+ const state = subnet.State;
14270
+ if (state === "pending" || state === "available") return subnet.SubnetId;
14271
+ if (state === "failed" || state === "failed-insufficient-capacity" || state === "unavailable") return;
14272
+ throw new Error("DescribeSubnets returned a subnet in no known state");
14273
+ }
14274
+ async readSecurityGroupIdIfExists(groupId) {
14275
+ let response;
14276
+ try {
14277
+ response = await this.ec2Client.send(new DescribeSecurityGroupsCommand({ GroupIds: [groupId] }));
14278
+ } catch (error) {
14279
+ if (isNamedError(error, SECURITY_GROUP_NOT_FOUND_NAMES)) return void 0;
14280
+ throw error;
14281
+ }
14282
+ const groups = response.SecurityGroups ?? [];
14283
+ if (groups.length !== 1 || typeof groups[0]?.GroupId !== "string") throw new Error("DescribeSecurityGroups did not return exactly the group asked for");
14284
+ return groups[0].GroupId;
14285
+ }
14114
14286
  async readEipAllocationIdIfExists(allocationId) {
14115
14287
  let response;
14116
14288
  try {
@@ -14238,10 +14410,11 @@ var EC2Provider = class {
14238
14410
  this.logger.debug(`Successfully deleted VPC ${logicalId}`);
14239
14411
  return;
14240
14412
  } catch (error) {
14241
- if (this.isNotFoundError(error)) {
14413
+ if (this.isNotFoundError(error) && (context?.failedCreateOrphan !== true || isNamedError(error, VPC_NOT_FOUND_NAMES))) {
14242
14414
  const clientRegion = await this.ec2Client.config.region();
14243
14415
  assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
14244
- this.logger.debug(`VPC ${physicalId} does not exist, skipping deletion`);
14416
+ if (context?.failedCreateOrphan === true) this.logger.info(safeMsg` VPC ${physicalId} (${logicalId}), which a failed deploy created, is already gone; nothing to delete`);
14417
+ else this.logger.debug(`VPC ${physicalId} does not exist, skipping deletion`);
14245
14418
  return;
14246
14419
  }
14247
14420
  const msg = describeAwsFailure(error).detail;
@@ -14402,10 +14575,11 @@ var EC2Provider = class {
14402
14575
  this.logger.debug(`Successfully deleted Subnet ${logicalId}`);
14403
14576
  return;
14404
14577
  } catch (error) {
14405
- if (this.isNotFoundError(error)) {
14578
+ if (this.isNotFoundError(error) && (context?.failedCreateOrphan !== true || isNamedError(error, SUBNET_NOT_FOUND_NAMES))) {
14406
14579
  const clientRegion = await this.ec2Client.config.region();
14407
14580
  assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
14408
- this.logger.debug(`Subnet ${physicalId} does not exist, skipping deletion`);
14581
+ if (context?.failedCreateOrphan === true) this.logger.info(safeMsg` Subnet ${physicalId} (${logicalId}), which a failed deploy created, is already gone; nothing to delete`);
14582
+ else this.logger.debug(`Subnet ${physicalId} does not exist, skipping deletion`);
14409
14583
  return;
14410
14584
  }
14411
14585
  const msg = describeAwsFailure(error).detail;
@@ -15086,10 +15260,11 @@ var EC2Provider = class {
15086
15260
  this.logger.debug(`Successfully deleted SecurityGroup ${logicalId}`);
15087
15261
  return;
15088
15262
  } catch (error) {
15089
- if (this.isNotFoundError(error)) {
15263
+ if (this.isNotFoundError(error) && (context?.failedCreateOrphan !== true || isNamedError(error, SECURITY_GROUP_NOT_FOUND_NAMES))) {
15090
15264
  const clientRegion = await this.ec2Client.config.region();
15091
15265
  assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
15092
- this.logger.debug(`SecurityGroup ${physicalId} does not exist, skipping deletion`);
15266
+ if (context?.failedCreateOrphan === true) this.logger.info(safeMsg` Security group ${physicalId} (${logicalId}), which a failed deploy created, is already gone; nothing to delete`);
15267
+ else this.logger.debug(`SecurityGroup ${physicalId} does not exist, skipping deletion`);
15093
15268
  return;
15094
15269
  }
15095
15270
  const msg = describeAwsFailure(error).detail;
@@ -15759,7 +15934,8 @@ var EC2Provider = class {
15759
15934
  if (this.isNotFoundError(error)) {
15760
15935
  const clientRegion = await this.ec2Client.config.region();
15761
15936
  assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
15762
- this.logger.debug(`EC2 Instance ${physicalId} already terminated (not found), treating as success`);
15937
+ if (context?.failedCreateOrphan === true) this.logger.info(safeMsg` EC2 instance ${physicalId} (${logicalId}), which a failed deploy created, is already gone; nothing to delete`);
15938
+ else this.logger.debug(`EC2 Instance ${physicalId} already terminated (not found), treating as success`);
15763
15939
  return;
15764
15940
  }
15765
15941
  const msg = describeAwsFailure(error).detail;
@@ -19907,16 +20083,31 @@ var CloudFrontOAIProvider = class {
19907
20083
  //#region src/provisioning/providers/cloudfront-oac-provider.ts
19908
20084
  var CloudFrontOACProvider = class {
19909
20085
  cloudFrontClient;
20086
+ createClient;
20087
+ credentialConfig;
19910
20088
  logger = getLogger().child("CloudFrontOACProvider");
19911
20089
  handledProperties = /* @__PURE__ */ new Map([["AWS::CloudFront::OriginAccessControl", /* @__PURE__ */ new Set(["OriginAccessControlConfig"])]]);
19912
20090
  constructor() {
19913
20091
  const awsClients = getAwsClients();
19914
20092
  this.cloudFrontClient = awsClients.cloudFront;
20093
+ this.credentialConfig = awsClients.credentialConfig ?? {};
20094
+ }
20095
+ getCreateClient() {
20096
+ const shared = this.cloudFrontClient;
20097
+ if (!(shared instanceof CloudFrontClient)) return Promise.resolve(shared);
20098
+ this.createClient ??= shared.config.region().then((region) => withoutServerErrorRetries(new CloudFrontClient({
20099
+ ...clientDefaultsFor(this.credentialConfig),
20100
+ region
20101
+ })), (error) => {
20102
+ this.createClient = void 0;
20103
+ throw error;
20104
+ });
20105
+ return this.createClient;
19915
20106
  }
19916
20107
  async create(logicalId, resourceType, properties) {
19917
20108
  this.logger.debug(`Creating CloudFront Origin Access Control ${logicalId}`);
19918
20109
  try {
19919
- const oacId = (await this.cloudFrontClient.send(new CreateOriginAccessControlCommand({ OriginAccessControlConfig: this.toSdkConfig(properties["OriginAccessControlConfig"], logicalId, resourceType) }))).OriginAccessControl?.Id;
20110
+ const oacId = (await (await this.getCreateClient()).send(new CreateOriginAccessControlCommand({ OriginAccessControlConfig: this.toSdkConfig(properties["OriginAccessControlConfig"], logicalId, resourceType) }))).OriginAccessControl?.Id;
19920
20111
  if (!oacId) throw new Error("CreateOriginAccessControl returned no OriginAccessControl.Id");
19921
20112
  this.logger.debug(`Created CloudFront Origin Access Control: ${oacId}`);
19922
20113
  return {
@@ -23111,6 +23302,15 @@ function isElbv2NotFoundName(error) {
23111
23302
  const name = error?.name;
23112
23303
  return name === "LoadBalancerNotFoundException" || name === "TargetGroupNotFoundException" || name === "ListenerNotFoundException";
23113
23304
  }
23305
+ const ELBV2_ARN_PATTERNS = /* @__PURE__ */ new Map([
23306
+ ["AWS::ElasticLoadBalancingV2::LoadBalancer", /^arn:(aws[a-z-]*):elasticloadbalancing:([a-z0-9-]+):(\d{12}):loadbalancer\/(?:app|net|gwy)\/[A-Za-z0-9-]+\/[0-9a-f]+$/],
23307
+ ["AWS::ElasticLoadBalancingV2::TargetGroup", /^arn:(aws[a-z-]*):elasticloadbalancing:([a-z0-9-]+):(\d{12}):targetgroup\/[A-Za-z0-9-]+\/[0-9a-f]+$/],
23308
+ ["AWS::ElasticLoadBalancingV2::Listener", /^arn:(aws[a-z-]*):elasticloadbalancing:([a-z0-9-]+):(\d{12}):listener\/(?:app|net|gwy)\/[A-Za-z0-9-]+\/[0-9a-f]+\/[0-9a-f]+$/]
23309
+ ]);
23310
+ function elbv2ArnScope(resourceType, physicalId) {
23311
+ const match = ELBV2_ARN_PATTERNS.get(resourceType)?.exec(physicalId);
23312
+ return match ? `${match[1]}:${match[2]}:${match[3]}` : void 0;
23313
+ }
23114
23314
  var ELBv2Provider = class {
23115
23315
  elbv2Client;
23116
23316
  providerRegion = ambientRegion();
@@ -23164,7 +23364,8 @@ var ELBv2Provider = class {
23164
23364
  "SslPolicy",
23165
23365
  "AlpnPolicy",
23166
23366
  "MutualAuthentication",
23167
- "ListenerAttributes"
23367
+ "ListenerAttributes",
23368
+ "Tags"
23168
23369
  ])]
23169
23370
  ]);
23170
23371
  getClient() {
@@ -23180,6 +23381,13 @@ var ELBv2Provider = class {
23180
23381
  maskErrorMessage(error, maskSecrets) {
23181
23382
  return maskerOrIdentity(maskSecrets)(error instanceof Error ? error.message : String(error));
23182
23383
  }
23384
+ isDeleteTargetGone(error, context, notFoundName) {
23385
+ return context?.failedCreateOrphan === true ? hasErrorName(error, [notFoundName]) : this.isNotFoundError(error);
23386
+ }
23387
+ logDeleteTargetGone(context, what, physicalId, logicalId, debugText) {
23388
+ if (context?.failedCreateOrphan === true) this.logger.info(safeMsg` ${what} ${physicalId} (${logicalId}), which a failed deploy created, is already gone; nothing to delete`);
23389
+ else this.logger.debug(debugText);
23390
+ }
23183
23391
  wrapMaskedError(mask, error, build) {
23184
23392
  return wrapMaskedAwsError(mask, error, build);
23185
23393
  }
@@ -23217,6 +23425,47 @@ var ELBv2Provider = class {
23217
23425
  default: throw new ProvisioningError(`Unsupported resource type: ${resourceType}`, resourceType, logicalId, physicalId);
23218
23426
  }
23219
23427
  }
23428
+ async isSameResource(journaledPhysicalId, record, resourceType, context) {
23429
+ const journaledScope = elbv2ArnScope(resourceType, journaledPhysicalId);
23430
+ const recordScope = elbv2ArnScope(resourceType, record.physicalId);
23431
+ if (journaledScope === void 0 || journaledScope !== recordScope) return "unknown";
23432
+ if (journaledPhysicalId === record.physicalId) return "same";
23433
+ if (journaledScope.split(":")[1] !== context.expectedRegion) return "unknown";
23434
+ if (await this.getClient().config.region() !== context.expectedRegion) return "unknown";
23435
+ if (await this.readElbv2ArnIfExists(resourceType, record.physicalId) !== record.physicalId) return "unknown";
23436
+ const journaledLive = await this.readElbv2ArnIfExists(resourceType, journaledPhysicalId);
23437
+ if (journaledLive === record.physicalId) return "same";
23438
+ return journaledLive === void 0 || journaledLive === journaledPhysicalId ? "different" : "unknown";
23439
+ }
23440
+ async readElbv2ArnIfExists(resourceType, arn) {
23441
+ let notFoundName;
23442
+ let read;
23443
+ switch (resourceType) {
23444
+ case "AWS::ElasticLoadBalancingV2::LoadBalancer":
23445
+ notFoundName = "LoadBalancerNotFoundException";
23446
+ read = async () => (await this.getClient().send(new DescribeLoadBalancersCommand({ LoadBalancerArns: [arn] }))).LoadBalancers?.map((lb) => lb.LoadBalancerArn);
23447
+ break;
23448
+ case "AWS::ElasticLoadBalancingV2::TargetGroup":
23449
+ notFoundName = "TargetGroupNotFoundException";
23450
+ read = async () => (await this.getClient().send(new DescribeTargetGroupsCommand({ TargetGroupArns: [arn] }))).TargetGroups?.map((tg) => tg.TargetGroupArn);
23451
+ break;
23452
+ case "AWS::ElasticLoadBalancingV2::Listener":
23453
+ notFoundName = "ListenerNotFoundException";
23454
+ read = async () => (await this.getClient().send(new DescribeListenersCommand({ ListenerArns: [arn] }))).Listeners?.map((l) => l.ListenerArn);
23455
+ break;
23456
+ default: throw new Error(`No ELBv2 identity read for ${resourceType}`);
23457
+ }
23458
+ let arns;
23459
+ try {
23460
+ arns = await read();
23461
+ } catch (error) {
23462
+ if (error?.name === notFoundName) return void 0;
23463
+ throw error;
23464
+ }
23465
+ const found = arns ?? [];
23466
+ if (found.length !== 1 || typeof found[0] !== "string" || found[0] === "") throw new Error("ELBv2 did not return exactly the resource asked for");
23467
+ return found[0];
23468
+ }
23220
23469
  async createLoadBalancer(logicalId, resourceType, properties, maskSecrets) {
23221
23470
  this.logger.debug(`Creating LoadBalancer ${logicalId}`);
23222
23471
  const tags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
@@ -23490,10 +23739,10 @@ var ELBv2Provider = class {
23490
23739
  flip.deleteAccepted = true;
23491
23740
  this.logger.debug(`Successfully deleted LoadBalancer ${logicalId}`);
23492
23741
  } catch (error) {
23493
- if (this.isNotFoundError(error)) {
23742
+ if (this.isDeleteTargetGone(error, context, "LoadBalancerNotFoundException")) {
23494
23743
  const clientRegion = await this.getClient().config.region();
23495
23744
  assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
23496
- this.logger.debug(`LoadBalancer ${physicalId} does not exist, skipping deletion`);
23745
+ this.logDeleteTargetGone(context, "Load balancer", physicalId, logicalId, `LoadBalancer ${physicalId} does not exist, skipping deletion`);
23497
23746
  return;
23498
23747
  }
23499
23748
  const cause = error instanceof Error ? error : void 0;
@@ -23657,10 +23906,10 @@ var ELBv2Provider = class {
23657
23906
  await this.getClient().send(new DeleteTargetGroupCommand({ TargetGroupArn: physicalId }));
23658
23907
  this.logger.debug(`Successfully deleted TargetGroup ${logicalId}`);
23659
23908
  } catch (error) {
23660
- if (this.isNotFoundError(error)) {
23909
+ if (this.isDeleteTargetGone(error, context, "TargetGroupNotFoundException")) {
23661
23910
  const clientRegion = await this.getClient().config.region();
23662
23911
  assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
23663
- this.logger.debug(`TargetGroup ${physicalId} does not exist, skipping deletion`);
23912
+ this.logDeleteTargetGone(context, "Target group", physicalId, logicalId, `TargetGroup ${physicalId} does not exist, skipping deletion`);
23664
23913
  return;
23665
23914
  }
23666
23915
  const cause = error instanceof Error ? error : void 0;
@@ -23801,10 +24050,10 @@ var ELBv2Provider = class {
23801
24050
  await this.getClient().send(new DeleteListenerCommand({ ListenerArn: physicalId }));
23802
24051
  this.logger.debug(`Successfully deleted Listener ${logicalId}`);
23803
24052
  } catch (error) {
23804
- if (this.isNotFoundError(error)) {
24053
+ if (this.isDeleteTargetGone(error, context, "ListenerNotFoundException")) {
23805
24054
  const clientRegion = await this.getClient().config.region();
23806
24055
  assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
23807
- this.logger.debug(`Listener ${physicalId} does not exist, skipping deletion`);
24056
+ this.logDeleteTargetGone(context, "Listener", physicalId, logicalId, `Listener ${physicalId} does not exist, skipping deletion`);
23808
24057
  return;
23809
24058
  }
23810
24059
  const cause = error instanceof Error ? error : void 0;
@@ -24221,6 +24470,7 @@ const RETAINED_ON_REMOVAL = [
24221
24470
  ];
24222
24471
  var RDSDBProxyProvider = class {
24223
24472
  rdsClient;
24473
+ createClient;
24224
24474
  providerRegion = ambientRegion();
24225
24475
  logger = getLogger().child("RDSDBProxyProvider");
24226
24476
  attributeCache = /* @__PURE__ */ new Map();
@@ -24237,12 +24487,22 @@ var RDSDBProxyProvider = class {
24237
24487
  "Tags"
24238
24488
  ])]]);
24239
24489
  getClient() {
24240
- if (!this.rdsClient) this.rdsClient = new RDSClient({
24241
- ...ambientClientDefaults(),
24242
- ...this.providerRegion ? { region: this.providerRegion } : {}
24243
- });
24490
+ if (!this.rdsClient) {
24491
+ this.rdsClient = new RDSClient({
24492
+ ...ambientClientDefaults(),
24493
+ ...this.providerRegion ? { region: this.providerRegion } : {}
24494
+ });
24495
+ this.createClient = withoutServerErrorRetries(new RDSClient({
24496
+ ...ambientClientDefaults(),
24497
+ ...this.providerRegion ? { region: this.providerRegion } : {}
24498
+ }));
24499
+ }
24244
24500
  return this.rdsClient;
24245
24501
  }
24502
+ getCreateClient() {
24503
+ this.getClient();
24504
+ return this.createClient;
24505
+ }
24246
24506
  async create(logicalId, resourceType, properties) {
24247
24507
  const tags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId, void 0, "Tags", DBPROXY_TAGS_WHAT, DBPROXY_TAG_OPTIONS);
24248
24508
  const dbProxyName = properties["DBProxyName"] ?? generateResourceName(logicalId, { maxLength: 64 });
@@ -24257,7 +24517,7 @@ var RDSDBProxyProvider = class {
24257
24517
  const client = this.getClient();
24258
24518
  this.logger.debug(`Creating DBProxy ${dbProxyName} (${engineFamily})`);
24259
24519
  try {
24260
- await client.send(new CreateDBProxyCommand({
24520
+ await this.getCreateClient().send(new CreateDBProxyCommand({
24261
24521
  DBProxyName: dbProxyName,
24262
24522
  EngineFamily: engineFamily,
24263
24523
  Auth: auth,
@@ -24535,6 +24795,7 @@ const POLL_INTERVAL_MS = 5e3;
24535
24795
  const POLL_TIMEOUT_MS = 18e5;
24536
24796
  var RDSDBProxyEndpointProvider = class {
24537
24797
  rdsClient;
24798
+ createClient;
24538
24799
  providerRegion = ambientRegion();
24539
24800
  logger = getLogger().child("RDSDBProxyEndpointProvider");
24540
24801
  attributeCache = /* @__PURE__ */ new Map();
@@ -24547,12 +24808,22 @@ var RDSDBProxyEndpointProvider = class {
24547
24808
  "Tags"
24548
24809
  ])]]);
24549
24810
  getClient() {
24550
- if (!this.rdsClient) this.rdsClient = new RDSClient({
24551
- ...ambientClientDefaults(),
24552
- ...this.providerRegion ? { region: this.providerRegion } : {}
24553
- });
24811
+ if (!this.rdsClient) {
24812
+ this.rdsClient = new RDSClient({
24813
+ ...ambientClientDefaults(),
24814
+ ...this.providerRegion ? { region: this.providerRegion } : {}
24815
+ });
24816
+ this.createClient = withoutServerErrorRetries(new RDSClient({
24817
+ ...ambientClientDefaults(),
24818
+ ...this.providerRegion ? { region: this.providerRegion } : {}
24819
+ }));
24820
+ }
24554
24821
  return this.rdsClient;
24555
24822
  }
24823
+ getCreateClient() {
24824
+ this.getClient();
24825
+ return this.createClient;
24826
+ }
24556
24827
  async create(logicalId, resourceType, properties) {
24557
24828
  const tags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId, void 0, "Tags", DBPROXY_TAGS_WHAT, DBPROXY_TAG_OPTIONS);
24558
24829
  const dbProxyName = properties["DBProxyName"];
@@ -24563,7 +24834,7 @@ var RDSDBProxyEndpointProvider = class {
24563
24834
  const client = this.getClient();
24564
24835
  this.logger.debug(`Creating DBProxyEndpoint ${dbProxyEndpointName} (proxy=${dbProxyName})`);
24565
24836
  try {
24566
- await client.send(new CreateDBProxyEndpointCommand({
24837
+ await this.getCreateClient().send(new CreateDBProxyEndpointCommand({
24567
24838
  DBProxyName: dbProxyName,
24568
24839
  DBProxyEndpointName: dbProxyEndpointName,
24569
24840
  VpcSubnetIds: vpcSubnetIds,
@@ -25374,6 +25645,7 @@ function instanceAttributes(instance) {
25374
25645
  }
25375
25646
  var DocDBProvider = class {
25376
25647
  docdbClient;
25648
+ createClient;
25377
25649
  providerRegion = ambientRegion();
25378
25650
  logger = getLogger().child("DocDBProvider");
25379
25651
  protectionFlips = new ProtectionFlipRegistry();
@@ -25405,12 +25677,22 @@ var DocDBProvider = class {
25405
25677
  "Tags"
25406
25678
  ])]]);
25407
25679
  getClient() {
25408
- if (!this.docdbClient) this.docdbClient = new DocDBClient({
25409
- ...ambientClientDefaults(),
25410
- ...this.providerRegion ? { region: this.providerRegion } : {}
25411
- });
25680
+ if (!this.docdbClient) {
25681
+ this.docdbClient = new DocDBClient({
25682
+ ...ambientClientDefaults(),
25683
+ ...this.providerRegion ? { region: this.providerRegion } : {}
25684
+ });
25685
+ this.createClient = withoutServerErrorRetries(new DocDBClient({
25686
+ ...ambientClientDefaults(),
25687
+ ...this.providerRegion ? { region: this.providerRegion } : {}
25688
+ }));
25689
+ }
25412
25690
  return this.docdbClient;
25413
25691
  }
25692
+ getCreateClient() {
25693
+ this.getClient();
25694
+ return this.createClient;
25695
+ }
25414
25696
  async create(logicalId, resourceType, properties) {
25415
25697
  switch (resourceType) {
25416
25698
  case "AWS::DocDB::DBCluster": return this.createDBCluster(logicalId, resourceType, properties);
@@ -25442,7 +25724,7 @@ var DocDBProvider = class {
25442
25724
  });
25443
25725
  let clusterCreated = false;
25444
25726
  try {
25445
- const response = await this.getClient().send(new CreateDBClusterCommand$1({
25727
+ const response = await this.getCreateClient().send(new CreateDBClusterCommand$1({
25446
25728
  DBClusterIdentifier: dbClusterIdentifier,
25447
25729
  Engine: "docdb",
25448
25730
  EngineVersion: properties["EngineVersion"],
@@ -25588,7 +25870,7 @@ var DocDBProvider = class {
25588
25870
  });
25589
25871
  let instanceCreated = false;
25590
25872
  try {
25591
- const response = await this.getClient().send(new CreateDBInstanceCommand$1({
25873
+ const response = await this.getCreateClient().send(new CreateDBInstanceCommand$1({
25592
25874
  DBInstanceIdentifier: dbInstanceIdentifier,
25593
25875
  DBInstanceClass: properties["DBInstanceClass"],
25594
25876
  Engine: "docdb",
@@ -25816,6 +26098,7 @@ var DocDBProvider = class {
25816
26098
  //#region src/provisioning/providers/docdb-subnet-group-provider.ts
25817
26099
  var DocDBSubnetGroupProvider = class {
25818
26100
  docdbClient;
26101
+ createClient;
25819
26102
  providerRegion = ambientRegion();
25820
26103
  logger = getLogger().child("DocDBSubnetGroupProvider");
25821
26104
  handledProperties = /* @__PURE__ */ new Map([["AWS::DocDB::DBSubnetGroup", /* @__PURE__ */ new Set([
@@ -25825,12 +26108,22 @@ var DocDBSubnetGroupProvider = class {
25825
26108
  "Tags"
25826
26109
  ])]]);
25827
26110
  getClient() {
25828
- if (!this.docdbClient) this.docdbClient = new DocDBClient({
25829
- ...ambientClientDefaults(),
25830
- ...this.providerRegion ? { region: this.providerRegion } : {}
25831
- });
26111
+ if (!this.docdbClient) {
26112
+ this.docdbClient = new DocDBClient({
26113
+ ...ambientClientDefaults(),
26114
+ ...this.providerRegion ? { region: this.providerRegion } : {}
26115
+ });
26116
+ this.createClient = withoutServerErrorRetries(new DocDBClient({
26117
+ ...ambientClientDefaults(),
26118
+ ...this.providerRegion ? { region: this.providerRegion } : {}
26119
+ }));
26120
+ }
25832
26121
  return this.docdbClient;
25833
26122
  }
26123
+ getCreateClient() {
26124
+ this.getClient();
26125
+ return this.createClient;
26126
+ }
25834
26127
  assertType(resourceType, logicalId, physicalId) {
25835
26128
  if (resourceType !== "AWS::DocDB::DBSubnetGroup") throw new ProvisioningError(`Unsupported resource type: ${resourceType}`, resourceType, logicalId, physicalId);
25836
26129
  }
@@ -25843,7 +26136,7 @@ var DocDBSubnetGroupProvider = class {
25843
26136
  lowercase: true
25844
26137
  });
25845
26138
  try {
25846
- await this.getClient().send(new CreateDBSubnetGroupCommand$1({
26139
+ await this.getCreateClient().send(new CreateDBSubnetGroupCommand$1({
25847
26140
  DBSubnetGroupName: dbSubnetGroupName,
25848
26141
  DBSubnetGroupDescription: properties["DBSubnetGroupDescription"] || `Subnet group for ${logicalId}`,
25849
26142
  SubnetIds: properties["SubnetIds"],
@@ -27176,6 +27469,7 @@ function collectSdkUnsupportedRuleKeys(value, found) {
27176
27469
  }
27177
27470
  var WAFv2WebACLProvider = class {
27178
27471
  wafv2Client;
27472
+ createClient;
27179
27473
  providerRegion = ambientRegion();
27180
27474
  logger = getLogger().child("WAFv2WebACLProvider");
27181
27475
  handledProperties = /* @__PURE__ */ new Map([["AWS::WAFv2::WebACL", /* @__PURE__ */ new Set([
@@ -27193,12 +27487,22 @@ var WAFv2WebACLProvider = class {
27193
27487
  "AssociationConfig"
27194
27488
  ])]]);
27195
27489
  getClient() {
27196
- if (!this.wafv2Client) this.wafv2Client = new WAFV2Client({
27197
- ...ambientClientDefaults(),
27198
- ...this.providerRegion ? { region: this.providerRegion } : {}
27199
- });
27490
+ if (!this.wafv2Client) {
27491
+ this.wafv2Client = new WAFV2Client({
27492
+ ...ambientClientDefaults(),
27493
+ ...this.providerRegion ? { region: this.providerRegion } : {}
27494
+ });
27495
+ this.createClient = withoutServerErrorRetries(new WAFV2Client({
27496
+ ...ambientClientDefaults(),
27497
+ ...this.providerRegion ? { region: this.providerRegion } : {}
27498
+ }));
27499
+ }
27200
27500
  return this.wafv2Client;
27201
27501
  }
27502
+ getCreateClient() {
27503
+ this.getClient();
27504
+ return this.createClient;
27505
+ }
27202
27506
  async create(logicalId, resourceType, properties, context) {
27203
27507
  this.logger.debug(`Creating WAFv2 WebACL ${logicalId}`);
27204
27508
  const desiredTags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
@@ -27210,7 +27514,7 @@ var WAFv2WebACLProvider = class {
27210
27514
  Key: tag.Key,
27211
27515
  Value: tag.Value
27212
27516
  }));
27213
- const summary = (await this.getClient().send(new CreateWebACLCommand({
27517
+ const summary = (await this.getCreateClient().send(new CreateWebACLCommand({
27214
27518
  Name: name,
27215
27519
  Scope: scope,
27216
27520
  DefaultAction: properties["DefaultAction"],
@@ -28392,6 +28696,7 @@ var CognitoUserPoolProvider = class {
28392
28696
  const CACHE_DELETE_WAIT_MS = Math.max(6e5, slowCcOperationTimeoutMs("AWS::ElastiCache::CacheCluster", "DELETE"));
28393
28697
  var ElastiCacheProvider = class {
28394
28698
  client;
28699
+ createClient;
28395
28700
  providerRegion = ambientRegion();
28396
28701
  logger = getLogger().child("ElastiCacheProvider");
28397
28702
  removalDefaults = /* @__PURE__ */ new Map([["AWS::ElastiCache::CacheCluster", /* @__PURE__ */ new Map([["AutoMinorVersionUpgrade", true]])]]);
@@ -28428,12 +28733,22 @@ var ElastiCacheProvider = class {
28428
28733
  ])]]);
28429
28734
  unhandledByDesign = /* @__PURE__ */ new Map([["AWS::ElastiCache::CacheCluster", /* @__PURE__ */ new Map([["CacheSecurityGroupNames", "EC2-Classic-only — use VpcSecurityGroupIds for VPC-deployed clusters (EC2-Classic retired 2022-08-15)"]])]]);
28430
28735
  getClient() {
28431
- if (!this.client) this.client = new ElastiCacheClient({
28432
- ...ambientClientDefaults(),
28433
- ...this.providerRegion ? { region: this.providerRegion } : {}
28434
- });
28736
+ if (!this.client) {
28737
+ this.client = new ElastiCacheClient({
28738
+ ...ambientClientDefaults(),
28739
+ ...this.providerRegion ? { region: this.providerRegion } : {}
28740
+ });
28741
+ this.createClient = withoutServerErrorRetries(new ElastiCacheClient({
28742
+ ...ambientClientDefaults(),
28743
+ ...this.providerRegion ? { region: this.providerRegion } : {}
28744
+ }));
28745
+ }
28435
28746
  return this.client;
28436
28747
  }
28748
+ getCreateClient() {
28749
+ this.getClient();
28750
+ return this.createClient;
28751
+ }
28437
28752
  async create(logicalId, resourceType, properties) {
28438
28753
  switch (resourceType) {
28439
28754
  case "AWS::ElastiCache::SubnetGroup": return this.createSubnetGroup(logicalId, resourceType, properties);
@@ -28464,7 +28779,7 @@ var ElastiCacheProvider = class {
28464
28779
  lowercase: true
28465
28780
  });
28466
28781
  try {
28467
- await this.getClient().send(new CreateCacheSubnetGroupCommand({
28782
+ await this.getCreateClient().send(new CreateCacheSubnetGroupCommand({
28468
28783
  CacheSubnetGroupName: cacheSubnetGroupName,
28469
28784
  CacheSubnetGroupDescription: properties["Description"] ?? properties["CacheSubnetGroupDescription"] ?? `Subnet group for ${logicalId}`,
28470
28785
  SubnetIds: properties["SubnetIds"],
@@ -28532,7 +28847,7 @@ var ElastiCacheProvider = class {
28532
28847
  });
28533
28848
  let clusterCreated = false;
28534
28849
  try {
28535
- await this.getClient().send(new CreateCacheClusterCommand({
28850
+ await this.getCreateClient().send(new CreateCacheClusterCommand({
28536
28851
  CacheClusterId: cacheClusterId,
28537
28852
  Engine: properties["Engine"],
28538
28853
  CacheNodeType: properties["CacheNodeType"],
@@ -31450,8 +31765,21 @@ function makeCallerAccountResolver(region) {
31450
31765
  return cached;
31451
31766
  };
31452
31767
  }
31768
+ function newGlueClients(region) {
31769
+ return {
31770
+ client: new GlueClient({
31771
+ ...ambientClientDefaults(),
31772
+ ...region ? { region } : {}
31773
+ }),
31774
+ createClient: withoutServerErrorRetries(new GlueClient({
31775
+ ...ambientClientDefaults(),
31776
+ ...region ? { region } : {}
31777
+ }))
31778
+ };
31779
+ }
31453
31780
  var GlueProvider = class {
31454
31781
  client;
31782
+ createClient;
31455
31783
  providerRegion = ambientRegion();
31456
31784
  callerAccountId = makeCallerAccountResolver(this.providerRegion);
31457
31785
  logger = getLogger().child("GlueProvider");
@@ -31470,12 +31798,13 @@ var GlueProvider = class {
31470
31798
  "OpenTableFormatInput"
31471
31799
  ])]]);
31472
31800
  getClient() {
31473
- if (!this.client) this.client = new GlueClient({
31474
- ...ambientClientDefaults(),
31475
- ...this.providerRegion ? { region: this.providerRegion } : {}
31476
- });
31801
+ if (!this.client) ({client: this.client, createClient: this.createClient} = newGlueClients(this.providerRegion));
31477
31802
  return this.client;
31478
31803
  }
31804
+ getCreateClient() {
31805
+ this.getClient();
31806
+ return this.createClient;
31807
+ }
31479
31808
  async create(logicalId, resourceType, properties, context) {
31480
31809
  switch (resourceType) {
31481
31810
  case "AWS::Glue::Database": return this.createDatabase(logicalId, resourceType, properties, context);
@@ -31511,7 +31840,7 @@ var GlueProvider = class {
31511
31840
  if (!databaseName) throw new ProvisioningError(`DatabaseInput.Name or top-level DatabaseName is required for Glue Database ${logicalId}`, resourceType, logicalId);
31512
31841
  const catalogId = properties["CatalogId"];
31513
31842
  try {
31514
- await this.getClient().send(new CreateDatabaseCommand({
31843
+ await this.getCreateClient().send(new CreateDatabaseCommand({
31515
31844
  CatalogId: catalogId,
31516
31845
  DatabaseInput: this.buildDatabaseInput(databaseInput, databaseName, { ...replayWarn(log, context) })
31517
31846
  }));
@@ -31632,7 +31961,7 @@ var GlueProvider = class {
31632
31961
  for (const [field, value] of [["DatabaseName", databaseName], ["TableInput.Name", tableName]]) if (typeof value !== "string") throw new ProvisioningError(`Glue Table ${logicalId}: ${field} must be a string, got ${describeUnresolvedName(value, log.mask)}. Set it to the ${field === "DatabaseName" ? "database" : "table"} name.`, resourceType, logicalId);
31633
31962
  const physicalId = `${databaseName}|${tableName}`;
31634
31963
  try {
31635
- await this.getClient().send(new CreateTableCommand$1({
31964
+ await this.getCreateClient().send(new CreateTableCommand$1({
31636
31965
  CatalogId: catalogId,
31637
31966
  DatabaseName: databaseName,
31638
31967
  TableInput: this.buildTableInput(tableInput, tableName),
@@ -32117,6 +32446,7 @@ var GlueProvider = class {
32117
32446
  };
32118
32447
  var GlueWorkflowProvider = class {
32119
32448
  client;
32449
+ createClient;
32120
32450
  stsClient;
32121
32451
  cachedAccountId;
32122
32452
  providerRegion = ambientRegion();
@@ -32132,12 +32462,13 @@ var GlueWorkflowProvider = class {
32132
32462
  "Tags"
32133
32463
  ])]]);
32134
32464
  getClient() {
32135
- if (!this.client) this.client = new GlueClient({
32136
- ...ambientClientDefaults(),
32137
- ...this.providerRegion ? { region: this.providerRegion } : {}
32138
- });
32465
+ if (!this.client) ({client: this.client, createClient: this.createClient} = newGlueClients(this.providerRegion));
32139
32466
  return this.client;
32140
32467
  }
32468
+ getCreateClient() {
32469
+ this.getClient();
32470
+ return this.createClient;
32471
+ }
32141
32472
  async create(logicalId, resourceType, properties, context) {
32142
32473
  const log = glueOperationSinks(this.logger, context?.maskSecrets, secretNamePairs([properties["Name"]]));
32143
32474
  const { value: v } = log;
@@ -32146,7 +32477,7 @@ var GlueWorkflowProvider = class {
32146
32477
  if (!name) throw new ProvisioningError(`Name is required for Glue Workflow ${logicalId}`, resourceType, logicalId);
32147
32478
  const tags = desiredGlueTags(properties["Tags"], resourceType, logicalId);
32148
32479
  try {
32149
- await this.getClient().send(new CreateWorkflowCommand({
32480
+ await this.getCreateClient().send(new CreateWorkflowCommand({
32150
32481
  Name: name,
32151
32482
  ...properties["Description"] !== void 0 && { Description: properties["Description"] },
32152
32483
  ...properties["DefaultRunProperties"] !== void 0 && { DefaultRunProperties: properties["DefaultRunProperties"] },
@@ -32271,6 +32602,7 @@ var GlueWorkflowProvider = class {
32271
32602
  };
32272
32603
  var GlueSecurityConfigurationProvider = class {
32273
32604
  client;
32605
+ createClient;
32274
32606
  providerRegion = ambientRegion();
32275
32607
  logger = getLogger().child("GlueSecurityConfigurationProvider");
32276
32608
  wrapMaskedError(mask, error, build) {
@@ -32278,12 +32610,13 @@ var GlueSecurityConfigurationProvider = class {
32278
32610
  }
32279
32611
  handledProperties = /* @__PURE__ */ new Map([["AWS::Glue::SecurityConfiguration", /* @__PURE__ */ new Set(["Name", "EncryptionConfiguration"])]]);
32280
32612
  getClient() {
32281
- if (!this.client) this.client = new GlueClient({
32282
- ...ambientClientDefaults(),
32283
- ...this.providerRegion ? { region: this.providerRegion } : {}
32284
- });
32613
+ if (!this.client) ({client: this.client, createClient: this.createClient} = newGlueClients(this.providerRegion));
32285
32614
  return this.client;
32286
32615
  }
32616
+ getCreateClient() {
32617
+ this.getClient();
32618
+ return this.createClient;
32619
+ }
32287
32620
  async create(logicalId, resourceType, properties, context) {
32288
32621
  const log = glueOperationSinks(this.logger, context?.maskSecrets, secretNamePairs([properties["Name"]]));
32289
32622
  const { value: v } = log;
@@ -32293,7 +32626,7 @@ var GlueSecurityConfigurationProvider = class {
32293
32626
  const encryptionConfiguration = properties["EncryptionConfiguration"];
32294
32627
  if (!encryptionConfiguration) throw new ProvisioningError(`EncryptionConfiguration is required for Glue SecurityConfiguration ${logicalId}`, resourceType, logicalId);
32295
32628
  try {
32296
- await this.getClient().send(new CreateSecurityConfigurationCommand({
32629
+ await this.getCreateClient().send(new CreateSecurityConfigurationCommand({
32297
32630
  Name: name,
32298
32631
  EncryptionConfiguration: buildEncryptionConfiguration(encryptionConfiguration)
32299
32632
  }));
@@ -32457,6 +32790,7 @@ async function fetchGlueTags(client, stsClient, resource, name, accountId, logge
32457
32790
  }
32458
32791
  var GlueJobProvider = class {
32459
32792
  client;
32793
+ createClient;
32460
32794
  stsClient;
32461
32795
  cachedAccountId;
32462
32796
  providerRegion = ambientRegion();
@@ -32491,12 +32825,13 @@ var GlueJobProvider = class {
32491
32825
  "Tags"
32492
32826
  ])]]);
32493
32827
  getClient() {
32494
- if (!this.client) this.client = new GlueClient({
32495
- ...ambientClientDefaults(),
32496
- ...this.providerRegion ? { region: this.providerRegion } : {}
32497
- });
32828
+ if (!this.client) ({client: this.client, createClient: this.createClient} = newGlueClients(this.providerRegion));
32498
32829
  return this.client;
32499
32830
  }
32831
+ getCreateClient() {
32832
+ this.getClient();
32833
+ return this.createClient;
32834
+ }
32500
32835
  getStsClient() {
32501
32836
  if (!this.stsClient) this.stsClient = new STSClient({
32502
32837
  ...ambientClientDefaults(),
@@ -32515,7 +32850,7 @@ var GlueJobProvider = class {
32515
32850
  if (!command) throw new ProvisioningError(`Command is required for Glue Job ${logicalId}`, resourceType, logicalId);
32516
32851
  const tags = desiredGlueTags(properties["Tags"], resourceType, logicalId);
32517
32852
  try {
32518
- await this.getClient().send(new CreateJobCommand({
32853
+ await this.getCreateClient().send(new CreateJobCommand({
32519
32854
  Name: name,
32520
32855
  Role: role,
32521
32856
  Command: buildJobCommand(command),
@@ -32748,6 +33083,7 @@ function pickDefined(obj) {
32748
33083
  }
32749
33084
  var GlueCrawlerProvider = class {
32750
33085
  client;
33086
+ createClient;
32751
33087
  stsClient;
32752
33088
  cachedAccountId;
32753
33089
  providerRegion = ambientRegion();
@@ -32773,12 +33109,13 @@ var GlueCrawlerProvider = class {
32773
33109
  "Tags"
32774
33110
  ])]]);
32775
33111
  getClient() {
32776
- if (!this.client) this.client = new GlueClient({
32777
- ...ambientClientDefaults(),
32778
- ...this.providerRegion ? { region: this.providerRegion } : {}
32779
- });
33112
+ if (!this.client) ({client: this.client, createClient: this.createClient} = newGlueClients(this.providerRegion));
32780
33113
  return this.client;
32781
33114
  }
33115
+ getCreateClient() {
33116
+ this.getClient();
33117
+ return this.createClient;
33118
+ }
32782
33119
  getStsClient() {
32783
33120
  if (!this.stsClient) this.stsClient = new STSClient({
32784
33121
  ...ambientClientDefaults(),
@@ -32797,7 +33134,7 @@ var GlueCrawlerProvider = class {
32797
33134
  if (!targets) throw new ProvisioningError(`Targets is required for Glue Crawler ${logicalId}`, resourceType, logicalId);
32798
33135
  const tags = desiredGlueTags(properties["Tags"], resourceType, logicalId);
32799
33136
  try {
32800
- await this.getClient().send(new CreateCrawlerCommand({
33137
+ await this.getCreateClient().send(new CreateCrawlerCommand({
32801
33138
  Name: name,
32802
33139
  Role: role,
32803
33140
  Targets: toSdkCrawlerTargets(targets),
@@ -33006,6 +33343,7 @@ function toCfnCrawlerTargets(targets) {
33006
33343
  }
33007
33344
  var GlueConnectionProvider = class {
33008
33345
  client;
33346
+ createClient;
33009
33347
  providerRegion = ambientRegion();
33010
33348
  callerAccountId = makeCallerAccountResolver(this.providerRegion);
33011
33349
  logger = getLogger().child("GlueConnectionProvider");
@@ -33014,12 +33352,13 @@ var GlueConnectionProvider = class {
33014
33352
  }
33015
33353
  handledProperties = /* @__PURE__ */ new Map([["AWS::Glue::Connection", /* @__PURE__ */ new Set(["ConnectionInput", "CatalogId"])]]);
33016
33354
  getClient() {
33017
- if (!this.client) this.client = new GlueClient({
33018
- ...ambientClientDefaults(),
33019
- ...this.providerRegion ? { region: this.providerRegion } : {}
33020
- });
33355
+ if (!this.client) ({client: this.client, createClient: this.createClient} = newGlueClients(this.providerRegion));
33021
33356
  return this.client;
33022
33357
  }
33358
+ getCreateClient() {
33359
+ this.getClient();
33360
+ return this.createClient;
33361
+ }
33023
33362
  async create(logicalId, resourceType, properties, context) {
33024
33363
  const log = glueOperationSinks(this.logger, context?.maskSecrets, secretNamePairs([asRecord$1(properties["ConnectionInput"])?.["Name"], properties["CatalogId"]]));
33025
33364
  const { value: v } = log;
@@ -33029,7 +33368,7 @@ var GlueConnectionProvider = class {
33029
33368
  const name = connectionInput["Name"] ?? logicalId;
33030
33369
  const catalogId = properties["CatalogId"];
33031
33370
  try {
33032
- await this.getClient().send(new CreateConnectionCommand({
33371
+ await this.getCreateClient().send(new CreateConnectionCommand({
33033
33372
  ...catalogId && { CatalogId: catalogId },
33034
33373
  ConnectionInput: buildConnectionInput(connectionInput, name)
33035
33374
  }));
@@ -33177,6 +33516,7 @@ function buildConnectionInput(ci, fallbackName) {
33177
33516
  }
33178
33517
  var GlueTriggerProvider = class {
33179
33518
  client;
33519
+ createClient;
33180
33520
  stsClient;
33181
33521
  cachedAccountId;
33182
33522
  providerRegion = ambientRegion();
@@ -33197,12 +33537,13 @@ var GlueTriggerProvider = class {
33197
33537
  "Tags"
33198
33538
  ])]]);
33199
33539
  getClient() {
33200
- if (!this.client) this.client = new GlueClient({
33201
- ...ambientClientDefaults(),
33202
- ...this.providerRegion ? { region: this.providerRegion } : {}
33203
- });
33540
+ if (!this.client) ({client: this.client, createClient: this.createClient} = newGlueClients(this.providerRegion));
33204
33541
  return this.client;
33205
33542
  }
33543
+ getCreateClient() {
33544
+ this.getClient();
33545
+ return this.createClient;
33546
+ }
33206
33547
  getStsClient() {
33207
33548
  if (!this.stsClient) this.stsClient = new STSClient({
33208
33549
  ...ambientClientDefaults(),
@@ -33221,7 +33562,7 @@ var GlueTriggerProvider = class {
33221
33562
  if (!actions) throw new ProvisioningError(`Actions is required for Glue Trigger ${logicalId}`, resourceType, logicalId);
33222
33563
  const tags = desiredGlueTags(properties["Tags"], resourceType, logicalId);
33223
33564
  try {
33224
- await this.getClient().send(new CreateTriggerCommand({
33565
+ await this.getCreateClient().send(new CreateTriggerCommand({
33225
33566
  Name: name,
33226
33567
  Type: type,
33227
33568
  Actions: actions,
@@ -33957,6 +34298,7 @@ function removableRecorded(kind, items) {
33957
34298
  }
33958
34299
  var BudgetsBudgetProvider = class {
33959
34300
  client;
34301
+ createClient;
33960
34302
  providerRegion = ambientRegion();
33961
34303
  logger = getLogger().child("BudgetsBudgetProvider");
33962
34304
  accountIdPromise;
@@ -33966,12 +34308,26 @@ var BudgetsBudgetProvider = class {
33966
34308
  "ResourceTags"
33967
34309
  ])]]);
33968
34310
  getClient() {
33969
- if (!this.client) this.client = new BudgetsClient({
33970
- ...ambientClientDefaults(),
33971
- ...this.providerRegion ? { region: this.providerRegion } : {}
33972
- });
34311
+ if (!this.client) {
34312
+ this.client = new BudgetsClient({
34313
+ ...ambientClientDefaults(),
34314
+ ...this.providerRegion ? { region: this.providerRegion } : {}
34315
+ });
34316
+ this.createClient = withoutServerErrorRetries(new BudgetsClient({
34317
+ ...ambientClientDefaults(),
34318
+ ...this.providerRegion ? { region: this.providerRegion } : {}
34319
+ }));
34320
+ }
33973
34321
  return this.client;
33974
34322
  }
34323
+ wrapBudgetError(mask, error, verb, logicalId, resourceType, physicalId) {
34324
+ const cause = error instanceof Error ? error : void 0;
34325
+ return wrapMaskedAwsError(mask, error, (text) => new ProvisioningError(`Failed to ${verb} budget ${logicalId}: ${text}`, resourceType, logicalId, physicalId, cause));
34326
+ }
34327
+ getCreateClient() {
34328
+ this.getClient();
34329
+ return this.createClient;
34330
+ }
33975
34331
  resolveAccountId() {
33976
34332
  if (!this.accountIdPromise) this.accountIdPromise = (async () => {
33977
34333
  try {
@@ -34092,7 +34448,7 @@ var BudgetsBudgetProvider = class {
34092
34448
  const notifications = this.toSdkNotificationsWithSubscribers(lists.NotificationsWithSubscribers);
34093
34449
  const resourceTags = this.toSdkResourceTags(lists.ResourceTags);
34094
34450
  const arn = await this.budgetArn(accountId, name);
34095
- await this.getClient().send(new CreateBudgetCommand({
34451
+ await this.getCreateClient().send(new CreateBudgetCommand({
34096
34452
  AccountId: accountId,
34097
34453
  Budget: this.toSdkBudget(properties["Budget"], name, logicalId, resourceType, mask),
34098
34454
  ...notifications.length > 0 && { NotificationsWithSubscribers: notifications },
@@ -34105,8 +34461,7 @@ var BudgetsBudgetProvider = class {
34105
34461
  };
34106
34462
  } catch (error) {
34107
34463
  if (error instanceof ProvisioningError) throw error;
34108
- const cause = error instanceof Error ? error : void 0;
34109
- throw new ProvisioningError(`Failed to create budget ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, void 0, cause);
34464
+ throw this.wrapBudgetError(mask, error, "create", logicalId, resourceType, void 0);
34110
34465
  }
34111
34466
  }
34112
34467
  async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
@@ -34151,8 +34506,7 @@ var BudgetsBudgetProvider = class {
34151
34506
  };
34152
34507
  } catch (error) {
34153
34508
  if (error instanceof ProvisioningError) throw error;
34154
- const cause = error instanceof Error ? error : void 0;
34155
- throw new ProvisioningError(`Failed to update budget ${logicalId}: ${error instanceof Error ? error.message : String(error)}`, resourceType, logicalId, physicalId, cause);
34509
+ throw this.wrapBudgetError(mask, error, "update", logicalId, resourceType, physicalId);
34156
34510
  }
34157
34511
  }
34158
34512
  readDesiredLists(logicalId, resourceType, values, physicalId) {
@@ -34782,6 +35136,22 @@ var KinesisStreamProvider = class {
34782
35136
  if (journaledArn === void 0) return "different";
34783
35137
  return journaledArn === recordArn ? "same" : "different";
34784
35138
  }
35139
+ async resourceIdentity(physicalId, _resourceType, context) {
35140
+ if (!isStreamName(physicalId)) return void 0;
35141
+ if (await this.getClient().config.region() !== context.expectedRegion) return void 0;
35142
+ let response;
35143
+ try {
35144
+ response = await this.getClient().send(new DescribeStreamSummaryCommand({ StreamName: physicalId }));
35145
+ } catch (error) {
35146
+ if (error instanceof ResourceNotFoundException$10) return RESOURCE_NOT_FOUND;
35147
+ throw error;
35148
+ }
35149
+ const arn = response.StreamDescriptionSummary?.StreamARN;
35150
+ const created = response.StreamDescriptionSummary?.StreamCreationTimestamp;
35151
+ if (typeof arn !== "string" || arn === "") return void 0;
35152
+ if (!(created instanceof Date) || Number.isNaN(created.getTime())) return void 0;
35153
+ return `${arn}@${created.getTime()}`;
35154
+ }
34785
35155
  async readStreamArnIfExists(streamName) {
34786
35156
  let response;
34787
35157
  try {
@@ -34934,6 +35304,7 @@ function consumerArnParts(consumerArn) {
34934
35304
  }
34935
35305
  var KinesisStreamConsumerProvider = class {
34936
35306
  client;
35307
+ createClient;
34937
35308
  providerRegion = ambientRegion();
34938
35309
  logger = getLogger().child("KinesisStreamConsumerProvider");
34939
35310
  handledProperties = /* @__PURE__ */ new Map([["AWS::Kinesis::StreamConsumer", /* @__PURE__ */ new Set([
@@ -34942,12 +35313,22 @@ var KinesisStreamConsumerProvider = class {
34942
35313
  "Tags"
34943
35314
  ])]]);
34944
35315
  getClient() {
34945
- if (!this.client) this.client = new KinesisClient({
34946
- ...ambientClientDefaults(),
34947
- ...this.providerRegion ? { region: this.providerRegion } : {}
34948
- });
35316
+ if (!this.client) {
35317
+ this.client = new KinesisClient({
35318
+ ...ambientClientDefaults(),
35319
+ ...this.providerRegion ? { region: this.providerRegion } : {}
35320
+ });
35321
+ this.createClient = withoutServerErrorRetries(new KinesisClient({
35322
+ ...ambientClientDefaults(),
35323
+ ...this.providerRegion ? { region: this.providerRegion } : {}
35324
+ }));
35325
+ }
34949
35326
  return this.client;
34950
35327
  }
35328
+ getCreateClient() {
35329
+ this.getClient();
35330
+ return this.createClient;
35331
+ }
34951
35332
  async create(logicalId, resourceType, properties) {
34952
35333
  const tagList = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
34953
35334
  const consumerName = properties["ConsumerName"];
@@ -34958,7 +35339,7 @@ var KinesisStreamConsumerProvider = class {
34958
35339
  const tagMap = tagListToMap(tagList);
34959
35340
  let createdArn;
34960
35341
  try {
34961
- const consumer = (await this.getClient().send(new RegisterStreamConsumerCommand({
35342
+ const consumer = (await this.getCreateClient().send(new RegisterStreamConsumerCommand({
34962
35343
  StreamARN: streamArn,
34963
35344
  ConsumerName: consumerName,
34964
35345
  ...tagMap && Object.keys(tagMap).length > 0 ? { Tags: tagMap } : {}
@@ -35716,6 +36097,7 @@ function deleteFailureClassifier(resourceType, logicalId, physicalId) {
35716
36097
  }
35717
36098
  var PipesPipeProvider = class {
35718
36099
  client;
36100
+ createClient;
35719
36101
  providerRegion = ambientRegion();
35720
36102
  logger = getLogger().child("PipesPipeProvider");
35721
36103
  options;
@@ -35748,19 +36130,29 @@ var PipesPipeProvider = class {
35748
36130
  this.options = options;
35749
36131
  }
35750
36132
  getClient() {
35751
- if (!this.client) this.client = new PipesClient({
35752
- ...ambientClientDefaults(),
35753
- ...this.providerRegion ? { region: this.providerRegion } : {}
35754
- });
36133
+ if (!this.client) {
36134
+ this.client = new PipesClient({
36135
+ ...ambientClientDefaults(),
36136
+ ...this.providerRegion ? { region: this.providerRegion } : {}
36137
+ });
36138
+ this.createClient = withoutServerErrorRetries(new PipesClient({
36139
+ ...ambientClientDefaults(),
36140
+ ...this.providerRegion ? { region: this.providerRegion } : {}
36141
+ }));
36142
+ }
35755
36143
  return this.client;
35756
36144
  }
36145
+ getCreateClient() {
36146
+ this.getClient();
36147
+ return this.createClient;
36148
+ }
35757
36149
  async create(logicalId, resourceType, properties, context) {
35758
36150
  const mask = maskerOrIdentity(context?.maskSecrets);
35759
36151
  const name = properties["Name"] ?? generateResourceName(logicalId, { maxLength: 64 });
35760
36152
  const tags = desiredTagMap(properties["Tags"], logicalId);
35761
36153
  this.logger.debug(mask(`Creating Pipe ${logicalId}: ${name}`));
35762
36154
  try {
35763
- await this.getClient().send(new CreatePipeCommand({
36155
+ await this.getCreateClient().send(new CreatePipeCommand({
35764
36156
  Name: name,
35765
36157
  RoleArn: properties["RoleArn"],
35766
36158
  Source: properties["Source"],
@@ -35777,7 +36169,7 @@ var PipesPipeProvider = class {
35777
36169
  }));
35778
36170
  } catch (error) {
35779
36171
  const cause = error instanceof Error ? error : void 0;
35780
- throw new ProvisioningError(`Failed to create Pipe ${logicalId}: ${cause?.message ?? String(error)}`, resourceType, logicalId, void 0, cause);
36172
+ throw new ProvisioningError(`Failed to create Pipe ${logicalId}: ${mask(cause?.message ?? String(error))}`, resourceType, logicalId, void 0, cause);
35781
36173
  }
35782
36174
  let settled;
35783
36175
  try {
@@ -35849,7 +36241,7 @@ var PipesPipeProvider = class {
35849
36241
  if (error instanceof ProvisioningError) throw error;
35850
36242
  if (error instanceof NotFoundException$6) assertRegionMatch(await this.getClient().config.region(), context?.expectedRegion, resourceType, logicalId, physicalId);
35851
36243
  const cause = error instanceof Error ? error : void 0;
35852
- throw new ProvisioningError(`Failed to update Pipe ${logicalId}: ${cause?.message ?? String(error)}`, resourceType, logicalId, physicalId, cause);
36244
+ throw new ProvisioningError(`Failed to update Pipe ${logicalId}: ${mask(cause?.message ?? String(error))}`, resourceType, logicalId, physicalId, cause);
35853
36245
  }
35854
36246
  return {
35855
36247
  physicalId,
@@ -36112,6 +36504,7 @@ function sameRootDirectory(requested, described) {
36112
36504
  }
36113
36505
  var EFSProvider = class {
36114
36506
  client;
36507
+ mountTargetCreateClient;
36115
36508
  providerRegion = ambientRegion();
36116
36509
  logger = getLogger().child("EFSProvider");
36117
36510
  unconfirmedCreationTokens = /* @__PURE__ */ new Map();
@@ -36144,12 +36537,22 @@ var EFSProvider = class {
36144
36537
  ]);
36145
36538
  unhandledByDesign = /* @__PURE__ */ new Map([["AWS::EFS::FileSystem", /* @__PURE__ */ new Map([["ReplicationConfiguration", "Cross-region EFS replication (CreateReplicationConfiguration) provisions a separate destination file system in another region with its own lifecycle, KMS key, and availability-zone placement; replicating + then tearing down the destination on destroy is a multi-resource, cross-region orchestration that is out of scope for the single-resource SDK provider. Tracked as a follow-up to issue #609."]])], ["AWS::EFS::AccessPoint", /* @__PURE__ */ new Map([["ClientToken", "cdkd supplies its own retry-stable ClientToken on CreateAccessPoint (issues #2039 and #2080), so a template-supplied value would be overwritten. The SDK does not own this field either: measured against @aws-sdk/client-efs 3.1018.0, an omitted ClientToken is auto-filled with a FRESH uuid per attempt, which leaves a retried 500 free to mint a second access point, while a caller-supplied value goes on the wire verbatim."]])]]);
36146
36539
  getClient() {
36147
- if (!this.client) this.client = new EFSClient({
36148
- ...ambientClientDefaults(),
36149
- ...this.providerRegion ? { region: this.providerRegion } : {}
36150
- });
36540
+ if (!this.client) {
36541
+ this.client = new EFSClient({
36542
+ ...ambientClientDefaults(),
36543
+ ...this.providerRegion ? { region: this.providerRegion } : {}
36544
+ });
36545
+ this.mountTargetCreateClient = withoutServerErrorRetries(new EFSClient({
36546
+ ...ambientClientDefaults(),
36547
+ ...this.providerRegion ? { region: this.providerRegion } : {}
36548
+ }));
36549
+ }
36151
36550
  return this.client;
36152
36551
  }
36552
+ getMountTargetCreateClient() {
36553
+ this.getClient();
36554
+ return this.mountTargetCreateClient;
36555
+ }
36153
36556
  wrapMaskedError(mask, error, build) {
36154
36557
  return wrapMaskedAwsError(mask, error, build);
36155
36558
  }
@@ -36479,7 +36882,7 @@ var EFSProvider = class {
36479
36882
  const securityGroups = properties["SecurityGroups"];
36480
36883
  let createdMountTargetId;
36481
36884
  try {
36482
- const mountTargetId = (await this.getClient().send(new CreateMountTargetCommand({
36885
+ const mountTargetId = (await this.getMountTargetCreateClient().send(new CreateMountTargetCommand({
36483
36886
  FileSystemId: fileSystemId,
36484
36887
  SubnetId: subnetId,
36485
36888
  SecurityGroups: securityGroups
@@ -36822,6 +37225,8 @@ var EFSProvider = class {
36822
37225
  //#region src/provisioning/providers/fsx-filesystem-provider.ts
36823
37226
  const DEFAULT_MAX_WAIT_MS$3 = 36e5;
36824
37227
  const DEFAULT_POLL_INTERVAL_MS$3 = 15e3;
37228
+ const FILE_SYSTEM_ID_PATTERN = /^fs-[0-9a-f]+$/;
37229
+ const FILE_SYSTEM_NOT_LIVE_LIFECYCLES = /* @__PURE__ */ new Set(["DELETING", "FAILED"]);
36825
37230
  const LUSTRE_MUTABLE_SUBPROPS = /* @__PURE__ */ new Set([
36826
37231
  "WeeklyMaintenanceStartTime",
36827
37232
  "DailyAutomaticBackupStartTime",
@@ -37474,7 +37879,8 @@ var FSxFileSystemProvider = class {
37474
37879
  if (error instanceof FileSystemNotFound$1) {
37475
37880
  const clientRegion = await this.getClient().config.region();
37476
37881
  assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
37477
- this.logger.debug(`FSx FileSystem ${physicalId} does not exist, skipping deletion`);
37882
+ if (context?.failedCreateOrphan === true) this.logger.info(safeMsg` FSx file system ${physicalId} (${logicalId}), which a failed deploy created, is already gone; nothing to delete`);
37883
+ else this.logger.debug(`FSx FileSystem ${physicalId} does not exist, skipping deletion`);
37478
37884
  return;
37479
37885
  }
37480
37886
  const cause = error instanceof Error ? error : void 0;
@@ -37483,6 +37889,30 @@ var FSxFileSystemProvider = class {
37483
37889
  await this.waitForFileSystemDeleted(physicalId, logicalId, resourceType);
37484
37890
  this.logger.debug(`Successfully deleted FSx FileSystem ${logicalId}`);
37485
37891
  }
37892
+ async isSameResource(journaledPhysicalId, record, resourceType, context) {
37893
+ if (resourceType !== "AWS::FSx::FileSystem") return "unknown";
37894
+ if (!FILE_SYSTEM_ID_PATTERN.test(journaledPhysicalId) || !FILE_SYSTEM_ID_PATTERN.test(record.physicalId)) return "unknown";
37895
+ if (journaledPhysicalId === record.physicalId) return "same";
37896
+ if (await this.getClient().config.region() !== context.expectedRegion) return "unknown";
37897
+ const recordRead = await this.readFileSystemForIdentity(record.physicalId);
37898
+ if (recordRead === void 0 || recordRead.id !== record.physicalId || FILE_SYSTEM_NOT_LIVE_LIFECYCLES.has(recordRead.lifecycle ?? "")) return "unknown";
37899
+ return (await this.readFileSystemForIdentity(journaledPhysicalId))?.id === record.physicalId ? "same" : "different";
37900
+ }
37901
+ async readFileSystemForIdentity(fileSystemId) {
37902
+ let response;
37903
+ try {
37904
+ response = await this.getClient().send(new DescribeFileSystemsCommand$1({ FileSystemIds: [fileSystemId] }));
37905
+ } catch (error) {
37906
+ if (error instanceof FileSystemNotFound$1) return void 0;
37907
+ throw error;
37908
+ }
37909
+ const fileSystems = response.FileSystems ?? [];
37910
+ if (fileSystems.length !== 1 || typeof fileSystems[0]?.FileSystemId !== "string") throw new Error("DescribeFileSystems did not return exactly the file system asked for");
37911
+ return {
37912
+ id: fileSystems[0].FileSystemId,
37913
+ lifecycle: fileSystems[0].Lifecycle
37914
+ };
37915
+ }
37486
37916
  async describeForPoll(fileSystemId, transientState, maxConsecutiveTransient = 5) {
37487
37917
  try {
37488
37918
  const response = await this.getClient().send(new DescribeFileSystemsCommand$1({ FileSystemIds: [fileSystemId] }));
@@ -37859,6 +38289,7 @@ const LIVE_CLUSTER_STATES = [
37859
38289
  "RUNNING",
37860
38290
  "WAITING"
37861
38291
  ];
38292
+ const CLUSTER_ID_PATTERN = /^j-[0-9A-Z]+$/;
37862
38293
  const runJobFlowLatch = new AmbiguousCreateLatch("emr:RunJobFlow");
37863
38294
  const clustersCreatedByThisProcess = new RecentIdSet();
37864
38295
  function emrClusterProtectionSite(physicalId, region) {
@@ -38297,7 +38728,8 @@ var EMRClusterProvider = class {
38297
38728
  if (error instanceof InvalidRequestException) {
38298
38729
  const clientRegion = await this.getClient().config.region();
38299
38730
  assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
38300
- this.logger.debug(`EMR Cluster ${physicalId} does not exist, skipping deletion`);
38731
+ if (context?.failedCreateOrphan === true) this.logger.info(safeMsg` EMR cluster ${physicalId} (${logicalId}), which a failed deploy created, is already gone; nothing to delete`);
38732
+ else this.logger.debug(`EMR Cluster ${physicalId} does not exist, skipping deletion`);
38301
38733
  return;
38302
38734
  }
38303
38735
  const cause = error instanceof Error ? error : void 0;
@@ -38305,7 +38737,8 @@ var EMRClusterProvider = class {
38305
38737
  }
38306
38738
  const currentState = current?.Status?.State;
38307
38739
  if (currentState && TERMINAL_STATES.has(currentState)) {
38308
- this.logger.debug(`EMR Cluster ${physicalId} already ${currentState}, skipping deletion`);
38740
+ if (context?.failedCreateOrphan === true) this.logger.info(safeMsg` EMR cluster ${physicalId} (${logicalId}), which a failed deploy created, is already ${currentState}; nothing to delete`);
38741
+ else this.logger.debug(`EMR Cluster ${physicalId} already ${currentState}, skipping deletion`);
38309
38742
  return;
38310
38743
  }
38311
38744
  try {
@@ -38406,6 +38839,27 @@ var EMRClusterProvider = class {
38406
38839
  default: return;
38407
38840
  }
38408
38841
  }
38842
+ async isSameResource(journaledPhysicalId, record, resourceType, context) {
38843
+ if (resourceType !== "AWS::EMR::Cluster") return "unknown";
38844
+ if (!CLUSTER_ID_PATTERN.test(journaledPhysicalId) || !CLUSTER_ID_PATTERN.test(record.physicalId)) return "unknown";
38845
+ if (journaledPhysicalId === record.physicalId) return "same";
38846
+ if (await this.getClient().config.region() !== context.expectedRegion) return "unknown";
38847
+ const recorded = await this.readClusterIdentity(record.physicalId);
38848
+ if (recorded?.id !== record.physicalId) return "unknown";
38849
+ return (await this.readClusterIdentity(journaledPhysicalId))?.id === recorded.id ? "same" : "different";
38850
+ }
38851
+ async readClusterIdentity(clusterId) {
38852
+ let response;
38853
+ try {
38854
+ response = await this.getClient().send(new DescribeClusterCommand({ ClusterId: clusterId }));
38855
+ } catch (error) {
38856
+ if (error instanceof InvalidRequestException) return void 0;
38857
+ throw error;
38858
+ }
38859
+ const id = response.Cluster?.Id;
38860
+ if (typeof id !== "string") throw new Error("DescribeCluster did not return the cluster asked for");
38861
+ return { id };
38862
+ }
38409
38863
  async import(input) {
38410
38864
  const explicit = resolveExplicitPhysicalId(input, null);
38411
38865
  if (explicit) {
@@ -39188,6 +39642,7 @@ const FIREHOSE_DELETE_POLL_INTERVAL_MS = 5e3;
39188
39642
  const FIREHOSE_DELETE_MAX_WAIT_MS = 6e5;
39189
39643
  var FirehoseProvider = class {
39190
39644
  client;
39645
+ createClient;
39191
39646
  providerRegion = ambientRegion();
39192
39647
  logger = getLogger().child("FirehoseProvider");
39193
39648
  handledProperties = /* @__PURE__ */ new Map([["AWS::KinesisFirehose::DeliveryStream", /* @__PURE__ */ new Set([
@@ -39206,12 +39661,22 @@ var FirehoseProvider = class {
39206
39661
  "DeliveryStreamEncryptionConfigurationInput"
39207
39662
  ])]]);
39208
39663
  getClient() {
39209
- if (!this.client) this.client = new FirehoseClient({
39210
- ...ambientClientDefaults(),
39211
- ...this.providerRegion ? { region: this.providerRegion } : {}
39212
- });
39664
+ if (!this.client) {
39665
+ this.client = new FirehoseClient({
39666
+ ...ambientClientDefaults(),
39667
+ ...this.providerRegion ? { region: this.providerRegion } : {}
39668
+ });
39669
+ this.createClient = withoutServerErrorRetries(new FirehoseClient({
39670
+ ...ambientClientDefaults(),
39671
+ ...this.providerRegion ? { region: this.providerRegion } : {}
39672
+ }));
39673
+ }
39213
39674
  return this.client;
39214
39675
  }
39676
+ getCreateClient() {
39677
+ this.getClient();
39678
+ return this.createClient;
39679
+ }
39215
39680
  async create(logicalId, resourceType, properties) {
39216
39681
  this.logger.debug(`Creating Firehose delivery stream ${logicalId}`);
39217
39682
  const deliveryStreamName = properties["DeliveryStreamName"];
@@ -39344,7 +39809,7 @@ var FirehoseProvider = class {
39344
39809
  Key: t.Key,
39345
39810
  Value: t.Value
39346
39811
  }));
39347
- const response = await this.getClient().send(new CreateDeliveryStreamCommand(input));
39812
+ const response = await this.getCreateClient().send(new CreateDeliveryStreamCommand(input));
39348
39813
  const physicalId = deliveryStreamName || input.DeliveryStreamName || response.DeliveryStreamARN?.split("/").pop() || "";
39349
39814
  createdStreamName = physicalId;
39350
39815
  const arn = response.DeliveryStreamARN;
@@ -40055,6 +40520,7 @@ function describeValue(value) {
40055
40520
  }
40056
40521
  var CloudTrailProvider = class {
40057
40522
  client;
40523
+ createClient;
40058
40524
  providerRegion = ambientRegion();
40059
40525
  logger = getLogger().child("CloudTrailProvider");
40060
40526
  removalDefaults = /* @__PURE__ */ new Map([["AWS::CloudTrail::Trail", /* @__PURE__ */ new Map([["IsMultiRegionTrail", false], ["EnableLogFileValidation", false]])]]);
@@ -40076,12 +40542,22 @@ var CloudTrailProvider = class {
40076
40542
  "IsOrganizationTrail"
40077
40543
  ])]]);
40078
40544
  getClient() {
40079
- if (!this.client) this.client = new CloudTrailClient({
40080
- ...ambientClientDefaults(),
40081
- ...this.providerRegion ? { region: this.providerRegion } : {}
40082
- });
40545
+ if (!this.client) {
40546
+ this.client = new CloudTrailClient({
40547
+ ...ambientClientDefaults(),
40548
+ ...this.providerRegion ? { region: this.providerRegion } : {}
40549
+ });
40550
+ this.createClient = withoutServerErrorRetries(new CloudTrailClient({
40551
+ ...ambientClientDefaults(),
40552
+ ...this.providerRegion ? { region: this.providerRegion } : {}
40553
+ }));
40554
+ }
40083
40555
  return this.client;
40084
40556
  }
40557
+ getCreateClient() {
40558
+ this.getClient();
40559
+ return this.createClient;
40560
+ }
40085
40561
  async create(logicalId, resourceType, properties) {
40086
40562
  this.logger.debug(`Creating CloudTrail Trail ${logicalId}`);
40087
40563
  const desiredTags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
@@ -40103,7 +40579,7 @@ var CloudTrailProvider = class {
40103
40579
  let trailCreated = false;
40104
40580
  let createdTrailArn;
40105
40581
  try {
40106
- const result = await this.getClient().send(new CreateTrailCommand({
40582
+ const result = await this.getCreateClient().send(new CreateTrailCommand({
40107
40583
  Name: trailName ?? logicalId,
40108
40584
  S3BucketName: s3BucketName,
40109
40585
  S3KeyPrefix: s3KeyPrefix,
@@ -40354,6 +40830,7 @@ var CloudTrailProvider = class {
40354
40830
  //#region src/provisioning/providers/codebuild-provider.ts
40355
40831
  var CodeBuildProvider = class {
40356
40832
  client;
40833
+ createClient;
40357
40834
  providerRegion = ambientRegion();
40358
40835
  logger = getLogger().child("CodeBuildProvider");
40359
40836
  disableCcApiFallback = true;
@@ -40382,12 +40859,22 @@ var CodeBuildProvider = class {
40382
40859
  "AutoRetryLimit"
40383
40860
  ])]]);
40384
40861
  getClient() {
40385
- if (!this.client) this.client = new CodeBuildClient({
40386
- ...ambientClientDefaults(),
40387
- ...this.providerRegion ? { region: this.providerRegion } : {}
40388
- });
40862
+ if (!this.client) {
40863
+ this.client = new CodeBuildClient({
40864
+ ...ambientClientDefaults(),
40865
+ ...this.providerRegion ? { region: this.providerRegion } : {}
40866
+ });
40867
+ this.createClient = withoutServerErrorRetries(new CodeBuildClient({
40868
+ ...ambientClientDefaults(),
40869
+ ...this.providerRegion ? { region: this.providerRegion } : {}
40870
+ }));
40871
+ }
40389
40872
  return this.client;
40390
40873
  }
40874
+ getCreateClient() {
40875
+ this.getClient();
40876
+ return this.createClient;
40877
+ }
40391
40878
  mapSource(source, containerPath) {
40392
40879
  if (source == null) return { type: "NO_SOURCE" };
40393
40880
  let buildspec;
@@ -40562,7 +41049,7 @@ var CodeBuildProvider = class {
40562
41049
  this.logger.debug(`Creating CodeBuild Project ${logicalId}`);
40563
41050
  try {
40564
41051
  const input = this.mapProperties(logicalId, properties);
40565
- const result = await this.getClient().send(new CreateProjectCommand(input));
41052
+ const result = await this.getCreateClient().send(new CreateProjectCommand(input));
40566
41053
  const projectName = result.project.name;
40567
41054
  const projectArn = result.project.arn;
40568
41055
  this.logger.debug(`Successfully created CodeBuild Project ${logicalId}: ${projectName}`);
@@ -41589,6 +42076,7 @@ var DLMLifecyclePolicyProvider = class {
41589
42076
  //#region src/provisioning/providers/s3-vectors-provider.ts
41590
42077
  var S3VectorsProvider = class {
41591
42078
  client;
42079
+ createClient;
41592
42080
  providerRegion = ambientRegion();
41593
42081
  logger = getLogger().child("S3VectorsProvider");
41594
42082
  handledProperties = /* @__PURE__ */ new Map([["AWS::S3Vectors::VectorBucket", /* @__PURE__ */ new Set([
@@ -41600,12 +42088,22 @@ var S3VectorsProvider = class {
41600
42088
  return wrapMaskedAwsError(mask, error, build);
41601
42089
  }
41602
42090
  getClient() {
41603
- if (!this.client) this.client = new S3VectorsClient({
41604
- ...ambientClientDefaults(),
41605
- ...this.providerRegion ? { region: this.providerRegion } : {}
41606
- });
42091
+ if (!this.client) {
42092
+ this.client = new S3VectorsClient({
42093
+ ...ambientClientDefaults(),
42094
+ ...this.providerRegion ? { region: this.providerRegion } : {}
42095
+ });
42096
+ this.createClient = withoutServerErrorRetries(new S3VectorsClient({
42097
+ ...ambientClientDefaults(),
42098
+ ...this.providerRegion ? { region: this.providerRegion } : {}
42099
+ }));
42100
+ }
41607
42101
  return this.client;
41608
42102
  }
42103
+ getCreateClient() {
42104
+ this.getClient();
42105
+ return this.createClient;
42106
+ }
41609
42107
  async create(logicalId, resourceType, properties) {
41610
42108
  switch (resourceType) {
41611
42109
  case "AWS::S3Vectors::VectorBucket": return this.createVectorBucket(logicalId, resourceType, properties);
@@ -41680,7 +42178,7 @@ var S3VectorsProvider = class {
41680
42178
  const tagRecord = Object.fromEntries(desiredTags.map((t) => [t.Key, t.Value]));
41681
42179
  const tags = Object.keys(tagRecord).length > 0 ? tagRecord : void 0;
41682
42180
  try {
41683
- const result = await this.getClient().send(new CreateVectorBucketCommand({
42181
+ const result = await this.getCreateClient().send(new CreateVectorBucketCommand({
41684
42182
  vectorBucketName,
41685
42183
  encryptionConfiguration: encryptionConfiguration ? {
41686
42184
  sseType: encryptionConfiguration["SseType"],
@@ -41804,6 +42302,8 @@ function notEmptyRefusalMessage(bucketName) {
41804
42302
  }
41805
42303
  var S3DirectoryBucketProvider = class {
41806
42304
  s3Client;
42305
+ createClient;
42306
+ credentialConfig;
41807
42307
  stsClient;
41808
42308
  logger = getLogger().child("S3DirectoryBucketProvider");
41809
42309
  handledProperties = /* @__PURE__ */ new Map([["AWS::S3Express::DirectoryBucket", /* @__PURE__ */ new Set([
@@ -41819,6 +42319,17 @@ var S3DirectoryBucketProvider = class {
41819
42319
  const awsClients = getAwsClients();
41820
42320
  this.s3Client = awsClients.s3;
41821
42321
  this.stsClient = awsClients.sts;
42322
+ this.credentialConfig = awsClients.credentialConfig ?? {};
42323
+ }
42324
+ getCreateClient() {
42325
+ this.createClient ??= this.s3Client.config.region().then((region) => withoutServerErrorRetries(new S3Client({
42326
+ ...clientDefaultsFor(this.credentialConfig),
42327
+ region
42328
+ })), (error) => {
42329
+ this.createClient = void 0;
42330
+ throw error;
42331
+ });
42332
+ return this.createClient;
41822
42333
  }
41823
42334
  getEc2Client() {
41824
42335
  if (!this.ec2Client) this.ec2Client = new EC2Client({
@@ -41876,7 +42387,7 @@ var S3DirectoryBucketProvider = class {
41876
42387
  const includeTags = tags.length > 0;
41877
42388
  try {
41878
42389
  const attributes = await this.buildAttributes(bucketName);
41879
- await this.s3Client.send(new CreateBucketCommand({
42390
+ await (await this.getCreateClient()).send(new CreateBucketCommand({
41880
42391
  Bucket: bucketName,
41881
42392
  CreateBucketConfiguration: {
41882
42393
  Bucket: {
@@ -42086,6 +42597,7 @@ function tableIdentityFromGetTable(tableARN, namespace, name) {
42086
42597
  }
42087
42598
  var S3TablesProvider = class {
42088
42599
  client;
42600
+ createClient;
42089
42601
  providerRegion = ambientRegion();
42090
42602
  logger = getLogger().child("S3TablesProvider");
42091
42603
  handledProperties = /* @__PURE__ */ new Map([
@@ -42102,12 +42614,22 @@ var S3TablesProvider = class {
42102
42614
  ])]
42103
42615
  ]);
42104
42616
  getClient() {
42105
- if (!this.client) this.client = new S3TablesClient({
42106
- ...ambientClientDefaults(),
42107
- ...this.providerRegion ? { region: this.providerRegion } : {}
42108
- });
42617
+ if (!this.client) {
42618
+ this.client = new S3TablesClient({
42619
+ ...ambientClientDefaults(),
42620
+ ...this.providerRegion ? { region: this.providerRegion } : {}
42621
+ });
42622
+ this.createClient = withoutServerErrorRetries(new S3TablesClient({
42623
+ ...ambientClientDefaults(),
42624
+ ...this.providerRegion ? { region: this.providerRegion } : {}
42625
+ }));
42626
+ }
42109
42627
  return this.client;
42110
42628
  }
42629
+ getCreateClient() {
42630
+ this.getClient();
42631
+ return this.createClient;
42632
+ }
42111
42633
  async create(logicalId, resourceType, properties, context) {
42112
42634
  switch (resourceType) {
42113
42635
  case "AWS::S3Tables::TableBucket": return this.createTableBucket(logicalId, resourceType, properties);
@@ -42150,7 +42672,7 @@ var S3TablesProvider = class {
42150
42672
  if (!tableBucketName) throw new ProvisioningError(`TableBucketName is required for S3 Table Bucket ${logicalId}`, resourceType, logicalId);
42151
42673
  const tags = this.tagListToSdkMap(desiredTags);
42152
42674
  try {
42153
- const tableBucketARN = (await this.getClient().send(new CreateTableBucketCommand({
42675
+ const tableBucketARN = (await this.getCreateClient().send(new CreateTableBucketCommand({
42154
42676
  name: tableBucketName,
42155
42677
  ...tags !== void 0 && { tags }
42156
42678
  }))).arn;
@@ -42247,7 +42769,7 @@ var S3TablesProvider = class {
42247
42769
  ...context?.replayingState === true && { onRefusal: (message) => this.logger.warn(message) }
42248
42770
  });
42249
42771
  try {
42250
- await this.getClient().send(new CreateNamespaceCommand({
42772
+ await this.getCreateClient().send(new CreateNamespaceCommand({
42251
42773
  tableBucketARN,
42252
42774
  namespace: [namespaceName]
42253
42775
  }));
@@ -42313,7 +42835,7 @@ var S3TablesProvider = class {
42313
42835
  });
42314
42836
  let tableCreated = false;
42315
42837
  try {
42316
- const response = await this.getClient().send(new CreateTableCommand$2({
42838
+ const response = await this.getCreateClient().send(new CreateTableCommand$2({
42317
42839
  tableBucketARN,
42318
42840
  namespace,
42319
42841
  name,
@@ -43194,6 +43716,7 @@ var NestedStackProvider = class {
43194
43716
  parameters: childParameters,
43195
43717
  ...inheritedSecrets && hasMaskableValues(inheritedSecrets) && { inheritedSecrets },
43196
43718
  ...passedClasses && { passedParameterClasses: passedClasses },
43719
+ passedNoEchoParameters: passedNoEchoParametersOf(inheritedSecrets),
43197
43720
  inheritedProducerRegions: getCurrentProducerRegions(),
43198
43721
  parentStackInfo: {
43199
43722
  parentStack: parentCtx.parentStackName,
@@ -43700,4 +44223,4 @@ var ACMCertificateProvider = class {
43700
44223
 
43701
44224
  //#endregion
43702
44225
  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, LambdaPermissionProvider, LambdaUrlProvider, 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 };
43703
- //# sourceMappingURL=provider-classes-DbpGX0KN.js.map
44226
+ //# sourceMappingURL=provider-classes-D76dAHvV.js.map