@go-to-k/cdkd 0.296.19 → 0.296.21

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 (25) hide show
  1. package/dist/{asg-provider-ha36d8C0.js → asg-provider-D5_Zlj5T.js} +2 -2
  2. package/dist/{asg-provider-ha36d8C0.js.map → asg-provider-D5_Zlj5T.js.map} +1 -1
  3. package/dist/cli.js +2 -2
  4. package/dist/{deploy-engine-DFGqFKxg.js → deploy-engine-CFgNpsEy.js} +404 -38
  5. package/dist/deploy-engine-CFgNpsEy.js.map +1 -0
  6. package/dist/iam-policy-targets-BoZuWtxK.js.map +1 -1
  7. package/dist/{iam-role-provider-ClhDA-4n.js → iam-role-provider-lZJS9r6W.js} +2 -2
  8. package/dist/{iam-role-provider-ClhDA-4n.js.map → iam-role-provider-lZJS9r6W.js.map} +1 -1
  9. package/dist/index.d.ts +75 -27
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +2 -2
  12. package/dist/{neptune-provider-DHPdyc-o.js → neptune-provider-DGI_r9C8.js} +2 -2
  13. package/dist/{neptune-provider-DHPdyc-o.js.map → neptune-provider-DGI_r9C8.js.map} +1 -1
  14. package/dist/{program-B71EFlzv.js → program-B5hwPYpu.js} +16 -5
  15. package/dist/program-B5hwPYpu.js.map +1 -0
  16. package/dist/{provider-classes-ByXP467R.js → provider-classes-D9az4nS4.js} +73 -15
  17. package/dist/provider-classes-D9az4nS4.js.map +1 -0
  18. package/dist/{rds-provider-DOBUTuj4.js → rds-provider-CE85wFCg.js} +2 -2
  19. package/dist/{rds-provider-DOBUTuj4.js.map → rds-provider-CE85wFCg.js.map} +1 -1
  20. package/dist/{version-DsDA-Fvw.js → version-_h48bvqX.js} +2 -2
  21. package/dist/{version-DsDA-Fvw.js.map → version-_h48bvqX.js.map} +1 -1
  22. package/package.json +1 -1
  23. package/dist/deploy-engine-DFGqFKxg.js.map +0 -1
  24. package/dist/program-B71EFlzv.js.map +0 -1
  25. package/dist/provider-classes-ByXP467R.js.map +0 -1
@@ -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, Aa as coerceWarmThroughput$1, Ac as displayAssemblyPath, B as S3_AUTO_DELETE_OBJECTS_TAG, Ba as replayWarn, Bn as DBPROXY_TAGS_WHAT, Br as s3BucketWebsiteUrl, Et as awaitInFlightSibling, F as DELETE_INDEX_WAIT_PROCEED_NOTE, Fa as coerceCfnInteger, Fn as earliestDefined, Fr as isSettledInstanceState, Gn as tagMapAsList, Gt as redactedDeleteAddressFields, H as isTruthyCfnBoolean, Ha as requireConfigObject, Hn as planTagDiff, I as INDEX_SETTLE_POLL_INTERVAL_MS, Ia as configBooleanRefusal, Ir as s3BucketArn, Ja as canonicalLambdaFunctionName, Jn as stringifyIfAssigned, Kn as tagPlanWarning, Kt as redactedDeleteAddressSkip, L as deleteTableWithIndexBusyRetry, La as configIntegerRefusal, Ln as reserveStackCreateToken, Lr as s3BucketDomainName, M as deleteBudgetKey, Ma as toCfnInteger, Mc as resolveAssemblyPath, Mo as carriesSecretMask, N as resolveDynamoDbDeleteBudgetClock, Na as toFiniteNumber, O as DynamoDBGlobalTableProvider, Ot as getStackRecords, P as resolveDynamoDbDeleteBudgetMs, Pa as coerceCfnBoolean, R as waitForIndexesSettled, Ra as configStringRefusal, Ri as refuseMalformedNestedChildOutputs, Rr as s3BucketDualStackDomainName, So as redactSecretsForState, To as dynamicReferenceTokens, U as getPriorAttempts, Ua as requireConfigString, Un as readTagList, Ut as REDACTED_DELETE_ADDRESS_SKIP_REASON, V as hasCdkAutoDeleteTag, Va as requireConfigArray, Vn as DBPROXY_TAG_OPTIONS, Vt as getCurrentProducerRegions, W as markRefusedBeforeApplying, Wn as refuseMalformedDesiredTags, Wr as getAccountInfo, Wt as isRedactedRecordedValue, Xa as sameLambdaFunctionAddress, Ya as lambdaFunctionNameForMask, _r as reEnableInstanceApiTermination, a as findNestedTemplateTreeDefect, ao as passedNoEchoParametersOf, ar as unchangedBehindSecretReference, ba as withoutSilentDropProperties, c as renderNestedTemplateTreeDefect, cr as deleteSkipReason, dr as markWaitAbandoned, ei as parseWebACLArn, ft as revertNestedChildFromJournal, ga as withheldAccountClause, gr as reDisableInstanceApiTermination, gt as withNestedStackContext, hc as decodeListingKey, hr as observeThenDisableInstanceApiTermination, hs as rewriteTemplateAssetReferences, ht as getCurrentNestedStackContext, ia as refuseMalformedResourcesForDestroy, ir as slowCcOperationTimeoutMs, j as compensateRemovedDeletionProtection, ja as isWarmThroughputDecrease, jc as renderAssemblyPathEscape, jo as recoverMaskedOutput, k as DYNAMODB_DELETE_MIN_RESOURCE_TIMEOUT_MS, ka as WARM_THROUGHPUT_MEMBERS, kc as describeFileReadFailure, li as accountArgs, lr as withIndeterminateGuard, lt as getNestedRevertRun, mr as isTerminationProtectionPropagationError, o as isAbsoluteAssetPath, pr as ec2InstanceProtectionSite, qa as withRetry, qn as definedAttributes, ri as passedParameterClassesOf, s as listNestedTemplateRows, t as DeployEngine, tr as getCurrentResourceSecrets, uo as hasMaskableValues, ur as isWaitAbandonedError, us as stringifyValue, va as findSilentDropProperties, vc as canonicalizeRegion, xo as markSameGenerationBag, yc as derivePartitionAndUrlSuffix, z as ECR_AUTO_DELETE_IMAGES_TAG, za as readConfigString, zn as acquireIdempotencyToken, zr as s3BucketRegionalDomainName } from "./deploy-engine-DFGqFKxg.js";
6
- import { n as collectInlinePolicyNamesManagedBySiblings, r as IamCreateClientCache, t as IAMRoleProvider } from "./iam-role-provider-ClhDA-4n.js";
7
- import { a as canonicalizeIpProtocolValue, i as resolveSecretDerivedPrincipals, n as runDestroyForStack, o as resolvedResourceTimeoutMs, r as isResolvableSecretPrincipalList, t as canonicalizeIpv4Cidr } from "./program-B71EFlzv.js";
8
- import { RDSProvider } from "./rds-provider-DOBUTuj4.js";
9
- import { NeptuneProvider } from "./neptune-provider-DHPdyc-o.js";
10
- import { ASGProvider } from "./asg-provider-ha36d8C0.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";
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";
@@ -3031,6 +3031,16 @@ function bucketLocationToRegion(constraint) {
3031
3031
  if (value === "eu") return "eu-west-1";
3032
3032
  return value;
3033
3033
  }
3034
+ const FAILED_CREATE_ORPHAN_NOT_EMPTY_SKIP_REASON = "the bucket a failed create left behind is not empty, and cdkd never empties such a bucket: something wrote to it after that create, so it may hold data or have been adopted by another deployment. Empty and delete it yourself if it is not in use";
3035
+ var BucketNotEmptyRefusal = class extends Error {
3036
+ name = "BucketNotEmptyRefusal";
3037
+ };
3038
+ function isPlainBucketName(value) {
3039
+ return typeof value === "string" && /^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$/.test(value);
3040
+ }
3041
+ const BUCKET_LIST_IDENTITY_ATTEMPTS = 3;
3042
+ const BUCKET_LIST_IDENTITY_DELAY_MS = 1500;
3043
+ const BUCKET_LIST_IDENTITY_BUDGET_MS = 6e3;
3034
3044
  function isNoSuchBucketError(error) {
3035
3045
  return error?.name === "NoSuchBucket";
3036
3046
  }
@@ -3137,6 +3147,10 @@ var S3BucketProvider = class S3BucketProvider {
3137
3147
  throw markNameCollision(new ProvisioningError(`Refusing to adopt S3 bucket ${this.shown(bucketName)} for ${displaySafe(logicalId)} (${resourceType}): its BucketName is set explicitly and ${evidence}. S3 does not say who made it, so cdkd cannot tell it from one made outside this stack, and CloudFormation fails the same create. Nothing was applied to it. Choose a bucket name no other bucket holds. If no record of this stack holds that bucket and it is yours (left by an interrupted deploy, or kept by DeletionPolicy: Retain), delete it, or adopt it with \`cdkd import\`, and re-run; confirm it is yours first, since adopting a bucket hands it to this stack's \`cdkd destroy\`.`, resourceType, logicalId, bucketName, "cause" in via ? via.cause : void 0));
3138
3148
  }
3139
3149
  async ownsBucketNamed(bucketName) {
3150
+ const listed = await this.listOwnedBucket(bucketName);
3151
+ return "unknown" in listed ? listed : { owned: listed.bucket !== void 0 };
3152
+ }
3153
+ async listOwnedBucket(bucketName) {
3140
3154
  try {
3141
3155
  let token;
3142
3156
  for (let page = 0; page < 100; page++) {
@@ -3145,13 +3159,14 @@ var S3BucketProvider = class S3BucketProvider {
3145
3159
  MaxBuckets: 1e3,
3146
3160
  ...token !== void 0 ? { ContinuationToken: token } : {}
3147
3161
  }));
3148
- if ((out.Buckets ?? []).some((b) => b.Name === bucketName)) return { owned: true };
3162
+ const found = (out.Buckets ?? []).find((b) => b.Name === bucketName);
3163
+ if (found !== void 0) return { bucket: found };
3149
3164
  token = out.ContinuationToken || void 0;
3150
- if (token === void 0) return { owned: false };
3165
+ if (token === void 0) return { bucket: void 0 };
3151
3166
  }
3152
3167
  return { unknown: "PaginationLimit" };
3153
3168
  } catch (error) {
3154
- this.logger.debug(safeMsg`ListBuckets failed while checking S3 bucket ${this.shown(bucketName)}: ` + safeMsg`${describeAwsFailure(error).detail}`);
3169
+ this.logger.debug(safeMsg`ListBuckets failed while reading this account's bucket list: ` + safeMsg`${describeAwsFailure(error).detail}`);
3155
3170
  return { unknown: error instanceof Error ? error.name : typeof error };
3156
3171
  }
3157
3172
  }
@@ -4333,12 +4348,10 @@ var S3BucketProvider = class S3BucketProvider {
4333
4348
  }
4334
4349
  if (explicitBucketName && preflight.kind === "region" && preflight.region === "us-east-1") this.refuseExplicitNameHeld(logicalId, resourceType, bucketName, { preflightRegion: preflight.region });
4335
4350
  let ownershipUnknown;
4336
- let listedFree = false;
4337
4351
  if (explicitBucketName && preflight.kind === "indeterminate") {
4338
4352
  const owned = await this.ownsBucketNamed(bucketName);
4339
4353
  if ("owned" in owned && owned.owned) this.refuseExplicitNameHeld(logicalId, resourceType, bucketName, { listed: true });
4340
4354
  if ("unknown" in owned) ownershipUnknown = owned.unknown;
4341
- else listedFree = true;
4342
4355
  }
4343
4356
  try {
4344
4357
  const attemptStartMs = Date.now();
@@ -4348,7 +4361,7 @@ var S3BucketProvider = class S3BucketProvider {
4348
4361
  createBucketLatch.noteFailure(logicalId, sendError, attemptStartMs, ambiguousWindow);
4349
4362
  throw sendError;
4350
4363
  }
4351
- createdNewBucket = preflight.kind === "absent" || listedFree;
4364
+ createdNewBucket = preflight.kind === "absent";
4352
4365
  bucketLeftBehind = createdNewBucket;
4353
4366
  if (createdNewBucket) windowSpent = true;
4354
4367
  if (preflight.kind === "region" && preflight.region !== "us-east-1") this.refuseForeignRegionAdopt(logicalId, resourceType, bucketName, "us-east-1", preflight.region);
@@ -4453,12 +4466,17 @@ var S3BucketProvider = class S3BucketProvider {
4453
4466
  }
4454
4467
  async delete(logicalId, physicalId, resourceType, properties, context) {
4455
4468
  this.logger.debug(`Deleting S3 bucket ${displaySafe(logicalId)}: ${displaySafe(physicalId)}`);
4456
- const allowAutoEmpty = context?.forceDataDelete === true || hasCdkAutoDeleteTag(properties, "aws-cdk:auto-delete-objects");
4469
+ const failedCreateOrphan = context?.failedCreateOrphan === true;
4470
+ const allowAutoEmpty = !failedCreateOrphan && (context?.forceDataDelete === true || hasCdkAutoDeleteTag(properties, "aws-cdk:auto-delete-objects"));
4457
4471
  if (context?.expectedRegion) await this.assertStateBucketRegion("delete", logicalId, resourceType, physicalId, context.expectedRegion, context);
4458
4472
  else this.announceUnverifiedBucketIdentity("delete", logicalId, physicalId, noRecordedRegionCause());
4459
4473
  try {
4460
4474
  await this.deleteBucketWithEmptyRetry(logicalId, physicalId, allowAutoEmpty);
4461
4475
  } catch (error) {
4476
+ if (failedCreateOrphan && error instanceof BucketNotEmptyRefusal) return {
4477
+ outcome: "skipped",
4478
+ reason: FAILED_CREATE_ORPHAN_NOT_EMPTY_SKIP_REASON
4479
+ };
4462
4480
  if (error instanceof NoSuchBucket) {
4463
4481
  const clientRegion = await this.s3Client.config.region();
4464
4482
  assertRegionMatch(clientRegion, context?.expectedRegion, resourceType, logicalId, physicalId);
@@ -5020,6 +5038,34 @@ var S3BucketProvider = class S3BucketProvider {
5020
5038
  if (filter?.["Prefix"] !== void 0) out["Prefix"] = filter["Prefix"];
5021
5039
  return out;
5022
5040
  }
5041
+ async isSameResource(journaledPhysicalId, record, resourceType, context) {
5042
+ if (resourceType !== "AWS::S3::Bucket") return "unknown";
5043
+ if (!isPlainBucketName(journaledPhysicalId) || !isPlainBucketName(record.physicalId)) return "unknown";
5044
+ if (journaledPhysicalId === record.physicalId) return "same";
5045
+ const want = canonicalizeRegion(context.expectedRegion);
5046
+ if (canonicalizeRegion(await this.getRegion()) !== want) return "unknown";
5047
+ const probe = await this.probeBucketRegion(record.physicalId);
5048
+ return probe.kind === "region" && probe.region === want ? "different" : "unknown";
5049
+ }
5050
+ async resourceIdentity(physicalId, resourceType, context) {
5051
+ if (resourceType !== "AWS::S3::Bucket" || !isPlainBucketName(physicalId)) return void 0;
5052
+ const want = canonicalizeRegion(context.expectedRegion);
5053
+ if (canonicalizeRegion(await this.getRegion()) !== want) return void 0;
5054
+ const probe = await this.probeBucketRegion(physicalId);
5055
+ if (probe.kind === "absent") return RESOURCE_NOT_FOUND;
5056
+ if (probe.kind !== "region" || probe.region !== want) return void 0;
5057
+ const started = Date.now();
5058
+ for (let attempt = 0; attempt < BUCKET_LIST_IDENTITY_ATTEMPTS; attempt++) {
5059
+ if (attempt > 0) {
5060
+ if (Date.now() - started > BUCKET_LIST_IDENTITY_BUDGET_MS) return void 0;
5061
+ await new Promise((r) => setTimeout(r, BUCKET_LIST_IDENTITY_DELAY_MS));
5062
+ }
5063
+ const listed = await this.listOwnedBucket(physicalId);
5064
+ if ("unknown" in listed) return void 0;
5065
+ const created = listed.bucket?.CreationDate;
5066
+ if (created instanceof Date && !Number.isNaN(created.getTime())) return `${physicalId}|${want}|${created.toISOString()}`;
5067
+ }
5068
+ }
5023
5069
  async import(input) {
5024
5070
  const explicit = resolveExplicitPhysicalId(input, "BucketName");
5025
5071
  if (explicit) try {
@@ -5044,7 +5090,7 @@ var S3BucketProvider = class S3BucketProvider {
5044
5090
  } catch (error) {
5045
5091
  const msg = describeAwsFailure(error).detail;
5046
5092
  if (msg.includes("not empty") || msg.includes("BucketNotEmpty")) {
5047
- if (!allowAutoEmpty) throw new Error(`bucket ${displaySafe(bucketName)} is not empty. Matching CloudFormation, cdkd does not delete a non-empty bucket unless it opted into automatic emptying (CDK's autoDeleteObjects: true, i.e. the '${S3_AUTO_DELETE_OBJECTS_TAG}' tag). Either empty the bucket first (delete all objects — and for versioned buckets all object versions and delete markers), or redeploy with autoDeleteObjects: true and destroy again.`);
5093
+ if (!allowAutoEmpty) throw new BucketNotEmptyRefusal(`bucket ${displaySafe(bucketName)} is not empty. Matching CloudFormation, cdkd does not delete a non-empty bucket unless it opted into automatic emptying (CDK's autoDeleteObjects: true, i.e. the '${S3_AUTO_DELETE_OBJECTS_TAG}' tag). Either empty the bucket first (delete all objects — and for versioned buckets all object versions and delete markers), or redeploy with autoDeleteObjects: true and destroy again.`);
5048
5094
  this.logger.info(`Bucket ${displaySafe(bucketName)} not empty (attempt ${attempt}/${maxAttempts}), emptying (auto-delete opt-in present)...`);
5049
5095
  await this.emptyBucket(bucketName);
5050
5096
  continue;
@@ -43817,6 +43863,17 @@ var NestedStackProvider = class {
43817
43863
  nestedTemplates: void 0,
43818
43864
  childUnaddressed: void 0
43819
43865
  };
43866
+ const childNoEchoReresolver = deleteContext?.noEchoReresolver === void 0 ? void 0 : await deleteContext.noEchoReresolver.forNestedChild(logicalId, {
43867
+ properties: _properties,
43868
+ noEchoLeaves: deleteContext.recordedNoEchoLeaves,
43869
+ values: deleteContext.noEchoDeleteValues
43870
+ }, childStackName, (templatePath) => {
43871
+ const { template, grandchildTemplates } = this.readChildTemplate(templatePath);
43872
+ return {
43873
+ template,
43874
+ nestedTemplates: grandchildTemplates
43875
+ };
43876
+ }, (properties) => this.extractParameters(properties));
43820
43877
  const childResult = await withNestedStackContext(childCtx, () => runDestroyForStack(childStackName, childStateData.state, {
43821
43878
  stateBackend: ctx.stateBackend,
43822
43879
  lockManager: ctx.lockManager,
@@ -43832,6 +43889,7 @@ var NestedStackProvider = class {
43832
43889
  ...deleteContext?.removeProtection === true && { removeProtection: true },
43833
43890
  ...deleteContext?.resolveSecretDerivedPrincipals !== void 0 && { resolveSecretDerivedPrincipals: { inheritedProducerRegions: deleteContext.resolveSecretDerivedPrincipals.importedProducerRegions } },
43834
43891
  ...deleteContext?.stackDestroy === true && { stackDestroy: true },
43892
+ ...childNoEchoReresolver !== void 0 && { noEchoReresolver: childNoEchoReresolver },
43835
43893
  ...(ctx.destroyOptions?.skipFinalSnapshot === true || ctx.options?.skipFinalSnapshot === true) && { skipFinalSnapshot: true },
43836
43894
  ...ctx.destroyOptions?.resourceWarnAfterMs !== void 0 && { resourceWarnAfterMs: ctx.destroyOptions.resourceWarnAfterMs },
43837
43895
  ...ctx.destroyOptions?.resourceTimeoutMs !== void 0 && { resourceTimeoutMs: ctx.destroyOptions.resourceTimeoutMs },
@@ -44377,4 +44435,4 @@ var ACMCertificateProvider = class {
44377
44435
 
44378
44436
  //#endregion
44379
44437
  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 };
44380
- //# sourceMappingURL=provider-classes-ByXP467R.js.map
44438
+ //# sourceMappingURL=provider-classes-D9az4nS4.js.map