@go-to-k/cdkd 0.296.21 → 0.296.23

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.
@@ -2,12 +2,12 @@ import { r as getAwsClients } from "./aws-clients-CnmtbrxD.js";
2
2
  import { F as displayStackName, I as isPasteableIdent, N as displayIdent, O as SECRET_REF_MAX_CODE_POINTS, P as displaySafe, R as plainIdentOr, a as getLogger, b as generateResourceNameWithFallback, n as isAwsAuthoredFailure, r as safeStringify, t as describeAwsFailure, y as generateResourceName, z as safeMsg } from "./aws-failure-text-BaWeCWRz.js";
3
3
  import { $ as protectedReplacementAdvice, $t as AccountIdUnavailableError, A as isQuotableImportValue, An as commandHole, B as isTerminalDeleteFailure, C as setBounded, D as VALUE_NOT_SHOWN, E as assertRegionMatch, F as resolveExplicitPhysicalId, Fn as plainOrDescribed, H as observeThenDisableProtection, Jn as markNameCollision, Jt as withPasteableAwsProfile, L as ProtectionFlipRegistry, M as quotedRemedyLogicalId, Mn as isInertUnquoted, Mt as markCreatedBeforeFailure, N as refusalTypeShown, Nn as pasteableCommand, O as isPlainImportJson, P as remedyLogicalId, Q as pasteableAwsCommand, Qn as isAmbiguousOutcomeError, Qt as credentialFingerprint, Rn as shellQuote, S as replayedSendWindow, St as withDerivedNameMasks, T as RESOURCE_NOT_FOUND, Tt as clearCreatedBeforeFailure, U as protectionFlipKey, Ut as injectiveKey, V as logGroupProtectionSite, W as rdsFamilyProtectionSite, Wt as injectiveKeyPrefix, X as WITHHELD_AWS_COMMAND, Xt as ambientCredentialConfig, Y as UNNAMEABLE_ID_CLAUSE, Yn as markReplayMayCollide, Yt as ambientClientDefaults, Z as isAwsCliLiteral, Zt as clientDefaultsFor, _ as RecentIdSet, _n as ResourceUpdateNotSupportedError, _t as createMaskedLogSinks, a as onlySecretDerived, ar as isThrottlingError, at as startInterruptWatch, b as isInsideWindow, bt as maskDeep, c as recordedPrincipalsRepair, cr as wrapMaskedAwsError, ct as canonicalizeRoute53QueryName, dt as compositeIdSkipResult, er as isRetryableTransientError, et as renderDisableCommand, ft as logicalIdShown, g as AmbiguousCreateLatch, gt as stateOrphanRecordRemedy, h as AMBIGUOUS_LATCH_TTL_MS, hn as ProvisioningError, ht as segmentAfterAnchor, i as holdsSecretDerivedEntry, ir as isMarkedNonRetryable, it as isInterruptedWaitError, j as normalizeAwsTagsToCfn, jn as hasClauseBreak, jt as markAuxiliaryFailure, k as isPlainImportValue, lt as compositeIdFormatMessage, o as readPrincipalLists, or as markNonRetryable, ot as ElapsedBudgetRegistry, p as withRemovalDefaults, pt as packCompositeId, q as userPoolProtectionSite, r as SECRET_DERIVED_READ_LIVE, rr as THROTTLING_ERROR_NAMES, sr as markRedactedCause, tn as CdkdError, tr as isTransientServerError, u as clearOnUpdateRemoval, ut as compositeIdSeparatorRefusal, v as ambiguousAttemptLead, vt as createMaskedRetryLogger, w as withoutServerErrorRetries, x as replayFollowedAmbiguousAttempt, xt as maskerOrIdentity, y as createAttemptKey, yt as isSecretDerivedValue, z as deleteWithProtectionCompensation, zn as withheldTargetClause } from "./iam-policy-targets-BoZuWtxK.js";
4
4
  import { s as ambientRegion } from "./aws-client-defaults-D0q0z4dG.js";
5
- import { A as beginDeleteWait, B as S3_AUTO_DELETE_OBJECTS_TAG, Ba as configStringRefusal, Bi as refuseMalformedNestedChildOutputs, Bn as DBPROXY_TAGS_WHAT, Br as s3BucketDualStackDomainName, Co as markSameGenerationBag, Do as dynamicReferenceTokens, Et as awaitInFlightSibling, F as DELETE_INDEX_WAIT_PROCEED_NOTE, Fa as toFiniteNumber, Fn as earliestDefined, Ga as requireConfigString, Gn as tagMapAsList, Gt as redactedDeleteAddressFields, H as isTruthyCfnBoolean, Ha as replayWarn, Hn as planTagDiff, Hr as s3BucketWebsiteUrl, I as INDEX_SETTLE_POLL_INTERVAL_MS, Ia as coerceCfnBoolean, Jn as stringifyIfAssigned, Kn as tagPlanWarning, Kr as getAccountInfo, Kt as redactedDeleteAddressSkip, L as deleteTableWithIndexBusyRetry, La as coerceCfnInteger, Ln as reserveStackCreateToken, Lr as isSettledInstanceState, M as deleteBudgetKey, Ma as coerceWarmThroughput$1, Mc as displayAssemblyPath, N as resolveDynamoDbDeleteBudgetClock, Na as isWarmThroughputDecrease, Nc as renderAssemblyPathEscape, No as recoverMaskedOutput, O as DynamoDBGlobalTableProvider, Ot as getStackRecords, P as resolveDynamoDbDeleteBudgetMs, Pa as toCfnInteger, Pc as resolveAssemblyPath, Po as carriesSecretMask, Qa as sameLambdaFunctionAddress, R as waitForIndexesSettled, Ra as configBooleanRefusal, Rr as s3BucketArn, Sa as withoutSilentDropProperties, U as getPriorAttempts, Ua as requireConfigArray, Un as readTagList, Ut as REDACTED_DELETE_ADDRESS_SKIP_REASON, V as hasCdkAutoDeleteTag, Va as readConfigString, Vn as DBPROXY_TAG_OPTIONS, Vr as s3BucketRegionalDomainName, Vt as getCurrentProducerRegions, W as markRefusedBeforeApplying, Wa as requireConfigObject, Wn as refuseMalformedDesiredTags, Wt as isRedactedRecordedValue, Xa as canonicalLambdaFunctionName, Ya as withRetry, Za as lambdaFunctionNameForMask, _c as decodeListingKey, _r as observeThenDisableInstanceApiTermination, _s as rewriteTemplateAssetReferences, a as findNestedTemplateTreeDefect, ai as passedParameterClassesOf, ba as findSilentDropProperties, bc as canonicalizeRegion, c as renderNestedTemplateTreeDefect, di as accountArgs, dr as withIndeterminateGuard, fo as hasMaskableValues, fr as isWaitAbandonedError, fs as stringifyValue, ft as revertNestedChildFromJournal, gr as isTerminationProtectionPropagationError, gt as withNestedStackContext, hr as ec2InstanceProtectionSite, ht as getCurrentNestedStackContext, j as compensateRemovedDeletionProtection, ja as WARM_THROUGHPUT_MEMBERS, jc as describeFileReadFailure, k as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, lt as getNestedRevertRun, ni as parseWebACLArn, o as isAbsoluteAssetPath, oa as refuseMalformedResourcesForDestroy, or as slowCcOperationTimeoutMs, pr as markWaitAbandoned, qn as definedAttributes, rr as getCurrentResourceSecrets, s as listNestedTemplateRows, so as passedNoEchoParametersOf, sr as unchangedBehindSecretReference, t as DeployEngine, ur as deleteSkipReason, va as withheldAccountClause, vr as reDisableInstanceApiTermination, wo as redactSecretsForState, xc as derivePartitionAndUrlSuffix, yr as reEnableInstanceApiTermination, z as ECR_AUTO_DELETE_IMAGES_TAG, za as configIntegerRefusal, zn as acquireIdempotencyToken, zr as s3BucketDomainName } from "./deploy-engine-CFgNpsEy.js";
6
- import { n as collectInlinePolicyNamesManagedBySiblings, r as IamCreateClientCache, t as IAMRoleProvider } from "./iam-role-provider-lZJS9r6W.js";
7
- import { a as canonicalizeIpProtocolValue, i as resolveSecretDerivedPrincipals, n as runDestroyForStack, o as resolvedResourceTimeoutMs, r as isResolvableSecretPrincipalList, t as canonicalizeIpv4Cidr } from "./program-B5hwPYpu.js";
8
- import { RDSProvider } from "./rds-provider-CE85wFCg.js";
9
- import { NeptuneProvider } from "./neptune-provider-DGI_r9C8.js";
10
- import { ASGProvider } from "./asg-provider-D5_Zlj5T.js";
5
+ import { $n as stringifyIfAssigned, B as deleteTableWithIndexBusyRetry, Ba as toFiniteNumber, Bn as earliestDefined, Ca as withheldAccountClause, Cr as reDisableInstanceApiTermination, Da as withoutSilentDropProperties, Ec as derivePartitionAndUrlSuffix, F as deleteBudgetKey, G as isTruthyCfnBoolean, Ga as configStringRefusal, Gi as refuseMalformedNestedChildOutputs, Gn as DBPROXY_TAGS_WHAT, Gr as s3BucketDualStackDomainName, H as ECR_AUTO_DELETE_IMAGES_TAG, Ha as coerceCfnInteger, Hn as reserveStackCreateToken, Hr as isSettledInstanceState, I as resolveDynamoDbDeleteBudgetClock, Ia as WARM_THROUGHPUT_MEMBERS, Ic as describeFileReadFailure, Ja as requireConfigArray, Jn as readTagList, Jt as REDACTED_DELETE_ADDRESS_SKIP_REASON, K as getPriorAttempts, Ka as readConfigString, Kn as DBPROXY_TAG_OPTIONS, Kr as s3BucketRegionalDomainName, Kt as getCurrentProducerRegions, L as resolveDynamoDbDeleteBudgetMs, La as coerceWarmThroughput$1, Lc as displayAssemblyPath, M as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, Mo as dynamicReferenceTokens, N as beginDeleteWait, Oo as markSameGenerationBag, P as compensateRemovedDeletionProtection, Qn as definedAttributes, R as DELETE_INDEX_WAIT_PROCEED_NOTE, Ra as isWarmThroughputDecrease, Rc as renderAssemblyPathEscape, Ro as recoverMaskedOutput, Sc as decodeListingKey, Sr as observeThenDisableInstanceApiTermination, Ss as rewriteTemplateAssetReferences, Ta as findSilentDropProperties, Tc as canonicalizeRegion, U as S3_AUTO_DELETE_OBJECTS_TAG, Ua as configBooleanRefusal, Ur as s3BucketArn, V as waitForIndexesSettled, Va as coerceCfnBoolean, W as hasCdkAutoDeleteTag, Wa as configIntegerRefusal, Wn as acquireIdempotencyToken, Wr as s3BucketDomainName, Xa as requireConfigString, Xn as tagMapAsList, Xt as redactedDeleteAddressFields, Ya as requireConfigObject, Yn as refuseMalformedDesiredTags, Yt as isRedactedRecordedValue, Zn as tagPlanWarning, Zr as getAccountInfo, Zt as redactedDeleteAddressSkip, _o as hasMaskableValues, _r as isWaitAbandonedError, _s as stringifyValue, a as findNestedTemplateTreeDefect, br as ec2InstanceProtectionSite, c as renderNestedTemplateTreeDefect, cr as getCurrentResourceSecrets, da as refuseMalformedResourcesForDestroy, dr as slowCcOperationTimeoutMs, eo as withRetry, fo as passedNoEchoParametersOf, fr as unchangedBehindSecretReference, ft as getNestedRevertRun, gi as accountArgs, gr as withIndeterminateGuard, hr as deleteSkipReason, ht as revertNestedChildFromJournal, j as DynamoDBGlobalTableProvider, jt as getStackRecords, ko as redactSecretsForState, kt as awaitInFlightSibling, no as lambdaFunctionNameForMask, o as isAbsoluteAssetPath, q as markRefusedBeforeApplying, qa as replayWarn, qn as planTagDiff, qr as s3BucketWebsiteUrl, ro as sameLambdaFunctionAddress, s as listNestedTemplateRows, si as parseWebACLArn, t as DeployEngine, to as canonicalLambdaFunctionName, ui as passedParameterClassesOf, vr as markWaitAbandoned, vt as getCurrentNestedStackContext, wr as reEnableInstanceApiTermination, xr as isTerminationProtectionPropagationError, yt as withNestedStackContext, z as INDEX_SETTLE_POLL_INTERVAL_MS, za as toCfnInteger, zc as resolveAssemblyPath, zo as carriesSecretMask } from "./deploy-engine-B0TGnXSs.js";
6
+ import { n as collectInlinePolicyNamesManagedBySiblings, r as IamCreateClientCache, t as IAMRoleProvider } from "./iam-role-provider-D8-QqG1A.js";
7
+ import { a as canonicalizeIpProtocolValue, i as resolveSecretDerivedPrincipals, n as runDestroyForStack, o as resolvedResourceTimeoutMs, r as isResolvableSecretPrincipalList, t as canonicalizeIpv4Cidr } from "./program-CHANXTqP.js";
8
+ import { RDSProvider } from "./rds-provider-B9-Nsiua.js";
9
+ import { NeptuneProvider } from "./neptune-provider-eboBIa2N.js";
10
+ import { ASGProvider } from "./asg-provider-CJ_0sDJ0.js";
11
11
  import { createHash, randomUUID } from "node:crypto";
12
12
  import { CreateBucketCommand, DeleteBucketAnalyticsConfigurationCommand, DeleteBucketCommand, DeleteBucketCorsCommand, DeleteBucketEncryptionCommand, DeleteBucketIntelligentTieringConfigurationCommand, DeleteBucketInventoryConfigurationCommand, DeleteBucketLifecycleCommand, DeleteBucketMetricsConfigurationCommand, DeleteBucketOwnershipControlsCommand, DeleteBucketPolicyCommand, DeleteBucketReplicationCommand, DeleteBucketTaggingCommand, DeleteBucketWebsiteCommand, DeleteObjectsCommand, GetBucketAccelerateConfigurationCommand, GetBucketCorsCommand, GetBucketEncryptionCommand, GetBucketLifecycleConfigurationCommand, GetBucketLocationCommand, GetBucketLoggingCommand, GetBucketNotificationConfigurationCommand, GetBucketOwnershipControlsCommand, GetBucketPolicyCommand, GetBucketReplicationCommand, GetBucketTaggingCommand, GetBucketVersioningCommand, GetBucketWebsiteCommand, GetObjectCommand, GetObjectLockConfigurationCommand, GetPublicAccessBlockCommand, HeadBucketCommand, ListBucketAnalyticsConfigurationsCommand, ListBucketIntelligentTieringConfigurationsCommand, ListBucketInventoryConfigurationsCommand, ListBucketMetricsConfigurationsCommand, ListBucketsCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchBucket, PutBucketAccelerateConfigurationCommand, PutBucketAnalyticsConfigurationCommand, PutBucketCorsCommand, PutBucketEncryptionCommand, PutBucketIntelligentTieringConfigurationCommand, PutBucketInventoryConfigurationCommand, PutBucketLifecycleConfigurationCommand, PutBucketLoggingCommand, PutBucketMetricsConfigurationCommand, PutBucketNotificationConfigurationCommand, PutBucketOwnershipControlsCommand, PutBucketPolicyCommand, PutBucketReplicationCommand, PutBucketTaggingCommand, PutBucketVersioningCommand, PutBucketWebsiteCommand, PutObjectLockConfigurationCommand, PutPublicAccessBlockCommand, S3Client } from "@aws-sdk/client-s3";
13
13
  import { AddRoleToInstanceProfileCommand, AddUserToGroupCommand, AttachGroupPolicyCommand, AttachRolePolicyCommand, AttachUserPolicyCommand, CreateAccessKeyCommand, CreateGroupCommand, CreateInstanceProfileCommand, CreateLoginProfileCommand, CreatePolicyCommand, CreatePolicyVersionCommand, CreateUserCommand, DeleteAccessKeyCommand, DeleteGroupCommand, DeleteGroupPolicyCommand, DeleteInstanceProfileCommand, DeleteLoginProfileCommand, DeletePolicyCommand, DeletePolicyVersionCommand, DeleteRolePolicyCommand, DeleteUserCommand, DeleteUserPermissionsBoundaryCommand, DeleteUserPolicyCommand, DetachGroupPolicyCommand, DetachRolePolicyCommand, DetachUserPolicyCommand, GetAccessKeyLastUsedCommand, GetGroupCommand, GetGroupPolicyCommand, GetInstanceProfileCommand, GetPolicyCommand, GetPolicyVersionCommand, GetRolePolicyCommand, GetUserCommand, GetUserPolicyCommand, IAMClient, ListAccessKeysCommand, ListAttachedGroupPoliciesCommand, ListAttachedUserPoliciesCommand, ListEntitiesForPolicyCommand, ListGroupPoliciesCommand, ListGroupsForUserCommand, ListPoliciesCommand, ListPolicyTagsCommand, ListPolicyVersionsCommand, ListUserPoliciesCommand, NoSuchEntityException, PutGroupPolicyCommand, PutRolePolicyCommand, PutUserPermissionsBoundaryCommand, PutUserPolicyCommand, RemoveRoleFromInstanceProfileCommand, RemoveUserFromGroupCommand, TagPolicyCommand, TagUserCommand, UntagPolicyCommand, UntagUserCommand, UpdateAccessKeyCommand, UpdateLoginProfileCommand } from "@aws-sdk/client-iam";
@@ -3089,6 +3089,23 @@ function holdCreateBucketWindow(logicalId, window) {
3089
3089
  heldAtMs: Date.now()
3090
3090
  });
3091
3091
  }
3092
+ const ownLeftoverBuckets = /* @__PURE__ */ new Map();
3093
+ function holdOwnLeftoverBucket(logicalId, identity) {
3094
+ setBounded(ownLeftoverBuckets, createAttemptKey("CreateBucket", logicalId), {
3095
+ identity,
3096
+ heldAtMs: Date.now()
3097
+ });
3098
+ }
3099
+ const OWN_LEFTOVER_IDENTITY_TIMEOUT_MS = 1e4;
3100
+ function tokenDate(token) {
3101
+ return token.slice(token.lastIndexOf("|") + 1);
3102
+ }
3103
+ function takeOwnLeftoverBucket(logicalId) {
3104
+ const key = createAttemptKey("CreateBucket", logicalId);
3105
+ const held = ownLeftoverBuckets.get(key);
3106
+ ownLeftoverBuckets.delete(key);
3107
+ return held !== void 0 && Date.now() - held.heldAtMs <= 18e5 ? held.identity : void 0;
3108
+ }
3092
3109
  var S3BucketProvider = class S3BucketProvider {
3093
3110
  s3Client;
3094
3111
  createClientHolder = {};
@@ -3150,6 +3167,40 @@ var S3BucketProvider = class S3BucketProvider {
3150
3167
  const listed = await this.listOwnedBucket(bucketName);
3151
3168
  return "unknown" in listed ? listed : { owned: listed.bucket !== void 0 };
3152
3169
  }
3170
+ async boundedIdentity(bucketName, resourceType, region) {
3171
+ let timer;
3172
+ try {
3173
+ return await Promise.race([this.resourceIdentity(bucketName, resourceType, { expectedRegion: region }), new Promise((resolve) => {
3174
+ timer = setTimeout(() => resolve(void 0), OWN_LEFTOVER_IDENTITY_TIMEOUT_MS);
3175
+ })]);
3176
+ } finally {
3177
+ clearTimeout(timer);
3178
+ }
3179
+ }
3180
+ async holdOwnLeftover(logicalId, resourceType, bucketName) {
3181
+ try {
3182
+ const region = canonicalizeRegion(await this.getRegion());
3183
+ const identity = await this.boundedIdentity(bucketName, resourceType, region);
3184
+ if (typeof identity === "string") {
3185
+ holdOwnLeftoverBucket(logicalId, identity);
3186
+ this.logger.debug(safeMsg`Recorded the bucket ${this.shown(bucketName)} this failed create of ${displaySafe(logicalId)} leaves (created ${tokenDate(identity)}), for its retry`);
3187
+ } else this.logger.debug(safeMsg`No identity for the bucket ${this.shown(bucketName)} this failed create of ${displaySafe(logicalId)} leaves; a retry will refuse it`);
3188
+ } catch {}
3189
+ }
3190
+ async isOwnLeftoverBucket(leftover, bucketName, resourceType, region) {
3191
+ if (leftover === void 0) {
3192
+ this.logger.debug(safeMsg`Not this create's own bucket: no earlier attempt recorded ${this.shown(bucketName)}`);
3193
+ return false;
3194
+ }
3195
+ try {
3196
+ const identity = await this.boundedIdentity(bucketName, resourceType, region);
3197
+ if (typeof identity === "string" && identity === leftover) return true;
3198
+ this.logger.debug(safeMsg`Not this create's own bucket: ${this.shown(bucketName)} reads ` + safeMsg`${typeof identity === "string" ? `created ${tokenDate(identity)}` : "no identity"}, ` + safeMsg`the earlier attempt recorded created ${tokenDate(leftover)}`);
3199
+ return false;
3200
+ } catch {
3201
+ return false;
3202
+ }
3203
+ }
3153
3204
  async listOwnedBucket(bucketName) {
3154
3205
  try {
3155
3206
  let token;
@@ -4342,30 +4393,38 @@ var S3BucketProvider = class S3BucketProvider {
4342
4393
  let createdNewBucket = false;
4343
4394
  const createClient = await this.getCreateClient();
4344
4395
  ambiguousWindow = takeCreateBucketWindow(logicalId);
4396
+ const ownLeftover = takeOwnLeftoverBucket(logicalId);
4397
+ const adoptedOwnLeftover = explicitBucketName && ownLeftover !== void 0 && context?.replayingState !== true && await this.isOwnLeftoverBucket(ownLeftover, bucketName, resourceType, canonicalRegion);
4398
+ if (adoptedOwnLeftover) {
4399
+ createdNewBucket = true;
4400
+ bucketLeftBehind = true;
4401
+ }
4345
4402
  if (ambiguousWindow !== void 0 && (preflight.kind === "indeterminate" || preflight.kind === "region" && preflight.region === "us-east-1")) {
4346
4403
  windowSpent = true;
4347
4404
  this.refuseAmbiguousCreateAdopt(logicalId, resourceType, bucketName, canonicalRegion, { preflight: preflight.kind }, explicitBucketName);
4348
4405
  }
4349
- if (explicitBucketName && preflight.kind === "region" && preflight.region === "us-east-1") this.refuseExplicitNameHeld(logicalId, resourceType, bucketName, { preflightRegion: preflight.region });
4406
+ if (explicitBucketName && preflight.kind === "region" && preflight.region === "us-east-1") {
4407
+ if (!adoptedOwnLeftover) this.refuseExplicitNameHeld(logicalId, resourceType, bucketName, { preflightRegion: preflight.region });
4408
+ }
4350
4409
  let ownershipUnknown;
4351
- if (explicitBucketName && preflight.kind === "indeterminate") {
4410
+ if (explicitBucketName && preflight.kind === "indeterminate" && !adoptedOwnLeftover) {
4352
4411
  const owned = await this.ownsBucketNamed(bucketName);
4353
4412
  if ("owned" in owned && owned.owned) this.refuseExplicitNameHeld(logicalId, resourceType, bucketName, { listed: true });
4354
4413
  if ("unknown" in owned) ownershipUnknown = owned.unknown;
4355
4414
  }
4356
4415
  try {
4357
4416
  const attemptStartMs = Date.now();
4358
- try {
4417
+ if (!adoptedOwnLeftover) try {
4359
4418
  await createClient.send(new CreateBucketCommand(createParams));
4360
4419
  } catch (sendError) {
4361
4420
  createBucketLatch.noteFailure(logicalId, sendError, attemptStartMs, ambiguousWindow);
4362
4421
  throw sendError;
4363
4422
  }
4364
- createdNewBucket = preflight.kind === "absent";
4423
+ createdNewBucket = adoptedOwnLeftover || preflight.kind === "absent";
4365
4424
  bucketLeftBehind = createdNewBucket;
4366
4425
  if (createdNewBucket) windowSpent = true;
4367
4426
  if (preflight.kind === "region" && preflight.region !== "us-east-1") this.refuseForeignRegionAdopt(logicalId, resourceType, bucketName, "us-east-1", preflight.region);
4368
- 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.`);
4427
+ if (preflight.kind === "region" && !adoptedOwnLeftover) 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.`);
4369
4428
  if (ownershipUnknown !== void 0 && preflight.kind === "indeterminate") this.logger.warn(safeMsg`S3 bucket ${this.shown(bucketName)} for ${displaySafe(logicalId)} (${resourceType}) was ` + `sent to CreateBucket without knowing whether a bucket of that explicit name ` + safeMsg`already existed: the region probe (${preflight.errorName}) and the bucket ` + safeMsg`listing (${ownershipUnknown}) both failed. In us-east-1 CreateBucket answers 200 ` + "OK over a bucket you own, so if one existed it has now been configured and recorded as this stack's. Re-run with --verbose for AWS's own message.");
4370
4429
  this.logger.debug(`Created S3 bucket: ${this.shown(bucketName)}`);
4371
4430
  } catch (createError) {
@@ -4414,7 +4473,10 @@ var S3BucketProvider = class S3BucketProvider {
4414
4473
  } catch (error) {
4415
4474
  if (ambiguousWindow !== void 0 && !windowSpent) holdCreateBucketWindow(logicalId, ambiguousWindow);
4416
4475
  const thrown = this.wrapOperationError("create", logicalId, resourceType, bucketName, error);
4417
- if (bucketLeftBehind) markCreatedBeforeFailure(thrown, logicalId, resourceType, bucketName);
4476
+ if (bucketLeftBehind) {
4477
+ markCreatedBeforeFailure(thrown, logicalId, resourceType, bucketName);
4478
+ if (explicitBucketName) await this.holdOwnLeftover(logicalId, resourceType, bucketName);
4479
+ }
4418
4480
  throw thrown;
4419
4481
  }
4420
4482
  }
@@ -44435,4 +44497,4 @@ var ACMCertificateProvider = class {
44435
44497
 
44436
44498
  //#endregion
44437
44499
  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 };
44438
- //# sourceMappingURL=provider-classes-D9az4nS4.js.map
44500
+ //# sourceMappingURL=provider-classes-DpgveKU5.js.map