@cdkd/cli 0.341.0 → 0.342.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.
- package/dist/{ambient-client-defaults-CtGTOtn9.js → ambient-client-defaults-3MwNEdTT.js} +4 -4
- package/dist/{ambient-client-defaults-CtGTOtn9.js.map → ambient-client-defaults-3MwNEdTT.js.map} +1 -1
- package/dist/{asg-provider-BT_0gh9s.js → asg-provider-ApHZ6Mae.js} +5 -5
- package/dist/{asg-provider-BT_0gh9s.js.map → asg-provider-ApHZ6Mae.js.map} +1 -1
- package/dist/{aws-client-defaults-BLXFsfMa.js → aws-client-defaults-BayGUTJ4.js} +31 -6
- package/dist/aws-client-defaults-BayGUTJ4.js.map +1 -0
- package/dist/{aws-clients-D3Z_tFc1.js → aws-clients-pNIHPxUe.js} +3 -2
- package/dist/aws-clients-pNIHPxUe.js.map +1 -0
- package/dist/cli.js +2 -2
- package/dist/{db-instance-modify-retry-CCbm-DKl.js → db-instance-modify-retry-vrjXpAjl.js} +3 -3
- package/dist/{db-instance-modify-retry-CCbm-DKl.js.map → db-instance-modify-retry-vrjXpAjl.js.map} +1 -1
- package/dist/{deploy-engine-BZSAOzE6.js → deploy-engine-B9WzTRxL.js} +374 -48
- package/dist/deploy-engine-B9WzTRxL.js.map +1 -0
- package/dist/{ecr-uri-DmkrTyRF.js → ecr-uri-CLSVFzAB.js} +3 -3
- package/dist/{ecr-uri-DmkrTyRF.js.map → ecr-uri-CLSVFzAB.js.map} +1 -1
- package/dist/{iam-role-provider-CbUqsAAi.js → iam-role-provider-qyUDKsou.js} +5 -5
- package/dist/{iam-role-provider-CbUqsAAi.js.map → iam-role-provider-qyUDKsou.js.map} +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/{neptune-provider-DlQ-_thp.js → neptune-provider-CZNhWtyQ.js} +6 -6
- package/dist/{neptune-provider-DlQ-_thp.js.map → neptune-provider-CZNhWtyQ.js.map} +1 -1
- package/dist/{program-7VC8uSCL.js → program-CWnbFCjg.js} +384 -123
- package/dist/program-CWnbFCjg.js.map +1 -0
- package/dist/{provider-classes-0cQAzv7Y.js → provider-classes-9YIXh-it.js} +12 -12
- package/dist/{provider-classes-0cQAzv7Y.js.map → provider-classes-9YIXh-it.js.map} +1 -1
- package/dist/{rds-provider-CaaoK9Yu.js → rds-provider-CvaAoT1c.js} +261 -21
- package/dist/rds-provider-CvaAoT1c.js.map +1 -0
- package/dist/{read-replica-DyG0ZkQJ.js → read-replica-BA5570ms.js} +3 -3
- package/dist/{read-replica-DyG0ZkQJ.js.map → read-replica-BA5570ms.js.map} +1 -1
- package/dist/{update-removal-CNj3wKPR.js → update-removal-DLbbpOoJ.js} +3 -3
- package/dist/{update-removal-CNj3wKPR.js.map → update-removal-DLbbpOoJ.js.map} +1 -1
- package/dist/{version-B7cmr9JA.js → version-LNRY1BhV.js} +2 -2
- package/dist/{version-B7cmr9JA.js.map → version-LNRY1BhV.js.map} +1 -1
- package/package.json +2 -2
- package/dist/aws-client-defaults-BLXFsfMa.js.map +0 -1
- package/dist/aws-clients-D3Z_tFc1.js.map +0 -1
- package/dist/deploy-engine-BZSAOzE6.js.map +0 -1
- package/dist/program-7VC8uSCL.js.map +0 -1
- package/dist/rds-provider-CaaoK9Yu.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as getCdkdVersion } from "./version-
|
|
1
|
+
import { t as getCdkdVersion } from "./version-LNRY1BhV.js";
|
|
2
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 refuseUnreadableCdkCrossAccountRefs, $c as liveMatchesUnresolvedTokenFrame, $i as createPreDeleteFinalSnapshot, $l as importableOutputs, $n as updatePartialMessage, $r as DEFAULT_RESOURCE_WARN_AFTER_MS, $s as malformedOutputsRefusalMessage, $t as NESTED_PENDING_PARENT_REASON, $u as getDockerCmd, A as PROTECTION_PROPERTY_BY_TYPE, Aa as slowCcOperationTimeoutMs, Ad as refuseFailedLookups, Ai as journaledOrphanPrintingBag, An as rollbackOrphanIds, Ao as recordedOutputReferenceRegions, Ar as withNameGenerationReached, As as refuseMalformedResourceEntriesForDestroy, Au as assertAssetBucketRegion, Bc as isMarkedCoordinate, Bd as nullPrototypeRecord, Bi as extractDeploymentEventError, Bl as recordProvenPublicExpression, Bn as propertiesChangedReason, Br as secretBearing, Bs as refuseMalformedResourcePropertiesForExport, Bt as refactorMarkerRefusalMessage, Bu as describeDockerCapturedOutput, C as refusePendingMovesOut, Cc as findActionableSdkUnwired, Cd as uploadCfnTemplate, Ci as noEchoAttributeNamesOf, Cl as isUncertifiedBaselineMaskPosition, Cn as DeploymentEventsStore, Co as cfnRefValueFromPhysicalId, Cr as orphanNeedsIdentity, Cs as malformedLocalResourceEntriesWarning, Cu as buildAssetRedirectMap, D as diffSecurity, Dd as PARTITION_TABLE, Di as withAttemptedItemsMasked, Dl as inheritNestedStackParameterAssociations, Dn as findRefactorHints, Dr as retiredAfterRollback, Ds as refuseMalformedResourceAttributesForOrphan, Du as AssetModeResolver, E as serviceTokenBlockingReason, Ea as CloudControlProvider, Ec as unwrittenCreateOnlyReplacement, Ed as expectedOwnerParam, Ei as noEchoParameterNamesOf, El as identityKeyFor, En as formatDestructiveChange, Eo as refStateLookupFromResource, Er as nameScopeOf, Es as malformedScrubResourceEntriesRefusalMessage, Eu as rewriteTemplateAssetReferences, Fa as deleteSkipReason, Fd as parseFailureDebugDetail, Fi as secretNamePrintingBags, Fl as provenPublicValue, Fn as differingRemedy, Fo as isNamelessDynamicReferenceError, Fr as reachableDivergentParameters, Fs as unreadableResourceEntries, Ft as keptForRetainedRecord, Fu as validateAssetBucketName, Ga as isWaitAbandonedError, Gc as noEchoCoordinatesOf, Gd as renderAssemblyPathEscape, Gi as ATOMIC_FINAL_SNAPSHOT_TYPES, Gl as isLockInfoExpired, Gn as DELETED_RESOURCE_REMEDY, Go as withoutUnsettledProperties, Gr as exportNameSecretExposure, Gs as malformedOrphansRefusalMessage, Gu as redactDockerArgvValues, Hc as maskReadbackAtCoordinates, Hd as absoluteAssemblyPathEscape, Hl as WHOLE_DYNAMIC_REFERENCE_PATTERN, Hn as referencedLogicalIds, Ho as unsettledItemsOf, Hr as secretSafeKeyDisplay, Hs as repairMalformedResourcePropertiesForReadOnly, Ht as sameMove, Hu as describeDockerFailure, Id as utf8ByteLength, Il as recordMaskOnlyValue, In as isPairableType, Io as carriesDynamicReference, Ir as resourcesNamingDeclaredParameter, Is as malformedDriftResourcePropertiesWarning, It as recordRetainedForReadoption, Iu as validateContainerRepoName, Ja as isAlwaysLiveAttribute, Jd as injectedAwsRegionValue, Ji as ccRoutedInstanceTakesNoSnapshot, Jl as acceptedCreateOnlyDropsOf, Jn as withUnprovenUnsettled, Jo as MULTI_REGION_RECREATE_BLOCKED_TYPES, Jr as collectDeclaredOutputNames, Js as refuseMalformedOrphansForDestroy, Ju as partitionSensitiveEnv, Ka as DiffCalculator, Kc as noEchoLeavesOf, Kd as resolveAssemblyPath, Ki as PRE_DELETE_SNAPSHOT_TYPES, Kl as S3StateBackend, Kn as recordAfterRollbackUpdate, Ko as findReplacedReadersOfRecreateTargets, Kr as isWholeDynamicReferenceValue, Ks as malformedOrphansWarning, Kt as formatResourceLine, Ku as dockerSpawnEnvWithSensitive, Lc as DagBuilder, Ld as defineOwnKey, Li as secretNamedRecordNeedles, Ll as recordMaskOnlyValuesIn, Ln as looselyEqual, Lo as keepsSecretReferenceToken, Lr as WITHHELD_NAME_DISPLAY, Ls as malformedResourcePropertiesWarning, Lt as readRefactorMarker, Lu as BOOTSTRAP_MARKER_PREFIX, M as perType, Ma as UNSPECIFIED_SKIP_REASON, Md as StageLoadError, Mi as namingSecretsWithRecordedNoEcho, Ml as recordNestedStackParameterExpressions, Mn as changedReferenceInDiff, Mo as getAccountInfo, Mr as inheritProducerRegions, Ms as refuseMalformedResourceEntriesForImportSave, Mt as withResourceDeadline, Mu as getBootstrapMarkerKey, N as readProtection, Na as deleteIndeterminateGuards, Nd as processStackMessages, Ni as orphanRecordsPrintingBag, Nl as splitGetAttStringForm, Nn as changedReferencePath, No as isImpossibleEmptyStoredAttribute, Nr as computeParameterTaint, Ns as refuseMalformedResourceEntriesForOrphan, Nt as IMPLICIT_DELETE_DEPENDENCIES, Nu as parseBootstrapMarker, O as recordedProtectionEvidence, Oc as NO_CC_HANDLERS_REASON, Od as canonicalizeRegion, Oi as createReadOnlyAttributeHealerFactory, On as hintSidesOf, Oo as keepHeldTokenProvenance, Or as retiredNameGenerationsAfter, Os as refuseMalformedResourceEntries, Ou as ensureAssetStorage, Pa as deleteLeftInPlace, Pd as describeJsonParseFailure, Pi as secretNamePrintingBag, Pl as carriesSecretMask, Pn as changedReferenceReason, Po as carriesFetchableDynamicReference, Pr as namesAnyDeclaredParameter, Ps as repairMalformedResourceEntriesForReadOnly, Pt as computeImplicitDeleteEdges, Pu as readBootstrapMarkerBody, Qa as producerLookupOver, Qc as valueAtCoordinate, Qi as unsupportedFinalSnapshotError, Ql as importableOutputKeys, Qn as undeclaredEmptyObservedKeys, Qr as DEFAULT_RESOURCE_TIMEOUT_MS, Qs as malformedLocalOutputsWarning, Qt as resolvePendingCloudControlRequests, Qu as formatDockerLoginError, Rc as TemplateParser, Rd as hasOwnKey, Ri as stateSecretNameNeedles, Rl as recordNoEchoAttributeValues, Rn as mappingPairs, Ro as withSharedDrainBudget, Rr as displayTextOrWithheld, Rs as refuseMalformedResourcePropertiesForDestroy, Rt as readRefactorMarkerOnce, Ru as buildDockerImage, S as pendingMovesRefusalMessage, Sa as isCustomResourceType$1, Sc as hasReadableResources, Sd as findLargeInlineResources, Si as yellow, Sl as dynamicReferenceTokens, Sn as DeploymentEventsReader, So as AWS_NO_VALUE, Sr as removeProtectionTypeList, Ss as isReadableResourceEntry, Su as WorkGraph, T as findServiceTokenRefusals, Td as decodeListingKey, Ti as noEchoExactEchoLeavesOf, Tl as pathCrossesDottedKey, Tn as findDestructiveChanges, To as lacksRecordedTableArn, Tr as nameGenerationHighWaterOf, Ts as malformedResourceEntriesWarning, Tu as loadPublishableAssetManifest, Uc as maskWholeValue, Ud as describeFileReadFailure, Ui as secretSegmentsOfState, Ul as isSingleDynamicReferenceToken, Un as replayFailedOperations, Uo as unsettledPropertiesOf, Ur as carriedExportAliasExposure, Us as UNREADABLE_ORPHANS_CONTAINER_ROW, Ut as updateRefactorMarker, Uu as redactedCause, Vc as maskAtCoordinates, Vd as ownValue, Vl as wholeStringLeavesOf, Vn as proposeRenames, Vo as unsettledItemsField, Vr as secretBearingStateKeyWarning, Vs as refuseMalformedResourcePropertiesForOrphan, Vt as refuseRefactorMarker, Vu as describeDockerExecFailure, Wc as maskedLeafCoordinatesOf, Wd as displayAssemblyPath, Wi as withSecretPhysicalIdsMaskedInState, Wl as LockManager, Wn as replayRollback, Wo as withUnsettledProperties, Wr as exportNameNoEchoParameters, Ws as hasReadableOrphans, Wu as redactedDockerCause, Xc as readsNoEchoSource, Xd as resolveBucketRegion, Xi as isFinalSnapshotError, Xl as exportNamesCarriedFrom, Xn as equalModuloMarkedMask, Xo as isStatefulRecreateTargetSync, Xr as isExportAliasCollision, Xs as malformedExportNamesWarning, Xu as isDockerClientEnvKey, Ya as poisonRenderedSpellingsCollidingIn, Yc as readbackPathFor, Yi as effectiveDeletionPolicy, Yl as describeRegionValueKind, Yn as calculateResourceDrift, Yo as isStatefulRecreateTargetForReplace, Yr as collectPublishedOutputNames, Ys as repairMalformedOrphansForReadOnly, Yu as warnFinchArgvExposure, Za as resolveDynamicReferences, Zc as recordedNoEchoValuesOf, Zi as refusesFinalSnapshot, Zl as hasReadableExportSet, Zn as equalModuloMask, Zo as renderStatefulReason, Zr as bindingSkippedOutputs, Zs as malformedExportSourceWarning, Zt as pendingRequestCount, Zu as isMalformedEnvKey, _ as listNestedTemplateRows, _a as CUSTOM_RESOURCE_RESPONSE_LIFECYCLE_RULE_ID, _c as withheldAccountClause, _d as warnDeprecatedNoPrefixCliFlag, _i as bold, _l as maskSecretsInText, _n as loadJournaledOrphans, _r as findNestedStackTypeChanges, _s as refuseMalformedOrphanRecordsForDestroy, _u as stackInstanceIdOf, a as scanActiveConsumers, ac as STATE_REGION_DIVERGED, ad as synthesisStatusMessage, al as createUnionSecretMasker, an as recordDisplacedSkips, ao as sendableAssumeRoleCommand, as as describeTypeWithThrottleRetry, au as hasReasonlessBaselineRefusal, b as hasPendingMovesOut, ba as TemplateNoEchoReresolver, bc as displayLogicalId, bd as CFN_TEMPLATE_URL_LIMIT, bi as green, bn as makeSiblingClaimReader, bo as isUnboundTemplateParameter, bs as unpreviewableOrphanRecords, bu as isSensitiveAttributeName, c as inheritedProvenanceForChildDiff, cc as malformedResourcesWarning, cd as loadCdkJson, ci as holdsSupersededResources, cl as logOnlyValueCount, cn as withNestedRevertRun, co as callerEnvCredentials, cr as demoteSupersededOrphans, cu as renderPhaseTimings, d as conditionInputsFrom, dc as refuseMalformedResourcesForDestroy, dd as resolveCaptureObservedState, di as supersededAfterRollback, dl as recordLogOnlyValue, dn as withNestedStackContext, do as classifyReplaySecretRegion, dr as planFailedOps, ds as isReadableOrphanRecord, du as CrossPrefixReadError, ea as buildFinalSnapshotIdentifier, ec as malformedOutputsWarning, ed as runDockerForeground, ei as maskingRetryLogger, en as displacedOpClause, eo as applyRoleArnIfSet, er as updatePartialReason, eu as isReadableBag, f as parentSuppliedValues, fa as CC_BROKEN_REASON, fc as refuseMalformedResourcesForExport, fd as resolveSkipPrefix, fi as supersededHeldByOtherTypeWarning, fl as shareLogOnlyValues, fn as deleteJournaledOrphans, fo as producerRegionsFromState, fr as recheckFailedPlan, fs as malformedOrphanRecordsRefusalMessage, fu as CrossPrefixScanCache, g as isAbsoluteAssetPath, ga as wouldReturnToSdkProvider, gc as accountArgs, gd as stateBucketExistenceConfirmed, gl as maskSecretsInError, gn as journaledOrphanLines, gr as withPreviousPolicies, gs as refuseMalformedOrphanRecords, gu as isNotImplemented, h as findNestedTemplateTreeDefect, ha as isCustomResource, hc as JSON_LISTING_HOLE_VALUE, hd as resolveUseCdkBootstrapAssets, hi as withoutSuperseded, hl as errorCauseChain, hn as isHandledOrphan, hr as resolveReplacementOldType, hs as previewableOrphanRecords, hu as isAccessDenied, i as mergeNoChangeOutputs, ic as repairMalformedOutputsForReadOnly, id as Synthesizer, ii as withStackRecords, il as carryLogOnlyValues, in as nestedChildStackName$1, io as isIamRoleArn, ir as withCreateTokenLedger, is as templateResourceTypes, iu as stackInstanceIdCarriedFrom, j as isProtectionValueActive, ja as RollbackInlinePolicyWriters, jd as AssemblyReader, ji as maskEventTextWithBoundBags, jl as recordPhysicalNameCopy, jn as withMovedTo, jo as recordedReferenceRegions, js as refuseMalformedResourceEntriesForImport, ju as isCrossRegionRedirect, k as recordedProtectionNote, ka as setResolvedResourceTimeouts, kc as hasNoCloudControlHandlers, kd as derivePartitionAndUrlSuffix, ki as completedReplayEntries, kl as physicalNameCopiesOf, kn as movedToHint, kr as retiredNameGenerationsLeaving, ks as refuseMalformedResourceEntriesForDeploy, ku as buildDenyExternalAccessPolicy, l as makeCanonicalizePropertiesFn, lc as malformedStateRefusalMessage, ld as resolveApp, li as isSupersededResourceRecord, ll as printingCorpusOf, ln as collectNestedChildUnaddressed, lo as envCredentialsAreAssumedRole, lr as isJournaledOrphan, ls as declaresNoEcho, lu as timePhase, m as childTemplateLoader, ma as ccBrokenReason, mc as repairMalformedResourcesForReadOnly, md as resolveStateBucketWithDefaultAndSource, mi as supersededResourcesOf, ml as createSecretMasker, mn as dropFailedHint, mr as replacementNeverSwapped, ms as malformedOrphanRowsKeptWarning, mu as crossPrefixDeniedWarning, n as isSecretBearingReferenceString, nc as refuseMalformedOutputs, nd as AssetManifestLoader, ni as destroyStackRecordsView, nn as dropSettledNestedJournals, no as assertSendableRoleArn, nr as ledgerForStack, nu as orphansCarriedFrom, o as inRunStackKey, oc as refuseDivergentRecordRegionForDestroy, od as getDefaultStateBucketName, oi as addSuperseded, ol as hasMaskableValues, oo as AWS_CREDENTIAL_ENV_KEYS, or as planRollback, os as withRetry, ou as hasUnverifiableParameterRefusal, p as readRecordedConditionVerdicts, pa as ProviderRegistry, pc as refuseMalformedState, pd as resolveStateBucketWithDefault, pi as supersededHolderOf, pl as unionOfSecretBags, pn as dropFailedCommands, po as regionLessSecretName, pr as recordUnderIdIsNotOwn, ps as malformedOrphanRecordsWarning, pu as applyCrossPrefixScan, qa as IntrinsicFunctionResolver, qc as noEchoOutputsComparison, qd as injectAwsRegion, qi as ccRoutedFinalSnapshotError, ql as splitImportedOps, qn as settleUnsettledPrevious, qo as shownType, qr as noEchoParameterValueSeed, qs as refuseMalformedOrphans, qu as finchSecretArgvRefusal, r as keptWholeReasonText, rc as refuseMalformedOutputsForDestroy, rd as getDockerImageBySourceHash, ro as explicitRoleArnOrThrow, rs as prefetchCreateOnlyPropertyPaths, ru as shouldRetainResource, s as crossStackOutputProvenanceSource, sc as malformedRenderedContainersWarning, sd as getLegacyStateBucketName, si as deleteSupersededEntry, sl as literalSplitDelimitersOf, sn as revertedNestedRowIds, so as applyCallerIdentityCredentials, sr as seedsDeleteFirstGuard, ss as parameterInputsFor, su as PhaseClock, t as DeployEngine, td as runDockerStreaming, tl as redactForState, tn as displacedPhysicalIdShown, to as assertFlagRoleArn, tu as orphansAfterRollback, u as conditionFingerprint, uc as refuseMalformedResourcesForDeploy, ud as resolveAutoAssetStorage, ui as removeSuperseded, ul as recordLogOnlyParameterValue, un as getCurrentNestedStackContext, uo as classifyRecordedSecretRegion, ur as isReplacementOrphan, us as deployRefusesOrphanRowsReason, uu as rebuildClientForBucketRegion, v as renderNestedTemplateTreeDefect, va as applyCustomResourceResponseExpiration, vc as STATE_RESOURCES_MALFORMED, vd as ssmResolvedValueType, vi as cyan, vl as scrubResourceRecord, vn as sameJournaledOrphans, vs as refuseMalformedOrphansForOrphan, vu as withStackInstanceIdWithheld, w as deferredServiceTokenWarning, wa as withPrintingSecrets, wc as findHandledUnwrittenCreateOnly, wd as CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION, wi as noEchoComparisonForTemplate, wl as spelledKeysOf, wn as constructPathOf$1, wo as isStalePlaceholderArnAttribute, wr as nameGenerationCarriedFrom, ws as malformedLocalResourcesWarning, wu as createAssetRedirectResolver, x as pendingMovesOutOf, xa as readsNoEchoDeleteValues, xc as hasReadableOutputs, xd as MIGRATE_TMP_PREFIX, xi as red, xl as DYNAMIC_REFERENCE_TOKEN_SCAN, xn as planOrphanAdoption, xo as parameterTypeMayLoseSecretIdentity, xs as unreadableOrphanRecords, xu as stringifyValue, y as templateIdentity, ya as customResourceResponseExpirationWarning, yc as UNREADABLE_RESOURCES_MAP_ROW, yd as CFN_TEMPLATE_BODY_LIMIT, yi as gray, yl as withPhysicalNameCopies, yn as makeForeignHolderScan, yo as coerceParameterTypedValue, ys as repairMalformedOrphanRecordsForReadOnly, yu as AssetPublisher, zc as canonicalCoordinates, zd as hasPlainPrototype, zi as storedSecretNameNeedles, zl as recordNoEchoParameterFreshValue, zn as parseMappingFile, zo as INTRINSIC_KEYS, zr as exportAliasCollisionScrubWarning, zs as refuseMalformedResourcePropertiesForDrift, zt as refactorMarkerMovesOf, zu as resolveDockerContextDirectory } from "./deploy-engine-BZSAOzE6.js";
|
|
4
|
-
import { $ as
|
|
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-
|
|
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-
|
|
7
|
-
import { a as
|
|
8
|
-
import { a as parseEcrRegistryHost, i as looksLikeEcrHostWithForeignSuffix, n as hasEcrRegistryHostLabels, t as ecrRegistryHostPattern } from "./ecr-uri-
|
|
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-B9WzTRxL.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-3MwNEdTT.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-DLbbpOoJ.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-pNIHPxUe.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-CLSVFzAB.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";
|
|
@@ -30,11 +30,11 @@ import * as readline$1 from "node:readline/promises";
|
|
|
30
30
|
import readline from "node:readline/promises";
|
|
31
31
|
import { Document, Pair, Scalar, YAMLError, YAMLMap, YAMLSeq, isScalar, parse, parseDocument, stringify, visit } from "yaml";
|
|
32
32
|
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, addAlbSpecificOptions, addCommonEcsServiceOptions, addImageOverrideOptions, addStartServiceSpecificOptions, albStrategy, architectureToPlatform, attachAuthorizers, attachStageContext, availableApiIdentifiers, 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, enforceImageOverrideOrphans, filterRoutesByApiIdentifier, firstUsableRegion, groupRoutesByServer, handleConnectionsRequest, invokeAgentCore, invokeAgentCoreWs, keysNotFromTemplate, keysOverriddenBy, materializeLayerFromArn, mcpInvokeOnce, parseConnectionsPath, parseImageOverrideFlags, parseSelectionExpressionPath, pickAgentCoreCandidateStack, pickAgentCoreCandidateStack as pickAgentCoreCandidateStack$1, probeHostGatewaySupport, readMtlsMaterialsFromDisk, recordAssumedRole, resolveAgentCoreTarget, resolveDynamicReferencesInEnv, resolveEnvVars, resolveHostGatewayExtraHosts, resolveImageOverrides, resolveRuntimeCodeMountPath, resolveRuntimeFileExtension, resolveRuntimeImage, resolveSingleTarget, resolveWatchConfig, runEcsServiceEmulator, runImageOverrideBuilds, signAgentCoreInvocation, startApiServer, substituteImagePlaceholders, tryResolveImageFnJoin, verifyJwtViaDiscovery, waitForAgentCorePing, withoutKeys } from "cdk-local/internal";
|
|
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";
|
|
34
35
|
import { createLocalStartAgentCoreCommand, createLocalStartCloudFrontCommand, createLocalStartMicrovmCommand, createLocalStartWebFunctionCommand, createLocalStateProvider, getEmbedConfig, isCfnFlagPresent, listTargets, rejectExplicitCfnStackWithMultipleStacks, resolveCfnFallbackRegion, setEmbedConfig, substituteAgainstState, substituteAgainstStateAsync, substituteEnvVarsFromState, substituteEnvVarsFromStateAsync } from "cdk-local";
|
|
35
36
|
import { createServer } from "node:net";
|
|
36
37
|
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
37
|
-
import { mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
38
38
|
import { WebSocketServer } from "ws";
|
|
39
39
|
|
|
40
40
|
// src/cli/commands/state-file-keys.ts
|
|
@@ -293,6 +293,9 @@ const strictGetattOption = new Option("--strict-getatt", "Fail the deploy on ANY
|
|
|
293
293
|
const allowUnaddressedOption = new Option("--allow-unaddressed", "Exit 0 even when the deploy left a resource unaddressed — a DELETE the provider could not issue, or a replacement whose old resource survives untracked (default: exit 2, matching cdkd destroy). The summary rows and warnings are printed either way; only the exit code changes.").default(false);
|
|
294
294
|
const noCfnFallbackOption = new Option("--no-cfn-fallback", "Do not fall back to CloudFormation (ListExports / stack outputs) when an Fn::ImportValue / Fn::GetStackOutput reference is not found in cdkd state (default: fall back, so producers still managed by CloudFormation can be referenced)");
|
|
295
295
|
const annotationMessageOptions = [new Option("--strict", "Do not proceed with stacks carrying warning annotations").default(false), new Option("--ignore-errors", "Ignore error annotations from stack synthesis, which will likely produce an invalid deployment").default(false)];
|
|
296
|
+
function exclusivelyOption(command) {
|
|
297
|
+
return new Option("-e, --exclusively", command === "deploy" ? "Only deploy requested stacks, do not include dependencies" : "Only destroy requested stacks, do not include the stacks that depend on them").default(false);
|
|
298
|
+
}
|
|
296
299
|
const deployOptions = [
|
|
297
300
|
new Option("--concurrency <number>", "Maximum concurrent resource operations").default(20).argParser((value) => parseInt(value, 10)),
|
|
298
301
|
new Option("--stack-concurrency <number>", "Maximum concurrent stack deployments").default(4).argParser((value) => parseInt(value, 10)),
|
|
@@ -307,7 +310,7 @@ const deployOptions = [
|
|
|
307
310
|
noWaitOption,
|
|
308
311
|
fullWaitOption,
|
|
309
312
|
aggressiveVpcParallelOption,
|
|
310
|
-
|
|
313
|
+
exclusivelyOption("deploy"),
|
|
311
314
|
allowUnsupportedTypesOption,
|
|
312
315
|
preferSdkRouteOption,
|
|
313
316
|
allowUnsupportedPropertiesOption,
|
|
@@ -1854,7 +1857,7 @@ function collectCrossStackRefs(node, onRef, unconditional) {
|
|
|
1854
1857
|
// src/provisioning/register-providers.ts
|
|
1855
1858
|
let providerClasses;
|
|
1856
1859
|
function loadProviderClasses() {
|
|
1857
|
-
providerClasses ??= import("./provider-classes-
|
|
1860
|
+
providerClasses ??= import("./provider-classes-9YIXh-it.js");
|
|
1858
1861
|
return providerClasses;
|
|
1859
1862
|
}
|
|
1860
1863
|
function registerAllProviders(registry, classes) {
|
|
@@ -11643,6 +11646,7 @@ async function applyRevertUpdate(args) {
|
|
|
11643
11646
|
maskSecrets: createSecretMasker(secrets),
|
|
11644
11647
|
expectedRegion: report.region,
|
|
11645
11648
|
recordedAttributes: stateResource.attributes,
|
|
11649
|
+
recordedCreateOnlyDrops: stateResource.acceptedCreateOnlyDrops,
|
|
11646
11650
|
removedProperties: /* @__PURE__ */ new Set()
|
|
11647
11651
|
}), outcome.logicalId, { logger: maskingRetryLogger(logger, secrets) });
|
|
11648
11652
|
tally.totalSucceeded++;
|
|
@@ -12503,7 +12507,8 @@ async function announceOrphansAndConfirm({ state, logger, stackNoEchoValues, jou
|
|
|
12503
12507
|
output: process.stdout
|
|
12504
12508
|
});
|
|
12505
12509
|
const journaledClause = journaledOrphans.count > 0 ? ` and ${journaledOrphans.count} recorded only in its rollback journal` : "";
|
|
12506
|
-
const
|
|
12510
|
+
const stackLabel = displayStackName(stackName) + (ctx.confirmationNote !== void 0 ? ` (${ctx.confirmationNote})` : "");
|
|
12511
|
+
const prompt = ctx.removeProtection ? `\nAbout to destroy ${resourceCount} resources${journaledClause} from stack ${stackLabel}, REMOVING DELETION PROTECTION on ${protectedCount} of them. Continue? (y/N): ` : `\nAre you sure you want to destroy stack ${stackLabel} and delete all ${resourceCount} resources${journaledClause}? (Y/n): `;
|
|
12507
12512
|
const answer = await rl.question(prompt);
|
|
12508
12513
|
rl.close();
|
|
12509
12514
|
const trimmed = answer.trim().toLowerCase();
|
|
@@ -12939,6 +12944,7 @@ async function deleteStackResource({ lock, state, ctx, stackName, logger, result
|
|
|
12939
12944
|
...ctx.skipFinalSnapshot === true && { skipFinalSnapshot: true },
|
|
12940
12945
|
...secretPrincipalOptIn !== void 0 && { resolveSecretDerivedPrincipals: secretPrincipalOptIn },
|
|
12941
12946
|
recordedAttributes: resource.attributes,
|
|
12947
|
+
recordedCreateOnlyDrops: resource.acceptedCreateOnlyDrops,
|
|
12942
12948
|
recordedNoEchoLeaves: resource.noEchoLeaves,
|
|
12943
12949
|
...noEchoDeleteValues !== void 0 && { noEchoDeleteValues },
|
|
12944
12950
|
...ctx.noEchoReresolver !== void 0 && { noEchoReresolver: ctx.noEchoReresolver },
|
|
@@ -13245,20 +13251,7 @@ async function destroyStackUnderLock({ stackName, state, ctx, logger, result, re
|
|
|
13245
13251
|
secretPrincipalRegions,
|
|
13246
13252
|
secretPrincipalRegionsIncomplete
|
|
13247
13253
|
};
|
|
13248
|
-
|
|
13249
|
-
if (lock.interrupted) {
|
|
13250
|
-
logger.debug("Interrupted (draining) — not scheduling further deletion levels");
|
|
13251
|
-
break;
|
|
13252
|
-
}
|
|
13253
|
-
const level = executionLevels[levelIndex];
|
|
13254
|
-
if (!level) continue;
|
|
13255
|
-
logger.debug(`Deletion level ${executionLevels.length - levelIndex}/${executionLevels.length} (${level.length} resources)`);
|
|
13256
|
-
const stackRegion = state.region ?? ctx.baseRegion;
|
|
13257
|
-
const deletePromises = level.map((logicalId) => withPrintingSecrets(printingBagOf(logicalId), () => deleteStackResource(resourceFrame, logicalId, stackRegion)));
|
|
13258
|
-
await Promise.all(deletePromises);
|
|
13259
|
-
}
|
|
13260
|
-
for (const entry of supersededResourcesOf(state)) {
|
|
13261
|
-
if (lock.interrupted) break;
|
|
13254
|
+
const deleteSupersededRow = async (entry, early = false) => {
|
|
13262
13255
|
const { logicalId } = entry;
|
|
13263
13256
|
const { physicalId, resourceType } = entry.state;
|
|
13264
13257
|
const drop = () => {
|
|
@@ -13269,9 +13262,9 @@ async function destroyStackUnderLock({ stackName, state, ctx, logger, result, re
|
|
|
13269
13262
|
if (holder !== void 0) {
|
|
13270
13263
|
drop();
|
|
13271
13264
|
if (holder.resourceType !== resourceType) withPrintingSecrets(bag, () => logger.warn(safeMsg` ⚠ ${supersededHeldByOtherTypeWarning(entry, holder.resourceType)}`));
|
|
13272
|
-
|
|
13265
|
+
return false;
|
|
13273
13266
|
}
|
|
13274
|
-
|
|
13267
|
+
return withPrintingSecrets(bag, async () => {
|
|
13275
13268
|
logger.info(safeMsg`Deleting ${logicalId}'s superseded ${resourceType} (${physicalId})...`);
|
|
13276
13269
|
let outcome;
|
|
13277
13270
|
try {
|
|
@@ -13299,7 +13292,11 @@ async function destroyStackUnderLock({ stackName, state, ctx, logger, result, re
|
|
|
13299
13292
|
result.deletedCount++;
|
|
13300
13293
|
drop();
|
|
13301
13294
|
logger.info(safeMsg` ✓ Deleted ${logicalId}'s superseded ${resourceType}`);
|
|
13302
|
-
return;
|
|
13295
|
+
return false;
|
|
13296
|
+
}
|
|
13297
|
+
if (early) {
|
|
13298
|
+
logger.info(safeMsg` ${logicalId}'s superseded ${resourceType} (${physicalId}) was not deleted yet; retrying after the stack's own resources`);
|
|
13299
|
+
return true;
|
|
13303
13300
|
}
|
|
13304
13301
|
const why = outcome.kind === "notDeleted" ? outcome.reason : maskSecretsInText(describeAwsFailure(outcome.error).detail, bag);
|
|
13305
13302
|
if (outcome.kind === "notDeleted") {
|
|
@@ -13307,11 +13304,35 @@ async function destroyStackUnderLock({ stackName, state, ctx, logger, result, re
|
|
|
13307
13304
|
result.skippedCount++;
|
|
13308
13305
|
result.journaledOrphanSkips++;
|
|
13309
13306
|
logger.warn(safeMsg` ⚠ ${logicalId}'s superseded ${resourceType} (${physicalId}) was not deleted: ${why}. ` + "Delete it manually — it is no longer tracked in state.");
|
|
13310
|
-
return;
|
|
13307
|
+
return false;
|
|
13311
13308
|
}
|
|
13312
13309
|
result.errorCount++;
|
|
13313
13310
|
logger.warn(safeMsg` ⚠ ${logicalId}'s superseded ${resourceType} (${physicalId}) was not deleted: ${why}. ` + "State preserved: it stays recorded, and a re-run of the destroy retries it.");
|
|
13311
|
+
return false;
|
|
13314
13312
|
});
|
|
13313
|
+
};
|
|
13314
|
+
const retryLate = /* @__PURE__ */ new Set();
|
|
13315
|
+
for (const entry of supersededResourcesOf(state)) {
|
|
13316
|
+
if (lock.interrupted) break;
|
|
13317
|
+
if (!isCustomResourceType$1(entry.state.resourceType)) continue;
|
|
13318
|
+
if (await deleteSupersededRow(entry, true)) retryLate.add(entry);
|
|
13319
|
+
}
|
|
13320
|
+
for (let levelIndex = executionLevels.length - 1; levelIndex >= 0; levelIndex--) {
|
|
13321
|
+
if (lock.interrupted) {
|
|
13322
|
+
logger.debug("Interrupted (draining) — not scheduling further deletion levels");
|
|
13323
|
+
break;
|
|
13324
|
+
}
|
|
13325
|
+
const level = executionLevels[levelIndex];
|
|
13326
|
+
if (!level) continue;
|
|
13327
|
+
logger.debug(`Deletion level ${executionLevels.length - levelIndex}/${executionLevels.length} (${level.length} resources)`);
|
|
13328
|
+
const stackRegion = state.region ?? ctx.baseRegion;
|
|
13329
|
+
const deletePromises = level.map((logicalId) => withPrintingSecrets(printingBagOf(logicalId), () => deleteStackResource(resourceFrame, logicalId, stackRegion)));
|
|
13330
|
+
await Promise.all(deletePromises);
|
|
13331
|
+
}
|
|
13332
|
+
for (const entry of supersededResourcesOf(state)) {
|
|
13333
|
+
if (lock.interrupted) break;
|
|
13334
|
+
if (isCustomResourceType$1(entry.state.resourceType) && !retryLate.has(entry)) continue;
|
|
13335
|
+
await deleteSupersededRow(entry);
|
|
13315
13336
|
}
|
|
13316
13337
|
const unreadableSuperseded = Array.isArray(state.supersededResources) ? state.supersededResources.filter((row) => !isSupersededResourceRecord(row)).length : holdsSupersededResources(state) ? 1 : 0;
|
|
13317
13338
|
if (unreadableSuperseded > 0) {
|
|
@@ -13620,6 +13641,9 @@ async function purgeEventsAfterDestroy(reader, stackName, region, opts, logger)
|
|
|
13620
13641
|
return null;
|
|
13621
13642
|
}
|
|
13622
13643
|
}
|
|
13644
|
+
function protectionNotNamed(dependsOn) {
|
|
13645
|
+
return safeMsg` --remove-protection applies only to the stacks you name; this stack was added because it depends on ${describeStack(dependsOn)}. Name it to remove its protection too.`;
|
|
13646
|
+
}
|
|
13623
13647
|
|
|
13624
13648
|
// src/cli/commands/destroy/select-targets.ts
|
|
13625
13649
|
async function selectDestroyTargets(stackArgs, options, stateBackend, logger) {
|
|
@@ -13646,7 +13670,8 @@ async function selectDestroyTargets(stackArgs, options, stateBackend, logger) {
|
|
|
13646
13670
|
...s.account && { account: s.account },
|
|
13647
13671
|
...s.terminationProtection !== void 0 && { terminationProtection: s.terminationProtection },
|
|
13648
13672
|
template: s.template,
|
|
13649
|
-
...s.nestedTemplates !== void 0 && { nestedTemplates: s.nestedTemplates }
|
|
13673
|
+
...s.nestedTemplates !== void 0 && { nestedTemplates: s.nestedTemplates },
|
|
13674
|
+
dependencyNames: s.dependencyNames
|
|
13650
13675
|
}));
|
|
13651
13676
|
synthScanStacks = result.stacks.map((s) => ({
|
|
13652
13677
|
stackName: s.stackName,
|
|
@@ -13697,16 +13722,30 @@ async function selectDestroyTargets(stackArgs, options, stateBackend, logger) {
|
|
|
13697
13722
|
stackName: s.stackName,
|
|
13698
13723
|
synth: appStackSet.has(s) ? s : void 0
|
|
13699
13724
|
});
|
|
13725
|
+
const expandSelection = (selected, seeds) => {
|
|
13726
|
+
if (options.exclusively === true) return selected;
|
|
13727
|
+
if (appStacks.length === 0) {
|
|
13728
|
+
if (selected.length > 0) logger.warn("No synthesized app stack to read stack dependencies from, so only the named stack(s) are destroyed: a deployed stack that depends on one, if any, stays deployed. Run destroy from the CDK app to destroy its dependents too.");
|
|
13729
|
+
return selected;
|
|
13730
|
+
}
|
|
13731
|
+
const added = expandDestroyTargetsDownstream(seeds, appStacks, deployedIn(allStateRefs));
|
|
13732
|
+
for (const t of added.notDeployed) logger.debug(safeMsg`Not destroying ${describeStack(t)}, which depends on a selected stack: it is not deployed`);
|
|
13733
|
+
if (added.targets.length > 0) logger.info(safeMsg`Also destroying ${added.targets.length} stack(s) that depend on the selected stack(s) (pass -e / --exclusively to destroy only the named stacks): ${added.targets.map((t) => describeWithDependency(t)).join(", ")}`);
|
|
13734
|
+
return [...selected, ...added.targets];
|
|
13735
|
+
};
|
|
13700
13736
|
let targets;
|
|
13701
13737
|
const namesAppStack = /* @__PURE__ */ new Set();
|
|
13702
13738
|
if (options.all) {
|
|
13703
13739
|
const { topLevel, inStages } = partitionTopLevel(candidateStacks);
|
|
13704
|
-
|
|
13705
|
-
|
|
13740
|
+
targets = expandSelection(topLevel.map(toTarget), partitionTopLevel(appStacks).topLevel);
|
|
13741
|
+
const expanded = new Set(targets.flatMap((t) => t.synth ? [t.synth] : []));
|
|
13742
|
+
const leftOut = inStages.filter((s) => !expanded.has(s));
|
|
13743
|
+
if (leftOut.length > 0) logger.warn(renderAllLeftOutStageStacks(leftOut));
|
|
13706
13744
|
} else if (stackPatterns.length > 0) {
|
|
13707
13745
|
const selectFrom = appStacks.length > 0 ? appStacks : candidateStacks;
|
|
13708
13746
|
const inState = new Set(candidateStacks.map((s) => s.stackName));
|
|
13709
|
-
|
|
13747
|
+
const matched = matchStacks(selectFrom, stackPatterns, { dedupe: "identity" });
|
|
13748
|
+
targets = expandSelection(matched.filter((s) => inState.has(s.stackName)).map(toTarget), matched.filter((s) => appStackSet.has(s)));
|
|
13710
13749
|
if (appStacks.length > 0) {
|
|
13711
13750
|
const gone = stacksNoLongerSelected(candidateStacks, stackPatterns, new Set(targets.map((t) => t.stackName)));
|
|
13712
13751
|
if (gone.stacks.length > 0) logger.warn(renderStacksNoLongerSelected(gone.patterns, gone.stacks));
|
|
@@ -13734,12 +13773,71 @@ async function selectDestroyTargets(stackArgs, options, stateBackend, logger) {
|
|
|
13734
13773
|
namesAppStack
|
|
13735
13774
|
};
|
|
13736
13775
|
}
|
|
13776
|
+
function expandDestroyTargetsDownstream(seeds, appStacks, isDeployed) {
|
|
13777
|
+
const dependentsOf = /* @__PURE__ */ new Map();
|
|
13778
|
+
for (const stack of appStacks) for (const depName of stack.dependencyNames ?? []) for (const producer of stacksForDependency(depName, stack, appStacks)) {
|
|
13779
|
+
const list = dependentsOf.get(producer) ?? [];
|
|
13780
|
+
list.push(stack);
|
|
13781
|
+
dependentsOf.set(producer, list);
|
|
13782
|
+
}
|
|
13783
|
+
const seen = new Set(seeds);
|
|
13784
|
+
const queue = seeds.map((s) => [s, s]);
|
|
13785
|
+
const targets = [];
|
|
13786
|
+
const notDeployed = [];
|
|
13787
|
+
while (queue.length > 0) {
|
|
13788
|
+
const [producer, seed] = queue.shift();
|
|
13789
|
+
for (const dependent of dependentsOf.get(producer) ?? []) {
|
|
13790
|
+
if (seen.has(dependent)) continue;
|
|
13791
|
+
seen.add(dependent);
|
|
13792
|
+
queue.push([dependent, seed]);
|
|
13793
|
+
if (isDeployed(dependent)) targets.push({
|
|
13794
|
+
stackName: dependent.stackName,
|
|
13795
|
+
synth: dependent,
|
|
13796
|
+
dependsOnSelected: seed
|
|
13797
|
+
});
|
|
13798
|
+
else notDeployed.push(dependent);
|
|
13799
|
+
}
|
|
13800
|
+
}
|
|
13801
|
+
return {
|
|
13802
|
+
targets,
|
|
13803
|
+
notDeployed
|
|
13804
|
+
};
|
|
13805
|
+
}
|
|
13806
|
+
function deployedIn(stateRefs) {
|
|
13807
|
+
return (stack) => stateRefs.some((r) => r.stackName === stack.stackName && (stack.region === void 0 || r.region === void 0 || r.region === stack.region));
|
|
13808
|
+
}
|
|
13809
|
+
function manifestAncestors(stack, appStacks) {
|
|
13810
|
+
const found = /* @__PURE__ */ new Set();
|
|
13811
|
+
const queue = [stack];
|
|
13812
|
+
while (queue.length > 0) {
|
|
13813
|
+
const s = queue.shift();
|
|
13814
|
+
for (const depName of s.dependencyNames ?? []) for (const producer of stacksForDependency(depName, s, appStacks)) {
|
|
13815
|
+
if (producer === stack || found.has(producer)) continue;
|
|
13816
|
+
found.add(producer);
|
|
13817
|
+
queue.push(producer);
|
|
13818
|
+
}
|
|
13819
|
+
}
|
|
13820
|
+
return found;
|
|
13821
|
+
}
|
|
13822
|
+
function describeWithDependency(t, describe = (x) => x.synth !== void 0 ? describeStack(x.synth) : displaySafe(x.stackName)) {
|
|
13823
|
+
const name = describe(t);
|
|
13824
|
+
return t.dependsOnSelected === void 0 ? name : `${name} (depends on ${describeStack(t.dependsOnSelected)})`;
|
|
13825
|
+
}
|
|
13737
13826
|
async function orderDestroyTargets(targets, appStacks, synthScanStacks, regionForStack, logger) {
|
|
13738
13827
|
const uniqueNames = [...new Set(targets.map((t) => t.stackName))];
|
|
13739
|
-
if (
|
|
13828
|
+
if (uniqueNames.length > 1) {
|
|
13740
13829
|
const inSet = new Set(uniqueNames);
|
|
13741
|
-
const
|
|
13742
|
-
|
|
13830
|
+
const edges = inferCrossStackStackDeps(synthScanStacks.filter((s) => inSet.has(s.stackName)));
|
|
13831
|
+
for (const t of targets) {
|
|
13832
|
+
if (t.synth === void 0) continue;
|
|
13833
|
+
for (const producer of manifestAncestors(t.synth, appStacks)) {
|
|
13834
|
+
if (producer.stackName === t.stackName || !inSet.has(producer.stackName)) continue;
|
|
13835
|
+
const producers = edges.get(t.stackName) ?? /* @__PURE__ */ new Set();
|
|
13836
|
+
producers.add(producer.stackName);
|
|
13837
|
+
edges.set(t.stackName, producers);
|
|
13838
|
+
}
|
|
13839
|
+
}
|
|
13840
|
+
targets = orderConsumersBeforeProducers(uniqueNames, edges).flatMap((name) => targets.filter((t) => t.stackName === name));
|
|
13743
13841
|
}
|
|
13744
13842
|
const sharedAppNames = new Set(appStacks.map((s) => s.stackName).filter((name, i, names) => names.indexOf(name) !== i));
|
|
13745
13843
|
const strictRegion = /* @__PURE__ */ new Map();
|
|
@@ -13751,12 +13849,25 @@ async function orderDestroyTargets(targets, appStacks, synthScanStacks, regionFo
|
|
|
13751
13849
|
const strictNames = new Set([...strictBySynth.keys()].map((s) => s.stackName));
|
|
13752
13850
|
refuseStackNameRegionCollisions(appStacks.filter((s) => strictBySynth.has(s) || strictNames.has(s.stackName) && s.region !== void 0), (s) => strictBySynth.get(s) ?? s.region, new Set(strictBySynth.keys()));
|
|
13753
13851
|
const describeTarget = (t) => t.synth !== void 0 && strictRegion.has(t) ? `${describeStack(t.synth)} in ${displaySafe(strictRegion.get(t))}` : displaySafe(t.stackName);
|
|
13754
|
-
logger.info(`Found ${targets.length} stack(s) to destroy: ${targets.map(describeTarget).join(", ")}`);
|
|
13852
|
+
logger.info(safeMsg`Found ${targets.length} stack(s) to destroy: ${targets.map((t) => describeWithDependency(t, describeTarget)).join(", ")}`);
|
|
13853
|
+
const dependentsOf = /* @__PURE__ */ new Map();
|
|
13854
|
+
const bySynth = new Map(targets.flatMap((t) => t.synth ? [[t.synth, t]] : []));
|
|
13855
|
+
for (const t of targets) {
|
|
13856
|
+
if (t.synth === void 0) continue;
|
|
13857
|
+
for (const producer of manifestAncestors(t.synth, appStacks)) {
|
|
13858
|
+
const pt = bySynth.get(producer);
|
|
13859
|
+
if (pt === void 0 || pt === t) continue;
|
|
13860
|
+
const list = dependentsOf.get(pt) ?? [];
|
|
13861
|
+
list.push(t);
|
|
13862
|
+
dependentsOf.set(pt, list);
|
|
13863
|
+
}
|
|
13864
|
+
}
|
|
13755
13865
|
return {
|
|
13756
13866
|
targets,
|
|
13757
13867
|
uniqueNames,
|
|
13758
13868
|
strictRegion,
|
|
13759
|
-
describeTarget
|
|
13869
|
+
describeTarget,
|
|
13870
|
+
dependentsOf
|
|
13760
13871
|
};
|
|
13761
13872
|
}
|
|
13762
13873
|
|
|
@@ -13881,7 +13992,8 @@ async function destroyCommand(stackArgs, options) {
|
|
|
13881
13992
|
}
|
|
13882
13993
|
const ordering = await orderDestroyTargets(targets, appStacks, synthScanStacks, regionForStack, logger);
|
|
13883
13994
|
targets = ordering.targets;
|
|
13884
|
-
const { uniqueNames, strictRegion, describeTarget } = ordering;
|
|
13995
|
+
const { uniqueNames, strictRegion, describeTarget, dependentsOf } = ordering;
|
|
13996
|
+
const notDestroyed = /* @__PURE__ */ new Set();
|
|
13885
13997
|
const accountId = "unknown";
|
|
13886
13998
|
const stateRefsByName = /* @__PURE__ */ new Map();
|
|
13887
13999
|
for (const ref of allStateRefs) {
|
|
@@ -13916,28 +14028,32 @@ async function destroyCommand(stackArgs, options) {
|
|
|
13916
14028
|
return plannedDestroyRegion(refs, target.synth?.region, fallbackRegionByName.get(target.stackName) ?? region);
|
|
13917
14029
|
};
|
|
13918
14030
|
for (const target of targets) {
|
|
13919
|
-
if (target.synth?.terminationProtection === true && !options.removeProtection) continue;
|
|
14031
|
+
if (target.synth?.terminationProtection === true && !(options.removeProtection === true && target.dependsOnSelected === void 0)) continue;
|
|
13920
14032
|
const planned = plannedRegionFor(target);
|
|
13921
14033
|
if (planned !== void 0) crossPrefixCheck.cache.full(target.stackName, planned, "prestart");
|
|
13922
14034
|
}
|
|
13923
14035
|
for (const [stackIndex, target] of targets.entries()) {
|
|
13924
14036
|
const stackName = target.stackName;
|
|
13925
14037
|
logger.info(`\nPreparing to destroy stack: ${describeTarget(target)}`);
|
|
14038
|
+
const removeProtection = options.removeProtection === true && target.dependsOnSelected === void 0;
|
|
13926
14039
|
if (wrongAccount.has(target)) {
|
|
13927
14040
|
logger.error(callerAccountUnreadable ? safeMsg` ✗ Stack ${describeTarget(target)} is pinned to account ${target.synth.account}, and the account this run's credentials resolve to could not be read (STS GetCallerIdentity failed), so it was not destroyed: another stack of the app shares its name, and only that account's credentials address its record. Check the credentials (aws sts get-caller-identity) and re-run destroy.` : safeMsg` ✗ Stack ${describeTarget(target)} is pinned to account ${target.synth.account}, which is not the account this run's credentials resolve to; not destroyed. Run destroy with that account's credentials.`);
|
|
14041
|
+
notDestroyed.add(target);
|
|
13928
14042
|
totalErrors++;
|
|
13929
14043
|
continue;
|
|
13930
14044
|
}
|
|
13931
14045
|
const refs = stateRefsByName.get(stackName) ?? [];
|
|
13932
14046
|
const synthStack = target.synth;
|
|
13933
14047
|
if (synthStack?.terminationProtection === true) {
|
|
13934
|
-
if (
|
|
14048
|
+
if (removeProtection) logger.warn(`Stack ${displaySafe(stackName)} has terminationProtection: true — bypassing because --remove-protection set`);
|
|
13935
14049
|
else {
|
|
13936
14050
|
const err = new StackTerminationProtectionError(stackName, void 0, {
|
|
13937
14051
|
args: stateCommandAccount.args,
|
|
13938
14052
|
clause: withheldAccountClause(accountRecovery, "the command below prints")
|
|
13939
14053
|
});
|
|
13940
14054
|
logger.error(` ✗ ${err.message}`);
|
|
14055
|
+
if (options.removeProtection === true && target.dependsOnSelected !== void 0) logger.error(protectionNotNamed(target.dependsOnSelected));
|
|
14056
|
+
notDestroyed.add(target);
|
|
13941
14057
|
totalErrors++;
|
|
13942
14058
|
continue;
|
|
13943
14059
|
}
|
|
@@ -13975,13 +14091,15 @@ async function destroyCommand(stackArgs, options) {
|
|
|
13975
14091
|
continue;
|
|
13976
14092
|
}
|
|
13977
14093
|
if (synthStack?.terminationProtection !== true && stateResult.state.terminationProtection === true) {
|
|
13978
|
-
if (
|
|
14094
|
+
if (removeProtection) logger.warn(safeMsg`Stack ${stackName} was deployed with terminationProtection: true — bypassing because --remove-protection set`);
|
|
13979
14095
|
else {
|
|
13980
14096
|
const err = new StackTerminationProtectionError(stackName, void 0, {
|
|
13981
14097
|
args: stateCommandAccount.args,
|
|
13982
14098
|
clause: withheldAccountClause(accountRecovery, "the command below prints")
|
|
13983
14099
|
}, { command: "cdkd destroy" });
|
|
13984
14100
|
logger.error(safeMsg` ✗ ${asIsMessage(err.message)}`);
|
|
14101
|
+
if (options.removeProtection === true && target.dependsOnSelected !== void 0) logger.error(protectionNotNamed(target.dependsOnSelected));
|
|
14102
|
+
notDestroyed.add(target);
|
|
13985
14103
|
totalErrors++;
|
|
13986
14104
|
continue;
|
|
13987
14105
|
}
|
|
@@ -13989,9 +14107,16 @@ async function destroyCommand(stackArgs, options) {
|
|
|
13989
14107
|
if (stateResult.state.parentStack) {
|
|
13990
14108
|
const err = new NestedStackChildDirectDestroyError(stackName, stateResult.state.parentStack, stateResult.state.parentLogicalId, void 0, stateCommandAccount);
|
|
13991
14109
|
logger.error(` ✗ ${err.message}`);
|
|
14110
|
+
notDestroyed.add(target);
|
|
13992
14111
|
totalErrors++;
|
|
13993
14112
|
continue;
|
|
13994
14113
|
}
|
|
14114
|
+
const keptDependents = (dependentsOf.get(target) ?? []).filter((d) => notDestroyed.has(d));
|
|
14115
|
+
if (keptDependents.length > 0) {
|
|
14116
|
+
logger.warn(safeMsg`Not destroying stack ${describeTarget(target)}: ${keptDependents.map(describeTarget).join(", ")} depends on it and was not destroyed in this run.`);
|
|
14117
|
+
notDestroyed.add(target);
|
|
14118
|
+
continue;
|
|
14119
|
+
}
|
|
13995
14120
|
if (runInterrupted()) {
|
|
13996
14121
|
stoppedEarly = true;
|
|
13997
14122
|
break;
|
|
@@ -14019,7 +14144,7 @@ async function destroyCommand(stackArgs, options) {
|
|
|
14019
14144
|
destroyOptions: {
|
|
14020
14145
|
...options.profile && { profile: options.profile },
|
|
14021
14146
|
statePrefix: options.statePrefix,
|
|
14022
|
-
...
|
|
14147
|
+
...removeProtection && { removeProtection: true },
|
|
14023
14148
|
...options.skipFinalSnapshot === true && { skipFinalSnapshot: true },
|
|
14024
14149
|
...options.resourceWarnAfter?.globalMs !== void 0 && { resourceWarnAfterMs: options.resourceWarnAfter.globalMs },
|
|
14025
14150
|
...options.resourceTimeout?.globalMs !== void 0 && { resourceTimeoutMs: options.resourceTimeout.globalMs },
|
|
@@ -14037,7 +14162,8 @@ async function destroyCommand(stackArgs, options) {
|
|
|
14037
14162
|
stateBucket,
|
|
14038
14163
|
statePrefix: options.statePrefix,
|
|
14039
14164
|
skipConfirmation: options.yes || options.force,
|
|
14040
|
-
|
|
14165
|
+
...target.dependsOnSelected !== void 0 && { confirmationNote: `it depends on ${describeStack(target.dependsOnSelected)}` },
|
|
14166
|
+
removeProtection,
|
|
14041
14167
|
skipFinalSnapshot: options.skipFinalSnapshot === true,
|
|
14042
14168
|
resolveSecretDerivedPrincipals: {},
|
|
14043
14169
|
stackDestroy: true,
|
|
@@ -14063,6 +14189,7 @@ async function destroyCommand(stackArgs, options) {
|
|
|
14063
14189
|
stackInterrupted = result.interrupted;
|
|
14064
14190
|
stackCancelled = result.cancelled === true;
|
|
14065
14191
|
if (result.interrupted) interrupted = true;
|
|
14192
|
+
if (result.errorCount > 0 || result.skippedCount > 0 || result.interrupted || result.cancelled === true) notDestroyed.add(target);
|
|
14066
14193
|
destroyRunResult = result.errorCount > 0 || result.skippedCount > 0 ? "FAILED" : "SUCCEEDED";
|
|
14067
14194
|
eventRecorder.record({
|
|
14068
14195
|
eventType: "RUN_FINISHED",
|
|
@@ -14114,6 +14241,7 @@ function createDestroyCommand() {
|
|
|
14114
14241
|
...stateOptions,
|
|
14115
14242
|
...stackOptions,
|
|
14116
14243
|
...destroyOptions,
|
|
14244
|
+
exclusivelyOption("destroy"),
|
|
14117
14245
|
...resourceTimeoutOptions,
|
|
14118
14246
|
skipFinalSnapshotOption,
|
|
14119
14247
|
...contextOptions
|
|
@@ -20937,6 +21065,7 @@ async function runRollbackReplay(ctx) {
|
|
|
20937
21065
|
const segment = journal.segments[journal.segments.length - 1];
|
|
20938
21066
|
const completedSplit = splitImportedOps(segment.operations, segment, orphanLogicalIds);
|
|
20939
21067
|
const completedOps = completedSplit.replay;
|
|
21068
|
+
const cleanup = segmentCleanupOptions(completedOps.length > 0, supersededHost, baseState);
|
|
20940
21069
|
const displaced = [...completedSplit.displaced, ...splitImportedOps(segment.failedOperations ?? [], segment).displaced];
|
|
20941
21070
|
for (const op of displaced) logger.warn(displacedOpLabel(op, segment).trim());
|
|
20942
21071
|
recordDisplacedSkips(ctx.recordEvent, stackName, displaced);
|
|
@@ -20970,6 +21099,7 @@ async function runRollbackReplay(ctx) {
|
|
|
20970
21099
|
afterOp: saveState,
|
|
20971
21100
|
isInterrupted: () => interrupted,
|
|
20972
21101
|
emitEnvelope: completedOps.length === 0,
|
|
21102
|
+
...cleanup,
|
|
20973
21103
|
onOrphan: (record) => mintedOrphans.push(record),
|
|
20974
21104
|
onRolledBackCreate: (create) => rolledBackCreates.push(create),
|
|
20975
21105
|
inlinePolicyWriters
|
|
@@ -21005,8 +21135,7 @@ async function runRollbackReplay(ctx) {
|
|
|
21005
21135
|
onRolledBackCreate: (create) => rolledBackCreates.push(create),
|
|
21006
21136
|
inlinePolicyWriters,
|
|
21007
21137
|
failedOperations: failedForGuard,
|
|
21008
|
-
|
|
21009
|
-
onSupersededSettled: (entry) => removeSuperseded(supersededHost, entry)
|
|
21138
|
+
...cleanup
|
|
21010
21139
|
}));
|
|
21011
21140
|
return {
|
|
21012
21141
|
failures: replayResult.failures + failedOpFailures,
|
|
@@ -24977,6 +25106,137 @@ async function applyRoleArnForLocal(opts) {
|
|
|
24977
25106
|
});
|
|
24978
25107
|
}
|
|
24979
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
|
+
|
|
24980
25240
|
// src/utils/local-aws-failure.ts
|
|
24981
25241
|
function describeLocalAwsFailureForWarn(err, operation) {
|
|
24982
25242
|
if (err instanceof CdkdError) return withoutTrailingPeriod(displaySafe(err.message));
|
|
@@ -25373,6 +25633,21 @@ async function pullImage(image, skipPull) {
|
|
|
25373
25633
|
}
|
|
25374
25634
|
}
|
|
25375
25635
|
async function runDetached(opts) {
|
|
25636
|
+
const wiring = getActiveWorkloadAwsWiring$1();
|
|
25637
|
+
if (!wiring) return runDetachedContainer(opts);
|
|
25638
|
+
const wired = await applyLocalAwsWiring(wiring, opts.env, opts.extraMounts ?? [], opts.mounts.map((m) => m.containerPath));
|
|
25639
|
+
const wiredOpts = {
|
|
25640
|
+
...opts,
|
|
25641
|
+
env: wired.env,
|
|
25642
|
+
extraMounts: wired.extraMounts
|
|
25643
|
+
};
|
|
25644
|
+
const ports = loopbackPortsFor(wiring, wired.env, opts.network);
|
|
25645
|
+
if (ports.length > 0) await prepareLocalLoopbackForwarder(wiring);
|
|
25646
|
+
const id = await runDetachedContainer(wiredOpts);
|
|
25647
|
+
await attachLocalLoopbackForwarder(id, ports);
|
|
25648
|
+
return id;
|
|
25649
|
+
}
|
|
25650
|
+
async function runDetachedContainer(opts) {
|
|
25376
25651
|
const args = [
|
|
25377
25652
|
"run",
|
|
25378
25653
|
"-d",
|
|
@@ -26001,52 +26276,6 @@ function singleFlight(fn, onError) {
|
|
|
26001
26276
|
};
|
|
26002
26277
|
}
|
|
26003
26278
|
|
|
26004
|
-
// src/cli/commands/local-profile-credentials-file.ts
|
|
26005
|
-
const CONTAINER_AWS_CREDENTIALS_PATH = "/cdkd-aws/credentials";
|
|
26006
|
-
async function writeProfileCredentialsFile(profileName, creds, opts) {
|
|
26007
|
-
if (profileName === "") throw new Error("writeProfileCredentialsFile: profile name must not be empty.");
|
|
26008
|
-
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).`);
|
|
26009
|
-
const dir = await mkdtemp(path.join(tmpdir(), "cdkd-profile-creds-"));
|
|
26010
|
-
const hostPath = path.join(dir, "credentials");
|
|
26011
|
-
opts?.onDirCreated?.(hostPath);
|
|
26012
|
-
const lines = [
|
|
26013
|
-
`[${profileName}]`,
|
|
26014
|
-
`aws_access_key_id = ${creds.accessKeyId}`,
|
|
26015
|
-
`aws_secret_access_key = ${creds.secretAccessKey}`
|
|
26016
|
-
];
|
|
26017
|
-
if (creds.sessionToken) lines.push(`aws_session_token = ${creds.sessionToken}`);
|
|
26018
|
-
try {
|
|
26019
|
-
await writeFile(hostPath, lines.join("\n") + "\n", { mode: 384 });
|
|
26020
|
-
} catch (err) {
|
|
26021
|
-
let removed = true;
|
|
26022
|
-
await rm(dir, {
|
|
26023
|
-
recursive: true,
|
|
26024
|
-
force: true
|
|
26025
|
-
}).catch(() => {
|
|
26026
|
-
removed = false;
|
|
26027
|
-
});
|
|
26028
|
-
if (removed) try {
|
|
26029
|
-
opts?.onDirRemoved?.(hostPath);
|
|
26030
|
-
} catch {}
|
|
26031
|
-
throw err;
|
|
26032
|
-
}
|
|
26033
|
-
return {
|
|
26034
|
-
hostPath,
|
|
26035
|
-
containerPath: CONTAINER_AWS_CREDENTIALS_PATH,
|
|
26036
|
-
profileName,
|
|
26037
|
-
dispose: async () => {
|
|
26038
|
-
await rm(dir, {
|
|
26039
|
-
recursive: true,
|
|
26040
|
-
force: true
|
|
26041
|
-
});
|
|
26042
|
-
}
|
|
26043
|
-
};
|
|
26044
|
-
}
|
|
26045
|
-
function strandedProfileCredentialsNotice(hostPath) {
|
|
26046
|
-
if (hostPath === void 0) return void 0;
|
|
26047
|
-
return `The AWS credentials file mounted into the containers is NOT removed: delete ${displayIdent(hostPath)} once you tear them down.`;
|
|
26048
|
-
}
|
|
26049
|
-
|
|
26050
26279
|
// src/local/websocket-body.ts
|
|
26051
26280
|
function bufferToBody$1(raw, isBinary) {
|
|
26052
26281
|
return bufferToBody(raw, isBinary);
|
|
@@ -27973,9 +28202,11 @@ async function buildContainerSpec(args) {
|
|
|
27973
28202
|
dockerEnv["AWS_ACCESS_KEY_ID"] = creds.accessKeyId;
|
|
27974
28203
|
dockerEnv["AWS_SECRET_ACCESS_KEY"] = creds.secretAccessKey;
|
|
27975
28204
|
dockerEnv["AWS_SESSION_TOKEN"] = creds.sessionToken;
|
|
27976
|
-
|
|
28205
|
+
setContainerRegion(dockerEnv, stsRegion);
|
|
27977
28206
|
} else {
|
|
27978
28207
|
forwardAwsEnv$2(dockerEnv);
|
|
28208
|
+
const containerRegion = firstUsableRegion(stsRegion, lambda.stack.region);
|
|
28209
|
+
setContainerRegion(dockerEnv, containerRegion);
|
|
27979
28210
|
if (profileCredentials) {
|
|
27980
28211
|
dockerEnv["AWS_ACCESS_KEY_ID"] = profileCredentials.accessKeyId;
|
|
27981
28212
|
dockerEnv["AWS_SECRET_ACCESS_KEY"] = profileCredentials.secretAccessKey;
|
|
@@ -29049,10 +29280,7 @@ async function localStartApiCommand(target, options) {
|
|
|
29049
29280
|
}
|
|
29050
29281
|
warnIfDeprecatedRegion(options);
|
|
29051
29282
|
if (options.layerRoleArn !== void 0) explicitRoleArnOrThrow("--layer-role-arn", options.layerRoleArn);
|
|
29052
|
-
await
|
|
29053
|
-
roleArn: options.roleArn,
|
|
29054
|
-
region: options.region
|
|
29055
|
-
});
|
|
29283
|
+
await activateLocalAwsAndRoleArn(options);
|
|
29056
29284
|
const normalizedAssumeRole = normalizeStartApiAssumeRole(options.assumeRole, options.assumeRoleAuto ?? false);
|
|
29057
29285
|
if (normalizedAssumeRole === void 0) delete options.assumeRole;
|
|
29058
29286
|
else options.assumeRole = normalizedAssumeRole;
|
|
@@ -29119,7 +29347,7 @@ async function localStartApiCommand(target, options) {
|
|
|
29119
29347
|
});
|
|
29120
29348
|
const corsConfigByStack = buildCorsConfigByStack(targetStacks);
|
|
29121
29349
|
const stateByStack = options.fromState || isCfnFlagPresent(options) ? await loadStateForRoutedStacks(targetStacks, routes, routesWithAuth, options) : /* @__PURE__ */ new Map();
|
|
29122
|
-
const profileCredentials =
|
|
29350
|
+
const profileCredentials = await profileCredentialsForWorkload(options.profile, resolveProfileCredentials);
|
|
29123
29351
|
if (options.profile && profileCredentials && !profileCredsFile) profileCredsFile = await writeProfileCredentialsFile(options.profile, profileCredentials, {
|
|
29124
29352
|
onDirCreated: (hostPath) => {
|
|
29125
29353
|
credsHostPath = hostPath;
|
|
@@ -29332,6 +29560,7 @@ function createLocalStartApiCommand() {
|
|
|
29332
29560
|
...stateOptions
|
|
29333
29561
|
].forEach((opt) => startApi.addOption(opt));
|
|
29334
29562
|
startApi.addOption(deprecatedRegionOption);
|
|
29563
|
+
addAwsEndpointOptions(startApi);
|
|
29335
29564
|
return startApi;
|
|
29336
29565
|
}
|
|
29337
29566
|
|
|
@@ -29900,7 +30129,10 @@ function buildDockerRunArgs(opts) {
|
|
|
29900
30129
|
const hostPort = pm.hostPort ?? pm.containerPort;
|
|
29901
30130
|
args.push("-p", `${containerHost}:${hostPort}:${pm.containerPort}/${pm.protocol}`);
|
|
29902
30131
|
}
|
|
29903
|
-
|
|
30132
|
+
const wiring = getActiveWorkloadAwsWiring();
|
|
30133
|
+
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`);
|
|
29904
30136
|
for (const mp of container.mountPoints) {
|
|
29905
30137
|
const v = volumeByName.get(mp.sourceVolume);
|
|
29906
30138
|
if (!v) continue;
|
|
@@ -29915,7 +30147,7 @@ function buildDockerRunArgs(opts) {
|
|
|
29915
30147
|
args.push("-v", `${name}:${mp.containerPath}${ro}`);
|
|
29916
30148
|
}
|
|
29917
30149
|
}
|
|
29918
|
-
|
|
30150
|
+
let finalEnv = {};
|
|
29919
30151
|
const metaEnv = buildMetadataEnv({
|
|
29920
30152
|
containerName: container.name,
|
|
29921
30153
|
...roleArn !== void 0 && { roleArn },
|
|
@@ -29923,10 +30155,11 @@ function buildDockerRunArgs(opts) {
|
|
|
29923
30155
|
...opts.sidecarIp !== void 0 && { sidecarIp: opts.sidecarIp }
|
|
29924
30156
|
});
|
|
29925
30157
|
Object.assign(finalEnv, metaEnv);
|
|
29926
|
-
if (
|
|
29927
|
-
finalEnv["AWS_SHARED_CREDENTIALS_FILE"] =
|
|
29928
|
-
finalEnv["AWS_PROFILE"] =
|
|
30158
|
+
if (profileCredentialsFile) {
|
|
30159
|
+
finalEnv["AWS_SHARED_CREDENTIALS_FILE"] = profileCredentialsFile.containerPath;
|
|
30160
|
+
finalEnv["AWS_PROFILE"] = profileCredentialsFile.profileName;
|
|
29929
30161
|
}
|
|
30162
|
+
if (wiring?.mode === "forward") for (const [k, v] of Object.entries(wiring.env)) defineOwnKey(finalEnv, k, v);
|
|
29930
30163
|
for (const [k, v] of Object.entries(container.environment)) defineOwnKey(finalEnv, k, v);
|
|
29931
30164
|
for (const s of secrets) defineOwnKey(finalEnv, s.name, s.value);
|
|
29932
30165
|
const overrides = opts.envOverrides;
|
|
@@ -29934,6 +30167,10 @@ function buildDockerRunArgs(opts) {
|
|
|
29934
30167
|
applyOverrideMap(finalEnv, overrides["Parameters"]);
|
|
29935
30168
|
applyOverrideMap(finalEnv, overrides[container.name]);
|
|
29936
30169
|
}
|
|
30170
|
+
if (wiring) finalEnv = applyWorkloadAwsWiringToEnv(finalEnv, wiring.mode === "emulator" ? wiring : {
|
|
30171
|
+
...wiring,
|
|
30172
|
+
env: {}
|
|
30173
|
+
});
|
|
29937
30174
|
const sensitiveKeys = /* @__PURE__ */ new Set([
|
|
29938
30175
|
...SENSITIVE_ENV_KEYS,
|
|
29939
30176
|
...secrets.map((s) => s.name),
|
|
@@ -29966,7 +30203,8 @@ function buildDockerRunArgs(opts) {
|
|
|
29966
30203
|
args,
|
|
29967
30204
|
dockerName,
|
|
29968
30205
|
sensitiveEnv,
|
|
29969
|
-
collisions
|
|
30206
|
+
collisions,
|
|
30207
|
+
loopbackPorts: wiring ? effectiveLoopbackPorts(finalEnv, wiring) : []
|
|
29970
30208
|
};
|
|
29971
30209
|
}
|
|
29972
30210
|
function applyOverrideMap(acc, map) {
|
|
@@ -30194,6 +30432,7 @@ async function runEcsTask(task, options, state) {
|
|
|
30194
30432
|
if (state.closing) throw interruptedError();
|
|
30195
30433
|
const mergedAddHostFlags = mergeHostGatewayAddHostFlags(options.addHostFlags, options.hostGatewayExtraHosts);
|
|
30196
30434
|
const dockerCmds = /* @__PURE__ */ new Map();
|
|
30435
|
+
const dockerLoopbackPorts = /* @__PURE__ */ new Map();
|
|
30197
30436
|
const dockerNames = /* @__PURE__ */ new Map();
|
|
30198
30437
|
const dockerEnvs = /* @__PURE__ */ new Map();
|
|
30199
30438
|
for (const container of task.containers) {
|
|
@@ -30223,6 +30462,7 @@ async function runEcsTask(task, options, state) {
|
|
|
30223
30462
|
...options.profileCredentialsFile && { profileCredentialsFile: options.profileCredentialsFile }
|
|
30224
30463
|
});
|
|
30225
30464
|
dockerCmds.set(container.name, built.args);
|
|
30465
|
+
dockerLoopbackPorts.set(container.name, built.loopbackPorts);
|
|
30226
30466
|
dockerNames.set(container.name, built.dockerName);
|
|
30227
30467
|
dockerEnvs.set(container.name, built.sensitiveEnv);
|
|
30228
30468
|
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.`);
|
|
@@ -30234,6 +30474,9 @@ async function runEcsTask(task, options, state) {
|
|
|
30234
30474
|
if (state.closing) throw interruptedError();
|
|
30235
30475
|
const args = dockerCmds.get(container.name);
|
|
30236
30476
|
const dockerName = dockerNames.get(container.name);
|
|
30477
|
+
const loopbackPorts = dockerLoopbackPorts.get(container.name) ?? [];
|
|
30478
|
+
const forwarderWiring = getActiveWorkloadAwsWiring$1();
|
|
30479
|
+
if (loopbackPorts.length > 0 && forwarderWiring) await prepareLocalLoopbackForwarder(forwarderWiring);
|
|
30237
30480
|
logger.info(`Starting container '${container.name}' (image=${imagePlan.get(container.name)})`);
|
|
30238
30481
|
const sensitiveEnv = dockerEnvs.get(container.name);
|
|
30239
30482
|
warnFinchArgvExposure(Object.keys(sensitiveEnv));
|
|
@@ -30262,6 +30505,7 @@ async function runEcsTask(task, options, state) {
|
|
|
30262
30505
|
id,
|
|
30263
30506
|
container
|
|
30264
30507
|
});
|
|
30508
|
+
if (loopbackPorts.length > 0) await attachLocalLoopbackForwarder(id, loopbackPorts);
|
|
30265
30509
|
if (!options.detach) state.logStreams.push({
|
|
30266
30510
|
containerId: id,
|
|
30267
30511
|
stream: streamContainerLogs(container.name, id)
|
|
@@ -30468,12 +30712,16 @@ function readEnvOverridesFile$2(filePath) {
|
|
|
30468
30712
|
|
|
30469
30713
|
// src/cli/commands/local-run-task/credentials.ts
|
|
30470
30714
|
async function resolveSidecarCredentials(options, assumedCredentials) {
|
|
30715
|
+
const wiring = getActiveWorkloadAwsWiring();
|
|
30716
|
+
if (wiring?.mode === "emulator") return wiring.emulatorCredentials;
|
|
30471
30717
|
if (assumedCredentials) return assumedCredentials;
|
|
30472
30718
|
if (options.profile) return resolveProfileCredentials(options.profile);
|
|
30719
|
+
return resolveHostDefaultCredentials();
|
|
30473
30720
|
}
|
|
30474
30721
|
async function resolveTaskCredentialChannels(options, assumedCredentials, opts) {
|
|
30475
30722
|
const sidecarCredentials = await resolveSidecarCredentials(options, assumedCredentials);
|
|
30476
|
-
|
|
30723
|
+
const emulator = getActiveWorkloadAwsWiring()?.mode === "emulator";
|
|
30724
|
+
if (options.profile && sidecarCredentials && !assumedCredentials && !emulator) return {
|
|
30477
30725
|
sidecarCredentials,
|
|
30478
30726
|
profileCredsFile: await writeProfileCredentialsFile(options.profile, sidecarCredentials, opts)
|
|
30479
30727
|
};
|
|
@@ -30607,10 +30855,7 @@ async function localRunTaskCommand(target, options) {
|
|
|
30607
30855
|
try {
|
|
30608
30856
|
if (typeof options.assumeTaskRole === "string") assertFlagRoleArn("--assume-task-role", options.assumeTaskRole);
|
|
30609
30857
|
if (options.ecrRoleArn !== void 0) assertFlagRoleArn("--ecr-role-arn", options.ecrRoleArn);
|
|
30610
|
-
await
|
|
30611
|
-
roleArn: options.roleArn,
|
|
30612
|
-
region: options.region
|
|
30613
|
-
});
|
|
30858
|
+
await activateLocalAwsAndRoleArn(options);
|
|
30614
30859
|
await ensureDockerAvailable();
|
|
30615
30860
|
const appCmd = resolveApp(options.app);
|
|
30616
30861
|
if (!appCmd) throw new Error("No CDK app specified. Pass --app, set CDKD_APP, or add \"app\" to cdk.json.");
|
|
@@ -30744,6 +30989,7 @@ function createLocalRunTaskCommand() {
|
|
|
30744
30989
|
...stateOptions
|
|
30745
30990
|
].forEach((opt) => cmd.addOption(opt));
|
|
30746
30991
|
cmd.addOption(deprecatedRegionOption);
|
|
30992
|
+
addAwsEndpointOptions(cmd);
|
|
30747
30993
|
return cmd;
|
|
30748
30994
|
}
|
|
30749
30995
|
|
|
@@ -30961,6 +31207,7 @@ async function softReloadAgentContainer(containerId, newAssetSourceDir) {
|
|
|
30961
31207
|
} catch (err) {
|
|
30962
31208
|
throw new CdkdError(`softReloadAgentContainer: docker restart of '${containerId}' failed: ${describeDockerExecFailure(err, restartArgs)}.`, "LOCAL_INVOKE_AGENTCORE_WATCH_SOFT_RELOAD_RESTART_FAILED");
|
|
30963
31209
|
}
|
|
31210
|
+
await attachLocalLoopbackForwarder(containerId);
|
|
30964
31211
|
}
|
|
30965
31212
|
async function loadAgentCoreAssetContext(args) {
|
|
30966
31213
|
const { resolvedTarget, resolved, stacks, cdkOutDir, assetLoader, oldAssetHash } = args;
|
|
@@ -31198,7 +31445,7 @@ async function applyAgentCoreCredentialEnv(dockerEnv, args) {
|
|
|
31198
31445
|
dockerEnv["AWS_ACCESS_KEY_ID"] = creds.accessKeyId;
|
|
31199
31446
|
dockerEnv["AWS_SECRET_ACCESS_KEY"] = creds.secretAccessKey;
|
|
31200
31447
|
dockerEnv["AWS_SESSION_TOKEN"] = creds.sessionToken;
|
|
31201
|
-
|
|
31448
|
+
setContainerRegion(dockerEnv, stsRegion);
|
|
31202
31449
|
assumeSucceeded = true;
|
|
31203
31450
|
} catch (err) {
|
|
31204
31451
|
logger.warn(`--assume-role: STS AssumeRole(${displayIdent(args.assumeRoleArn, { maxCodePoints: 613 })}) failed: ${describeLocalAwsFailureForWarn(err, "STS AssumeRole")}. Falling back to the developer's shell credentials.`);
|
|
@@ -31206,6 +31453,7 @@ async function applyAgentCoreCredentialEnv(dockerEnv, args) {
|
|
|
31206
31453
|
}
|
|
31207
31454
|
if (!assumeSucceeded) {
|
|
31208
31455
|
forwardAwsEnv$1(dockerEnv);
|
|
31456
|
+
setContainerRegion(dockerEnv, canonicalizeRegion(args.region ?? process.env["AWS_REGION"] ?? process.env["AWS_DEFAULT_REGION"]));
|
|
31209
31457
|
applyProfileCredentialsOverlay(dockerEnv, args.profileCredentials, false);
|
|
31210
31458
|
if (args.profileCredsFile) {
|
|
31211
31459
|
dockerEnv["AWS_SHARED_CREDENTIALS_FILE"] = args.profileCredsFile.containerPath;
|
|
@@ -31653,6 +31901,12 @@ function sigv4NoCredentialsRefusal(args) {
|
|
|
31653
31901
|
}
|
|
31654
31902
|
async function resolveHostCredentialsForSigV4(options, resolved, loaded, region) {
|
|
31655
31903
|
const logger = getLogger();
|
|
31904
|
+
const emulatorKeys = localAwsEmulatorCredentials();
|
|
31905
|
+
if (emulatorKeys) return {
|
|
31906
|
+
accessKeyId: emulatorKeys.accessKeyId,
|
|
31907
|
+
secretAccessKey: emulatorKeys.secretAccessKey,
|
|
31908
|
+
...emulatorKeys.sessionToken && { sessionToken: emulatorKeys.sessionToken }
|
|
31909
|
+
};
|
|
31656
31910
|
const assumeRoleArn = resolveAssumeRoleArn(options, resolved, loaded);
|
|
31657
31911
|
if (assumeRoleArn) try {
|
|
31658
31912
|
return await assumeAgentCoreExecutionRole(assumeRoleArn, region);
|
|
@@ -31770,12 +32024,9 @@ async function localInvokeAgentCoreCommand(target, options) {
|
|
|
31770
32024
|
try {
|
|
31771
32025
|
if (typeof options.assumeRole === "string") explicitRoleArnOrThrow("--assume-role", options.assumeRole, (message) => new CdkdError(message, "LOCAL_INVOKE_AGENTCORE_ASSUME_ROLE_INVALID"));
|
|
31772
32026
|
if (options.ecrRoleArn !== void 0) assertFlagRoleArn("--ecr-role-arn", options.ecrRoleArn, (message) => new CdkdError(message, "LOCAL_INVOKE_AGENTCORE_ECR_ROLE_ARN_INVALID"));
|
|
31773
|
-
await
|
|
31774
|
-
roleArn: options.roleArn,
|
|
31775
|
-
region: options.region
|
|
31776
|
-
});
|
|
32027
|
+
await activateLocalAwsAndRoleArn(options);
|
|
31777
32028
|
await ensureDockerAvailable();
|
|
31778
|
-
const profileCredentials =
|
|
32029
|
+
const profileCredentials = await profileCredentialsForWorkload(options.profile, resolveProfileCredentials);
|
|
31779
32030
|
if (options.profile && profileCredentials) profileCredsFile = await writeProfileCredentialsFile(options.profile, profileCredentials);
|
|
31780
32031
|
const appCmd = resolveApp(options.app);
|
|
31781
32032
|
if (!appCmd) throw new CdkdError(`No CDK app specified. Pass --app, set ${getEmbedConfig().envPrefix}_APP, or add "app" to cdk.json.`, "LOCAL_INVOKE_AGENTCORE_NO_APP");
|
|
@@ -32014,6 +32265,7 @@ function createLocalInvokeAgentCoreCommand() {
|
|
|
32014
32265
|
...stateOptions
|
|
32015
32266
|
].forEach((opt) => cmd.addOption(opt));
|
|
32016
32267
|
cmd.addOption(deprecatedRegionOption);
|
|
32268
|
+
addAwsEndpointOptions(cmd);
|
|
32017
32269
|
return cmd;
|
|
32018
32270
|
}
|
|
32019
32271
|
|
|
@@ -32092,7 +32344,7 @@ async function applyLambdaCredentialEnv(dockerEnv, args) {
|
|
|
32092
32344
|
dockerEnv["AWS_ACCESS_KEY_ID"] = creds.accessKeyId;
|
|
32093
32345
|
dockerEnv["AWS_SECRET_ACCESS_KEY"] = creds.secretAccessKey;
|
|
32094
32346
|
dockerEnv["AWS_SESSION_TOKEN"] = creds.sessionToken;
|
|
32095
|
-
|
|
32347
|
+
setContainerRegion(dockerEnv, stsRegion);
|
|
32096
32348
|
assumeSucceeded = true;
|
|
32097
32349
|
} catch (err) {
|
|
32098
32350
|
logger.warn(`--assume-role: STS AssumeRole(${displayIdent(args.assumeRoleArn, { maxCodePoints: 613 })}) failed: ${describeLocalAwsFailureForWarn(err, "STS AssumeRole")}. Falling back to the developer's shell credentials.`);
|
|
@@ -32105,6 +32357,8 @@ async function applyLambdaCredentialEnv(dockerEnv, args) {
|
|
|
32105
32357
|
dockerEnv["AWS_SHARED_CREDENTIALS_FILE"] = args.profileCredsFile.containerPath;
|
|
32106
32358
|
dockerEnv["AWS_PROFILE"] = args.profileCredsFile.profileName;
|
|
32107
32359
|
}
|
|
32360
|
+
const containerRegion = firstUsableRegion(args.region, process.env["AWS_REGION"], process.env["AWS_DEFAULT_REGION"], args.stackRegion);
|
|
32361
|
+
setContainerRegion(dockerEnv, containerRegion);
|
|
32108
32362
|
}
|
|
32109
32363
|
}
|
|
32110
32364
|
async function assumeLambdaExecutionRole(roleArn, region) {
|
|
@@ -32520,12 +32774,9 @@ async function localInvokeCommand(target, options) {
|
|
|
32520
32774
|
if (typeof options.assumeRole === "string") explicitRoleArnOrThrow("--assume-role", options.assumeRole);
|
|
32521
32775
|
if (options.layerRoleArn !== void 0) explicitRoleArnOrThrow("--layer-role-arn", options.layerRoleArn);
|
|
32522
32776
|
if (options.ecrRoleArn !== void 0) assertFlagRoleArn("--ecr-role-arn", options.ecrRoleArn);
|
|
32523
|
-
await
|
|
32524
|
-
roleArn: options.roleArn,
|
|
32525
|
-
region: options.region
|
|
32526
|
-
});
|
|
32777
|
+
await activateLocalAwsAndRoleArn(options);
|
|
32527
32778
|
await ensureDockerAvailable();
|
|
32528
|
-
const profileCredentials =
|
|
32779
|
+
const profileCredentials = await profileCredentialsForWorkload(options.profile, resolveProfileCredentials);
|
|
32529
32780
|
if (options.profile && profileCredentials) profileCredsFile = await writeProfileCredentialsFile(options.profile, profileCredentials);
|
|
32530
32781
|
const appCmd = resolveApp(options.app);
|
|
32531
32782
|
if (!appCmd) throw new Error("No CDK app specified. Pass --app, set CDKD_APP, or add \"app\" to cdk.json.");
|
|
@@ -32568,6 +32819,7 @@ async function localInvokeCommand(target, options) {
|
|
|
32568
32819
|
await applyLambdaCredentialEnv(dockerEnv, {
|
|
32569
32820
|
...resolvedAssumeRoleArn && { assumeRoleArn: resolvedAssumeRoleArn },
|
|
32570
32821
|
...options.region !== void 0 && { region: options.region },
|
|
32822
|
+
...lambda.stack.region !== void 0 && { stackRegion: lambda.stack.region },
|
|
32571
32823
|
...profileCredentials && { profileCredentials },
|
|
32572
32824
|
...profileCredsFile && { profileCredsFile }
|
|
32573
32825
|
});
|
|
@@ -32777,7 +33029,15 @@ const CDKD_EMBED_CONFIG = {
|
|
|
32777
33029
|
};
|
|
32778
33030
|
function createLocalCommand() {
|
|
32779
33031
|
setEmbedConfig(CDKD_EMBED_CONFIG);
|
|
33032
|
+
setAwsEndpointOverrideSource(getAwsEndpointOverride);
|
|
32780
33033
|
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
|
+
});
|
|
32781
33041
|
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));
|
|
32782
33042
|
[
|
|
32783
33043
|
...commonOptions,
|
|
@@ -32786,6 +33046,7 @@ function createLocalCommand() {
|
|
|
32786
33046
|
...stateOptions
|
|
32787
33047
|
].forEach((opt) => invoke.addOption(opt));
|
|
32788
33048
|
invoke.addOption(deprecatedRegionOption);
|
|
33049
|
+
addAwsEndpointOptions(invoke);
|
|
32789
33050
|
local.addCommand(invoke);
|
|
32790
33051
|
local.addCommand(createLocalStartApiCommand());
|
|
32791
33052
|
local.addCommand(createLocalRunTaskCommand());
|
|
@@ -32855,4 +33116,4 @@ function collectVerbFlags(program) {
|
|
|
32855
33116
|
}
|
|
32856
33117
|
|
|
32857
33118
|
export { resolveSecretDerivedPrincipals as a, buildProgram, isResolvableSecretPrincipalList as i, runDestroyForStack as n, canonicalizeIpProtocolValue as o, holdsUnprovenSecretPrincipalToken as r, canonicalizeIpv4Cidr as t };
|
|
32858
|
-
//# sourceMappingURL=program-
|
|
33119
|
+
//# sourceMappingURL=program-CWnbFCjg.js.map
|