@cdkd/cli 0.343.0 → 0.344.0

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 (40) hide show
  1. package/dist/{ambient-client-defaults-CPmXchp0.js → ambient-client-defaults-w6GrD1cQ.js} +10 -4
  2. package/dist/ambient-client-defaults-w6GrD1cQ.js.map +1 -0
  3. package/dist/{asg-provider-Bppos8EY.js → asg-provider-BNaBEVOz.js} +6 -6
  4. package/dist/{asg-provider-Bppos8EY.js.map → asg-provider-BNaBEVOz.js.map} +1 -1
  5. package/dist/{aws-client-defaults-BayGUTJ4.js → aws-client-defaults-DP5k4Mfi.js} +5 -2
  6. package/dist/{aws-client-defaults-BayGUTJ4.js.map → aws-client-defaults-DP5k4Mfi.js.map} +1 -1
  7. package/dist/{aws-clients-C8p6sQfr.js → aws-clients-CUCH-WCd.js} +2 -2
  8. package/dist/{aws-clients-C8p6sQfr.js.map → aws-clients-CUCH-WCd.js.map} +1 -1
  9. package/dist/{aws-failure-text-zxW2CTmF.js → aws-failure-text-jomzO3aT.js} +5 -2
  10. package/dist/{aws-failure-text-zxW2CTmF.js.map → aws-failure-text-jomzO3aT.js.map} +1 -1
  11. package/dist/cli.js +2 -2
  12. package/dist/{db-instance-modify-retry-NFYmLL_I.js → db-instance-modify-retry-BwAEmSQH.js} +4 -4
  13. package/dist/{db-instance-modify-retry-NFYmLL_I.js.map → db-instance-modify-retry-BwAEmSQH.js.map} +1 -1
  14. package/dist/{deploy-engine-9vVOF1h_.js → deploy-engine-BB7LVmAG.js} +40 -15
  15. package/dist/deploy-engine-BB7LVmAG.js.map +1 -0
  16. package/dist/{ecr-uri-NwcD6PUe.js → ecr-uri-CzGt7ztW.js} +3 -3
  17. package/dist/{ecr-uri-NwcD6PUe.js.map → ecr-uri-CzGt7ztW.js.map} +1 -1
  18. package/dist/{iam-role-provider-D3txh4Jy.js → iam-role-provider-BlSi1iNz.js} +6 -6
  19. package/dist/{iam-role-provider-D3txh4Jy.js.map → iam-role-provider-BlSi1iNz.js.map} +1 -1
  20. package/dist/index.d.ts +5 -0
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +5 -5
  23. package/dist/{neptune-provider-DZOT1xuJ.js → neptune-provider-oRAIG3Kd.js} +7 -7
  24. package/dist/{neptune-provider-DZOT1xuJ.js.map → neptune-provider-oRAIG3Kd.js.map} +1 -1
  25. package/dist/{program-DP4g5uS3.js → program-BQH8NPXj.js} +506 -212
  26. package/dist/program-BQH8NPXj.js.map +1 -0
  27. package/dist/{provider-classes-CHzimhh6.js → provider-classes-DmCFkSIr.js} +13 -13
  28. package/dist/{provider-classes-CHzimhh6.js.map → provider-classes-DmCFkSIr.js.map} +1 -1
  29. package/dist/{rds-provider-CePynqbO.js → rds-provider-D7y6wD4F.js} +8 -8
  30. package/dist/{rds-provider-CePynqbO.js.map → rds-provider-D7y6wD4F.js.map} +1 -1
  31. package/dist/{read-replica-CngiOJmt.js → read-replica-c2dYFLKs.js} +3 -3
  32. package/dist/{read-replica-CngiOJmt.js.map → read-replica-c2dYFLKs.js.map} +1 -1
  33. package/dist/{update-removal-Bp0Y4QQ2.js → update-removal-BjJh8h9m.js} +16 -5
  34. package/dist/{update-removal-Bp0Y4QQ2.js.map → update-removal-BjJh8h9m.js.map} +1 -1
  35. package/dist/{version-ZgB66ZVw.js → version-b-uLTNXf.js} +2 -2
  36. package/dist/{version-ZgB66ZVw.js.map → version-b-uLTNXf.js.map} +1 -1
  37. package/package.json +2 -2
  38. package/dist/ambient-client-defaults-CPmXchp0.js.map +0 -1
  39. package/dist/deploy-engine-9vVOF1h_.js.map +0 -1
  40. package/dist/program-DP4g5uS3.js.map +0 -1
@@ -1,11 +1,11 @@
1
- import { t as getCdkdVersion } from "./version-ZgB66ZVw.js";
2
- import { $ as UNRENDERABLE, F as generateResourceName, G as isNameGeneration, J as withStackScope, M as PATTERN_B_NAME_PROPERTIES, N as PATTERN_B_RESOURCE_TYPES, P as derivesPatternBName, Q as STACK_REF_MAX_CODE_POINTS, X as SAFE_MSG_ALTERED_CHAR, Z as SECRET_REF_MAX_CODE_POINTS, _ as explicitNamePropertyFor, a as safeStringify, at as displayStackName, c as isStdoutReservedForPayload, ct as plainIdentOr, d as runStackBuffered, dt as terminalSafe, et as asIsMessage, ft as truncateCodePoints, it as displaySafe, j as PATTERN_B_NAME_OPTIONS, l as reserveStdoutForPayload, lt as safeMsg, m as getLiveRenderer, n as describeAwsFailure, nt as displayAwsMessage, ot as isPasteableIdent, q as withSkipPrefix, rt as displayIdent, s as getLogger, tt as cutMarker, ut as stringifyJsonPayload, x as coerceCfnBoolean } from "./aws-failure-text-zxW2CTmF.js";
3
- import { $a as applyRoleArnIfSet, $i as buildFinalSnapshotIdentifier, $l as isReadableBag, $n as updatePartialMessage, $r as DEFAULT_RESOURCE_TIMEOUT_MS, $s as malformedOutputsWarning, $t as NESTED_PENDING_PARENT_REASON, $u as runDockerForeground, A as PROTECTION_PROPERTY_BY_TYPE, Aa as RollbackInlinePolicyWriters, Ad as AssemblyReader, Ai as maskEventTextWithBoundBags, Al as recordPhysicalNameCopy, An as rollbackOrphanIds, Ao as recordedReferenceRegions, Ar as retiredNameGenerationsLeaving, As as refuseMalformedResourceEntriesForImport, Au as isCrossRegionRedirect, Bc as maskAtCoordinates, Bd as ownValue, Bl as wholeStringLeavesOf, Bn as propertiesChangedReason, Bo as unsettledItemsField, Br as exportAliasCollisionScrubWarning, Bs as refuseMalformedResourcePropertiesForOrphan, Bt as refactorMarkerRefusalMessage, Bu as describeDockerExecFailure, C as refusePendingMovesOut, Ca as withPrintingSecrets, Cc as findHandledUnwrittenCreateOnly, Cd as CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION, Ci as noEchoComparisonForTemplate, Cl as spelledKeysOf, Cn as DeploymentEventsStore, Co as isStalePlaceholderArnAttribute, Cr as removeProtectionTypeList, Cs as malformedLocalResourcesWarning, Cu as createAssetRedirectResolver, D as diffSecurity, Dc as NO_CC_HANDLERS_REASON, Dd as canonicalizeRegion, Di as createReadOnlyAttributeHealerFactory, Dn as findRefactorHints, Do as keepHeldTokenProvenance, Dr as nameScopeOf, Ds as refuseMalformedResourceEntries, Du as ensureAssetStorage, E as serviceTokenBlockingReason, Ed as PARTITION_TABLE, Ei as withAttemptedItemsMasked, El as inheritNestedStackParameterAssociations, En as formatDestructiveChange, Er as nameGenerationHighWaterOf, Es as refuseMalformedResourceAttributesForOrphan, Eu as AssetModeResolver, Fd as utf8ByteLength, Fl as recordMaskOnlyValue, Fn as differingRemedy, Fo as carriesDynamicReference, Fr as namesAnyDeclaredParameter, Fs as malformedDriftResourcePropertiesWarning, Ft as keptForRetainedRecord, Fu as validateContainerRepoName, Ga as DiffCalculator, Gc as noEchoLeavesOf, Gd as resolveAssemblyPath, Gi as PRE_DELETE_SNAPSHOT_TYPES, Gl as S3StateBackend, Gn as DELETED_RESOURCE_REMEDY, Go as findReplacedReadersOfRecreateTargets, Gr as exportNameNoEchoParameters, Gs as malformedOrphansWarning, Gu as dockerSpawnEnvWithSensitive, Hc as maskWholeValue, Hd as describeFileReadFailure, Hi as secretSegmentsOfState, Hl as isSingleDynamicReferenceToken, Hn as referencedLogicalIds, Ho as unsettledPropertiesOf, Hr as secretBearingStateKeyWarning, Hs as UNREADABLE_ORPHANS_CONTAINER_ROW, Ht as sameMove, Hu as redactedCause, Ic as DagBuilder, Id as defineOwnKey, Ii as secretNamedRecordNeedles, Il as recordMaskOnlyValuesIn, In as isPairableType, Io as keepsSecretReferenceToken, Ir as reachableDivergentParameters, Is as malformedResourcePropertiesWarning, It as recordRetainedForReadoption, Iu as BOOTSTRAP_MARKER_PREFIX, Ja as poisonRenderedSpellingsCollidingIn, Jc as readbackPathFor, Ji as effectiveDeletionPolicy, Jl as describeRegionValueKind, Jn as withUnprovenUnsettled, Jo as isStatefulRecreateTargetForReplace, Jr as noEchoParameterValueSeed, Js as repairMalformedOrphansForReadOnly, Ju as warnFinchArgvExposure, Ka as IntrinsicFunctionResolver, Kc as noEchoOutputsComparison, Kd as injectAwsRegion, Ki as ccRoutedFinalSnapshotError, Kl as splitImportedOps, Kn as recordAfterRollbackUpdate, Ko as shownType, Kr as exportNameSecretExposure, Ks as refuseMalformedOrphans, Kt as formatResourceLine, Ku as finchSecretArgvRefusal, Lc as TemplateParser, Ld as hasOwnKey, Li as stateSecretNameNeedles, Ll as recordNoEchoAttributeValues, Ln as looselyEqual, Lo as withSharedDrainBudget, Lr as resourcesNamingDeclaredParameter, Ls as refuseMalformedResourcePropertiesForDestroy, Lt as readRefactorMarker, Lu as buildDockerImage, M as perType, Ma as deleteIndeterminateGuards, Md as processStackMessages, Mi as orphanRecordsPrintingBag, Ml as splitGetAttStringForm, Mn as changedReferenceInDiff, Mo as isImpossibleEmptyStoredAttribute, Ms as refuseMalformedResourceEntriesForOrphan, Mt as withResourceDeadline, Mu as parseBootstrapMarker, N as readProtection, Na as deleteLeftInPlace, Nd as describeJsonParseFailure, Ni as secretNamePrintingBag, Nl as carriesSecretMask, Nn as changedReferencePath, No as carriesFetchableDynamicReference, Nr as inheritProducerRegions, Ns as repairMalformedResourceEntriesForReadOnly, Nt as IMPLICIT_DELETE_DEPENDENCIES, Nu as readBootstrapMarkerBody, O as recordedProtectionEvidence, Oa as setResolvedResourceTimeouts, Oc as hasNoCloudControlHandlers, Od as derivePartitionAndUrlSuffix, Oi as completedReplayEntries, Ol as physicalNameCopiesOf, On as hintSidesOf, Or as retiredAfterRollback, Os as refuseMalformedResourceEntriesForDeploy, Ou as buildDenyExternalAccessPolicy, Pa as deleteSkipReason, Pd as parseFailureDebugDetail, Pi as secretNamePrintingBags, Pl as provenPublicValue, Pn as changedReferenceReason, Po as isNamelessDynamicReferenceError, Pr as computeParameterTaint, Ps as unreadableResourceEntries, Pt as computeImplicitDeleteEdges, Pu as validateAssetBucketName, Qa as refuseUnreadableCdkCrossAccountRefs, Qc as liveMatchesUnresolvedTokenFrame, Qi as createPreDeleteFinalSnapshot, Ql as importableOutputs, Qn as undeclaredEmptyObservedKeys, Qr as bindingSkippedOutputs, Qs as malformedOutputsRefusalMessage, Qt as resolvePendingCloudControlRequests, Qu as getDockerCmd, Rc as canonicalCoordinates, Rd as hasPlainPrototype, Ri as storedSecretNameNeedles, Rl as recordNoEchoParameterFreshValue, Rn as mappingPairs, Ro as INTRINSIC_KEYS, Rr as WITHHELD_NAME_DISPLAY, Rs as refuseMalformedResourcePropertiesForDrift, Rt as readRefactorMarkerOnce, Ru as resolveDockerContextDirectory, S as pendingMovesRefusalMessage, Sc as findActionableSdkUnwired, Sd as uploadCfnTemplate, Si as noEchoAttributeNamesOf, Sl as isUncertifiedBaselineMaskPosition, Sn as DeploymentEventsReader, So as cfnRefValueFromPhysicalId, Sr as segmentCleanupOptions, Ss as malformedLocalResourceEntriesWarning, Su as buildAssetRedirectMap, T as findServiceTokenRefusals, Ta as CloudControlProvider, Tc as unwrittenCreateOnlyReplacement, Td as expectedOwnerParam, Ti as noEchoParameterNamesOf, Tl as identityKeyFor, Tn as findDestructiveChanges, To as refStateLookupFromResource, Tr as nameGenerationCarriedFrom, Ts as malformedScrubResourceEntriesRefusalMessage, Tu as rewriteTemplateAssetReferences, Uc as maskedLeafCoordinatesOf, Ud as displayAssemblyPath, Ui as withSecretPhysicalIdsMaskedInState, Ul as LockManager, Un as replayFailedOperations, Uo as withUnsettledProperties, Ur as secretSafeKeyDisplay, Us as hasReadableOrphans, Ut as updateRefactorMarker, Uu as redactedDockerCause, Vc as maskReadbackAtCoordinates, Vd as absoluteAssemblyPathEscape, Vl as WHOLE_DYNAMIC_REFERENCE_PATTERN, Vn as proposeRenames, Vo as unsettledItemsOf, Vr as secretBearing, Vs as repairMalformedResourcePropertiesForReadOnly, Vt as refuseRefactorMarker, Vu as describeDockerFailure, Wa as isWaitAbandonedError, Wc as noEchoCoordinatesOf, Wd as renderAssemblyPathEscape, Wi as ATOMIC_FINAL_SNAPSHOT_TYPES, Wl as isLockInfoExpired, Wn as replayRollback, Wo as withoutUnsettledProperties, Wr as carriedExportAliasExposure, Ws as malformedOrphansRefusalMessage, Wu as redactDockerArgvValues, Xa as resolveDynamicReferences, Xc as recordedNoEchoValuesOf, Xi as refusesFinalSnapshot, Xl as hasReadableExportSet, Xn as equalModuloMarkedMask, Xo as renderStatefulReason, Xr as collectPublishedOutputNames, Xs as malformedExportSourceWarning, Xu as isMalformedEnvKey, Yc as readsNoEchoSource, Yd as resolveBucketRegion, Yi as isFinalSnapshotError, Yl as exportNamesCarriedFrom, Yn as calculateResourceDrift, Yo as isStatefulRecreateTargetSync, Yr as collectDeclaredOutputNames, Ys as malformedExportNamesWarning, Yu as isDockerClientEnvKey, Za as producerLookupOver, Zc as valueAtCoordinate, Zi as unsupportedFinalSnapshotError, Zl as importableOutputKeys, Zn as equalModuloMask, Zr as isExportAliasCollision, Zs as malformedLocalOutputsWarning, Zt as pendingRequestCount, Zu as formatDockerLoginError, _ as listNestedTemplateRows, _a as applyCustomResourceResponseExpiration, _c as STATE_RESOURCES_MALFORMED, _d as ssmResolvedValueType, _i as cyan, _l as scrubResourceRecord, _n as loadJournaledOrphans, _r as findNestedStackTypeChanges, _s as refuseMalformedOrphansForOrphan, _u as withStackInstanceIdWithheld, a as scanActiveConsumers, ac as refuseDivergentRecordRegionForDestroy, ad as getDefaultStateBucketName, ai as withStackRecords, al as hasMaskableValues, an as recordDisplacedSkips, ao as AWS_CREDENTIAL_ENV_KEYS, as as withRetry, au as hasUnverifiableParameterRefusal, b as hasPendingMovesOut, ba as readsNoEchoDeleteValues, bc as hasReadableOutputs, bd as MIGRATE_TMP_PREFIX, bi as red, bl as DYNAMIC_REFERENCE_TOKEN_SCAN, bn as makeSiblingClaimReader, bo as parameterTypeMayLoseSecretIdentity, bs as unreadableOrphanRecords, bu as stringifyValue, c as inheritedProvenanceForChildDiff, cc as malformedStateRefusalMessage, cd as resolveApp, ci as holdsSupersededResources, cl as printingCorpusOf, cn as withNestedRevertRun, co as envCredentialsAreAssumedRole, cr as demoteSupersededOrphans, cs as declaresNoEcho, cu as timePhase, d as conditionInputsFrom, da as CC_BROKEN_REASON, dc as refuseMalformedResourcesForExport, dd as resolveSkipPrefix, di as supersededHeldByOtherTypeWarning, dl as shareLogOnlyValues, dn as withNestedStackContext, do as producerRegionsFromState, dr as planFailedOps, ds as malformedOrphanRecordsRefusalMessage, du as CrossPrefixScanCache, ed as runDockerStreaming, ei as DEFAULT_RESOURCE_WARN_AFTER_MS, el as redactForState, en as displacedOpClause, eo as assertFlagRoleArn, er as updatePartialReason, eu as orphansAfterRollback, f as parentSuppliedValues, fa as ProviderRegistry, fc as refuseMalformedState, fd as resolveStateBucketWithDefault, fi as supersededHolderOf, fl as unionOfSecretBags, fn as deleteJournaledOrphans, fo as regionLessSecretName, fr as recheckFailedPlan, fs as malformedOrphanRecordsWarning, fu as applyCrossPrefixScan, g as isAbsoluteAssetPath, ga as CUSTOM_RESOURCE_RESPONSE_LIFECYCLE_RULE_ID, gc as withheldAccountClause, gd as warnDeprecatedNoPrefixCliFlag, gi as bold, gl as maskSecretsInText, gn as journaledOrphanLines, gr as withPreviousPolicies, gs as refuseMalformedOrphanRecordsForDestroy, gu as stackInstanceIdOf, h as findNestedTemplateTreeDefect, ha as wouldReturnToSdkProvider, hc as accountArgs, hd as stateBucketExistenceConfirmed, hl as maskSecretsInError, hn as isHandledOrphan, hr as resolveReplacementOldType, hs as refuseMalformedOrphanRecords, hu as isNotImplemented, i as mergeNoChangeOutputs, ic as STATE_REGION_DIVERGED, id as synthesisStatusMessage, il as createUnionSecretMasker, in as nestedChildStackName$1, io as sendableAssumeRoleCommand, ir as withCreateTokenLedger, is as describeTypeWithThrottleRetry, iu as hasReasonlessBaselineRefusal, j as isProtectionValueActive, ja as UNSPECIFIED_SKIP_REASON, jd as StageLoadError, ji as namingSecretsWithRecordedNoEcho, jl as recordNestedStackParameterExpressions, jn as withMovedTo, jo as getAccountInfo, jr as withNameGenerationReached, js as refuseMalformedResourceEntriesForImportSave, ju as getBootstrapMarkerKey, k as recordedProtectionNote, ka as slowCcOperationTimeoutMs, kd as refuseFailedLookups, ki as journaledOrphanPrintingBag, kn as movedToHint, ko as recordedOutputReferenceRegions, kr as retiredNameGenerationsAfter, ks as refuseMalformedResourceEntriesForDestroy, ku as assertAssetBucketRegion, l as makeCanonicalizePropertiesFn, lc as refuseMalformedResourcesForDeploy, ld as resolveAutoAssetStorage, li as isSupersededResourceRecord, ll as recordLogOnlyParameterValue, ln as collectNestedChildUnaddressed, lo as classifyRecordedSecretRegion, lr as isJournaledOrphan, ls as deployRefusesOrphanRowsReason, lu as rebuildClientForBucketRegion, m as childTemplateLoader, ma as isCustomResource, mc as JSON_LISTING_HOLE_VALUE, md as resolveUseCdkBootstrapAssets, mi as withoutSuperseded, ml as errorCauseChain, mn as dropFailedHint, mr as replacementNeverSwapped, ms as previewableOrphanRecords, mu as isAccessDenied, n as isSecretBearingReferenceString, nc as refuseMalformedOutputsForDestroy, nd as getDockerImageBySourceHash, nn as dropSettledNestedJournals, no as explicitRoleArnOrThrow, nr as ledgerForStack, ns as prefetchCreateOnlyPropertyPaths, nu as shouldRetainResource, o as inRunStackKey, oc as malformedRenderedContainersWarning, od as getLegacyStateBucketName, ol as literalSplitDelimitersOf, oo as applyCallerIdentityCredentials, or as planRollback, os as parameterInputsFor, ou as PhaseClock, p as readRecordedConditionVerdicts, pa as ccBrokenReason, pc as repairMalformedResourcesForReadOnly, pd as resolveStateBucketWithDefaultAndSource, pi as supersededResourcesOf, pl as createSecretMasker, pn as dropFailedCommands, pr as recordUnderIdIsNotOwn, ps as malformedOrphanRowsKeptWarning, pu as crossPrefixDeniedWarning, qa as isAlwaysLiveAttribute, qd as injectedAwsRegionValue, qi as ccRoutedInstanceTakesNoSnapshot, ql as acceptedCreateOnlyDropsOf, qn as settleUnsettledPrevious, qo as MULTI_REGION_RECREATE_BLOCKED_TYPES, qr as isWholeDynamicReferenceValue, qs as refuseMalformedOrphansForDestroy, qu as partitionSensitiveEnv, r as keptWholeReasonText, rc as repairMalformedOutputsForReadOnly, rd as Synthesizer, ri as destroyStackRecordsView, rl as carryLogOnlyValues, ro as isIamRoleArn, rs as templateResourceTypes, ru as stackInstanceIdCarriedFrom, s as crossStackOutputProvenanceSource, sc as malformedResourcesWarning, sd as loadCdkJson, si as deleteSupersededEntry, sl as logOnlyValueCount, sn as revertedNestedRowIds, so as callerEnvCredentials, sr as seedsDeleteFirstGuard, su as renderPhaseTimings, t as DeployEngine, tc as refuseMalformedOutputs, td as AssetManifestLoader, ti as maskingRetryLogger, tn as displacedPhysicalIdShown, to as assertSendableRoleArn, tu as orphansCarriedFrom, u as conditionFingerprint, uc as refuseMalformedResourcesForDestroy, ud as resolveCaptureObservedState, ui as supersededAfterRollback, ul as recordLogOnlyValue, un as getCurrentNestedStackContext, uo as classifyReplaySecretRegion, ur as isReplacementOrphan, us as isReadableOrphanRecord, uu as CrossPrefixReadError, v as renderNestedTemplateTreeDefect, va as customResourceResponseExpirationWarning, vc as UNREADABLE_RESOURCES_MAP_ROW, vd as CFN_TEMPLATE_BODY_LIMIT, vi as gray, vl as withPhysicalNameCopies, vn as sameJournaledOrphans, vo as coerceParameterTypedValue, vs as repairMalformedOrphanRecordsForReadOnly, vu as AssetPublisher, w as deferredServiceTokenWarning, wd as decodeListingKey, wi as noEchoExactEchoLeavesOf, wl as pathCrossesDottedKey, wn as constructPathOf$1, wo as lacksRecordedTableArn, wr as orphanNeedsIdentity, ws as malformedResourceEntriesWarning, wu as loadPublishableAssetManifest, x as pendingMovesOutOf, xa as isCustomResourceType$1, xc as hasReadableResources, xd as findLargeInlineResources, xi as yellow, xl as dynamicReferenceTokens, xn as planOrphanAdoption, xo as AWS_NO_VALUE, xs as isReadableResourceEntry, xu as WorkGraph, y as templateIdentity, ya as TemplateNoEchoReresolver, yc as displayLogicalId, yd as CFN_TEMPLATE_URL_LIMIT, yi as green, yn as makeForeignHolderScan, yo as isUnboundTemplateParameter, ys as unpreviewableOrphanRecords, yu as isSensitiveAttributeName, zc as isMarkedCoordinate, zd as nullPrototypeRecord, zi as extractDeploymentEventError, zl as recordProvenPublicExpression, zn as parseMappingFile, zr as displayTextOrWithheld, zs as refuseMalformedResourcePropertiesForExport, zt as refactorMarkerMovesOf, zu as describeDockerCapturedOutput } from "./deploy-engine-9vVOF1h_.js";
4
- import { $ as CdkdError, A as stripControlChars, B as retryClassificationText, Ct as setPasteableRunFlags, F as isAmbiguousOutcomeError, H as isMarkedNonRetryable, J as DynamicReferenceRegionAmbiguousError, R as isRetryableTransientError, St as withheldTargetClause, U as isThrottlingError, W as markNonRetryable, X as MalformedProducerRecordRefusalError, Y as IntrinsicResolutionRefusalError, Z as AccountIdUnavailableError, _ as ResourceUpdateNotSupportedError, a as normalizeAwsError, at as ResourceTimeoutError, bt as shellBoundedDisplay, dt as SHELL_ACTIVE_WHY, et as DeployCancelledError, g as PartialFailureError, gt as pasteableCommand, h as NestedStackChildDirectDestroyError, ht as isInertUnquoted, i as credentialFingerprint, it as ProvisioningError, j as stripForDisplay, k as escapeRegExp, l as withErrorHandling, lt as TIMEOUT_FLAG_RESOURCE_TYPE, n as ambientCredentialConfig, nt as LocalInvokeBuildError$1, o as formatError, ot as StateError, pt as commandHole, q as CrossAccountSecretRefusalError, r as clientDefaultsFor, s as handleError, st as SynthesisError, t as ambientClientDefaults, u as LocalStartServiceError, v as StackHasActiveImportsError, vt as plainOrDescribed, wt as setPasteableVerbFlags, xt as shellQuote, y as StackTerminationProtectionError, yt as quotedOrDescribed, z as isTransientServerError } from "./ambient-client-defaults-CPmXchp0.js";
5
- import { $t as forceQuitRecoveryClause, Dt as logicalIdShown, H as assertRegionMatch, M as VALUE_NOT_SHOWN, Qt as buildLockContentionMessage, U as isMarkedNotGone, V as RESOURCE_NOT_FOUND, Xt as UNREPRODUCIBLE_LOCK_CLAUSE, Zt as buildForceUnlockCommand, an as CUSTOM_RESOURCE_RESPONSE_PREFIX, bt as interruptWatchListenerCount, dn as setPasteableAwsProfile, en as formatLockExpiry, fn as withPasteableAwsProfile, kt as resourceTypeShown, ln as producerCoordinateKey, m as RESOLVED_PREVIOUS_PRINCIPAL_KEYS, mt as isAwsCliLiteral, nn as formatLockOwner, on as DEFAULT_STATE_PREFIX, p as IAM_PRINCIPAL_NAME, sn as injectiveKey, st as runDeleteAttempt, tn as formatLockOperation, un as producerRecordKey, vt as beginCommandInterruptScope, xt as isInterruptedWaitError, y as readRecordedPrincipals, yt as endCommandInterruptScope, z as remedyLogicalId } from "./update-removal-Bp0Y4QQ2.js";
6
- import { a as runWithStackAwsClients, i as resetAwsClients, l as s3ClientDefaults, o as setAwsClients, s as resolveS3ClientDefaults, t as AwsClients, u as setS3ClientDefaultsDebugLog } from "./aws-clients-C8p6sQfr.js";
7
- import { a as getPreAssumeEnvCredentials, f as runInStackAwsScope, i as getAssumedRoleCredentials, n as awsClientDefaults, o as setAssumedRoleCredentials, p as formatAuthority, s as setAwsEndpointOverrideSource } from "./aws-client-defaults-BayGUTJ4.js";
8
- import { a as parseEcrRegistryHost, i as looksLikeEcrHostWithForeignSuffix, n as hasEcrRegistryHostLabels, t as ecrRegistryHostPattern } from "./ecr-uri-NwcD6PUe.js";
1
+ import { t as getCdkdVersion } from "./version-b-uLTNXf.js";
2
+ import { $ as STACK_REF_MAX_CODE_POINTS, F as derivesPatternBName, I as generateResourceName, J as withSkipPrefix, K as isNameGeneration, M as PATTERN_B_NAME_OPTIONS, N as PATTERN_B_NAME_PROPERTIES, P as PATTERN_B_RESOURCE_TYPES, Q as SECRET_REF_MAX_CODE_POINTS, S as coerceCfnBoolean, Y as withStackScope, Z as SAFE_MSG_ALTERED_CHAR, a as safeStringify, at as displaySafe, c as isStdoutReservedForPayload, dt as stringifyJsonPayload, et as UNRENDERABLE, f as runStackBuffered, ft as terminalSafe, h as getLiveRenderer, it as displayIdent, l as releaseStdoutForPayload, lt as plainIdentOr, n as describeAwsFailure, nt as cutMarker, ot as displayStackName, pt as truncateCodePoints, rt as displayAwsMessage, s as getLogger, st as isPasteableIdent, tt as asIsMessage, u as reserveStdoutForPayload, ut as safeMsg, v as explicitNamePropertyFor } from "./aws-failure-text-jomzO3aT.js";
3
+ import { $a as applyRoleArnIfSet, $i as buildFinalSnapshotIdentifier, $l as isReadableBag, $n as updatePartialMessage, $r as DEFAULT_RESOURCE_TIMEOUT_MS, $s as malformedOutputsWarning, $t as NESTED_PENDING_PARENT_REASON, $u as runDockerForeground, A as PROTECTION_PROPERTY_BY_TYPE, Aa as RollbackInlinePolicyWriters, Ad as AssemblyReader, Ai as maskEventTextWithBoundBags, Al as recordPhysicalNameCopy, An as rollbackOrphanIds, Ao as recordedReferenceRegions, Ar as retiredNameGenerationsLeaving, As as refuseMalformedResourceEntriesForImport, Au as isCrossRegionRedirect, Bc as maskAtCoordinates, Bd as ownValue, Bl as wholeStringLeavesOf, Bn as propertiesChangedReason, Bo as unsettledItemsField, Br as exportAliasCollisionScrubWarning, Bs as refuseMalformedResourcePropertiesForOrphan, Bt as refactorMarkerRefusalMessage, Bu as describeDockerExecFailure, C as refusePendingMovesOut, Ca as withPrintingSecrets, Cc as findHandledUnwrittenCreateOnly, Cd as CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION, Ci as noEchoComparisonForTemplate, Cl as spelledKeysOf, Cn as DeploymentEventsStore, Co as isStalePlaceholderArnAttribute, Cr as removeProtectionTypeList, Cs as malformedLocalResourcesWarning, Cu as createAssetRedirectResolver, D as diffSecurity, Dc as NO_CC_HANDLERS_REASON, Dd as canonicalizeRegion, Di as createReadOnlyAttributeHealerFactory, Dn as findRefactorHints, Do as keepHeldTokenProvenance, Dr as nameScopeOf, Ds as refuseMalformedResourceEntries, Du as ensureAssetStorage, E as serviceTokenBlockingReason, Ed as PARTITION_TABLE, Ei as withAttemptedItemsMasked, El as inheritNestedStackParameterAssociations, En as formatDestructiveChange, Er as nameGenerationHighWaterOf, Es as refuseMalformedResourceAttributesForOrphan, Eu as AssetModeResolver, Fd as utf8ByteLength, Fl as recordMaskOnlyValue, Fn as differingRemedy, Fo as carriesDynamicReference, Fr as namesAnyDeclaredParameter, Fs as malformedDriftResourcePropertiesWarning, Ft as keptForRetainedRecord, Fu as validateContainerRepoName, Ga as DiffCalculator, Gc as noEchoLeavesOf, Gd as resolveAssemblyPath, Gi as PRE_DELETE_SNAPSHOT_TYPES, Gl as S3StateBackend, Gn as DELETED_RESOURCE_REMEDY, Go as findReplacedReadersOfRecreateTargets, Gr as exportNameNoEchoParameters, Gs as malformedOrphansWarning, Gu as dockerSpawnEnvWithSensitive, Hc as maskWholeValue, Hd as describeFileReadFailure, Hi as secretSegmentsOfState, Hl as isSingleDynamicReferenceToken, Hn as referencedLogicalIds, Ho as unsettledPropertiesOf, Hr as secretBearingStateKeyWarning, Hs as UNREADABLE_ORPHANS_CONTAINER_ROW, Ht as sameMove, Hu as redactedCause, Ic as DagBuilder, Id as defineOwnKey, Ii as secretNamedRecordNeedles, Il as recordMaskOnlyValuesIn, In as isPairableType, Io as keepsSecretReferenceToken, Ir as reachableDivergentParameters, Is as malformedResourcePropertiesWarning, It as recordRetainedForReadoption, Iu as BOOTSTRAP_MARKER_PREFIX, Ja as poisonRenderedSpellingsCollidingIn, Jc as readbackPathFor, Ji as effectiveDeletionPolicy, Jl as describeRegionValueKind, Jn as withUnprovenUnsettled, Jo as isStatefulRecreateTargetForReplace, Jr as noEchoParameterValueSeed, Js as repairMalformedOrphansForReadOnly, Ju as warnFinchArgvExposure, Ka as IntrinsicFunctionResolver, Kc as noEchoOutputsComparison, Kd as injectAwsRegion, Ki as ccRoutedFinalSnapshotError, Kl as splitImportedOps, Kn as recordAfterRollbackUpdate, Ko as shownType, Kr as exportNameSecretExposure, Ks as refuseMalformedOrphans, Kt as formatResourceLine, Ku as finchSecretArgvRefusal, Lc as TemplateParser, Ld as hasOwnKey, Li as stateSecretNameNeedles, Ll as recordNoEchoAttributeValues, Ln as looselyEqual, Lo as withSharedDrainBudget, Lr as resourcesNamingDeclaredParameter, Ls as refuseMalformedResourcePropertiesForDestroy, Lt as readRefactorMarker, Lu as buildDockerImage, M as perType, Ma as deleteIndeterminateGuards, Md as processStackMessages, Mi as orphanRecordsPrintingBag, Ml as splitGetAttStringForm, Mn as changedReferenceInDiff, Mo as isImpossibleEmptyStoredAttribute, Ms as refuseMalformedResourceEntriesForOrphan, Mt as withResourceDeadline, Mu as parseBootstrapMarker, N as readProtection, Na as deleteLeftInPlace, Nd as describeJsonParseFailure, Ni as secretNamePrintingBag, Nl as carriesSecretMask, Nn as changedReferencePath, No as carriesFetchableDynamicReference, Nr as inheritProducerRegions, Ns as repairMalformedResourceEntriesForReadOnly, Nt as IMPLICIT_DELETE_DEPENDENCIES, Nu as readBootstrapMarkerBody, O as recordedProtectionEvidence, Oa as setResolvedResourceTimeouts, Oc as hasNoCloudControlHandlers, Od as derivePartitionAndUrlSuffix, Oi as completedReplayEntries, Ol as physicalNameCopiesOf, On as hintSidesOf, Or as retiredAfterRollback, Os as refuseMalformedResourceEntriesForDeploy, Ou as buildDenyExternalAccessPolicy, Pa as deleteSkipReason, Pd as parseFailureDebugDetail, Pi as secretNamePrintingBags, Pl as provenPublicValue, Pn as changedReferenceReason, Po as isNamelessDynamicReferenceError, Pr as computeParameterTaint, Ps as unreadableResourceEntries, Pt as computeImplicitDeleteEdges, Pu as validateAssetBucketName, Qa as refuseUnreadableCdkCrossAccountRefs, Qc as liveMatchesUnresolvedTokenFrame, Qi as createPreDeleteFinalSnapshot, Ql as importableOutputs, Qn as undeclaredEmptyObservedKeys, Qr as bindingSkippedOutputs, Qs as malformedOutputsRefusalMessage, Qt as resolvePendingCloudControlRequests, Qu as getDockerCmd, Rc as canonicalCoordinates, Rd as hasPlainPrototype, Ri as storedSecretNameNeedles, Rl as recordNoEchoParameterFreshValue, Rn as mappingPairs, Ro as INTRINSIC_KEYS, Rr as WITHHELD_NAME_DISPLAY, Rs as refuseMalformedResourcePropertiesForDrift, Rt as readRefactorMarkerOnce, Ru as resolveDockerContextDirectory, S as pendingMovesRefusalMessage, Sc as findActionableSdkUnwired, Sd as uploadCfnTemplate, Si as noEchoAttributeNamesOf, Sl as isUncertifiedBaselineMaskPosition, Sn as DeploymentEventsReader, So as cfnRefValueFromPhysicalId, Sr as segmentCleanupOptions, Ss as malformedLocalResourceEntriesWarning, Su as buildAssetRedirectMap, T as findServiceTokenRefusals, Ta as CloudControlProvider, Tc as unwrittenCreateOnlyReplacement, Td as expectedOwnerParam, Ti as noEchoParameterNamesOf, Tl as identityKeyFor, Tn as findDestructiveChanges, To as refStateLookupFromResource, Tr as nameGenerationCarriedFrom, Ts as malformedScrubResourceEntriesRefusalMessage, Tu as rewriteTemplateAssetReferences, Uc as maskedLeafCoordinatesOf, Ud as displayAssemblyPath, Ui as withSecretPhysicalIdsMaskedInState, Ul as LockManager, Un as replayFailedOperations, Uo as withUnsettledProperties, Ur as secretSafeKeyDisplay, Us as hasReadableOrphans, Ut as updateRefactorMarker, Uu as redactedDockerCause, Vc as maskReadbackAtCoordinates, Vd as absoluteAssemblyPathEscape, Vl as WHOLE_DYNAMIC_REFERENCE_PATTERN, Vn as proposeRenames, Vo as unsettledItemsOf, Vr as secretBearing, Vs as repairMalformedResourcePropertiesForReadOnly, Vt as refuseRefactorMarker, Vu as describeDockerFailure, Wa as isWaitAbandonedError, Wc as noEchoCoordinatesOf, Wd as renderAssemblyPathEscape, Wi as ATOMIC_FINAL_SNAPSHOT_TYPES, Wl as isLockInfoExpired, Wn as replayRollback, Wo as withoutUnsettledProperties, Wr as carriedExportAliasExposure, Ws as malformedOrphansRefusalMessage, Wu as redactDockerArgvValues, Xa as resolveDynamicReferences, Xc as recordedNoEchoValuesOf, Xi as refusesFinalSnapshot, Xl as hasReadableExportSet, Xn as equalModuloMarkedMask, Xo as renderStatefulReason, Xr as collectPublishedOutputNames, Xs as malformedExportSourceWarning, Xu as isMalformedEnvKey, Yc as readsNoEchoSource, Yd as resolveBucketRegion, Yi as isFinalSnapshotError, Yl as exportNamesCarriedFrom, Yn as calculateResourceDrift, Yo as isStatefulRecreateTargetSync, Yr as collectDeclaredOutputNames, Ys as malformedExportNamesWarning, Yu as isDockerClientEnvKey, Za as producerLookupOver, Zc as valueAtCoordinate, Zi as unsupportedFinalSnapshotError, Zl as importableOutputKeys, Zn as equalModuloMask, Zr as isExportAliasCollision, Zs as malformedLocalOutputsWarning, Zt as pendingRequestCount, Zu as formatDockerLoginError, _ as listNestedTemplateRows, _a as applyCustomResourceResponseExpiration, _c as STATE_RESOURCES_MALFORMED, _d as ssmResolvedValueType, _i as cyan, _l as scrubResourceRecord, _n as loadJournaledOrphans, _r as findNestedStackTypeChanges, _s as refuseMalformedOrphansForOrphan, _u as withStackInstanceIdWithheld, a as scanActiveConsumers, ac as refuseDivergentRecordRegionForDestroy, ad as getDefaultStateBucketName, ai as withStackRecords, al as hasMaskableValues, an as recordDisplacedSkips, ao as AWS_CREDENTIAL_ENV_KEYS, as as withRetry, au as hasUnverifiableParameterRefusal, b as hasPendingMovesOut, ba as readsNoEchoDeleteValues, bc as hasReadableOutputs, bd as MIGRATE_TMP_PREFIX, bi as red, bl as DYNAMIC_REFERENCE_TOKEN_SCAN, bn as makeSiblingClaimReader, bo as parameterTypeMayLoseSecretIdentity, bs as unreadableOrphanRecords, bu as stringifyValue, c as inheritedProvenanceForChildDiff, cc as malformedStateRefusalMessage, cd as resolveApp, ci as holdsSupersededResources, cl as printingCorpusOf, cn as withNestedRevertRun, co as envCredentialsAreAssumedRole, cr as demoteSupersededOrphans, cs as declaresNoEcho, cu as timePhase, d as conditionInputsFrom, da as CC_BROKEN_REASON, dc as refuseMalformedResourcesForExport, dd as resolveSkipPrefix, di as supersededHeldByOtherTypeWarning, dl as shareLogOnlyValues, dn as withNestedStackContext, do as producerRegionsFromState, dr as planFailedOps, ds as malformedOrphanRecordsRefusalMessage, du as CrossPrefixScanCache, ed as runDockerStreaming, ei as DEFAULT_RESOURCE_WARN_AFTER_MS, el as redactForState, en as displacedOpClause, eo as assertFlagRoleArn, er as updatePartialReason, eu as orphansAfterRollback, f as parentSuppliedValues, fa as ProviderRegistry, fc as refuseMalformedState, fd as resolveStateBucketWithDefault, fi as supersededHolderOf, fl as unionOfSecretBags, fn as deleteJournaledOrphans, fo as regionLessSecretName, fr as recheckFailedPlan, fs as malformedOrphanRecordsWarning, fu as applyCrossPrefixScan, g as isAbsoluteAssetPath, ga as CUSTOM_RESOURCE_RESPONSE_LIFECYCLE_RULE_ID, gc as withheldAccountClause, gd as warnDeprecatedNoPrefixCliFlag, gi as bold, gl as maskSecretsInText, gn as journaledOrphanLines, gr as withPreviousPolicies, gs as refuseMalformedOrphanRecordsForDestroy, gu as stackInstanceIdOf, h as findNestedTemplateTreeDefect, ha as wouldReturnToSdkProvider, hc as accountArgs, hd as stateBucketExistenceConfirmed, hl as maskSecretsInError, hn as isHandledOrphan, hr as resolveReplacementOldType, hs as refuseMalformedOrphanRecords, hu as isNotImplemented, i as mergeNoChangeOutputs, ic as STATE_REGION_DIVERGED, id as synthesisStatusMessage, il as createUnionSecretMasker, in as nestedChildStackName$1, io as sendableAssumeRoleCommand, ir as withCreateTokenLedger, is as describeTypeWithThrottleRetry, iu as hasReasonlessBaselineRefusal, j as isProtectionValueActive, ja as UNSPECIFIED_SKIP_REASON, jd as StageLoadError, ji as namingSecretsWithRecordedNoEcho, jl as recordNestedStackParameterExpressions, jn as withMovedTo, jo as getAccountInfo, jr as withNameGenerationReached, js as refuseMalformedResourceEntriesForImportSave, ju as getBootstrapMarkerKey, k as recordedProtectionNote, ka as slowCcOperationTimeoutMs, kd as refuseFailedLookups, ki as journaledOrphanPrintingBag, kn as movedToHint, ko as recordedOutputReferenceRegions, kr as retiredNameGenerationsAfter, ks as refuseMalformedResourceEntriesForDestroy, ku as assertAssetBucketRegion, l as makeCanonicalizePropertiesFn, lc as refuseMalformedResourcesForDeploy, ld as resolveAutoAssetStorage, li as isSupersededResourceRecord, ll as recordLogOnlyParameterValue, ln as collectNestedChildUnaddressed, lo as classifyRecordedSecretRegion, lr as isJournaledOrphan, ls as deployRefusesOrphanRowsReason, lu as rebuildClientForBucketRegion, m as childTemplateLoader, ma as isCustomResource, mc as JSON_LISTING_HOLE_VALUE, md as resolveUseCdkBootstrapAssets, mi as withoutSuperseded, ml as errorCauseChain, mn as dropFailedHint, mr as replacementNeverSwapped, ms as previewableOrphanRecords, mu as isAccessDenied, n as isSecretBearingReferenceString, nc as refuseMalformedOutputsForDestroy, nd as getDockerImageBySourceHash, nn as dropSettledNestedJournals, no as explicitRoleArnOrThrow, nr as ledgerForStack, ns as prefetchCreateOnlyPropertyPaths, nu as shouldRetainResource, o as inRunStackKey, oc as malformedRenderedContainersWarning, od as getLegacyStateBucketName, ol as literalSplitDelimitersOf, oo as applyCallerIdentityCredentials, or as planRollback, os as parameterInputsFor, ou as PhaseClock, p as readRecordedConditionVerdicts, pa as ccBrokenReason, pc as repairMalformedResourcesForReadOnly, pd as resolveStateBucketWithDefaultAndSource, pi as supersededResourcesOf, pl as createSecretMasker, pn as dropFailedCommands, pr as recordUnderIdIsNotOwn, ps as malformedOrphanRowsKeptWarning, pu as crossPrefixDeniedWarning, qa as isAlwaysLiveAttribute, qd as injectedAwsRegionValue, qi as ccRoutedInstanceTakesNoSnapshot, ql as acceptedCreateOnlyDropsOf, qn as settleUnsettledPrevious, qo as MULTI_REGION_RECREATE_BLOCKED_TYPES, qr as isWholeDynamicReferenceValue, qs as refuseMalformedOrphansForDestroy, qu as partitionSensitiveEnv, r as keptWholeReasonText, rc as repairMalformedOutputsForReadOnly, rd as Synthesizer, ri as destroyStackRecordsView, rl as carryLogOnlyValues, ro as isIamRoleArn, rs as templateResourceTypes, ru as stackInstanceIdCarriedFrom, s as crossStackOutputProvenanceSource, sc as malformedResourcesWarning, sd as loadCdkJson, si as deleteSupersededEntry, sl as logOnlyValueCount, sn as revertedNestedRowIds, so as callerEnvCredentials, sr as seedsDeleteFirstGuard, su as renderPhaseTimings, t as DeployEngine, tc as refuseMalformedOutputs, td as AssetManifestLoader, ti as maskingRetryLogger, tn as displacedPhysicalIdShown, to as assertSendableRoleArn, tu as orphansCarriedFrom, u as conditionFingerprint, uc as refuseMalformedResourcesForDestroy, ud as resolveCaptureObservedState, ui as supersededAfterRollback, ul as recordLogOnlyValue, un as getCurrentNestedStackContext, uo as classifyReplaySecretRegion, ur as isReplacementOrphan, us as isReadableOrphanRecord, uu as CrossPrefixReadError, v as renderNestedTemplateTreeDefect, va as customResourceResponseExpirationWarning, vc as UNREADABLE_RESOURCES_MAP_ROW, vd as CFN_TEMPLATE_BODY_LIMIT, vi as gray, vl as withPhysicalNameCopies, vn as sameJournaledOrphans, vo as coerceParameterTypedValue, vs as repairMalformedOrphanRecordsForReadOnly, vu as AssetPublisher, w as deferredServiceTokenWarning, wd as decodeListingKey, wi as noEchoExactEchoLeavesOf, wl as pathCrossesDottedKey, wn as constructPathOf$1, wo as lacksRecordedTableArn, wr as orphanNeedsIdentity, ws as malformedResourceEntriesWarning, wu as loadPublishableAssetManifest, x as pendingMovesOutOf, xa as isCustomResourceType$1, xc as hasReadableResources, xd as findLargeInlineResources, xi as yellow, xl as dynamicReferenceTokens, xn as planOrphanAdoption, xo as AWS_NO_VALUE, xs as isReadableResourceEntry, xu as WorkGraph, y as templateIdentity, ya as TemplateNoEchoReresolver, yc as displayLogicalId, yd as CFN_TEMPLATE_URL_LIMIT, yi as green, yn as makeForeignHolderScan, yo as isUnboundTemplateParameter, ys as unpreviewableOrphanRecords, yu as isSensitiveAttributeName, zc as isMarkedCoordinate, zd as nullPrototypeRecord, zi as extractDeploymentEventError, zl as recordProvenPublicExpression, zn as parseMappingFile, zr as displayTextOrWithheld, zs as refuseMalformedResourcePropertiesForExport, zt as refactorMarkerMovesOf, zu as describeDockerCapturedOutput } from "./deploy-engine-BB7LVmAG.js";
4
+ import { $ as CdkdError, A as stripControlChars, B as retryClassificationText, Ct as setPasteableRunFlags, F as isAmbiguousOutcomeError, H as isMarkedNonRetryable, J as DynamicReferenceRegionAmbiguousError, R as isRetryableTransientError, St as withheldTargetClause, U as isThrottlingError, W as markNonRetryable, X as MalformedProducerRecordRefusalError, Y as IntrinsicResolutionRefusalError, Z as AccountIdUnavailableError, _ as ResourceUpdateNotSupportedError, a as normalizeAwsError, at as ResourceTimeoutError, bt as shellBoundedDisplay, dt as SHELL_ACTIVE_WHY, et as DeployCancelledError, g as PartialFailureError, gt as pasteableCommand, h as NestedStackChildDirectDestroyError, ht as isInertUnquoted, i as credentialFingerprint, it as ProvisioningError, j as stripForDisplay, k as escapeRegExp, l as withErrorHandling, lt as TIMEOUT_FLAG_RESOURCE_TYPE, n as ambientCredentialConfig, nt as LocalInvokeBuildError$1, o as formatError, ot as StateError, pt as commandHole, q as CrossAccountSecretRefusalError, r as clientDefaultsFor, s as handleError, st as SynthesisError, t as ambientClientDefaults, u as LocalStartServiceError, v as StackHasActiveImportsError, vt as plainOrDescribed, wt as setPasteableVerbFlags, xt as shellQuote, y as StackTerminationProtectionError, yt as quotedOrDescribed, z as isTransientServerError } from "./ambient-client-defaults-w6GrD1cQ.js";
5
+ import { $t as forceQuitRecoveryClause, Dt as logicalIdShown, H as assertRegionMatch, M as VALUE_NOT_SHOWN, Qt as buildLockContentionMessage, U as isMarkedNotGone, V as RESOURCE_NOT_FOUND, Xt as UNREPRODUCIBLE_LOCK_CLAUSE, Zt as buildForceUnlockCommand, an as CUSTOM_RESOURCE_RESPONSE_PREFIX, bt as interruptWatchListenerCount, dn as setPasteableAwsCaBundle, en as formatLockExpiry, fn as setPasteableAwsProfile, kt as resourceTypeShown, ln as producerCoordinateKey, m as RESOLVED_PREVIOUS_PRINCIPAL_KEYS, mt as isAwsCliLiteral, nn as formatLockOwner, on as DEFAULT_STATE_PREFIX, p as IAM_PRINCIPAL_NAME, pn as withPasteableAwsProfile, sn as injectiveKey, st as runDeleteAttempt, tn as formatLockOperation, un as producerRecordKey, vt as beginCommandInterruptScope, xt as isInterruptedWaitError, y as readRecordedPrincipals, yt as endCommandInterruptScope, z as remedyLogicalId } from "./update-removal-BjJh8h9m.js";
6
+ import { a as runWithStackAwsClients, i as resetAwsClients, l as s3ClientDefaults, o as setAwsClients, s as resolveS3ClientDefaults, t as AwsClients, u as setS3ClientDefaultsDebugLog } from "./aws-clients-CUCH-WCd.js";
7
+ import { a as getAssumedRoleCredentials, c as setAwsEndpointOverrideSource, m as formatAuthority, n as awsClientDefaults, o as getPreAssumeEnvCredentials, p as runInStackAwsScope, s as setAssumedRoleCredentials } from "./aws-client-defaults-DP5k4Mfi.js";
8
+ import { a as parseEcrRegistryHost, i as looksLikeEcrHostWithForeignSuffix, n as hasEcrRegistryHostLabels, t as ecrRegistryHostPattern } from "./ecr-uri-CzGt7ztW.js";
9
9
  import { t as cdkdCacheHome } from "./cli.js";
10
10
  import { randomBytes, randomUUID } from "node:crypto";
11
11
  import { CopyObjectCommand, CreateBucketCommand, DeleteBucketCommand, DeleteObjectsCommand, GetBucketLocationCommand, GetObjectCommand, HeadBucketCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchBucket, NotFound, PutBucketEncryptionCommand, PutBucketPolicyCommand, PutBucketVersioningCommand, PutObjectCommand, S3Client, S3ServiceException } from "@aws-sdk/client-s3";
@@ -21,17 +21,17 @@ import { cpSync, existsSync, lstatSync, mkdirSync, mkdtempSync, promises, readFi
21
21
  import * as path from "node:path";
22
22
  import { basename, dirname, isAbsolute, join, resolve } from "node:path";
23
23
  import { execFile, spawn } from "node:child_process";
24
- import { tmpdir } from "node:os";
24
+ import { devNull, tmpdir } from "node:os";
25
25
  import { BatchDeleteImageCommand, DeleteRepositoryCommand, DescribeImagesCommand as DescribeImagesCommand$1, ECRClient, GetAuthorizationTokenCommand } from "@aws-sdk/client-ecr";
26
26
  import { isDeepStrictEqual, promisify } from "node:util";
27
27
  import graphlib from "graphlib";
28
28
  import { Command, InvalidArgumentError, Option } from "commander";
29
+ import { A2A_CONTAINER_PORT, A2A_PATH, AGENTCORE_A2A_PROTOCOL, AGENTCORE_AGUI_PROTOCOL, AGENTCORE_MCP_PROTOCOL, ConnectionRegistry, DEFAULT_AWS_EMULATOR_URL, DynamicReferenceResolver, EMULATOR_SCRUBBED_ENV_KEYS, EcsTaskResolutionError, HOST_GATEWAY_MIN_VERSION, LocalInvokeBuildError, MCP_CONTAINER_PORT, MCP_PATH, a2aInvokeOnce, activateWorkloadAwsWiring, addAlbSpecificOptions, addAwsEndpointOptions, addCommonEcsServiceOptions, addImageOverrideOptions, addStartServiceSpecificOptions, albStrategy, applyWorkloadAwsWiringToEnv, architectureToPlatform, attachAuthorizers, attachLoopbackForwarder, attachStageContext, availableApiIdentifiers, awaitLoopbackForwarderStatus, awsEmulatorEnvName, bufferToBody, buildAgentCoreCodeImage, buildCognitoJwksUrl, buildConnectEvent, buildContainerImage, buildCorsConfigByApiId, buildCorsConfigFromCloudFrontChain, buildDisconnectEvent, buildJwksUrlFromIssuer, buildMessageEvent, buildMgmtEndpointEnvUrl, buildNamespaceOwnerForwarderDockerArgs, buildStageMap, canonicalizeImageOverrideKeys, classifySourceChange, containsDynamicReference, createAuthorizerCache, createFileWatcher, createFileWatcher as createFileWatcher$1, createJwksCache, createWatchPredicates, defaultCredentialsLoader, derivePseudoParametersFromRegion, describeAwsFailureForWarn, describeForwarderFailure, discoverRoutes, discoverWebSocketApis, downloadAndExtractS3Bundle, effectiveLoopbackPorts, enforceImageOverrideOrphans, ensureForwarderImage, filterRoutesByApiIdentifier, firstUsableRegion, getActiveWorkloadAwsWiring, getActiveWorkloadAwsWiring as getActiveWorkloadAwsWiring$1, getAwsEndpointOverride, groupRoutesByServer, handleConnectionsRequest, invokeAgentCore, invokeAgentCoreWs, keysNotFromTemplate, keysOverriddenBy, materializeLayerFromArn, mcpInvokeOnce, parseAwsEndpoint, parseConnectionsPath, parseImageOverrideFlags, parseSelectionExpressionPath, pickAgentCoreCandidateStack, pickAgentCoreCandidateStack as pickAgentCoreCandidateStack$1, probeHostGatewaySupport, readEmulatorRunFiles, readMtlsMaterialsFromDisk, recordAssumedRole, resolveAgentCoreTarget, resolveAwsEmulatorOption, resolveDynamicReferencesInEnv, resolveEnvVars, resolveHostDefaultCredentials, resolveHostGatewayExtraHosts, resolveImageOverrides, resolveRuntimeCodeMountPath, resolveRuntimeFileExtension, resolveRuntimeImage, resolveSingleTarget, resolveWatchConfig, resolveWorkloadAwsWiring, runEcsServiceEmulator, runImageOverrideBuilds, setActiveWorkloadAwsWiring, setAwsEndpointOverride, signAgentCoreInvocation, startApiServer, substituteImagePlaceholders, tryResolveImageFnJoin, verifyJwtViaDiscovery, waitForAgentCorePing, withoutKeys } from "cdk-local/internal";
30
+ import { mkdtemp, rm, writeFile } from "node:fs/promises";
29
31
  import * as readline$1 from "node:readline/promises";
30
32
  import readline from "node:readline/promises";
31
33
  import { Document, Pair, Scalar, YAMLError, YAMLMap, YAMLSeq, isScalar, parse, parseDocument, stringify, visit } from "yaml";
32
34
  import { emitKeypressEvents } from "node:readline";
33
- import { A2A_CONTAINER_PORT, A2A_PATH, AGENTCORE_A2A_PROTOCOL, AGENTCORE_AGUI_PROTOCOL, AGENTCORE_MCP_PROTOCOL, ConnectionRegistry, DynamicReferenceResolver, EcsTaskResolutionError, HOST_GATEWAY_MIN_VERSION, LocalInvokeBuildError, MCP_CONTAINER_PORT, MCP_PATH, a2aInvokeOnce, activateWorkloadAwsWiring, addAlbSpecificOptions, addAwsEndpointOptions, addCommonEcsServiceOptions, addImageOverrideOptions, addStartServiceSpecificOptions, albStrategy, applyWorkloadAwsWiringToEnv, architectureToPlatform, attachAuthorizers, attachLoopbackForwarder, attachStageContext, availableApiIdentifiers, awsEmulatorEnvName, bufferToBody, buildAgentCoreCodeImage, buildCognitoJwksUrl, buildConnectEvent, buildContainerImage, buildCorsConfigByApiId, buildCorsConfigFromCloudFrontChain, buildDisconnectEvent, buildJwksUrlFromIssuer, buildMessageEvent, buildMgmtEndpointEnvUrl, buildStageMap, canonicalizeImageOverrideKeys, classifySourceChange, containsDynamicReference, createAuthorizerCache, createFileWatcher, createFileWatcher as createFileWatcher$1, createJwksCache, createWatchPredicates, defaultCredentialsLoader, derivePseudoParametersFromRegion, describeAwsFailureForWarn, discoverRoutes, discoverWebSocketApis, downloadAndExtractS3Bundle, effectiveLoopbackPorts, enforceImageOverrideOrphans, ensureForwarderImage, filterRoutesByApiIdentifier, firstUsableRegion, getActiveWorkloadAwsWiring, getActiveWorkloadAwsWiring as getActiveWorkloadAwsWiring$1, getAwsEndpointOverride, groupRoutesByServer, handleConnectionsRequest, invokeAgentCore, invokeAgentCoreWs, keysNotFromTemplate, keysOverriddenBy, materializeLayerFromArn, mcpInvokeOnce, parseConnectionsPath, parseImageOverrideFlags, parseSelectionExpressionPath, pickAgentCoreCandidateStack, pickAgentCoreCandidateStack as pickAgentCoreCandidateStack$1, probeHostGatewaySupport, readMtlsMaterialsFromDisk, recordAssumedRole, resolveAgentCoreTarget, resolveAwsEmulatorOption, resolveDynamicReferencesInEnv, resolveEnvVars, resolveHostDefaultCredentials, resolveHostGatewayExtraHosts, resolveImageOverrides, resolveRuntimeCodeMountPath, resolveRuntimeFileExtension, resolveRuntimeImage, resolveSingleTarget, resolveWatchConfig, runEcsServiceEmulator, runImageOverrideBuilds, signAgentCoreInvocation, startApiServer, substituteImagePlaceholders, tryResolveImageFnJoin, verifyJwtViaDiscovery, waitForAgentCorePing, withoutKeys } from "cdk-local/internal";
34
- import { mkdtemp, rm, writeFile } from "node:fs/promises";
35
35
  import { createLocalStartAgentCoreCommand, createLocalStartCloudFrontCommand, createLocalStartMicrovmCommand, createLocalStartWebFunctionCommand, createLocalStateProvider, getEmbedConfig, isCfnFlagPresent, listTargets, rejectExplicitCfnStackWithMultipleStacks, resolveCfnFallbackRegion, setEmbedConfig, substituteAgainstState, substituteAgainstStateAsync, substituteEnvVarsFromState, substituteEnvVarsFromStateAsync } from "cdk-local";
36
36
  import { createServer } from "node:net";
37
37
  import { setTimeout as setTimeout$1 } from "node:timers/promises";
@@ -333,6 +333,289 @@ const destroyOptions = [
333
333
  ];
334
334
  const skipFinalSnapshotOption = new Option("--skip-final-snapshot", "Delete resources whose DeletionPolicy (or, on replacements, UpdateReplacePolicy) is 'Snapshot' — including an RDS DB cluster or standalone DB instance with no DeletionPolicy, whose CloudFormation default is 'Snapshot' — WITHOUT creating the final snapshot the policy promises (DATA LOSS — explicit opt-out of CloudFormation parity). By default cdkd creates the final snapshot for every CloudFormation-supported type (RDS DBInstance / DBCluster, Neptune / DocDB clusters, ElastiCache CacheCluster / ReplicationGroup, Redshift Cluster, EC2 Volume) and refuses the delete when it cannot — e.g. a resource managed via the Cloud Control API route, whose delete has no final-snapshot parameter. On 'cdkd rollback' the flag governs the rolled-back CREATE's DeletionPolicy; a reverse-replacement delete of the NEW resource keeps its own bounded UpdateReplacePolicy behavior and is unaffected.").default(false);
335
335
 
336
+ // src/local/local-role-arn.ts
337
+ async function applyRoleArnForLocal(opts) {
338
+ await applyRoleArnIfSet(opts);
339
+ const role = getAssumedRoleCredentials();
340
+ if (role === void 0) return;
341
+ recordAssumedRole(getPreAssumeEnvCredentials(), {
342
+ accessKeyId: role.accessKeyId,
343
+ secretAccessKey: role.secretAccessKey,
344
+ sessionToken: role.sessionToken
345
+ });
346
+ }
347
+
348
+ // src/cli/commands/local-profile-credentials-file.ts
349
+ const CONTAINER_AWS_CREDENTIALS_PATH = "/cdkd-aws/credentials";
350
+ async function writeProfileCredentialsFile(profileName, creds, opts) {
351
+ if (profileName === "") throw new Error("writeProfileCredentialsFile: profile name must not be empty.");
352
+ if (/[\r\n[\]]/.test(profileName)) throw new Error(`writeProfileCredentialsFile: profile name ${displayIdent(profileName)} contains a forbidden character (any of CR, LF, '[', ']' would corrupt the INI file or the docker -e env var).`);
353
+ const dir = await mkdtemp(path.join(tmpdir(), "cdkd-profile-creds-"));
354
+ const hostPath = path.join(dir, "credentials");
355
+ opts?.onDirCreated?.(hostPath);
356
+ const lines = [
357
+ `[${profileName}]`,
358
+ `aws_access_key_id = ${creds.accessKeyId}`,
359
+ `aws_secret_access_key = ${creds.secretAccessKey}`
360
+ ];
361
+ if (creds.sessionToken) lines.push(`aws_session_token = ${creds.sessionToken}`);
362
+ try {
363
+ await writeFile(hostPath, lines.join("\n") + "\n", { mode: 384 });
364
+ } catch (err) {
365
+ let removed = true;
366
+ await rm(dir, {
367
+ recursive: true,
368
+ force: true
369
+ }).catch(() => {
370
+ removed = false;
371
+ });
372
+ if (removed) try {
373
+ opts?.onDirRemoved?.(hostPath);
374
+ } catch {}
375
+ throw err;
376
+ }
377
+ return {
378
+ hostPath,
379
+ containerPath: CONTAINER_AWS_CREDENTIALS_PATH,
380
+ profileName,
381
+ dispose: async () => {
382
+ await rm(dir, {
383
+ recursive: true,
384
+ force: true
385
+ });
386
+ }
387
+ };
388
+ }
389
+ function strandedProfileCredentialsNotice(hostPath) {
390
+ if (hostPath === void 0) return void 0;
391
+ return `The AWS credentials file mounted into the containers is NOT removed: delete ${displayIdent(hostPath)} once you tear them down.`;
392
+ }
393
+
394
+ // src/local/local-aws-wiring.ts
395
+ async function activateLocalAwsWiring(options) {
396
+ assertAwsEmulatorValue(options.awsEmulator);
397
+ try {
398
+ await activateWorkloadAwsWiring({
399
+ awsEmulator: options.awsEmulator,
400
+ caBundle: options.caBundle,
401
+ profile: options.profile,
402
+ pull: options.pull
403
+ });
404
+ } catch (err) {
405
+ throw new CdkdError(err instanceof Error ? err.message : String(err), "LOCAL_AWS_WIRING_FAILED", err instanceof Error ? err : void 0);
406
+ }
407
+ }
408
+ async function activateLocalAwsAndRoleArn(options) {
409
+ await activateLocalAwsWiring(options);
410
+ await applyRoleArnForLocal({
411
+ roleArn: options.roleArn,
412
+ region: options.region
413
+ });
414
+ }
415
+ function assertAwsEmulatorValue(flag) {
416
+ const value = resolveAwsEmulatorOption(flag);
417
+ if (typeof value !== "string") return;
418
+ const where = `--aws-emulator (or ${awsEmulatorEnvName()})`;
419
+ let u;
420
+ try {
421
+ u = new URL(value);
422
+ } catch {
423
+ u = void 0;
424
+ }
425
+ if (u === void 0 ? /^[a-z][a-z0-9+.-]*:\/\/[^/?#]*@/i.test(value) || /[?#]/.test(value) : u.username !== "" || u.password !== "" || u.search !== "" || u.hash !== "") throw new CdkdError(`${where} must be a bare scheme://host:port URL; the value carries a user name, password, query or fragment, which is not shown here. Remove it.`, "LOCAL_AWS_WIRING_FAILED");
426
+ if (u === void 0 || u.protocol !== "https:" && u.protocol !== "http:") throw new CdkdError(`${where} takes an http(s) URL such as https://127.0.0.1:9297, and the value given is not one. The URL is OPTIONAL, so a value right after the flag is taken as the URL: put --aws-emulator after the target, or write --aws-emulator=<url>.`, "LOCAL_AWS_WIRING_FAILED");
427
+ }
428
+ async function applyLocalAwsWiring(wiring, env, extraMounts, takenContainerPaths) {
429
+ const defaults = wiring.mode === "forward" && !env["AWS_ACCESS_KEY_ID"] ? await resolveHostDefaultCredentials() : void 0;
430
+ const wiredEnv = applyWorkloadAwsWiringToEnv(env, wiring, defaults);
431
+ const mounts = extraMounts.filter((m) => wiring.mode !== "emulator" || m.containerPath !== "/cdkd-aws/credentials");
432
+ const taken = /* @__PURE__ */ new Set([...takenContainerPaths, ...mounts.map((m) => m.containerPath)]);
433
+ for (const m of wiring.mounts) if (!taken.has(m.containerPath)) mounts.push({
434
+ ...m,
435
+ readOnly: true
436
+ });
437
+ return {
438
+ env: wiredEnv,
439
+ extraMounts: mounts
440
+ };
441
+ }
442
+ function loopbackPortsFor(wiring, env, network) {
443
+ return network === "host" ? [] : effectiveLoopbackPorts(env, wiring);
444
+ }
445
+ async function prepareLocalLoopbackForwarder(wiring) {
446
+ try {
447
+ await ensureForwarderImage(wiring.skipPull === true);
448
+ } catch (err) {
449
+ if (wiring.mode === "emulator") throw new CdkdError(`--aws-emulator: the loopback forwarder image could not be pulled: ${err.message}`, "LOCAL_AWS_EMULATOR_FORWARDER_PULL_FAILED");
450
+ }
451
+ }
452
+ async function attachLocalLoopbackForwarder(containerId, ports) {
453
+ const wiring = getActiveWorkloadAwsWiring$1();
454
+ if (!wiring) return;
455
+ try {
456
+ await (ports === void 0 ? attachLoopbackForwarder(containerId, wiring) : attachLoopbackForwarder(containerId, wiring, ports));
457
+ } catch (err) {
458
+ throw new CdkdError(err instanceof Error ? err.message : String(err), "LOCAL_AWS_EMULATOR_FORWARDER_FAILED", err instanceof Error ? err : void 0);
459
+ }
460
+ }
461
+ async function profileCredentialsForWorkload(profile, resolve) {
462
+ if (!profile || localAwsEmulatorActive()) return void 0;
463
+ return resolve(profile);
464
+ }
465
+ function setContainerRegion(env, region) {
466
+ if (!region) return;
467
+ const folded = canonicalizeRegion(region);
468
+ env["AWS_REGION"] = folded;
469
+ env["AWS_DEFAULT_REGION"] = folded;
470
+ }
471
+ function localAwsEmulatorActive() {
472
+ return getActiveWorkloadAwsWiring$1()?.mode === "emulator";
473
+ }
474
+ function localAwsEmulatorCredentials() {
475
+ const wiring = getActiveWorkloadAwsWiring$1();
476
+ return wiring?.mode === "emulator" ? wiring.emulatorCredentials : void 0;
477
+ }
478
+
479
+ // src/cli/aws-emulator-activation.ts
480
+ async function activateAwsEmulatorForCommand(flag) {
481
+ try {
482
+ const wiring = await resolveWorkloadAwsWiring({
483
+ awsEmulator: resolveAwsEmulatorOption(flag),
484
+ skipPull: true
485
+ });
486
+ setActiveWorkloadAwsWiring(wiring);
487
+ const endpoint = wiring.emulatorEndpoint;
488
+ if (wiring.mode !== "emulator" || endpoint === void 0) throw new Error("--aws-emulator: the AWS Emulator wiring did not resolve to an endpoint.");
489
+ setAwsEndpointOverride({
490
+ endpoint: endpoint.url,
491
+ ...wiring.caHostPath !== void 0 && { caPem: readFileSync(wiring.caHostPath, "utf8") },
492
+ ...wiring.emulatorCredentials !== void 0 && { credentials: wiring.emulatorCredentials }
493
+ });
494
+ const url = endpoint.url;
495
+ getLogger().info(safeMsg`Using AWS Emulator at ${url} for every AWS call.`);
496
+ } catch (err) {
497
+ throw new CdkdError(err instanceof Error ? err.message : String(err), "AWS_EMULATOR_UNAVAILABLE", err instanceof Error ? err : void 0);
498
+ }
499
+ }
500
+
501
+ // src/cli/options/aws-emulator.ts
502
+ function awsEmulatorOption() {
503
+ return new Option("--aws-emulator [url]", `Run against a local AWS Emulator (default https://127.0.0.1:9297; the port selects ~/.aws/emulator/<port>/): every AWS call uses the emulator's endpoint, CA and keys only; --profile, --role-arn and credential env vars are ignored (env: ${awsEmulatorEnvName()})`);
504
+ }
505
+
506
+ // src/cli/aws-emulator.ts
507
+ const LOCAL_COMMAND = "local";
508
+ const CREDENTIAL_ENV_KEYS = [
509
+ "AWS_ACCESS_KEY_ID",
510
+ "AWS_SECRET_ACCESS_KEY",
511
+ "AWS_SESSION_TOKEN",
512
+ "AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"
513
+ ];
514
+ function addAwsEmulatorOptions(cmd) {
515
+ for (const sub of cmd.commands) {
516
+ if (cmd.parent === null && sub.name() === LOCAL_COMMAND) continue;
517
+ const declares = (long) => sub.options.some((o) => o.long === long);
518
+ if (declares("--profile") && !declares("--aws-emulator")) sub.addOption(awsEmulatorOption());
519
+ addAwsEmulatorOptions(sub);
520
+ }
521
+ }
522
+ function declaresAwsEmulator(cmd) {
523
+ for (let c = cmd; c !== null; c = c.parent) if (c.options.some((o) => o.long === "--aws-emulator")) return true;
524
+ return false;
525
+ }
526
+ function underLocalCommand(cmd) {
527
+ for (let c = cmd; c !== null; c = c.parent) if (c.parent !== null && c.parent.parent === null && c.name() === LOCAL_COMMAND) return true;
528
+ return false;
529
+ }
530
+ function clearOption(cmd, attr) {
531
+ let cleared = false;
532
+ for (let c = cmd; c !== null; c = c.parent) if (c.getOptionValue(attr) !== void 0) {
533
+ c.setOptionValueWithSource(attr, void 0, "default");
534
+ cleared = true;
535
+ }
536
+ return cleared;
537
+ }
538
+ function prepareAwsEmulatorForCommand(actionCommand) {
539
+ if (!declaresAwsEmulator(actionCommand)) return void 0;
540
+ const flag = actionCommand.optsWithGlobals().awsEmulator;
541
+ assertAwsEmulatorValue(flag);
542
+ const value = resolveAwsEmulatorOption(flag);
543
+ if (value === void 0) return void 0;
544
+ const local = underLocalCommand(actionCommand);
545
+ const ignored = [];
546
+ if (clearOption(actionCommand, "profile")) ignored.push("--profile");
547
+ if (!local && clearOption(actionCommand, "roleArn")) ignored.push("--role-arn");
548
+ const scrubbed = [
549
+ ...local ? [] : ["CDKD_ROLE_ARN"],
550
+ ...EMULATOR_SCRUBBED_ENV_KEYS,
551
+ ...CREDENTIAL_ENV_KEYS
552
+ ];
553
+ for (const key of scrubbed) if (process.env[key] !== void 0) {
554
+ if (process.env[key] !== "") ignored.push(key);
555
+ delete process.env[key];
556
+ }
557
+ for (const key of Object.keys(process.env)) if (key.startsWith("AWS_ENDPOINT_URL") || key === "AWS_IGNORE_CONFIGURED_ENDPOINT_URLS") {
558
+ if (process.env[key] !== "") ignored.push(key);
559
+ delete process.env[key];
560
+ }
561
+ if (ignored.length > 0) {
562
+ const names = ignored.join(", ");
563
+ onStderr(() => getLogger().info(safeMsg`--aws-emulator: ignoring ${names}; every AWS call uses the emulator's keys.`));
564
+ }
565
+ const endpoint = parseAwsEndpoint(value === true ? DEFAULT_AWS_EMULATOR_URL : value, "--aws-emulator");
566
+ const url = endpoint.hostname === "localhost" ? endpoint.url.replace("//localhost", "//127.0.0.1") : endpoint.url;
567
+ const caBundle = actionCommand.optsWithGlobals().caBundle;
568
+ pointEnvironmentAtEmulator(url, endpoint.port, caBundle);
569
+ if (local) return void 0;
570
+ setAwsEndpointOverrideSource(getAwsEndpointOverride);
571
+ return () => onStderr(() => activateAwsEmulatorForCommand(flag));
572
+ }
573
+ function onStderr(fn) {
574
+ if (isStdoutReservedForPayload()) return fn();
575
+ reserveStdoutForPayload();
576
+ let result;
577
+ try {
578
+ result = fn();
579
+ } catch (err) {
580
+ releaseStdoutForPayload();
581
+ throw err;
582
+ }
583
+ if (result instanceof Promise) return result.finally(releaseStdoutForPayload);
584
+ releaseStdoutForPayload();
585
+ return result;
586
+ }
587
+ function pointEnvironmentAtEmulator(url, port, caBundle) {
588
+ const run = readEmulatorRunFiles(port);
589
+ const runFile = (name) => {
590
+ const p = join(run.dir, name);
591
+ return run.present && existsSync(p) ? p : devNull;
592
+ };
593
+ process.env["AWS_ENDPOINT_URL"] = url;
594
+ const config = runFile("config");
595
+ process.env["AWS_CONFIG_FILE"] = config;
596
+ if (!process.env["AWS_REGION"] && !process.env["AWS_DEFAULT_REGION"] && config !== devNull) {
597
+ const region = defaultProfileRegion(readFileSync(config, "utf8"));
598
+ if (region !== void 0) process.env["AWS_REGION"] = region;
599
+ }
600
+ process.env["AWS_SHARED_CREDENTIALS_FILE"] = runFile("emulator_credentials");
601
+ process.env["AWS_EC2_METADATA_DISABLED"] = "true";
602
+ const ca = caBundle !== void 0 && caBundle !== "" ? caBundle : runFile("ca.pem");
603
+ setPasteableAwsCaBundle(url.startsWith("https:") && ca !== devNull ? ca : void 0);
604
+ }
605
+ function defaultProfileRegion(ini) {
606
+ let inDefault = false;
607
+ for (const raw of ini.split(/\r?\n/)) {
608
+ const line = raw.trim();
609
+ const section = /^\[\s*(.+?)\s*\]$/.exec(line);
610
+ if (section) {
611
+ inDefault = section[1] === "default" || section[1] === "profile default";
612
+ continue;
613
+ }
614
+ const kv = /^region\s*=\s*([a-z0-9-]+)\s*$/i.exec(line);
615
+ if (inDefault && kv) return kv[1].toLowerCase();
616
+ }
617
+ }
618
+
336
619
  // src/cli/region-options.ts
337
620
  function foldRegionOption(options) {
338
621
  if (options.region !== void 0) options.region = canonicalizeRegion(options.region);
@@ -1857,7 +2140,7 @@ function collectCrossStackRefs(node, onRef, unconditional) {
1857
2140
  // src/provisioning/register-providers.ts
1858
2141
  let providerClasses;
1859
2142
  function loadProviderClasses() {
1860
- providerClasses ??= import("./provider-classes-CHzimhh6.js");
2143
+ providerClasses ??= import("./provider-classes-DmCFkSIr.js");
1861
2144
  return providerClasses;
1862
2145
  }
1863
2146
  function registerAllProviders(registry, classes) {
@@ -25094,149 +25377,6 @@ function collectMultiple(value, previous) {
25094
25377
  return [...previous ?? [], value];
25095
25378
  }
25096
25379
 
25097
- // src/local/local-role-arn.ts
25098
- async function applyRoleArnForLocal(opts) {
25099
- await applyRoleArnIfSet(opts);
25100
- const role = getAssumedRoleCredentials();
25101
- if (role === void 0) return;
25102
- recordAssumedRole(getPreAssumeEnvCredentials(), {
25103
- accessKeyId: role.accessKeyId,
25104
- secretAccessKey: role.secretAccessKey,
25105
- sessionToken: role.sessionToken
25106
- });
25107
- }
25108
-
25109
- // src/cli/commands/local-profile-credentials-file.ts
25110
- const CONTAINER_AWS_CREDENTIALS_PATH = "/cdkd-aws/credentials";
25111
- async function writeProfileCredentialsFile(profileName, creds, opts) {
25112
- if (profileName === "") throw new Error("writeProfileCredentialsFile: profile name must not be empty.");
25113
- if (/[\r\n[\]]/.test(profileName)) throw new Error(`writeProfileCredentialsFile: profile name ${displayIdent(profileName)} contains a forbidden character (any of CR, LF, '[', ']' would corrupt the INI file or the docker -e env var).`);
25114
- const dir = await mkdtemp(path.join(tmpdir(), "cdkd-profile-creds-"));
25115
- const hostPath = path.join(dir, "credentials");
25116
- opts?.onDirCreated?.(hostPath);
25117
- const lines = [
25118
- `[${profileName}]`,
25119
- `aws_access_key_id = ${creds.accessKeyId}`,
25120
- `aws_secret_access_key = ${creds.secretAccessKey}`
25121
- ];
25122
- if (creds.sessionToken) lines.push(`aws_session_token = ${creds.sessionToken}`);
25123
- try {
25124
- await writeFile(hostPath, lines.join("\n") + "\n", { mode: 384 });
25125
- } catch (err) {
25126
- let removed = true;
25127
- await rm(dir, {
25128
- recursive: true,
25129
- force: true
25130
- }).catch(() => {
25131
- removed = false;
25132
- });
25133
- if (removed) try {
25134
- opts?.onDirRemoved?.(hostPath);
25135
- } catch {}
25136
- throw err;
25137
- }
25138
- return {
25139
- hostPath,
25140
- containerPath: CONTAINER_AWS_CREDENTIALS_PATH,
25141
- profileName,
25142
- dispose: async () => {
25143
- await rm(dir, {
25144
- recursive: true,
25145
- force: true
25146
- });
25147
- }
25148
- };
25149
- }
25150
- function strandedProfileCredentialsNotice(hostPath) {
25151
- if (hostPath === void 0) return void 0;
25152
- return `The AWS credentials file mounted into the containers is NOT removed: delete ${displayIdent(hostPath)} once you tear them down.`;
25153
- }
25154
-
25155
- // src/local/local-aws-wiring.ts
25156
- async function activateLocalAwsWiring(options) {
25157
- assertAwsEmulatorValue(options.awsEmulator);
25158
- try {
25159
- await activateWorkloadAwsWiring({
25160
- awsEmulator: options.awsEmulator,
25161
- caBundle: options.caBundle,
25162
- profile: options.profile,
25163
- pull: options.pull
25164
- });
25165
- } catch (err) {
25166
- throw new CdkdError(err instanceof Error ? err.message : String(err), "LOCAL_AWS_WIRING_FAILED", err instanceof Error ? err : void 0);
25167
- }
25168
- }
25169
- async function activateLocalAwsAndRoleArn(options) {
25170
- await activateLocalAwsWiring(options);
25171
- await applyRoleArnForLocal({
25172
- roleArn: options.roleArn,
25173
- region: options.region
25174
- });
25175
- }
25176
- function assertAwsEmulatorValue(flag) {
25177
- const value = resolveAwsEmulatorOption(flag);
25178
- if (typeof value !== "string") return;
25179
- const where = `--aws-emulator (or ${awsEmulatorEnvName()})`;
25180
- let u;
25181
- try {
25182
- u = new URL(value);
25183
- } catch {
25184
- u = void 0;
25185
- }
25186
- if (u === void 0 ? /^[a-z][a-z0-9+.-]*:\/\/[^/?#]*@/i.test(value) || /[?#]/.test(value) : u.username !== "" || u.password !== "" || u.search !== "" || u.hash !== "") throw new CdkdError(`${where} must be a bare scheme://host:port URL; the value carries a user name, password, query or fragment, which is not shown here. Remove it.`, "LOCAL_AWS_WIRING_FAILED");
25187
- if (u === void 0 || u.protocol !== "https:" && u.protocol !== "http:") throw new CdkdError(`${where} takes an http(s) URL such as https://127.0.0.1:9297, and the value given is not one. The URL is OPTIONAL, so a value right after the flag is taken as the URL: put --aws-emulator after the target, or write --aws-emulator=<url>.`, "LOCAL_AWS_WIRING_FAILED");
25188
- }
25189
- async function applyLocalAwsWiring(wiring, env, extraMounts, takenContainerPaths) {
25190
- const defaults = wiring.mode === "forward" && !env["AWS_ACCESS_KEY_ID"] ? await resolveHostDefaultCredentials() : void 0;
25191
- const wiredEnv = applyWorkloadAwsWiringToEnv(env, wiring, defaults);
25192
- const mounts = extraMounts.filter((m) => wiring.mode !== "emulator" || m.containerPath !== "/cdkd-aws/credentials");
25193
- const taken = /* @__PURE__ */ new Set([...takenContainerPaths, ...mounts.map((m) => m.containerPath)]);
25194
- for (const m of wiring.mounts) if (!taken.has(m.containerPath)) mounts.push({
25195
- ...m,
25196
- readOnly: true
25197
- });
25198
- return {
25199
- env: wiredEnv,
25200
- extraMounts: mounts
25201
- };
25202
- }
25203
- function loopbackPortsFor(wiring, env, network) {
25204
- return network === "host" ? [] : effectiveLoopbackPorts(env, wiring);
25205
- }
25206
- async function prepareLocalLoopbackForwarder(wiring) {
25207
- try {
25208
- await ensureForwarderImage();
25209
- } catch (err) {
25210
- if (wiring.mode === "emulator") throw new CdkdError(`--aws-emulator: the loopback forwarder image could not be pulled: ${err.message}`, "LOCAL_AWS_EMULATOR_FORWARDER_PULL_FAILED");
25211
- }
25212
- }
25213
- async function attachLocalLoopbackForwarder(containerId, ports) {
25214
- const wiring = getActiveWorkloadAwsWiring$1();
25215
- if (!wiring) return;
25216
- try {
25217
- await (ports === void 0 ? attachLoopbackForwarder(containerId, wiring) : attachLoopbackForwarder(containerId, wiring, ports));
25218
- } catch (err) {
25219
- throw new CdkdError(err instanceof Error ? err.message : String(err), "LOCAL_AWS_EMULATOR_FORWARDER_FAILED", err instanceof Error ? err : void 0);
25220
- }
25221
- }
25222
- async function profileCredentialsForWorkload(profile, resolve) {
25223
- if (!profile || localAwsEmulatorActive()) return void 0;
25224
- return resolve(profile);
25225
- }
25226
- function setContainerRegion(env, region) {
25227
- if (!region) return;
25228
- const folded = canonicalizeRegion(region);
25229
- env["AWS_REGION"] = folded;
25230
- env["AWS_DEFAULT_REGION"] = folded;
25231
- }
25232
- function localAwsEmulatorActive() {
25233
- return getActiveWorkloadAwsWiring$1()?.mode === "emulator";
25234
- }
25235
- function localAwsEmulatorCredentials() {
25236
- const wiring = getActiveWorkloadAwsWiring$1();
25237
- return wiring?.mode === "emulator" ? wiring.emulatorCredentials : void 0;
25238
- }
25239
-
25240
25380
  // src/utils/local-aws-failure.ts
25241
25381
  function describeLocalAwsFailureForWarn(err, operation) {
25242
25382
  if (err instanceof CdkdError) return withoutTrailingPeriod(displaySafe(err.message));
@@ -25599,7 +25739,7 @@ function createLocalStateProvider$1(options, cdkdStackName, synthRegion) {
25599
25739
  }
25600
25740
 
25601
25741
  // src/local/docker-runner.ts
25602
- const execFileAsync$6 = promisify(execFile);
25742
+ const execFileAsync$7 = promisify(execFile);
25603
25743
  var DockerRunnerError = class DockerRunnerError extends Error {
25604
25744
  constructor(message) {
25605
25745
  super(message);
@@ -25687,7 +25827,7 @@ async function runDetachedContainer(opts) {
25687
25827
  if (refusal !== void 0) throw new DockerRunnerError(refusal);
25688
25828
  warnFinchArgvExposure(forwardedKeys);
25689
25829
  try {
25690
- const { stdout } = await execFileAsync$6(getDockerCmd(), args, {
25830
+ const { stdout } = await execFileAsync$7(getDockerCmd(), args, {
25691
25831
  maxBuffer: 10485760,
25692
25832
  env: dockerSpawnEnvWithSensitive(passthroughEnv)
25693
25833
  });
@@ -25756,7 +25896,7 @@ async function killContainer(containerId, timeoutMs = 1e4) {
25756
25896
  if (!containerId) return;
25757
25897
  const args = ["kill", containerId];
25758
25898
  try {
25759
- await execFileAsync$6(getDockerCmd(), args, { timeout: timeoutMs });
25899
+ await execFileAsync$7(getDockerCmd(), args, { timeout: timeoutMs });
25760
25900
  } catch (error) {
25761
25901
  getLogger().child("docker").debug(safeMsg`docker kill ${containerId} failed: ${describeDockerFailure(error, args)}`);
25762
25902
  }
@@ -25790,7 +25930,7 @@ async function removeContainer(containerId) {
25790
25930
  containerId
25791
25931
  ];
25792
25932
  try {
25793
- await execFileAsync$6(getDockerCmd(), args);
25933
+ await execFileAsync$7(getDockerCmd(), args);
25794
25934
  logger.debug(`Removed container ${containerId}`);
25795
25935
  } catch (error) {
25796
25936
  logger.debug(`docker rm -f ${containerId} failed: ${describeDockerFailure(error, args)}`);
@@ -25804,7 +25944,7 @@ async function ensureDockerAvailable() {
25804
25944
  "{{.Server.Version}}"
25805
25945
  ];
25806
25946
  try {
25807
- await execFileAsync$6(cmd, args);
25947
+ await execFileAsync$7(cmd, args);
25808
25948
  } catch (error) {
25809
25949
  if (error.code === "ENOENT") throw new DockerRunnerError(`${cmd} is not installed or not on PATH. cdkd local invoke needs Docker (or a compatible CLI specified via CDK_DOCKER) — install it and retry.`);
25810
25950
  throw new DockerRunnerError(`${cmd} daemon is not reachable: ${describeDockerFailure(error, args)}. Start Docker Desktop / the docker daemon and retry.`);
@@ -29565,7 +29705,7 @@ function createLocalStartApiCommand() {
29565
29705
  }
29566
29706
 
29567
29707
  // src/local/ecs-network.ts
29568
- const execFileAsync$5 = promisify(execFile);
29708
+ const execFileAsync$6 = promisify(execFile);
29569
29709
  const METADATA_ENDPOINT_IMAGE = "amazon/amazon-ecs-local-container-endpoints:latest-amd64";
29570
29710
  const METADATA_ENDPOINT_IP = "169.254.170.2";
29571
29711
  const TASK_ROLE_CREDENTIALS_PATH = "/creds";
@@ -29592,7 +29732,7 @@ async function createNetworkAndSidecar(args) {
29592
29732
  networkName
29593
29733
  ];
29594
29734
  try {
29595
- await execFileAsync$5(getDockerCmd(), createArgs);
29735
+ await execFileAsync$6(getDockerCmd(), createArgs);
29596
29736
  } catch (err) {
29597
29737
  throw new DockerRunnerError(`docker network create failed: ${describeDockerFailure(err, createArgs)}. Hint: another cdkd run may already own subnet ${cidr}; wait for it to finish, or remove the leftover network with \`docker network ls\` + \`docker network rm\`. \`cdkd local run-task\` always uses 169.254.170.0/24, where AWS SDKs read task-role credentials, as does a \`cdkd local start-service\` / \`start-alb\` run with \`--assume-role\`, so only one of them can be active at a time.`);
29598
29738
  }
@@ -29621,7 +29761,7 @@ async function createNetworkAndSidecar(args) {
29621
29761
  warnFinchArgvExposure(Object.keys(sidecarSensitiveEnv));
29622
29762
  logger.info(`Starting ECS local-container-endpoints sidecar at ${sidecarIp}...`);
29623
29763
  try {
29624
- const { stdout } = await execFileAsync$5(getDockerCmd(), sidecarArgs, {
29764
+ const { stdout } = await execFileAsync$6(getDockerCmd(), sidecarArgs, {
29625
29765
  maxBuffer: 10485760,
29626
29766
  env: dockerSpawnEnvWithSensitive(sidecarSensitiveEnv)
29627
29767
  });
@@ -29683,7 +29823,7 @@ async function destroyNetworkOnly(networkName) {
29683
29823
  networkName
29684
29824
  ];
29685
29825
  try {
29686
- await execFileAsync$5(getDockerCmd(), rmArgs);
29826
+ await execFileAsync$6(getDockerCmd(), rmArgs);
29687
29827
  logger.debug(`Removed docker network ${networkName}`);
29688
29828
  } catch (err) {
29689
29829
  logger.debug(`docker network rm ${networkName} failed: ${describeDockerFailure(err, rmArgs)}`);
@@ -29801,6 +29941,7 @@ function createEcsRunState() {
29801
29941
  network: void 0,
29802
29942
  dockerVolumeNames: [],
29803
29943
  startedContainers: [],
29944
+ forwarders: [],
29804
29945
  logStreams: [],
29805
29946
  closing: false,
29806
29947
  inFlight: void 0
@@ -29815,7 +29956,7 @@ var EcsTaskInterruptedError = class EcsTaskInterruptedError extends EcsTaskRunne
29815
29956
  };
29816
29957
 
29817
29958
  // src/local/ecs-task-runner/cleanup.ts
29818
- const execFileAsync$4 = promisify(execFile);
29959
+ const execFileAsync$5 = promisify(execFile);
29819
29960
  async function runAfterContainersStopped(hook, logger) {
29820
29961
  if (!hook) return;
29821
29962
  try {
@@ -29888,6 +30029,8 @@ async function cleanupEcsRun(state, options) {
29888
30029
  logger.debug(`log stream stop failed: ${describeAwsFailure(err).detail}`);
29889
30030
  }
29890
30031
  await runAfterContainersStopped(options.afterContainersStopped, logger);
30032
+ await removeForwarders(state.forwarders.filter((f) => !f.joined), logger);
30033
+ state.forwarders = state.forwarders.filter((f) => f.joined);
29891
30034
  } else {
29892
30035
  for (const c of state.startedContainers) {
29893
30036
  const stopArgs = dockerStopArgs(c.id, CLEANUP_STOP_GRACE_SECONDS);
@@ -29915,6 +30058,8 @@ async function cleanupEcsRun(state, options) {
29915
30058
  ])}`);
29916
30059
  }
29917
30060
  state.startedContainers = [];
30061
+ await removeForwarders(state.forwarders, logger);
30062
+ state.forwarders = [];
29918
30063
  }
29919
30064
  if (state.network && !state.network.ownedByCaller) await destroyTaskNetwork(state.network);
29920
30065
  state.network = void 0;
@@ -29925,7 +30070,7 @@ async function cleanupEcsRun(state, options) {
29925
30070
  v
29926
30071
  ];
29927
30072
  try {
29928
- await execFileAsync$4(getDockerCmd(), rmArgs);
30073
+ await execFileAsync$5(getDockerCmd(), rmArgs);
29929
30074
  logger.debug(`Removed docker volume ${v}`);
29930
30075
  } catch (err) {
29931
30076
  logger.debug(`docker volume rm ${v} failed: ${describeDockerFailure(err, rmArgs)}`);
@@ -29933,6 +30078,17 @@ async function cleanupEcsRun(state, options) {
29933
30078
  }
29934
30079
  state.dockerVolumeNames = [];
29935
30080
  }
30081
+ async function removeForwarders(forwarders, logger) {
30082
+ for (const f of forwarders) try {
30083
+ await removeContainer(f.id);
30084
+ } catch (err) {
30085
+ logger.debug(safeMsg`docker rm -f ${f.id} failed: ${describeDockerFailure(err, [
30086
+ "rm",
30087
+ "-f",
30088
+ f.id
30089
+ ])}`);
30090
+ }
30091
+ }
29936
30092
  const CLEANUP_STOP_GRACE_SECONDS = 10;
29937
30093
  function dockerStopArgs(containerId, graceSeconds) {
29938
30094
  return [
@@ -29944,12 +30100,12 @@ function dockerStopArgs(containerId, graceSeconds) {
29944
30100
  }
29945
30101
  async function stopContainer(containerId, graceSeconds) {
29946
30102
  try {
29947
- await execFileAsync$4(getDockerCmd(), dockerStopArgs(containerId, graceSeconds));
30103
+ await execFileAsync$5(getDockerCmd(), dockerStopArgs(containerId, graceSeconds));
29948
30104
  } catch {}
29949
30105
  }
29950
30106
 
29951
30107
  // src/local/ecs-task-runner/containers.ts
29952
- const execFileAsync$3 = promisify(execFile);
30108
+ const execFileAsync$4 = promisify(execFile);
29953
30109
  function buildDependencyGraph(containers) {
29954
30110
  const g = new graphlib.Graph({ directed: true });
29955
30111
  for (const c of containers) g.setNode(c.name);
@@ -30013,7 +30169,7 @@ async function waitForContainerHealthy(containerId, displayName) {
30013
30169
  ];
30014
30170
  while (Date.now() < deadline) {
30015
30171
  try {
30016
- const { stdout } = await execFileAsync$3(getDockerCmd(), inspectArgs);
30172
+ const { stdout } = await execFileAsync$4(getDockerCmd(), inspectArgs);
30017
30173
  const status = stdout.trim();
30018
30174
  if (status !== lastStatus) {
30019
30175
  logger.debug(`Container '${displayName}' health status: ${status}`);
@@ -30032,7 +30188,7 @@ async function waitForContainerHealthy(containerId, displayName) {
30032
30188
  async function waitForContainerExit(containerId) {
30033
30189
  const waitArgs = ["wait", containerId];
30034
30190
  try {
30035
- const { stdout } = await execFileAsync$3(getDockerCmd(), waitArgs, { maxBuffer: 1048576 });
30191
+ const { stdout } = await execFileAsync$4(getDockerCmd(), waitArgs, { maxBuffer: 1048576 });
30036
30192
  const code = Number.parseInt(stdout.trim(), 10);
30037
30193
  return Number.isFinite(code) ? code : 1;
30038
30194
  } catch (err) {
@@ -30111,40 +30267,56 @@ function groupSecretsByContainer(resolved) {
30111
30267
  function buildDockerRunArgs(opts) {
30112
30268
  const { task, container, image, network, volumeByName, secrets, containerHost, roleArn } = opts;
30113
30269
  const args = ["run", "-d"];
30270
+ const joinArgs = ["run", "-d"];
30271
+ const both = (...xs) => {
30272
+ args.push(...xs);
30273
+ joinArgs.push(...xs);
30274
+ };
30114
30275
  const dockerName = `cdkd-local-${task.family}-${container.name}-${randHex(3)}`;
30115
- args.push("--name", dockerName);
30276
+ const forwarderName = `${dockerName}-awsfwd`;
30277
+ const ownerAliases = [container.name];
30278
+ const ownerPublish = [];
30279
+ const ownerAddHosts = [];
30280
+ const ownerLinks = [];
30281
+ both("--name", dockerName);
30116
30282
  args.push("--network", network);
30283
+ joinArgs.push("--network", `container:${forwarderName}`);
30117
30284
  args.push("--network-alias", container.name);
30118
30285
  if (opts.networkAliases && opts.networkAliases.length > 0) {
30119
30286
  const seen = /* @__PURE__ */ new Set([container.name]);
30120
30287
  for (const a of opts.networkAliases) if (!seen.has(a)) {
30121
30288
  args.push("--network-alias", a);
30289
+ ownerAliases.push(a);
30122
30290
  seen.add(a);
30123
30291
  }
30124
30292
  }
30125
- if (opts.addHostFlags && opts.addHostFlags.length > 0) for (const f of opts.addHostFlags) args.push(f);
30126
- if (opts.platformOverride) args.push("--platform", opts.platformOverride);
30127
- else if (task.runtimePlatform) args.push("--platform", task.runtimePlatform.cpuArchitecture === "ARM64" ? "linux/arm64" : "linux/amd64");
30293
+ if (opts.addHostFlags && opts.addHostFlags.length > 0) {
30294
+ for (const f of opts.addHostFlags) args.push(f);
30295
+ for (let i = 0; i + 1 < opts.addHostFlags.length; i++) if (opts.addHostFlags[i] === "--add-host") ownerAddHosts.push(opts.addHostFlags[++i]);
30296
+ }
30297
+ if (opts.platformOverride) both("--platform", opts.platformOverride);
30298
+ else if (task.runtimePlatform) both("--platform", task.runtimePlatform.cpuArchitecture === "ARM64" ? "linux/arm64" : "linux/amd64");
30128
30299
  if (!opts.skipHostPortPublish) for (const pm of container.portMappings) {
30129
- const hostPort = pm.hostPort ?? pm.containerPort;
30130
- args.push("-p", `${containerHost}:${hostPort}:${pm.containerPort}/${pm.protocol}`);
30300
+ const publish = `${containerHost}:${pm.hostPort ?? pm.containerPort}:${pm.containerPort}/${pm.protocol}`;
30301
+ args.push("-p", publish);
30302
+ ownerPublish.push(publish);
30131
30303
  }
30132
30304
  const wiring = getActiveWorkloadAwsWiring();
30133
30305
  const profileCredentialsFile = wiring?.mode === "emulator" ? void 0 : opts.profileCredentialsFile;
30134
- if (profileCredentialsFile) args.push("-v", `${profileCredentialsFile.hostPath}:${profileCredentialsFile.containerPath}:ro`);
30135
- for (const m of wiring?.mounts ?? []) if (!container.mountPoints.some((mp) => mp.containerPath === m.containerPath)) args.push("-v", `${m.hostPath}:${m.containerPath}:ro`);
30306
+ if (profileCredentialsFile) both("-v", `${profileCredentialsFile.hostPath}:${profileCredentialsFile.containerPath}:ro`);
30307
+ for (const m of wiring?.mounts ?? []) if (!container.mountPoints.some((mp) => mp.containerPath === m.containerPath)) both("-v", `${m.hostPath}:${m.containerPath}:ro`);
30136
30308
  for (const mp of container.mountPoints) {
30137
30309
  const v = volumeByName.get(mp.sourceVolume);
30138
30310
  if (!v) continue;
30139
30311
  if (v.kind === "host") {
30140
30312
  if (v.hostPath) {
30141
30313
  const ro = mp.readOnly ? ":ro" : "";
30142
- args.push("-v", `${v.hostPath}:${mp.containerPath}${ro}`);
30143
- } else args.push("-v", mp.containerPath);
30314
+ both("-v", `${v.hostPath}:${mp.containerPath}${ro}`);
30315
+ } else both("-v", mp.containerPath);
30144
30316
  } else {
30145
30317
  const name = v.dockerVolumeName ?? v.name;
30146
30318
  const ro = mp.readOnly ? ":ro" : "";
30147
- args.push("-v", `${name}:${mp.containerPath}${ro}`);
30319
+ both("-v", `${name}:${mp.containerPath}${ro}`);
30148
30320
  }
30149
30321
  }
30150
30322
  let finalEnv = {};
@@ -30179,32 +30351,48 @@ function buildDockerRunArgs(opts) {
30179
30351
  ...opts.plaintextEnvKeys ?? []
30180
30352
  ]);
30181
30353
  const { flags, sensitiveEnv, collisions } = partitionSensitiveEnv(finalEnv, sensitiveKeys, { subject: `Container '${container.name}'` });
30182
- args.push(...flags);
30183
- if (container.user) args.push("--user", container.user);
30184
- if (container.privileged) args.push("--privileged");
30185
- if (container.readonlyRootFilesystem) args.push("--read-only");
30186
- if (container.workingDirectory) args.push("--workdir", container.workingDirectory);
30187
- for (const u of container.ulimits) args.push("--ulimit", `${u.name}=${u.softLimit}:${u.hardLimit}`);
30188
- for (const link of container.links) args.push("--link", link);
30354
+ both(...flags);
30355
+ if (container.user) both("--user", container.user);
30356
+ if (container.privileged) both("--privileged");
30357
+ if (container.readonlyRootFilesystem) both("--read-only");
30358
+ if (container.workingDirectory) both("--workdir", container.workingDirectory);
30359
+ for (const u of container.ulimits) both("--ulimit", `${u.name}=${u.softLimit}:${u.hardLimit}`);
30360
+ for (const link of container.links) {
30361
+ args.push("--link", link);
30362
+ ownerLinks.push(link);
30363
+ }
30189
30364
  if (container.healthCheck) {
30190
- args.push("--health-cmd", shellJoin(container.healthCheck.command));
30191
- if (container.healthCheck.interval !== void 0) args.push("--health-interval", `${container.healthCheck.interval}s`);
30192
- if (container.healthCheck.timeout !== void 0) args.push("--health-timeout", `${container.healthCheck.timeout}s`);
30193
- if (container.healthCheck.retries !== void 0) args.push("--health-retries", String(container.healthCheck.retries));
30194
- if (container.healthCheck.startPeriod !== void 0) args.push("--health-start-period", `${container.healthCheck.startPeriod}s`);
30365
+ both("--health-cmd", shellJoin(container.healthCheck.command));
30366
+ if (container.healthCheck.interval !== void 0) both("--health-interval", `${container.healthCheck.interval}s`);
30367
+ if (container.healthCheck.timeout !== void 0) both("--health-timeout", `${container.healthCheck.timeout}s`);
30368
+ if (container.healthCheck.retries !== void 0) both("--health-retries", String(container.healthCheck.retries));
30369
+ if (container.healthCheck.startPeriod !== void 0) both("--health-start-period", `${container.healthCheck.startPeriod}s`);
30195
30370
  }
30196
30371
  let entryPointTail = [];
30197
30372
  if (container.entryPoint && container.entryPoint.length > 0) {
30198
- args.push("--entrypoint", container.entryPoint[0]);
30373
+ both("--entrypoint", container.entryPoint[0]);
30199
30374
  entryPointTail = container.entryPoint.slice(1);
30200
30375
  }
30201
- args.push(image, ...entryPointTail, ...container.command ?? []);
30376
+ both(image, ...entryPointTail, ...container.command ?? []);
30377
+ const loopbackPorts = wiring ? effectiveLoopbackPorts(finalEnv, wiring) : [];
30202
30378
  return {
30203
30379
  args,
30204
30380
  dockerName,
30205
30381
  sensitiveEnv,
30206
30382
  collisions,
30207
- loopbackPorts: wiring ? effectiveLoopbackPorts(finalEnv, wiring) : []
30383
+ loopbackPorts,
30384
+ ...loopbackPorts.length > 0 && { forwarder: {
30385
+ name: forwarderName,
30386
+ container: dockerName,
30387
+ namespace: {
30388
+ network,
30389
+ networkAliases: ownerAliases,
30390
+ publish: ownerPublish,
30391
+ addHosts: ownerAddHosts,
30392
+ links: ownerLinks
30393
+ },
30394
+ args: joinArgs
30395
+ } }
30208
30396
  };
30209
30397
  }
30210
30398
  function applyOverrideMap(acc, map) {
@@ -30220,7 +30408,7 @@ function shellJoin(parts) {
30220
30408
  }
30221
30409
 
30222
30410
  // src/local/ecs-task-runner/images.ts
30223
- const execFileAsync$2 = promisify(execFile);
30411
+ const execFileAsync$3 = promisify(execFile);
30224
30412
  async function prepareImages(task, out, options) {
30225
30413
  const logger = getLogger().child("ecs-runner");
30226
30414
  for (const container of task.containers) {
@@ -30299,7 +30487,7 @@ async function realizeDockerVolumes(volumes, state) {
30299
30487
  args.push(dockerVolumeName);
30300
30488
  await runDockerStep(state, async () => {
30301
30489
  try {
30302
- await execFileAsync$2(getDockerCmd(), args);
30490
+ await execFileAsync$3(getDockerCmd(), args);
30303
30491
  } catch (err) {
30304
30492
  throw new DockerRunnerError(`docker volume create failed for '${v.name}': ${describeDockerFailure(err, args)}`);
30305
30493
  }
@@ -30307,7 +30495,7 @@ async function realizeDockerVolumes(volumes, state) {
30307
30495
  state.dockerVolumeNames.push(dockerVolumeName);
30308
30496
  logger.debug(`Created docker volume ${dockerVolumeName} for task volume '${v.name}'`);
30309
30497
  }, async () => {
30310
- await execFileAsync$2(getDockerCmd(), [
30498
+ await execFileAsync$3(getDockerCmd(), [
30311
30499
  "volume",
30312
30500
  "rm",
30313
30501
  "-f",
@@ -30327,11 +30515,91 @@ async function realizeDockerVolumes(volumes, state) {
30327
30515
  return out;
30328
30516
  }
30329
30517
 
30518
+ // src/local/ecs-task-runner/loopback-forwarder.ts
30519
+ const execFileAsync$2 = promisify(execFile);
30520
+ async function startNamespaceForwarder(state, forwarder, containerName, ports, wiring) {
30521
+ const label = wiring.mode === "emulator" ? `--aws-emulator ${wiring.emulatorEndpoint?.url ?? ""}` : "The AWS endpoint override (AWS_ENDPOINT_URL*)";
30522
+ await prepareLocalLoopbackForwarder(wiring);
30523
+ const { name } = forwarder;
30524
+ const args = buildNamespaceOwnerForwarderDockerArgs({
30525
+ name,
30526
+ namespace: forwarder.namespace,
30527
+ ports,
30528
+ probe: wiring.probeHealth ? "health" : "tcp",
30529
+ ...wiring.caHostPath ? { caHostPath: wiring.caHostPath } : {},
30530
+ ...wiring.skipPull ? { skipPull: true } : {}
30531
+ });
30532
+ getLogger().child("ecs-runner").debug(`Starting loopback forwarder ${name} for ports ${ports.join(",")}`);
30533
+ try {
30534
+ await runDockerStep(state, () => runForwarderContainer(args, containerName), (id) => {
30535
+ state.forwarders.push({
30536
+ name,
30537
+ id,
30538
+ container: forwarder.container,
30539
+ joined: false
30540
+ });
30541
+ }, () => removeContainer(name), namedSubject([{
30542
+ kind: "container",
30543
+ name,
30544
+ rm: "docker rm -f",
30545
+ list: "docker ps -a"
30546
+ }]));
30547
+ } catch (err) {
30548
+ if (state.closing) throw interruptedError();
30549
+ await removeNamespaceForwarder(state, name);
30550
+ if (wiring.mode === "emulator") throw err;
30551
+ return failed(state, wiring, `start:${containerName}`, `${label}: ${err.message}`);
30552
+ }
30553
+ let result;
30554
+ try {
30555
+ result = await awaitLoopbackForwarderStatus(name);
30556
+ } catch (err) {
30557
+ if (state.closing) throw interruptedError();
30558
+ await removeNamespaceForwarder(state, name);
30559
+ return failed(state, wiring, `start:${containerName}`, `${label}: ${err.message}`);
30560
+ }
30561
+ if (state.closing) throw interruptedError();
30562
+ if (result.ok) return true;
30563
+ await removeNamespaceForwarder(state, name);
30564
+ return failed(state, wiring, String(result.failedPort ?? 0), describeForwarderFailure(result, label));
30565
+ }
30566
+ async function runForwarderContainer(args, containerName) {
30567
+ try {
30568
+ return (await execFileAsync$2(getDockerCmd(), args)).stdout.trim();
30569
+ } catch (err) {
30570
+ throw new DockerRunnerError(`docker run failed for container '${containerName}' (its loopback AWS forwarder, which holds the container's network aliases and published ports): ${describeDockerFailure(err, args)}`);
30571
+ }
30572
+ }
30573
+ async function removeNamespaceForwarder(state, name) {
30574
+ await removeContainer(name);
30575
+ state.forwarders = state.forwarders.filter((f) => f.name !== name);
30576
+ }
30577
+ function failed(state, wiring, key, message) {
30578
+ if (wiring.mode === "emulator") throw new CdkdError(message, "LOCAL_AWS_EMULATOR_FORWARDER_FAILED");
30579
+ state.forwarderWarnings ??= /* @__PURE__ */ new Set();
30580
+ if (!state.forwarderWarnings.has(key)) {
30581
+ state.forwarderWarnings.add(key);
30582
+ getLogger().warn(message);
30583
+ }
30584
+ return false;
30585
+ }
30586
+
30330
30587
  // src/local/ecs-task-runner.ts
30331
30588
  const execFileAsync$1 = promisify(execFile);
30332
30589
  function mergeHostGatewayAddHostFlags(addHostFlags, hostGatewayExtraHosts) {
30333
30590
  return [...addHostFlags ?? [], ...(hostGatewayExtraHosts ?? []).flatMap((h) => ["--add-host", `${h.host}:${h.ip}`])];
30334
30591
  }
30592
+ function loopbackPortClash(container, loopbackPorts, joined) {
30593
+ if (!joined) return void 0;
30594
+ return container.portMappings.find((pm) => pm.protocol !== "udp" && loopbackPorts.includes(pm.containerPort))?.containerPort;
30595
+ }
30596
+ function describeDetachedForwarders(state) {
30597
+ const joined = state.forwarders.filter((f) => f.joined);
30598
+ if (joined.length === 0) return void 0;
30599
+ const containers = joined.map((f) => f.container).join(", ");
30600
+ const forwarders = joined.map((f) => f.name).join(", ");
30601
+ return safeMsg`Under the loopback AWS endpoint, these task containers share the network of a forwarder container, so that filter does not list them: ${containers}. Remove them before their forwarders: ${forwarders}.`;
30602
+ }
30335
30603
  async function runEcsTask(task, options, state) {
30336
30604
  const logger = getLogger();
30337
30605
  if (task.containers.length === 0) throw new EcsTaskRunnerError(`Task '${task.taskDefinitionLogicalId}' has no containers — nothing to run.`);
@@ -30433,6 +30701,7 @@ async function runEcsTask(task, options, state) {
30433
30701
  const mergedAddHostFlags = mergeHostGatewayAddHostFlags(options.addHostFlags, options.hostGatewayExtraHosts);
30434
30702
  const dockerCmds = /* @__PURE__ */ new Map();
30435
30703
  const dockerLoopbackPorts = /* @__PURE__ */ new Map();
30704
+ const dockerForwarders = /* @__PURE__ */ new Map();
30436
30705
  const dockerNames = /* @__PURE__ */ new Map();
30437
30706
  const dockerEnvs = /* @__PURE__ */ new Map();
30438
30707
  for (const container of task.containers) {
@@ -30463,6 +30732,7 @@ async function runEcsTask(task, options, state) {
30463
30732
  });
30464
30733
  dockerCmds.set(container.name, built.args);
30465
30734
  dockerLoopbackPorts.set(container.name, built.loopbackPorts);
30735
+ if (built.forwarder) dockerForwarders.set(container.name, built.forwarder);
30466
30736
  dockerNames.set(container.name, built.dockerName);
30467
30737
  dockerEnvs.set(container.name, built.sensitiveEnv);
30468
30738
  if (built.collisions.length > 0) logger.warn(`Container '${container.name}': secret(s) ${built.collisions.map((k) => JSON.stringify(k)).join(", ")} share a name with a variable the container client reads (docker, or the CDK_DOCKER binary) or have a malformed name (empty, or containing '=' / NUL), and were NOT passed to the container at all (a colliding name would hijack that client; a malformed name cannot form a valid environment variable). Rename the secret if the container needs it.`);
@@ -30472,11 +30742,18 @@ async function runEcsTask(task, options, state) {
30472
30742
  const container = task.containers.find((c) => c.name === containerName);
30473
30743
  await awaitDependencies(container, startedByName);
30474
30744
  if (state.closing) throw interruptedError();
30475
- const args = dockerCmds.get(container.name);
30745
+ let args = dockerCmds.get(container.name);
30476
30746
  const dockerName = dockerNames.get(container.name);
30477
30747
  const loopbackPorts = dockerLoopbackPorts.get(container.name) ?? [];
30478
30748
  const forwarderWiring = getActiveWorkloadAwsWiring$1();
30479
- if (loopbackPorts.length > 0 && forwarderWiring) await prepareLocalLoopbackForwarder(forwarderWiring);
30749
+ const forwarder = dockerForwarders.get(container.name);
30750
+ let joined;
30751
+ if (loopbackPorts.length > 0 && forwarderWiring && forwarder) {
30752
+ if (await startNamespaceForwarder(state, forwarder, container.name, loopbackPorts, forwarderWiring)) {
30753
+ args = forwarder.args;
30754
+ joined = forwarder.name;
30755
+ }
30756
+ }
30480
30757
  logger.info(`Starting container '${container.name}' (image=${imagePlan.get(container.name)})`);
30481
30758
  const sensitiveEnv = dockerEnvs.get(container.name);
30482
30759
  warnFinchArgvExposure(Object.keys(sensitiveEnv));
@@ -30495,17 +30772,24 @@ async function runEcsTask(task, options, state) {
30495
30772
  name: container.name,
30496
30773
  id: startedId
30497
30774
  });
30775
+ if (joined !== void 0) {
30776
+ const owner = state.forwarders.find((f) => f.name === joined);
30777
+ if (owner) owner.joined = true;
30778
+ }
30498
30779
  }, () => removeContainer(dockerName), namedSubject([{
30499
30780
  kind: "container",
30500
30781
  name: dockerName,
30501
30782
  rm: "docker rm -f",
30502
30783
  list: "docker ps -a"
30503
- }]));
30784
+ }])).catch(async (err) => {
30785
+ const started = state.startedContainers.some((c) => c.name === container.name);
30786
+ if (joined !== void 0 && !started) await removeNamespaceForwarder(state, joined);
30787
+ throw err;
30788
+ });
30504
30789
  startedByName.set(container.name, {
30505
30790
  id,
30506
30791
  container
30507
30792
  });
30508
- if (loopbackPorts.length > 0) await attachLocalLoopbackForwarder(id, loopbackPorts);
30509
30793
  if (!options.detach) state.logStreams.push({
30510
30794
  containerId: id,
30511
30795
  stream: streamContainerLogs(container.name, id)
@@ -30521,6 +30805,8 @@ async function runEcsTask(task, options, state) {
30521
30805
  const exitCode = await waitForContainerExit(essentialId);
30522
30806
  const essentialLogs = state.logStreams.find((l) => l.containerId === essentialId);
30523
30807
  if (essentialLogs) await essentialLogs.stream.drain(CONTAINER_LOG_DRAIN_TIMEOUT_MS);
30808
+ const clash = loopbackPortClash(essential, dockerLoopbackPorts.get(essential.name) ?? [], state.forwarders.some((f) => f.joined && f.container === dockerNames.get(essential.name)));
30809
+ if (exitCode !== 0 && clash !== void 0) logger.warn(safeMsg`Container ${essential.name} exited with code ${exitCode} and listens on port ${clash}, which is also the loopback AWS endpoint's port: cdkd's forwarder holds 127.0.0.1:${clash} inside the task to reach the endpoint, so the app cannot bind it. Run the endpoint on another port.`);
30524
30810
  return {
30525
30811
  exitCode,
30526
30812
  essentialContainerName: essential.name,
@@ -30963,6 +31249,8 @@ async function localRunTaskCommand(target, options) {
30963
31249
  if (options.detach) {
30964
31250
  logger.info("Task containers started in detached mode; cdkd is exiting.");
30965
31251
  logger.info(`Use 'docker ps -a --filter network=${result.state.network?.networkName ?? "<network>"}' to inspect; tear down with 'docker rm -f' and 'docker network rm'.`);
31252
+ const forwarderNotice = describeDetachedForwarders(result.state);
31253
+ if (forwarderNotice) logger.info(forwarderNotice);
30966
31254
  const detachedNotice = strandedProfileCredentialsNotice(channels.profileCredsFile?.hostPath);
30967
31255
  if (detachedNotice) logger.info(`Detached mode leaves the mounted credentials file behind. ${detachedNotice}`);
30968
31256
  detachedSuccessfully = true;
@@ -33031,13 +33319,6 @@ function createLocalCommand() {
33031
33319
  setEmbedConfig(CDKD_EMBED_CONFIG);
33032
33320
  setAwsEndpointOverrideSource(getAwsEndpointOverride);
33033
33321
  const local = new Command("local").description("Local execution of Lambda functions (RIE) and ECS task definitions (Docker required)");
33034
- local.hook("preAction", (_local, action) => {
33035
- try {
33036
- assertAwsEmulatorValue(action.opts()["awsEmulator"]);
33037
- } catch (err) {
33038
- handleError(err);
33039
- }
33040
- });
33041
33322
  const invoke = new Command("invoke").description("Run a Lambda function locally in a Docker container (RIE-backed). Target accepts a CDK display path (MyStack/MyApi/Handler) or stack-qualified logical ID (MyStack:MyApiHandler1234ABCD). Single-stack apps may omit the stack prefix.").argument("<target>", "CDK display path or stack-qualified logical ID of the Lambda to invoke").addOption(new Option("-e, --event <file>", "JSON event payload file (default: {})")).addOption(new Option("--event-stdin", "Read event JSON from stdin").default(false)).addOption(new Option("--env-vars <file>", "JSON env-var overrides (SAM-compatible: {\"LogicalId\":{\"KEY\":\"VALUE\"}})")).addOption(new Option("--no-pull", "Skip docker pull (use cached image) — no-op for IMAGE local-build path; `docker build` does not pull base layers by default")).addOption(new Option("--no-build", "Skip docker build on the IMAGE local-build path (use the previously-built tag). Requires the deterministic tag to already be in the local registry; errors with an actionable message when missing. No-op for ZIP Lambdas and the IMAGE ECR-pull path. Compatible with --no-pull.")).addOption(new Option("--debug-port <port>", "Node --inspect-brk port (default: off)")).addOption(new Option("--container-host <host>", "Host to bind the RIE port to").default("127.0.0.1")).addOption(new Option("--assume-role [arn]", "Assume the Lambda's deployed execution role and forward STS-issued temp credentials to the container so the handler runs with the deployed function's narrow permissions (closes the \"developer admin / function narrow\" skew). Three forms: (1) `--assume-role <arn>` assumes the explicit ARN; (2) `--assume-role` (bare) auto-resolves the function's execution role ARN from cdkd state (requires --from-state); (3) `--no-assume-role` explicitly opts out (forces dev creds even with --from-state). Off by default — when omitted, the developer's shell credentials are forwarded unchanged (SAM-compatible default). STS failures degrade to a warn + dev-creds fallback.")).addOption(new Option("--no-assume-role", "Explicitly opt out of assuming the deployed execution role: forward your ambient AWS credentials (or the --profile overlay) even when --from-state is set, and suppress the \"run with --assume-role\" hint. Distinct from omitting the flag, which still prints that hint.")).addOption(new Option("--layer-role-arn <arn>", "Role to sts:AssumeRole before calling lambda:GetLayerVersion on every literal-ARN entry in Properties.Layers. Use only when the dev credentials cannot read the layer — typically cross-account layers. AWS-published public layers (e.g. Lambda Powertools) are readable from every account and need no role.")).addOption(new Option("--ecr-role-arn <arn>", "Role ARN to assume before authenticating against ECR for cross-account / centralized registries. Issues sts:AssumeRole via the default credential chain and uses the temporary credentials for ecr:GetAuthorizationToken + docker pull. Required when the caller does not have direct cross-account access to the target repository. A same-account pull in ANY region does not need this flag: the ECR client is built for the image URI's own region, so crossing a region costs nothing extra.")).addOption(new Option("--from-state", "Read cdkd S3 state for the target stack and substitute Ref / Fn::GetAtt / Fn::Sub in env vars with the deployed physical IDs / attributes. Off by default — keep PR 1 warn-and-drop semantics; turn on for stacks already deployed via cdkd deploy.").default(false)).addOption(new Option("--from-cfn-stack [cfn-stack-name]", "Read a deployed CloudFormation stack via ListStackResources and substitute Ref / Fn::ImportValue in env vars with the deployed physical IDs / exports. Use for CDK apps deployed via the upstream CDK CLI (`cdk deploy`). Bare form uses the cdkd stack name; pass an explicit value when CFn stack name differs. Mutually exclusive with --from-state. Fn::GetAtt is warn-and-dropped in v1 (CFn ListStackResources does not return per-attribute values).")).addOption(new Option("--stack-region <region>", "Region of the state record to read. Used with --from-state when the same stack name has state in multiple regions, and with --from-cfn-stack as the CFn client region (cdkd does not have a separate --cfn-stack-region flag).").argParser(parseStackRegion)).action(withErrorHandling(localInvokeCommand));
33042
33323
  [
33043
33324
  ...commonOptions,
@@ -33066,6 +33347,12 @@ function buildProgram() {
33066
33347
  program.name("cdkd").description("Drop-in CDK CLI for existing CDK apps - up to 15x faster deploys via direct AWS SDK calls instead of CloudFormation").version(getCdkdVersion());
33067
33348
  setS3ClientDefaultsDebugLog((message) => getLogger().debug(message));
33068
33349
  program.hook("preAction", async (_thisCommand, actionCommand) => {
33350
+ let activateAwsEmulator;
33351
+ try {
33352
+ activateAwsEmulator = prepareAwsEmulatorForCommand(actionCommand);
33353
+ } catch (err) {
33354
+ handleError(err);
33355
+ }
33069
33356
  const { profile } = actionCommand.optsWithGlobals();
33070
33357
  setPasteableAwsProfile(profile);
33071
33358
  const { stateBucket, roleArn } = actionCommand.optsWithGlobals();
@@ -33074,9 +33361,15 @@ function buildProgram() {
33074
33361
  profile,
33075
33362
  stateBucket,
33076
33363
  statePrefix: prefixFromCli ? actionCommand.optsWithGlobals().statePrefix : void 0,
33077
- roleArn: roleArn !== void 0
33364
+ roleArn: roleArn !== void 0,
33365
+ awsEmulator: actionCommand.getOptionValueSourceWithGlobals("awsEmulator") === "cli" ? actionCommand.optsWithGlobals().awsEmulator : void 0
33078
33366
  });
33079
33367
  if (profile !== void 0) process.env["AWS_PROFILE"] = profile;
33368
+ if (activateAwsEmulator !== void 0) try {
33369
+ await activateAwsEmulator();
33370
+ } catch (err) {
33371
+ handleError(err);
33372
+ }
33080
33373
  await resolveS3ClientDefaults({ profile });
33081
33374
  });
33082
33375
  program.addCommand(createBootstrapCommand());
@@ -33099,6 +33392,7 @@ function buildProgram() {
33099
33392
  program.addCommand(createLocalCommand());
33100
33393
  program.addCommand(createExportCommand());
33101
33394
  guardStackRegionOptions(program);
33395
+ addAwsEmulatorOptions(program);
33102
33396
  setPasteableVerbFlags(collectVerbFlags(program));
33103
33397
  return program;
33104
33398
  }
@@ -33116,4 +33410,4 @@ function collectVerbFlags(program) {
33116
33410
  }
33117
33411
 
33118
33412
  export { resolveSecretDerivedPrincipals as a, buildProgram, isResolvableSecretPrincipalList as i, runDestroyForStack as n, canonicalizeIpProtocolValue as o, holdsUnprovenSecretPrincipalToken as r, canonicalizeIpv4Cidr as t };
33119
- //# sourceMappingURL=program-DP4g5uS3.js.map
33413
+ //# sourceMappingURL=program-BQH8NPXj.js.map