@cdkd/cli 0.346.0 → 0.347.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-w6GrD1cQ.js → ambient-client-defaults-BV_xDm4m.js} +11 -4
- package/dist/ambient-client-defaults-BV_xDm4m.js.map +1 -0
- package/dist/{asg-provider-Bu7rz365.js → asg-provider-fpr4ZEfp.js} +5 -5
- package/dist/{asg-provider-Bu7rz365.js.map → asg-provider-fpr4ZEfp.js.map} +1 -1
- package/dist/{aws-client-defaults-DP5k4Mfi.js → aws-client-defaults-DAebi99J.js} +13 -5
- package/dist/{aws-client-defaults-DP5k4Mfi.js.map → aws-client-defaults-DAebi99J.js.map} +1 -1
- package/dist/{aws-clients-CUCH-WCd.js → aws-clients-DOkPjjAW.js} +2 -2
- package/dist/{aws-clients-CUCH-WCd.js.map → aws-clients-DOkPjjAW.js.map} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{db-instance-modify-retry-CY94H9jp.js → db-instance-modify-retry-BbBT68Qa.js} +3 -3
- package/dist/{db-instance-modify-retry-CY94H9jp.js.map → db-instance-modify-retry-BbBT68Qa.js.map} +1 -1
- package/dist/{deploy-engine-BocT17az.js → deploy-engine-DMWjQ_C2.js} +153 -43
- package/dist/deploy-engine-DMWjQ_C2.js.map +1 -0
- package/dist/{ecr-uri-Cg53WsUz.js → ecr-uri-C2FWGsrX.js} +3 -3
- package/dist/{ecr-uri-Cg53WsUz.js.map → ecr-uri-C2FWGsrX.js.map} +1 -1
- package/dist/{iam-role-provider-_bvctXgr.js → iam-role-provider-70-NzlFV.js} +5 -5
- package/dist/{iam-role-provider-_bvctXgr.js.map → iam-role-provider-70-NzlFV.js.map} +1 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/{neptune-provider-CceDOA6q.js → neptune-provider-CX4BHKjZ.js} +6 -6
- package/dist/{neptune-provider-CceDOA6q.js.map → neptune-provider-CX4BHKjZ.js.map} +1 -1
- package/dist/{program-DM3nrEl9.js → program-BU5T28eB.js} +771 -375
- package/dist/program-BU5T28eB.js.map +1 -0
- package/dist/{provider-classes-BJRQVOZ0.js → provider-classes-cw32hLq9.js} +12 -12
- package/dist/{provider-classes-BJRQVOZ0.js.map → provider-classes-cw32hLq9.js.map} +1 -1
- package/dist/{rds-provider-B-TkBvu0.js → rds-provider-CxSVX1d7.js} +7 -7
- package/dist/{rds-provider-B-TkBvu0.js.map → rds-provider-CxSVX1d7.js.map} +1 -1
- package/dist/{read-replica-IoZoKlpg.js → read-replica-DtD9IDko.js} +3 -3
- package/dist/{read-replica-IoZoKlpg.js.map → read-replica-DtD9IDko.js.map} +1 -1
- package/dist/{update-removal-BjJh8h9m.js → update-removal-CpGaCv-d.js} +3 -3
- package/dist/{update-removal-BjJh8h9m.js.map → update-removal-CpGaCv-d.js.map} +1 -1
- package/dist/{version-BdxBmlDu.js → version-Bx-Ox9xU.js} +2 -2
- package/dist/{version-BdxBmlDu.js.map → version-Bx-Ox9xU.js.map} +1 -1
- package/package.json +2 -2
- package/dist/ambient-client-defaults-w6GrD1cQ.js.map +0 -1
- package/dist/deploy-engine-BocT17az.js.map +0 -1
- package/dist/program-DM3nrEl9.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as getCdkdVersion } from "./version-
|
|
1
|
+
import { t as getCdkdVersion } from "./version-Bx-Ox9xU.js";
|
|
2
2
|
import { $ as STACK_REF_MAX_CODE_POINTS, F as derivesPatternBName, I as generateResourceName, J as withSkipPrefix, K as isNameGeneration, M as PATTERN_B_NAME_OPTIONS, N as PATTERN_B_NAME_PROPERTIES, P as PATTERN_B_RESOURCE_TYPES, Q as SECRET_REF_MAX_CODE_POINTS, S as coerceCfnBoolean, Y as withStackScope, Z as SAFE_MSG_ALTERED_CHAR, a as safeStringify, at as displaySafe, c as isStdoutReservedForPayload, dt as stringifyJsonPayload, et as UNRENDERABLE, f as runStackBuffered, ft as terminalSafe, h as getLiveRenderer, it as displayIdent, l as releaseStdoutForPayload, lt as plainIdentOr, n as describeAwsFailure, nt as cutMarker, ot as displayStackName, pt as truncateCodePoints, rt as displayAwsMessage, s as getLogger, st as isPasteableIdent, tt as asIsMessage, u as reserveStdoutForPayload, ut as safeMsg, v as explicitNamePropertyFor } from "./aws-failure-text-jomzO3aT.js";
|
|
3
|
-
import { $c as recordedNoEchoValuesOf, $i as isFinalSnapshotError, $l as hasReadableExportSet, $n as updatePartialMessage, $o as isStatefulRecreateTargetSync, $r as DEFAULT_RESOURCE_TIMEOUT_MS, $s as malformedExportNamesWarning, $t as NESTED_PENDING_PARENT_REASON, $u as isMalformedEnvKey, A as PROTECTION_PROPERTY_BY_TYPE, Ad as canonicalizeRegion, Ai as withAttemptedItemsMasked, An as rollbackOrphanIds, Ar as retiredNameGenerationsLeaving, As as refuseMalformedResourceAttributesForOrphan, Au as ensureAssetStorage, Bc as DagBuilder, Bd as hasOwnKey, Bi as secretNamedRecordNeedles, Bl as recordNoEchoAttributeValues, Bn as propertiesChangedReason, Bo as keepsSecretReferenceToken, Br as exportAliasCollisionScrubWarning, Bs as malformedResourcePropertiesWarning, Bt as refactorMarkerRefusalMessage, Bu as buildDockerImage, C as refusePendingMovesOut, Ca as TemplateNoEchoReresolver, Cc as displayLogicalId, Cd as MIGRATE_TMP_PREFIX, Ci as green, Cl as DYNAMIC_REFERENCE_TOKEN_SCAN, Cn as DeploymentEventsStore, Co as isUnboundTemplateParameter, Cr as removeProtectionTypeList, Cs as unpreviewableOrphanRecords, Cu as stringifyValue, D as diffSecurity, Da as withPrintingSecrets, Dc as findHandledUnwrittenCreateOnly, Dd as decodeListingKey, Di as noEchoComparisonForTemplate, Dl as pathCrossesDottedKey, Dn as findRefactorHints, Do as isStalePlaceholderArnAttribute, Dr as nameScopeOf, Ds as malformedLocalResourcesWarning, Du as loadPublishableAssetManifest, E as serviceTokenBlockingReason, Ec as findActionableSdkUnwired, Ed as CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION, Ei as noEchoAttributeNamesOf, El as spelledKeysOf, En as formatDestructiveChange, Eo as cfnRefValueFromPhysicalId, Er as nameGenerationHighWaterOf, Es as malformedLocalResourceEntriesWarning, Eu as createAssetRedirectResolver, Fa as UNSPECIFIED_SKIP_REASON, Fd as processStackMessages, Fi as namingSecretsWithRecordedNoEcho, Fl as splitGetAttStringForm, Fn as differingRemedy, Fo as getAccountInfo, Fr as namesAnyDeclaredParameter, Fs as refuseMalformedResourceEntriesForImportSave, Ft as keptForRetainedRecord, Fu as parseBootstrapMarker, Gc as maskReadbackAtCoordinates, Gd as describeFileReadFailure, Gl as isSingleDynamicReferenceToken, Gn as DELETED_RESOURCE_REMEDY, Go as unsettledItemsOf, Gr as exportNameNoEchoParameters, Gs as repairMalformedResourcePropertiesForReadOnly, Gu as redactedCause, Hc as canonicalCoordinates, Hd as nullPrototypeRecord, Hi as storedSecretNameNeedles, Hl as recordProvenPublicExpression, Hn as referencedLogicalIds, Ho as INTRINSIC_KEYS, Hr as secretBearingStateKeyWarning, Hs as refuseMalformedResourcePropertiesForDrift, Ht as sameMove, Hu as describeDockerCapturedOutput, Ia as deleteIndeterminateGuards, Id as describeJsonParseFailure, Ii as orphanRecordsPrintingBag, Il as carriesSecretMask, In as isPairableType, Io as isImpossibleEmptyStoredAttribute, Ir as reachableDivergentParameters, Is as refuseMalformedResourceEntriesForOrphan, It as recordRetainedForReadoption, Iu as readBootstrapMarkerBody, Ja as isWaitAbandonedError, Jc as noEchoCoordinatesOf, Jd as resolveAssemblyPath, Ji as ATOMIC_FINAL_SNAPSHOT_TYPES, Jl as S3StateBackend, Jn as withUnprovenUnsettled, Jo as withoutUnsettledProperties, Jr as noEchoParameterValueSeed, Js as malformedOrphansRefusalMessage, Ju as dockerSpawnEnvWithSensitive, Kc as maskWholeValue, Kd as displayAssemblyPath, Ki as secretSegmentsOfState, Kl as LockManager, Kn as recordAfterRollbackUpdate, Ko as unsettledPropertiesOf, Kr as exportNameSecretExposure, Ks as UNREADABLE_ORPHANS_CONTAINER_ROW, Kt as formatResourceLine, Ku as redactedDockerCause, La as deleteLeftInPlace, Ld as parseFailureDebugDetail, Li as secretNamePrintingBag, Ll as provenPublicValue, Ln as looselyEqual, Lo as carriesFetchableDynamicReference, Lr as resourcesNamingDeclaredParameter, Ls as repairMalformedResourceEntriesForReadOnly, Lt as readRefactorMarker, Lu as validateAssetBucketName, M as perType, Ma as setResolvedResourceTimeouts, Mc as hasNoCloudControlHandlers, Md as refuseFailedLookups, Mi as completedReplayEntries, Mn as changedReferenceInDiff, Ms as refuseMalformedResourceEntriesForDeploy, Mt as withResourceDeadline, Mu as assertAssetBucketRegion, N as readProtection, Na as slowCcOperationTimeoutMs, Nd as AssemblyReader, Ni as journaledOrphanPrintingBag, Nl as recordPhysicalNameCopy, Nn as changedReferencePath, No as recordedOutputReferenceRegions, Nr as inheritProducerRegions, Ns as refuseMalformedResourceEntriesForDestroy, Nt as IMPLICIT_DELETE_DEPENDENCIES, Nu as isCrossRegionRedirect, O as recordedProtectionEvidence, Od as expectedOwnerParam, Oi as noEchoExactEchoLeavesOf, Ol as identityKeyFor, On as hintSidesOf, Oo as lacksRecordedTableArn, Or as retiredAfterRollback, Os as malformedResourceEntriesWarning, Ou as rewriteTemplateAssetReferences, Pa as RollbackInlinePolicyWriters, Pd as StageLoadError, Pi as maskEventTextWithBoundBags, Pl as recordNestedStackParameterExpressions, Pn as changedReferenceReason, Po as recordedReferenceRegions, Pr as computeParameterTaint, Ps as refuseMalformedResourceEntriesForImport, Pt as computeImplicitDeleteEdges, Pu as getBootstrapMarkerKey, Qa as poisonRenderedSpellingsCollidingIn, Qc as readsNoEchoSource, Qd as resolveBucketRegion, Qi as effectiveDeletionPolicy, Ql as exportNamesCarriedFrom, Qn as undeclaredEmptyObservedKeys, Qo as isStatefulRecreateTargetForReplace, Qr as bindingSkippedOutputs, Qs as repairMalformedOrphansForReadOnly, Qt as resolvePendingCloudControlRequests, Qu as isDockerClientEnvKey, Ra as deleteSkipReason, Rd as utf8ByteLength, Ri as secretNamePrintingBags, Rl as recordMaskOnlyValue, Rn as mappingPairs, Ro as isNamelessDynamicReferenceError, Rr as WITHHELD_NAME_DISPLAY, Rs as unreadableResourceEntries, Rt as readRefactorMarkerOnce, Ru as validateContainerRepoName, S as pendingMovesRefusalMessage, Sa as customResourceResponseExpirationWarning, Sc as UNREADABLE_RESOURCES_MAP_ROW, Sd as CFN_TEMPLATE_URL_LIMIT, Si as gray, Sn as DeploymentEventsReader, So as coerceParameterTypedValue, Sr as segmentCleanupOptions, Ss as repairMalformedOrphanRecordsForReadOnly, Su as isSensitiveAttributeName, T as findServiceTokenRefusals, Ta as isCustomResourceType$1, Tc as hasReadableResources, Td as uploadCfnTemplate, Ti as yellow, Tl as isUncertifiedBaselineMaskPosition, Tn as findDestructiveChanges, To as AWS_NO_VALUE, Tr as nameGenerationCarriedFrom, Ts as isReadableResourceEntry, Tu as buildAssetRedirectMap, Uc as isMarkedCoordinate, Ud as ownValue, Ui as extractDeploymentEventError, Ul as wholeStringLeavesOf, Un as replayFailedOperations, Ur as secretSafeKeyDisplay, Us as refuseMalformedResourcePropertiesForExport, Ut as updateRefactorMarker, Uu as describeDockerExecFailure, Vc as TemplateParser, Vd as hasPlainPrototype, Vi as stateSecretNameNeedles, Vl as recordNoEchoParameterFreshValue, Vn as proposeRenames, Vo as withSharedDrainBudget, Vr as secretBearing, Vs as refuseMalformedResourcePropertiesForDestroy, Vt as refuseRefactorMarker, Vu as resolveDockerContextDirectory, Wc as maskAtCoordinates, Wd as absoluteAssemblyPathEscape, Wl as WHOLE_DYNAMIC_REFERENCE_PATTERN, Wn as replayRollback, Wo as unsettledItemsField, Wr as carriedExportAliasExposure, Ws as refuseMalformedResourcePropertiesForOrphan, Wu as describeDockerFailure, Xa as IntrinsicFunctionResolver, Xc as noEchoOutputsComparison, Xd as injectedAwsRegionValue, Xi as ccRoutedFinalSnapshotError, Xl as acceptedCreateOnlyDropsOf, Xn as equalModuloMarkedMask, Xo as shownType, Xr as collectPublishedOutputNames, Xs as refuseMalformedOrphans, Xu as partitionSensitiveEnv, Ya as DiffCalculator, Yc as noEchoLeavesOf, Yd as injectAwsRegion, Yi as PRE_DELETE_SNAPSHOT_TYPES, Yl as splitImportedOps, Yn as calculateResourceDrift, Yo as findReplacedReadersOfRecreateTargets, Yr as collectDeclaredOutputNames, Ys as malformedOrphansWarning, Yu as finchSecretArgvRefusal, Za as isAlwaysLiveAttribute, Zi as ccRoutedInstanceTakesNoSnapshot, Zl as describeRegionValueKind, Zn as equalModuloMask, Zo as MULTI_REGION_RECREATE_BLOCKED_TYPES, Zr as isExportAliasCollision, Zs as refuseMalformedOrphansForDestroy, Zt as pendingRequestCount, Zu as warnFinchArgvExposure, _ as listNestedTemplateRows, _a as ccBrokenReason, _c as repairMalformedResourcesForReadOnly, _d as resolveUseCdkBootstrapAssets, _l as errorCauseChain, _n as loadJournaledOrphans, _r as findNestedStackTypeChanges, _s as malformedOrphanRowsKeptWarning, _u as isAccessDenied, a as scanActiveConsumers, ac as refuseMalformedOutputs, ad as getDockerImageBySourceHash, ai as withStackRecords, an as recordDisplacedSkips, ao as assertSendableRoleArn, au as shouldRetainResource, b as hasPendingMovesOut, ba as CUSTOM_RESOURCE_RESPONSE_LIFECYCLE_RULE_ID, bc as withheldAccountClause, bd as ssmResolvedValueType, bi as bold, bl as scrubResourceRecord, bn as makeSiblingClaimReader, bs as refuseMalformedOrphanRecordsForDestroy, bu as withStackInstanceIdWithheld, c as inheritedProvenanceForChildDiff, cc as STATE_REGION_DIVERGED, cd as getDefaultStateBucketName, ci as holdsSupersededResources, cl as hasMaskableValues, cn as withNestedRevertRun, co as sendableAssumeRoleCommand, cr as demoteSupersededOrphans, cs as describeTypeWithThrottleRetry, cu as hasUnverifiableParameterRefusal, d as conditionInputsFrom, dc as malformedResourcesWarning, dd as resolveApp, di as supersededHeldByOtherTypeWarning, dl as printingCorpusOf, dn as withNestedStackContext, do as callerEnvCredentials, dr as planFailedOps, du as timePhase, ea as refusesFinalSnapshot, ec as malformedExportSourceWarning, ed as formatDockerLoginError, ei as DEFAULT_RESOURCE_WARN_AFTER_MS, el as valueAtCoordinate, en as displacedOpClause, eo as resolveDynamicReferences, er as updatePartialReason, es as renderStatefulReason, eu as importableOutputKeys, f as parentSuppliedValues, fc as malformedStateRefusalMessage, fd as resolveAutoAssetStorage, fi as supersededHolderOf, fl as recordLogOnlyParameterValue, fn as deleteJournaledOrphans, fo as envCredentialsAreAssumedRole, fr as recheckFailedPlan, fs as declaresNoEcho, fu as rebuildClientForBucketRegion, g as isAbsoluteAssetPath, ga as ProviderRegistry, gc as refuseMalformedState, gd as resolveStateBucketWithDefaultAndSource, gl as createSecretMasker, gn as journaledOrphanLines, go as regionLessSecretName, gr as withPreviousPolicies, gs as malformedOrphanRecordsWarning, gu as crossPrefixDeniedWarning, h as findNestedTemplateTreeDefect, ha as CC_BROKEN_REASON, hc as refuseMalformedResourcesForExport, hd as resolveStateBucketWithDefault, hl as unionOfSecretBags, hn as isHandledOrphan, ho as producerRegionsFromState, hr as resolveReplacementOldType, hs as malformedOrphanRecordsRefusalMessage, hu as applyCrossPrefixScan, i as mergeNoChangeOutputs, id as AssetManifestLoader, in as nestedChildStackName$1, io as assertFlagRoleArn, ir as withCreateTokenLedger, iu as orphansCarriedFrom, j as isProtectionValueActive, jc as NO_CC_HANDLERS_REASON, jd as derivePartitionAndUrlSuffix, ji as createReadOnlyAttributeHealerFactory, jl as physicalNameCopiesOf, jn as withMovedTo, jo as keepHeldTokenProvenance, jr as withNameGenerationReached, js as refuseMalformedResourceEntries, ju as buildDenyExternalAccessPolicy, k as recordedProtectionNote, ka as CloudControlProvider, kc as unwrittenCreateOnlyReplacement, kd as PARTITION_TABLE, ki as noEchoParameterNamesOf, kl as inheritNestedStackParameterAssociations, kn as movedToHint, ko as refStateLookupFromResource, kr as retiredNameGenerationsAfter, ks as malformedScrubResourceEntriesRefusalMessage, ku as AssetModeResolver, l as makeCanonicalizePropertiesFn, lc as refuseDivergentRecordRegionForDestroy, ld as getLegacyStateBucketName, li as isSupersededResourceRecord, ll as literalSplitDelimitersOf, ln as collectNestedChildUnaddressed, lo as AWS_CREDENTIAL_ENV_KEYS, lr as isJournaledOrphan, ls as withRetry, lu as PhaseClock, m as childTemplateLoader, mc as refuseMalformedResourcesForDestroy, md as resolveSkipPrefix, mi as withoutSuperseded, ml as shareLogOnlyValues, mn as dropFailedHint, mo as classifyReplaySecretRegion, mr as replacementNeverSwapped, ms as isReadableOrphanRecord, mu as CrossPrefixScanCache, n as isSecretBearingReferenceString, na as createPreDeleteFinalSnapshot, nc as malformedOutputsRefusalMessage, nd as runDockerForeground, nn as dropSettledNestedJournals, no as refuseUnreadableCdkCrossAccountRefs, nr as ledgerForStack, nu as isReadableBag, o as inRunStackKey, oc as refuseMalformedOutputsForDestroy, od as Synthesizer, ol as carryLogOnlyValues, oo as explicitRoleArnOrThrow, or as planRollback, os as prefetchCreateOnlyPropertyPaths, ou as stackInstanceIdCarriedFrom, p as readRecordedConditionVerdicts, pc as refuseMalformedResourcesForDeploy, pd as resolveCaptureObservedState, pi as supersededResourcesOf, pl as recordLogOnlyValue, pn as dropFailedCommands, po as classifyRecordedSecretRegion, pr as recordUnderIdIsNotOwn, ps as deployRefusesOrphanRowsReason, pu as CrossPrefixReadError, qc as maskedLeafCoordinatesOf, qd as renderAssemblyPathEscape, qi as withSecretPhysicalIdsMaskedInState, ql as isLockInfoExpired, qn as settleUnsettledPrevious, qo as withUnsettledProperties, qr as isWholeDynamicReferenceValue, qs as hasReadableOrphans, qu as redactDockerArgvValues, r as keptWholeReasonText, ra as buildFinalSnapshotIdentifier, rc as malformedOutputsWarning, rd as runDockerStreaming, ri as destroyStackRecordsView, rl as redactForState, ro as applyRoleArnIfSet, ru as orphansAfterRollback, s as crossStackOutputProvenanceSource, sc as repairMalformedOutputsForReadOnly, sd as synthesisStatusMessage, si as deleteSupersededEntry, sl as createUnionSecretMasker, sn as revertedNestedRowIds, so as isIamRoleArn, sr as seedsDeleteFirstGuard, ss as templateResourceTypes, su as hasReasonlessBaselineRefusal, t as DeployEngine, ta as unsupportedFinalSnapshotError, tc as malformedLocalOutputsWarning, td as getDockerCmd, ti as maskingRetryLogger, tl as liveMatchesUnresolvedTokenFrame, tn as displacedPhysicalIdShown, to as producerLookupOver, tu as importableOutputs, u as conditionFingerprint, uc as malformedRenderedContainersWarning, ud as loadCdkJson, ui as supersededAfterRollback, ul as logOnlyValueCount, un as getCurrentNestedStackContext, uo as applyCallerIdentityCredentials, ur as isReplacementOrphan, us as parameterInputsFor, uu as renderPhaseTimings, v as renderNestedTemplateTreeDefect, va as isCustomResource, vc as JSON_LISTING_HOLE_VALUE, vd as stateBucketExistenceConfirmed, vl as maskSecretsInError, vn as sameJournaledOrphans, vs as previewableOrphanRecords, vu as isNotImplemented, w as deferredServiceTokenWarning, wa as readsNoEchoDeleteValues, wc as hasReadableOutputs, wd as findLargeInlineResources, wi as red, wl as dynamicReferenceTokens, wn as constructPathOf$1, wo as parameterTypeMayLoseSecretIdentity, wr as orphanNeedsIdentity, ws as unreadableOrphanRecords, wu as WorkGraph, x as pendingMovesOutOf, xa as applyCustomResourceResponseExpiration, xc as STATE_RESOURCES_MALFORMED, xd as CFN_TEMPLATE_BODY_LIMIT, xi as cyan, xl as withPhysicalNameCopies, xn as planOrphanAdoption, xs as refuseMalformedOrphansForOrphan, xu as AssetPublisher, y as templateIdentity, ya as wouldReturnToSdkProvider, yc as accountArgs, yd as warnDeprecatedNoPrefixCliFlag, yl as maskSecretsInText, yn as makeForeignHolderScan, ys as refuseMalformedOrphanRecords, yu as stackInstanceIdOf, zd as defineOwnKey, zl as recordMaskOnlyValuesIn, zn as parseMappingFile, zo as carriesDynamicReference, zr as displayTextOrWithheld, zs as malformedDriftResourcePropertiesWarning, zt as refactorMarkerMovesOf, zu as BOOTSTRAP_MARKER_PREFIX } from "./deploy-engine-BocT17az.js";
|
|
4
|
-
import {
|
|
5
|
-
import { $t as forceQuitRecoveryClause, Dt as logicalIdShown, H as assertRegionMatch, M as VALUE_NOT_SHOWN, Qt as buildLockContentionMessage, U as isMarkedNotGone, V as RESOURCE_NOT_FOUND, Xt as UNREPRODUCIBLE_LOCK_CLAUSE, Zt as buildForceUnlockCommand, an as CUSTOM_RESOURCE_RESPONSE_PREFIX, bt as interruptWatchListenerCount, dn as setPasteableAwsCaBundle, en as formatLockExpiry, fn as setPasteableAwsProfile, kt as resourceTypeShown, ln as producerCoordinateKey, m as RESOLVED_PREVIOUS_PRINCIPAL_KEYS, mt as isAwsCliLiteral, nn as formatLockOwner, on as DEFAULT_STATE_PREFIX, p as IAM_PRINCIPAL_NAME, pn as withPasteableAwsProfile, sn as injectiveKey, st as runDeleteAttempt, tn as formatLockOperation, un as producerRecordKey, vt as beginCommandInterruptScope, xt as isInterruptedWaitError, y as readRecordedPrincipals, yt as endCommandInterruptScope, z as remedyLogicalId } from "./update-removal-
|
|
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 getAssumedRoleCredentials, c as setAwsEndpointOverrideSource, m as
|
|
8
|
-
import { a as parseEcrRegistryHost, i as looksLikeEcrHostWithForeignSuffix, n as hasEcrRegistryHostLabels, t as ecrRegistryHostPattern } from "./ecr-uri-
|
|
3
|
+
import { $a as poisonRenderedSpellingsCollidingIn, $d as injectedAwsRegionValue, $i as isFinalSnapshotError, $l as describeRegionValueKind, $n as updatePartialMessage, $o as MULTI_REGION_RECREATE_BLOCKED_TYPES, $r as DEFAULT_RESOURCE_TIMEOUT_MS, $s as refuseMalformedOrphansForDestroy, $t as NESTED_PENDING_PARENT_REASON, $u as warnFinchArgvExposure, A as PROTECTION_PROPERTY_BY_TYPE, Ad as expectedOwnerParam, Ai as withAttemptedItemsMasked, Al as identityKeyFor, An as rollbackOrphanIds, Ao as lacksRecordedTableArn, Ar as retiredNameGenerationsLeaving, As as malformedResourceEntriesWarning, Au as rewriteTemplateAssetReferences, Bd as utf8ByteLength, Bi as secretNamedRecordNeedles, Bl as recordMaskOnlyValue, Bn as propertiesChangedReason, Bo as isNamelessDynamicReferenceError, Br as exportAliasCollisionScrubWarning, Bs as unreadableResourceEntries, Bt as refactorMarkerRefusalMessage, Bu as validateContainerRepoName, C as refusePendingMovesOut, Ca as TemplateNoEchoReresolver, Cc as STATE_RESOURCES_MALFORMED, Cd as CFN_TEMPLATE_BODY_LIMIT, Ci as green, Cl as withPhysicalNameCopies, Cn as DeploymentEventsStore, Cr as removeProtectionTypeList, Cs as refuseMalformedOrphansForOrphan, Cu as AssetPublisher, D as diffSecurity, Da as withPrintingSecrets, Dc as hasReadableResources, Dd as uploadCfnTemplate, Di as noEchoComparisonForTemplate, Dl as isUncertifiedBaselineMaskPosition, Dn as findRefactorHints, Do as AWS_NO_VALUE, Dr as nameScopeOf, Ds as isReadableResourceEntry, Du as buildAssetRedirectMap, E as serviceTokenBlockingReason, Ec as hasReadableOutputs, Ed as findLargeInlineResources, Ei as noEchoAttributeNamesOf, El as dynamicReferenceTokens, En as formatDestructiveChange, Eo as parameterTypeMayLoseSecretIdentity, Er as nameGenerationHighWaterOf, Es as unreadableOrphanRecords, Eu as WorkGraph, Fa as UNSPECIFIED_SKIP_REASON, Fd as AssemblyReader, Fi as namingSecretsWithRecordedNoEcho, Fl as recordPhysicalNameCopy, Fn as differingRemedy, Fo as recordedOutputReferenceRegions, Fr as namesAnyDeclaredParameter, Fs as refuseMalformedResourceEntriesForDestroy, Ft as keptForRetainedRecord, Fu as isCrossRegionRedirect, Gc as isMarkedCoordinate, Gd as ownValue, Gl as wholeStringLeavesOf, Gn as DELETED_RESOURCE_REMEDY, Gr as exportNameNoEchoParameters, Gs as refuseMalformedResourcePropertiesForExport, Gu as describeDockerExecFailure, Hc as DagBuilder, Hd as hasOwnKey, Hi as storedSecretNameNeedles, Hl as recordNoEchoAttributeValues, Hn as referencedLogicalIds, Ho as keepsSecretReferenceToken, Hr as secretBearingStateKeyWarning, Hs as malformedResourcePropertiesWarning, Ht as sameMove, Hu as buildDockerImage, Ia as deleteIndeterminateGuards, Id as StageLoadError, Ii as orphanRecordsPrintingBag, Il as recordNestedStackParameterExpressions, In as isPairableType, Io as recordedReferenceRegions, Ir as reachableDivergentParameters, Is as refuseMalformedResourceEntriesForImport, It as recordRetainedForReadoption, Iu as getBootstrapMarkerKey, Ja as isWaitAbandonedError, Jc as maskWholeValue, Jd as displayAssemblyPath, Ji as ATOMIC_FINAL_SNAPSHOT_TYPES, Jl as LockManager, Jn as withUnprovenUnsettled, Jo as unsettledPropertiesOf, Jr as noEchoParameterValueSeed, Js as UNREADABLE_ORPHANS_CONTAINER_ROW, Ju as redactedDockerCause, Kc as maskAtCoordinates, Kd as absoluteAssemblyPathEscape, Ki as secretSegmentsOfState, Kl as WHOLE_DYNAMIC_REFERENCE_PATTERN, Kn as recordAfterRollbackUpdate, Ko as unsettledItemsField, Kr as exportNameSecretExposure, Ks as refuseMalformedResourcePropertiesForOrphan, Kt as formatResourceLine, Ku as describeDockerFailure, La as deleteLeftInPlace, Ld as processStackMessages, Li as secretNamePrintingBag, Ll as splitGetAttStringForm, Ln as looselyEqual, Lo as getAccountInfo, Lr as resourcesNamingDeclaredParameter, Ls as refuseMalformedResourceEntriesForImportSave, Lt as readRefactorMarker, Lu as parseBootstrapMarker, M as perType, Ma as setResolvedResourceTimeouts, Md as canonicalizeRegion, Mi as completedReplayEntries, Mn as changedReferenceInDiff, Ms as refuseMalformedResourceAttributesForOrphan, Mt as withResourceDeadline, Mu as ensureAssetStorage, N as readProtection, Na as slowCcOperationTimeoutMs, Nc as NO_CC_HANDLERS_REASON, Nd as derivePartitionAndUrlSuffix, Ni as journaledOrphanPrintingBag, Nl as physicalNameCopiesOf, Nn as changedReferencePath, No as keepHeldTokenProvenance, Nr as inheritProducerRegions, Ns as refuseMalformedResourceEntries, Nt as IMPLICIT_DELETE_DEPENDENCIES, Nu as buildDenyExternalAccessPolicy, O as recordedProtectionEvidence, Oc as findActionableSdkUnwired, Od as CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION, Oi as noEchoExactEchoLeavesOf, Ol as spelledKeysOf, On as hintSidesOf, Oo as cfnRefValueFromPhysicalId, Or as retiredAfterRollback, Os as malformedLocalResourceEntriesWarning, Ou as createAssetRedirectResolver, Pa as RollbackInlinePolicyWriters, Pc as hasNoCloudControlHandlers, Pd as refuseFailedLookups, Pi as maskEventTextWithBoundBags, Pn as changedReferenceReason, Pr as computeParameterTaint, Ps as refuseMalformedResourceEntriesForDeploy, Pt as computeImplicitDeleteEdges, Pu as assertAssetBucketRegion, Qa as isAlwaysLiveAttribute, Qc as noEchoOutputsComparison, Qd as injectAwsRegion, Qi as effectiveDeletionPolicy, Ql as acceptedCreateOnlyDropsOf, Qn as undeclaredEmptyObservedKeys, Qo as shownType, Qr as bindingSkippedOutputs, Qs as refuseMalformedOrphans, Qt as resolvePendingCloudControlRequests, Qu as partitionSensitiveEnv, Ra as deleteSkipReason, Rd as describeJsonParseFailure, Ri as secretNamePrintingBags, Rl as carriesSecretMask, Rn as mappingPairs, Ro as isImpossibleEmptyStoredAttribute, Rr as WITHHELD_NAME_DISPLAY, Rs as refuseMalformedResourceEntriesForOrphan, Rt as readRefactorMarkerOnce, Ru as readBootstrapMarkerBody, S as pendingMovesRefusalMessage, Sa as customResourceResponseExpirationWarning, Sc as withheldAccountClause, Sd as ssmResolvedValueType, Si as gray, Sl as scrubResourceRecord, Sn as DeploymentEventsReader, Sr as segmentCleanupOptions, Ss as refuseMalformedOrphanRecordsForDestroy, Su as withStackInstanceIdWithheld, T as findServiceTokenRefusals, Ta as isCustomResourceType$1, Tc as displayLogicalId, Td as MIGRATE_TMP_PREFIX, Ti as yellow, Tl as DYNAMIC_REFERENCE_TOKEN_SCAN, Tn as findDestructiveChanges, To as isUnboundTemplateParameter, Tr as nameGenerationCarriedFrom, Ts as unpreviewableOrphanRecords, Tu as stringifyValue, Uc as TemplateParser, Ud as hasPlainPrototype, Ui as extractDeploymentEventError, Ul as recordNoEchoParameterFreshValue, Un as replayFailedOperations, Uo as withSharedDrainBudget, Ur as secretSafeKeyDisplay, Us as refuseMalformedResourcePropertiesForDestroy, Ut as updateRefactorMarker, Uu as resolveDockerContextDirectory, Vd as defineOwnKey, Vi as stateSecretNameNeedles, Vl as recordMaskOnlyValuesIn, Vn as proposeRenames, Vo as carriesDynamicReference, Vr as secretBearing, Vs as malformedDriftResourcePropertiesWarning, Vt as refuseRefactorMarker, Vu as BOOTSTRAP_MARKER_PREFIX, Wc as canonicalCoordinates, Wd as nullPrototypeRecord, Wl as recordProvenPublicExpression, Wn as replayRollback, Wo as INTRINSIC_KEYS, Wr as carriedExportAliasExposure, Ws as refuseMalformedResourcePropertiesForDrift, Wu as describeDockerCapturedOutput, Xa as IntrinsicFunctionResolver, Xc as noEchoCoordinatesOf, Xd as resolveAssemblyPath, Xi as ccRoutedFinalSnapshotError, Xl as S3StateBackend, Xn as equalModuloMarkedMask, Xo as withoutUnsettledProperties, Xr as collectPublishedOutputNames, Xs as malformedOrphansRefusalMessage, Xu as dockerSpawnEnvWithSensitive, Ya as DiffCalculator, Yc as maskedLeafCoordinatesOf, Yd as renderAssemblyPathEscape, Yi as PRE_DELETE_SNAPSHOT_TYPES, Yl as isLockInfoExpired, Yn as calculateResourceDrift, Yo as withUnsettledProperties, Yr as collectDeclaredOutputNames, Ys as hasReadableOrphans, Yu as redactDockerArgvValues, Za as isSelectOutOfBounds, Zc as noEchoLeavesOf, Zd as setChildProcessAwsEnv, Zi as ccRoutedInstanceTakesNoSnapshot, Zl as splitImportedOps, Zn as equalModuloMask, Zo as findReplacedReadersOfRecreateTargets, Zr as isExportAliasCollision, Zs as malformedOrphansWarning, Zt as pendingRequestCount, Zu as finchSecretArgvRefusal, _ as listNestedTemplateRows, _a as ccBrokenReason, _c as refuseMalformedResourcesForExport, _d as resolveStateBucketWithDefault, _l as unionOfSecretBags, _n as loadJournaledOrphans, _o as producerRegionsFromState, _r as findNestedStackTypeChanges, _s as malformedOrphanRecordsRefusalMessage, _u as applyCrossPrefixScan, a as scanActiveConsumers, ac as malformedOutputsWarning, ad as runDockerStreaming, ai as withStackRecords, al as redactForState, an as recordDisplacedSkips, ao as applyRoleArnIfSet, au as orphansAfterRollback, b as hasPendingMovesOut, ba as CUSTOM_RESOURCE_RESPONSE_LIFECYCLE_RULE_ID, bc as JSON_LISTING_HOLE_VALUE, bd as stateBucketExistenceConfirmed, bi as bold, bl as maskSecretsInError, bn as makeSiblingClaimReader, bs as previewableOrphanRecords, bu as isNotImplemented, c as inheritedProvenanceForChildDiff, cc as refuseMalformedOutputsForDestroy, cd as Synthesizer, ci as holdsSupersededResources, cl as carryLogOnlyValues, cn as withNestedRevertRun, co as explicitRoleArnOrThrow, cr as demoteSupersededOrphans, cs as prefetchCreateOnlyPropertyPaths, cu as stackInstanceIdCarriedFrom, d as conditionInputsFrom, dc as refuseDivergentRecordRegionForDestroy, dd as getLegacyStateBucketName, di as supersededHeldByOtherTypeWarning, dl as literalSplitDelimitersOf, dn as withNestedStackContext, do as AWS_CREDENTIAL_ENV_KEYS, dr as planFailedOps, ds as withRetry, du as PhaseClock, ea as refusesFinalSnapshot, ec as repairMalformedOrphansForReadOnly, ed as isDockerClientEnvKey, ei as DEFAULT_RESOURCE_WARN_AFTER_MS, el as readsNoEchoSource, en as displacedOpClause, eo as stackIdTailOf, er as updatePartialReason, es as isStatefulRecreateTargetForReplace, eu as exportNamesCarriedFrom, f as parentSuppliedValues, fc as malformedRenderedContainersWarning, fd as loadCdkJson, fi as supersededHolderOf, fl as logOnlyValueCount, fn as deleteJournaledOrphans, fo as applyCallerIdentityCredentials, fr as recheckFailedPlan, fs as parameterInputsFor, fu as renderPhaseTimings, g as isAbsoluteAssetPath, ga as ProviderRegistry, gc as refuseMalformedResourcesForDestroy, gd as resolveSkipPrefix, gl as shareLogOnlyValues, gn as journaledOrphanLines, go as classifyReplaySecretRegion, gr as withPreviousPolicies, gs as isReadableOrphanRecord, gu as CrossPrefixScanCache, h as findNestedTemplateTreeDefect, ha as CC_BROKEN_REASON, hc as refuseMalformedResourcesForDeploy, hd as resolveCaptureObservedState, hl as recordLogOnlyValue, hn as isHandledOrphan, ho as classifyRecordedSecretRegion, hr as resolveReplacementOldType, hs as deployRefusesOrphanRowsReason, hu as CrossPrefixReadError, i as mergeNoChangeOutputs, ic as malformedOutputsRefusalMessage, id as runDockerForeground, in as nestedChildStackName$1, io as refuseUnreadableCdkCrossAccountRefs, ir as withCreateTokenLedger, iu as isReadableBag, j as isProtectionValueActive, jc as unwrittenCreateOnlyReplacement, jd as PARTITION_TABLE, ji as createReadOnlyAttributeHealerFactory, jl as inheritNestedStackParameterAssociations, jn as withMovedTo, jo as refStateLookupFromResource, jr as withNameGenerationReached, js as malformedScrubResourceEntriesRefusalMessage, ju as AssetModeResolver, k as recordedProtectionNote, ka as CloudControlProvider, kc as findHandledUnwrittenCreateOnly, kd as decodeListingKey, ki as noEchoParameterNamesOf, kl as pathCrossesDottedKey, kn as movedToHint, ko as isStalePlaceholderArnAttribute, kr as retiredNameGenerationsAfter, ks as malformedLocalResourcesWarning, ku as loadPublishableAssetManifest, l as makeCanonicalizePropertiesFn, lc as repairMalformedOutputsForReadOnly, ld as synthesisStatusMessage, li as isSupersededResourceRecord, ll as createUnionSecretMasker, ln as collectNestedChildUnaddressed, lo as isIamRoleArn, lr as isJournaledOrphan, ls as templateResourceTypes, lu as hasReasonlessBaselineRefusal, m as childTemplateLoader, mc as malformedStateRefusalMessage, md as resolveAutoAssetStorage, mi as withoutSuperseded, ml as recordLogOnlyParameterValue, mn as dropFailedHint, mo as envCredentialsAreAssumedRole, mr as replacementNeverSwapped, ms as declaresNoEcho, mu as rebuildClientForBucketRegion, n as isSecretBearingReferenceString, na as createPreDeleteFinalSnapshot, nc as malformedExportSourceWarning, nd as formatDockerLoginError, nl as valueAtCoordinate, nn as dropSettledNestedJournals, no as resolveDynamicReferences, nr as ledgerForStack, ns as renderStatefulReason, nu as importableOutputKeys, o as inRunStackKey, od as AssetManifestLoader, oo as assertFlagRoleArn, or as planRollback, ou as orphansCarriedFrom, p as readRecordedConditionVerdicts, pc as malformedResourcesWarning, pd as resolveApp, pi as supersededResourcesOf, pl as printingCorpusOf, pn as dropFailedCommands, po as callerEnvCredentials, pr as recordUnderIdIsNotOwn, pu as timePhase, qc as maskReadbackAtCoordinates, qd as describeFileReadFailure, qi as withSecretPhysicalIdsMaskedInState, ql as isSingleDynamicReferenceToken, qn as settleUnsettledPrevious, qo as unsettledItemsOf, qr as isWholeDynamicReferenceValue, qs as repairMalformedResourcePropertiesForReadOnly, qu as redactedCause, r as keptWholeReasonText, ra as buildFinalSnapshotIdentifier, rc as malformedLocalOutputsWarning, rd as getDockerCmd, ri as destroyStackRecordsView, rl as liveMatchesUnresolvedTokenFrame, ro as producerLookupOver, ru as importableOutputs, s as crossStackOutputProvenanceSource, sc as refuseMalformedOutputs, sd as getDockerImageBySourceHash, si as deleteSupersededEntry, sn as revertedNestedRowIds, so as assertSendableRoleArn, sr as seedsDeleteFirstGuard, su as shouldRetainResource, t as DeployEngine, ta as unsupportedFinalSnapshotError, tc as malformedExportNamesWarning, td as isMalformedEnvKey, tf as resolveBucketRegion, ti as maskingRetryLogger, tl as recordedNoEchoValuesOf, tn as displacedPhysicalIdShown, ts as isStatefulRecreateTargetSync, tu as hasReadableExportSet, u as conditionFingerprint, uc as STATE_REGION_DIVERGED, ud as getDefaultStateBucketName, ui as supersededAfterRollback, ul as hasMaskableValues, un as getCurrentNestedStackContext, uo as sendableAssumeRoleCommand, ur as isReplacementOrphan, us as describeTypeWithThrottleRetry, uu as hasUnverifiableParameterRefusal, v as renderNestedTemplateTreeDefect, va as isCustomResource, vc as refuseMalformedState, vd as resolveStateBucketWithDefaultAndSource, vl as createSecretMasker, vn as sameJournaledOrphans, vo as regionLessSecretName, vs as malformedOrphanRecordsWarning, vu as crossPrefixDeniedWarning, w as deferredServiceTokenWarning, wa as readsNoEchoDeleteValues, wc as UNREADABLE_RESOURCES_MAP_ROW, wd as CFN_TEMPLATE_URL_LIMIT, wi as red, wn as constructPathOf$1, wo as coerceParameterTypedValue, wr as orphanNeedsIdentity, ws as repairMalformedOrphanRecordsForReadOnly, wu as isSensitiveAttributeName, x as pendingMovesOutOf, xa as applyCustomResourceResponseExpiration, xc as accountArgs, xd as warnDeprecatedNoPrefixCliFlag, xi as cyan, xl as maskSecretsInText, xn as planOrphanAdoption, xs as refuseMalformedOrphanRecords, xu as stackInstanceIdOf, y as templateIdentity, ya as wouldReturnToSdkProvider, yc as repairMalformedResourcesForReadOnly, yd as resolveUseCdkBootstrapAssets, yl as errorCauseChain, yn as makeForeignHolderScan, ys as malformedOrphanRowsKeptWarning, yu as isAccessDenied, zd as parseFailureDebugDetail, zl as provenPublicValue, zn as parseMappingFile, zo as carriesFetchableDynamicReference, zr as displayTextOrWithheld, zs as repairMalformedResourceEntriesForReadOnly, zt as refactorMarkerMovesOf, zu as validateAssetBucketName } from "./deploy-engine-DMWjQ_C2.js";
|
|
4
|
+
import { A as stripControlChars, B as retryClassificationText, Ct as withheldTargetClause, F as isAmbiguousOutcomeError, H as isMarkedNonRetryable, J as DynamicReferenceRegionAmbiguousError, Q as AccountIdUnavailableError, R as isRetryableTransientError, St as shellQuote, Tt as setPasteableVerbFlags, U as isThrottlingError, W as markNonRetryable, X as MalformedProducerRecordRefusalError, Y as IntrinsicResolutionRefusalError, _ as ResourceUpdateNotSupportedError, _t as pasteableCommand, a as normalizeAwsError, at as ProvisioningError, bt as quotedOrDescribed, ct as SynthesisError, et as CdkdError, ft as SHELL_ACTIVE_WHY, g as PartialFailureError, gt as isInertUnquoted, h as NestedStackChildDirectDestroyError, i as credentialFingerprint, j as stripForDisplay, k as escapeRegExp, l as withErrorHandling, mt as commandHole, n as ambientCredentialConfig, o as formatError, ot as ResourceTimeoutError, q as CrossAccountSecretRefusalError, r as clientDefaultsFor, rt as LocalInvokeBuildError$1, s as handleError, st as StateError, t as ambientClientDefaults, tt as DeployCancelledError, u as LocalStartServiceError, ut as TIMEOUT_FLAG_RESOURCE_TYPE, v as StackHasActiveImportsError, wt as setPasteableRunFlags, xt as shellBoundedDisplay, y as StackTerminationProtectionError, yt as plainOrDescribed, z as isTransientServerError } from "./ambient-client-defaults-BV_xDm4m.js";
|
|
5
|
+
import { $t as forceQuitRecoveryClause, Dt as logicalIdShown, H as assertRegionMatch, M as VALUE_NOT_SHOWN, Qt as buildLockContentionMessage, U as isMarkedNotGone, V as RESOURCE_NOT_FOUND, Xt as UNREPRODUCIBLE_LOCK_CLAUSE, Zt as buildForceUnlockCommand, an as CUSTOM_RESOURCE_RESPONSE_PREFIX, bt as interruptWatchListenerCount, dn as setPasteableAwsCaBundle, en as formatLockExpiry, fn as setPasteableAwsProfile, kt as resourceTypeShown, ln as producerCoordinateKey, m as RESOLVED_PREVIOUS_PRINCIPAL_KEYS, mt as isAwsCliLiteral, nn as formatLockOwner, on as DEFAULT_STATE_PREFIX, p as IAM_PRINCIPAL_NAME, pn as withPasteableAwsProfile, sn as injectiveKey, st as runDeleteAttempt, tn as formatLockOperation, un as producerRecordKey, vt as beginCommandInterruptScope, xt as isInterruptedWaitError, y as readRecordedPrincipals, yt as endCommandInterruptScope, z as remedyLogicalId } from "./update-removal-CpGaCv-d.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-DOkPjjAW.js";
|
|
7
|
+
import { a as getAssumedRoleCredentials, c as setAssumedRoleCredentials, h as formatAuthority, l as setAwsEndpointOverrideSource, m as runInStackAwsScope, n as awsClientDefaults, o as getPreAssumeEnvCredentials, s as runWithRealAws } from "./aws-client-defaults-DAebi99J.js";
|
|
8
|
+
import { a as parseEcrRegistryHost, i as looksLikeEcrHostWithForeignSuffix, n as hasEcrRegistryHostLabels, t as ecrRegistryHostPattern } from "./ecr-uri-C2FWGsrX.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";
|
|
@@ -26,7 +26,7 @@ import { BatchDeleteImageCommand, DeleteRepositoryCommand, DescribeImagesCommand
|
|
|
26
26
|
import { isDeepStrictEqual, promisify } from "node:util";
|
|
27
27
|
import graphlib from "graphlib";
|
|
28
28
|
import { Command, InvalidArgumentError, Option } from "commander";
|
|
29
|
-
import { A2A_CONTAINER_PORT, A2A_PATH, AGENTCORE_A2A_PROTOCOL, AGENTCORE_AGUI_PROTOCOL, AGENTCORE_MCP_PROTOCOL, ConnectionRegistry, DEFAULT_AWS_EMULATOR_URL, DynamicReferenceResolver, EMULATOR_SCRUBBED_ENV_KEYS, EcsTaskResolutionError, HOST_GATEWAY_MIN_VERSION, LocalInvokeBuildError, MCP_CONTAINER_PORT, MCP_PATH, a2aInvokeOnce, activateWorkloadAwsWiring, addAlbSpecificOptions, addAwsEndpointOptions, addCommonEcsServiceOptions, addImageOverrideOptions, addStartServiceSpecificOptions, albStrategy, applyWorkloadAwsWiringToEnv, architectureToPlatform, attachAuthorizers, attachLoopbackForwarder, attachStageContext, availableApiIdentifiers, awaitLoopbackForwarderStatus, awsEmulatorEnvName, bufferToBody, buildAgentCoreCodeImage, buildCognitoJwksUrl, buildConnectEvent, buildContainerImage, buildCorsConfigByApiId, buildCorsConfigFromCloudFrontChain, buildDisconnectEvent, buildJwksUrlFromIssuer, buildMessageEvent, buildMgmtEndpointEnvUrl, buildNamespaceOwnerForwarderDockerArgs, buildStageMap, canonicalizeImageOverrideKeys, classifySourceChange, containsDynamicReference, createAuthorizerCache, createFileWatcher, createFileWatcher as createFileWatcher$1, createJwksCache, createWatchPredicates, defaultCredentialsLoader, derivePseudoParametersFromRegion, describeAwsFailureForWarn, describeForwarderFailure, discoverRoutes, discoverWebSocketApis, downloadAndExtractS3Bundle, effectiveLoopbackPorts, enforceImageOverrideOrphans, ensureForwarderImage, filterRoutesByApiIdentifier, firstUsableRegion, getActiveWorkloadAwsWiring, getActiveWorkloadAwsWiring as getActiveWorkloadAwsWiring$1, getAwsEndpointOverride, groupRoutesByServer, handleConnectionsRequest, invokeAgentCore, invokeAgentCoreWs, keysNotFromTemplate, keysOverriddenBy, materializeLayerFromArn, mcpInvokeOnce, parseAwsEndpoint, parseConnectionsPath, parseImageOverrideFlags, parseSelectionExpressionPath, pickAgentCoreCandidateStack, pickAgentCoreCandidateStack as pickAgentCoreCandidateStack$1, probeHostGatewaySupport, readEmulatorRunFiles, readMtlsMaterialsFromDisk, recordAssumedRole, resolveAgentCoreTarget, resolveAwsEmulatorOption, resolveDynamicReferencesInEnv, resolveEnvVars, resolveHostDefaultCredentials, resolveHostGatewayExtraHosts, resolveImageOverrides, resolveRuntimeCodeMountPath, resolveRuntimeFileExtension, resolveRuntimeImage, resolveSingleTarget, resolveWatchConfig, resolveWorkloadAwsWiring, runEcsServiceEmulator, runImageOverrideBuilds, setActiveWorkloadAwsWiring, setAwsEndpointOverride, signAgentCoreInvocation, startApiServer, substituteImagePlaceholders, tryResolveImageFnJoin, verifyJwtViaDiscovery, waitForAgentCorePing, withoutKeys } from "cdk-local/internal";
|
|
29
|
+
import { A2A_CONTAINER_PORT, A2A_PATH, AGENTCORE_A2A_PROTOCOL, AGENTCORE_AGUI_PROTOCOL, AGENTCORE_MCP_PROTOCOL, ConnectionRegistry, DEFAULT_AWS_EMULATOR_URL, DynamicReferenceResolver, EMULATOR_SCRUBBED_ENV_KEYS, EcsTaskResolutionError, HOST_GATEWAY_MIN_VERSION, LocalInvokeBuildError, MCP_CONTAINER_PORT, MCP_PATH, UNNAMED_WORKLOAD, a2aInvokeOnce, activateWorkloadAwsWiring, addAlbSpecificOptions, addAwsEndpointOptions, addCommonEcsServiceOptions, addImageOverrideOptions, addStartServiceSpecificOptions, albStrategy, applyWorkloadAwsWiringToEnv, architectureToPlatform, attachAuthorizers, attachLoopbackForwarder, attachStageContext, availableApiIdentifiers, awaitLoopbackForwarderStatus, awsEmulatorEnvName, awsEmulatorRealServices, bufferToBody, buildAgentCoreCodeImage, buildCognitoJwksUrl, buildConnectEvent, buildContainerImage, buildCorsConfigByApiId, buildCorsConfigFromCloudFrontChain, buildDisconnectEvent, buildJwksUrlFromIssuer, buildMessageEvent, buildMgmtEndpointEnvUrl, buildNamespaceOwnerForwarderDockerArgs, buildStageMap, canonicalizeImageOverrideKeys, classifySourceChange, containsDynamicReference, createAuthorizerCache, createFileWatcher, createFileWatcher as createFileWatcher$1, createJwksCache, createMixedModeStateProvider, createWatchPredicates, defaultCredentialsLoader, derivePseudoParametersFromRegion, describeAwsFailureForWarn, describeForwarderFailure, discoverRoutes, discoverWebSocketApis, downloadAndExtractS3Bundle, effectiveLoopbackPorts, enforceImageOverrideOrphans, ensureForwarderImage, filterRoutesByApiIdentifier, firstUsableRegion, getActiveWorkloadAwsWiring, getActiveWorkloadAwsWiring as getActiveWorkloadAwsWiring$1, getAwsEndpointOverride, groupRoutesByServer, groupWorkloadsRoutedApart, handleConnectionsRequest, invokeAgentCore, invokeAgentCoreWs, isAwsServiceRoutedToEmulator, isRealAwsSentinel, keysNotFromTemplate, keysOverriddenBy, loopbackForwarderPlan, materializeLayerFromArn, mcpInvokeOnce, parseAwsEndpoint, parseConnectionsPath, parseImageOverrideFlags, parseSelectionExpressionPath, pickAgentCoreCandidateStack, pickAgentCoreCandidateStack as pickAgentCoreCandidateStack$1, probeHostGatewaySupport, readAwsEmulatorEnvVarsFile, readEmulatorRunFiles, readEnvVarsFileText, readMtlsMaterialsFromDisk, realAwsServicesOf, recordAssumedRole, resolveAgentCoreTarget, resolveAwsEmulatorOption, resolveDynamicReferencesInEnv, resolveEnvVars, resolveHostDefaultCredentials, resolveHostGatewayExtraHosts, resolveImageOverrides, resolveRuntimeCodeMountPath, resolveRuntimeFileExtension, resolveRuntimeImage, resolveSingleTarget, resolveWatchConfig, resolveWorkloadAwsWiring, runEcsServiceEmulator, runImageOverrideBuilds, setActiveWorkloadAwsWiring, setAwsEndpointOverride, signAgentCoreInvocation, startApiServer, substituteImagePlaceholders, takeAwsEmulatorStateSourceHint, tryResolveImageFnJoin, verifyJwtViaDiscovery, waitForAgentCorePing, withoutKeys } from "cdk-local/internal";
|
|
30
30
|
import { mkdtemp, rm, writeFile } from "node:fs/promises";
|
|
31
31
|
import * as readline$1 from "node:readline/promises";
|
|
32
32
|
import readline from "node:readline/promises";
|
|
@@ -335,7 +335,8 @@ const skipFinalSnapshotOption = new Option("--skip-final-snapshot", "Delete reso
|
|
|
335
335
|
|
|
336
336
|
// src/local/local-role-arn.ts
|
|
337
337
|
async function applyRoleArnForLocal(opts) {
|
|
338
|
-
await applyRoleArnIfSet(opts);
|
|
338
|
+
if (getActiveWorkloadAwsWiring()?.mixed) await runWithRealAws(() => applyRoleArnIfSet(opts));
|
|
339
|
+
else await applyRoleArnIfSet(opts);
|
|
339
340
|
const role = getAssumedRoleCredentials();
|
|
340
341
|
if (role === void 0) return;
|
|
341
342
|
recordAssumedRole(getPreAssumeEnvCredentials(), {
|
|
@@ -399,10 +400,12 @@ async function activateLocalAwsWiring(options) {
|
|
|
399
400
|
awsEmulator: options.awsEmulator,
|
|
400
401
|
caBundle: options.caBundle,
|
|
401
402
|
profile: options.profile,
|
|
402
|
-
pull: options.pull
|
|
403
|
+
pull: options.pull,
|
|
404
|
+
envVars: options.envVars
|
|
403
405
|
});
|
|
404
406
|
} catch (err) {
|
|
405
|
-
|
|
407
|
+
const cause = err instanceof Error && err.cause instanceof Error ? err.cause : void 0;
|
|
408
|
+
throw new CdkdError(err instanceof Error ? err.message : String(err), "LOCAL_AWS_WIRING_FAILED", cause);
|
|
406
409
|
}
|
|
407
410
|
}
|
|
408
411
|
async function activateLocalAwsAndRoleArn(options) {
|
|
@@ -428,7 +431,8 @@ function assertAwsEmulatorValue(flag) {
|
|
|
428
431
|
async function applyLocalAwsWiring(wiring, env, extraMounts, takenContainerPaths) {
|
|
429
432
|
const defaults = wiring.mode === "forward" && !env["AWS_ACCESS_KEY_ID"] ? await resolveHostDefaultCredentials() : void 0;
|
|
430
433
|
const wiredEnv = applyWorkloadAwsWiringToEnv(env, wiring, defaults);
|
|
431
|
-
const
|
|
434
|
+
const emulatorOnly = workloadGetsEmulatorKeysOnly(env, wiring);
|
|
435
|
+
const mounts = extraMounts.filter((m) => !emulatorOnly || m.containerPath !== "/cdkd-aws/credentials");
|
|
432
436
|
const taken = /* @__PURE__ */ new Set([...takenContainerPaths, ...mounts.map((m) => m.containerPath)]);
|
|
433
437
|
for (const m of wiring.mounts) if (!taken.has(m.containerPath)) mounts.push({
|
|
434
438
|
...m,
|
|
@@ -440,13 +444,16 @@ async function applyLocalAwsWiring(wiring, env, extraMounts, takenContainerPaths
|
|
|
440
444
|
};
|
|
441
445
|
}
|
|
442
446
|
function loopbackPortsFor(wiring, env, network) {
|
|
443
|
-
|
|
447
|
+
if (network !== "host") return effectiveLoopbackPorts(env, wiring);
|
|
448
|
+
const mixed = wiring.mixed;
|
|
449
|
+
if (mixed && effectiveLoopbackPorts(env, wiring).includes(mixed.resignPort)) throw new CdkdError("A run with \"real-aws\" exceptions (AWS Emulator mixed mode) cannot use the host network: its re-signing sidecar listens on the workload's own loopback. Drop the \"real-aws\" exceptions or the host network.", "LOCAL_AWS_EMULATOR_FORWARDER_FAILED");
|
|
450
|
+
return [];
|
|
444
451
|
}
|
|
445
452
|
async function prepareLocalLoopbackForwarder(wiring) {
|
|
446
453
|
try {
|
|
447
454
|
await ensureForwarderImage(wiring.skipPull === true);
|
|
448
455
|
} catch (err) {
|
|
449
|
-
if (wiring.mode === "emulator") throw new CdkdError(`--aws-emulator: the loopback forwarder image could not be pulled: ${err.message}`, "LOCAL_AWS_EMULATOR_FORWARDER_PULL_FAILED");
|
|
456
|
+
if (wiring.mode === "emulator" || wiring.mixed) throw new CdkdError(`--aws-emulator: the loopback forwarder image could not be pulled: ${err.message}`, "LOCAL_AWS_EMULATOR_FORWARDER_PULL_FAILED");
|
|
450
457
|
}
|
|
451
458
|
}
|
|
452
459
|
async function attachLocalLoopbackForwarder(containerId, ports) {
|
|
@@ -475,6 +482,26 @@ function localAwsEmulatorCredentials() {
|
|
|
475
482
|
const wiring = getActiveWorkloadAwsWiring$1();
|
|
476
483
|
return wiring?.mode === "emulator" ? wiring.emulatorCredentials : void 0;
|
|
477
484
|
}
|
|
485
|
+
function workloadGetsEmulatorKeysOnly(env, wiring) {
|
|
486
|
+
if (!wiring) return false;
|
|
487
|
+
if (wiring.mode === "emulator") return true;
|
|
488
|
+
if (!wiring.mixed) return false;
|
|
489
|
+
return !Object.entries(env).some(([k, v]) => k !== "AWS_ENDPOINT_URL" && isRealAwsSentinel(k, v));
|
|
490
|
+
}
|
|
491
|
+
function mixedModeActive() {
|
|
492
|
+
return getActiveWorkloadAwsWiring$1()?.mixed !== void 0;
|
|
493
|
+
}
|
|
494
|
+
function realAwsException(service, workload) {
|
|
495
|
+
return mixedModeActive() && !isAwsServiceRoutedToEmulator(service, workload);
|
|
496
|
+
}
|
|
497
|
+
function mixedModeEmulatorOverride() {
|
|
498
|
+
return getAwsEndpointOverride() ?? getActiveWorkloadAwsWiring$1()?.mixed?.emulatorClientOverride;
|
|
499
|
+
}
|
|
500
|
+
function warnAwsEmulatorStateSourceHint(dropped, stateSourceGiven) {
|
|
501
|
+
if (dropped === 0 || stateSourceGiven) return;
|
|
502
|
+
const hint = takeAwsEmulatorStateSourceHint();
|
|
503
|
+
if (hint !== void 0) getLogger().warn(hint);
|
|
504
|
+
}
|
|
478
505
|
|
|
479
506
|
// src/cli/aws-emulator-activation.ts
|
|
480
507
|
async function activateAwsEmulatorForCommand(flag) {
|
|
@@ -542,6 +569,13 @@ function prepareAwsEmulatorForCommand(actionCommand) {
|
|
|
542
569
|
const value = resolveAwsEmulatorOption(flag);
|
|
543
570
|
if (value === void 0) return void 0;
|
|
544
571
|
const local = underLocalCommand(actionCommand);
|
|
572
|
+
const endpoint = parseAwsEndpoint(value === true ? DEFAULT_AWS_EMULATOR_URL : value, "--aws-emulator");
|
|
573
|
+
const url = endpoint.hostname === "localhost" ? endpoint.url.replace("//localhost", "//127.0.0.1") : endpoint.url;
|
|
574
|
+
if (local && localCommandIsMixedMode(actionCommand)) {
|
|
575
|
+
keepHostClientsOnRealAws();
|
|
576
|
+
pointChildProcessesAtEmulator(url, endpoint.port);
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
545
579
|
const ignored = [];
|
|
546
580
|
if (clearOption(actionCommand, "profile")) ignored.push("--profile");
|
|
547
581
|
if (!local && clearOption(actionCommand, "roleArn")) ignored.push("--role-arn");
|
|
@@ -562,14 +596,29 @@ function prepareAwsEmulatorForCommand(actionCommand) {
|
|
|
562
596
|
const names = ignored.join(", ");
|
|
563
597
|
onStderr(() => getLogger().info(safeMsg`--aws-emulator: ignoring ${names}; every AWS call uses the emulator's keys.`));
|
|
564
598
|
}
|
|
565
|
-
const endpoint = parseAwsEndpoint(value === true ? DEFAULT_AWS_EMULATOR_URL : value, "--aws-emulator");
|
|
566
|
-
const url = endpoint.hostname === "localhost" ? endpoint.url.replace("//localhost", "//127.0.0.1") : endpoint.url;
|
|
567
599
|
const caBundle = actionCommand.optsWithGlobals().caBundle;
|
|
568
600
|
pointEnvironmentAtEmulator(url, endpoint.port, caBundle);
|
|
569
601
|
if (local) return void 0;
|
|
570
602
|
setAwsEndpointOverrideSource(getAwsEndpointOverride);
|
|
571
603
|
return () => onStderr(() => activateAwsEmulatorForCommand(flag));
|
|
572
604
|
}
|
|
605
|
+
function keepHostClientsOnRealAws() {
|
|
606
|
+
const ignored = [];
|
|
607
|
+
for (const key of Object.keys(process.env)) if (key.startsWith("AWS_ENDPOINT_URL")) {
|
|
608
|
+
if (process.env[key] !== "") ignored.push(key);
|
|
609
|
+
delete process.env[key];
|
|
610
|
+
}
|
|
611
|
+
process.env["AWS_IGNORE_CONFIGURED_ENDPOINT_URLS"] = "true";
|
|
612
|
+
if (ignored.length > 0) {
|
|
613
|
+
const names = ignored.join(", ");
|
|
614
|
+
onStderr(() => getLogger().info(safeMsg`--aws-emulator (mixed mode): ignoring ${names}; the "real-aws" exceptions go to real AWS.`));
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
function localCommandIsMixedMode(actionCommand) {
|
|
618
|
+
const envVars = actionCommand.optsWithGlobals().envVars;
|
|
619
|
+
if (typeof envVars !== "string" || envVars === "") return false;
|
|
620
|
+
return realAwsServicesOf(readAwsEmulatorEnvVarsFile(envVars).exceptions).length > 0;
|
|
621
|
+
}
|
|
573
622
|
function onStderr(fn) {
|
|
574
623
|
if (isStdoutReservedForPayload()) return fn();
|
|
575
624
|
reserveStdoutForPayload();
|
|
@@ -585,22 +634,42 @@ function onStderr(fn) {
|
|
|
585
634
|
return result;
|
|
586
635
|
}
|
|
587
636
|
function pointEnvironmentAtEmulator(url, port, caBundle) {
|
|
637
|
+
Object.assign(process.env, emulatorEnvironment(url, port, process.env));
|
|
638
|
+
const run = readEmulatorRunFiles(port);
|
|
639
|
+
const caPath = join(run.dir, "ca.pem");
|
|
640
|
+
const runCa = run.present && existsSync(caPath) ? caPath : devNull;
|
|
641
|
+
const ca = caBundle !== void 0 && caBundle !== "" ? caBundle : runCa;
|
|
642
|
+
setPasteableAwsCaBundle(url.startsWith("https:") && ca !== devNull ? ca : void 0);
|
|
643
|
+
}
|
|
644
|
+
function emulatorEnvironment(url, port, env) {
|
|
588
645
|
const run = readEmulatorRunFiles(port);
|
|
589
646
|
const runFile = (name) => {
|
|
590
647
|
const p = join(run.dir, name);
|
|
591
648
|
return run.present && existsSync(p) ? p : devNull;
|
|
592
649
|
};
|
|
593
|
-
process.env["AWS_ENDPOINT_URL"] = url;
|
|
594
650
|
const config = runFile("config");
|
|
595
|
-
|
|
596
|
-
|
|
651
|
+
const out = {
|
|
652
|
+
AWS_ENDPOINT_URL: url,
|
|
653
|
+
AWS_CONFIG_FILE: config,
|
|
654
|
+
AWS_SHARED_CREDENTIALS_FILE: runFile("emulator_credentials"),
|
|
655
|
+
AWS_EC2_METADATA_DISABLED: "true"
|
|
656
|
+
};
|
|
657
|
+
if (!env["AWS_REGION"] && !env["AWS_DEFAULT_REGION"] && config !== devNull) {
|
|
597
658
|
const region = defaultProfileRegion(readFileSync(config, "utf8"));
|
|
598
|
-
if (region !== void 0)
|
|
659
|
+
if (region !== void 0) out["AWS_REGION"] = region;
|
|
599
660
|
}
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
661
|
+
return out;
|
|
662
|
+
}
|
|
663
|
+
function pointChildProcessesAtEmulator(url, port) {
|
|
664
|
+
setChildProcessAwsEnv((env) => {
|
|
665
|
+
for (const key of [
|
|
666
|
+
"CDKD_ROLE_ARN",
|
|
667
|
+
...EMULATOR_SCRUBBED_ENV_KEYS,
|
|
668
|
+
...CREDENTIAL_ENV_KEYS
|
|
669
|
+
]) delete env[key];
|
|
670
|
+
for (const key of Object.keys(env)) if (key.startsWith("AWS_ENDPOINT_URL") || key === "AWS_IGNORE_CONFIGURED_ENDPOINT_URLS") delete env[key];
|
|
671
|
+
return Object.assign(env, emulatorEnvironment(url, port, env));
|
|
672
|
+
});
|
|
604
673
|
}
|
|
605
674
|
function defaultProfileRegion(ini) {
|
|
606
675
|
let inDefault = false;
|
|
@@ -2140,7 +2209,7 @@ function collectCrossStackRefs(node, onRef, unconditional) {
|
|
|
2140
2209
|
// src/provisioning/register-providers.ts
|
|
2141
2210
|
let providerClasses;
|
|
2142
2211
|
function loadProviderClasses() {
|
|
2143
|
-
providerClasses ??= import("./provider-classes-
|
|
2212
|
+
providerClasses ??= import("./provider-classes-cw32hLq9.js");
|
|
2144
2213
|
return providerClasses;
|
|
2145
2214
|
}
|
|
2146
2215
|
function registerAllProviders(registry, classes) {
|
|
@@ -3645,7 +3714,7 @@ async function deployStackInScope(ctx, stackInfo, stackRegion, stackAwsClients)
|
|
|
3645
3714
|
const syncValidation = validateRecreateTargets({
|
|
3646
3715
|
template: stackInfo.template,
|
|
3647
3716
|
state: stateForRecreateCheck?.state ?? {
|
|
3648
|
-
version:
|
|
3717
|
+
version: 16,
|
|
3649
3718
|
stackName: stackInfo.stackName,
|
|
3650
3719
|
region: stackRegion,
|
|
3651
3720
|
resources: {},
|
|
@@ -3680,7 +3749,7 @@ async function deployStackInScope(ctx, stackInfo, stackRegion, stackAwsClients)
|
|
|
3680
3749
|
const replacedReaders = await findReplacedReadersOfRecreateTargets({
|
|
3681
3750
|
template: stackInfo.template,
|
|
3682
3751
|
state: stateForRecreateCheck?.state ?? {
|
|
3683
|
-
version:
|
|
3752
|
+
version: 16,
|
|
3684
3753
|
stackName: stackInfo.stackName,
|
|
3685
3754
|
region: stackRegion,
|
|
3686
3755
|
resources: {},
|
|
@@ -5718,6 +5787,7 @@ async function bindParametersAndConditions({ template, parameters, stackName, st
|
|
|
5718
5787
|
resources: currentState.resources,
|
|
5719
5788
|
stateBackend,
|
|
5720
5789
|
stackName,
|
|
5790
|
+
stackIdTail: () => stackIdTailOf(currentState, stackName),
|
|
5721
5791
|
bestEffort: true,
|
|
5722
5792
|
...mergedParameters && { parameters: mergedParameters },
|
|
5723
5793
|
...inheritedForResolver && { inheritedSecrets: inheritedForResolver },
|
|
@@ -5729,7 +5799,9 @@ async function bindParametersAndConditions({ template, parameters, stackName, st
|
|
|
5729
5799
|
effectiveTemplate = new TemplateParser().filterResourcesByCondition(template, conditions);
|
|
5730
5800
|
everyConditionKnown = unboundParameterNames.size === 0 && unknownConditions.size === 0;
|
|
5731
5801
|
} catch (error) {
|
|
5732
|
-
|
|
5802
|
+
const message = `Diff condition evaluation for stack ${displayStackName(stackName)} skipped: ${describeAwsFailure(error).detail}`;
|
|
5803
|
+
if (isSelectOutOfBounds(error)) logger.warn(`${message}. \`cdkd deploy\` refuses this template.`);
|
|
5804
|
+
else logger.debug(message);
|
|
5733
5805
|
}
|
|
5734
5806
|
if (mismatchedRecords.length > 0) logger.warn(safeMsg`Stack ${displayStackName(stackName)}: condition(s) ${mismatchedRecords.map((name) => displayIdent(name)).join(", ")} read a secret-fed parameter and changed since the last deploy, or one of their inputs did. This diff cannot tell which branch the next deploy takes, and shows each Fn::If on them as its FALSE branch.`);
|
|
5735
5807
|
const stillUnknown = [...unknownConditions].filter((name) => !Object.hasOwn(recordedVerdicts, name));
|
|
@@ -5903,6 +5975,7 @@ async function resolveChildStackParameters(parentStackRow, parentTemplate, paren
|
|
|
5903
5975
|
secretNameSink: derivedNameSink ?? /* @__PURE__ */ new Map(),
|
|
5904
5976
|
stateBackend,
|
|
5905
5977
|
stackName: parentStackName,
|
|
5978
|
+
stackIdTail: () => stackIdTailOf(parentState, parentStackName),
|
|
5906
5979
|
bestEffort: true,
|
|
5907
5980
|
...parentParameters && { parameters: parentParameters },
|
|
5908
5981
|
...parentConditions && { conditions: parentConditions },
|
|
@@ -6048,6 +6121,7 @@ async function computeStackDiff(currentState, template, region, stackName, state
|
|
|
6048
6121
|
resources: currentState.resources,
|
|
6049
6122
|
stateBackend,
|
|
6050
6123
|
stackName,
|
|
6124
|
+
stackIdTail: () => stackIdTailOf(currentState, stackName),
|
|
6051
6125
|
bestEffort: true,
|
|
6052
6126
|
...mergedParameters && { parameters: mergedParameters },
|
|
6053
6127
|
...conditions && { conditions },
|
|
@@ -6094,6 +6168,7 @@ async function computeStackDiff(currentState, template, region, stackName, state
|
|
|
6094
6168
|
resources: resourcesForInputs,
|
|
6095
6169
|
stateBackend,
|
|
6096
6170
|
stackName,
|
|
6171
|
+
stackIdTail: () => stackIdTailOf(currentState, stackName),
|
|
6097
6172
|
bestEffort: true,
|
|
6098
6173
|
...Object.keys(classified.bound).length > 0 && { parameters: classified.bound },
|
|
6099
6174
|
...conditions && Object.keys(conditions).length > 0 && { conditions },
|
|
@@ -6281,7 +6356,7 @@ async function loadStateOrEmpty(stackName, region, stateBackend, refusalRecovery
|
|
|
6281
6356
|
region,
|
|
6282
6357
|
resources: {},
|
|
6283
6358
|
outputs: {},
|
|
6284
|
-
version:
|
|
6359
|
+
version: 16,
|
|
6285
6360
|
lastModified: Date.now()
|
|
6286
6361
|
},
|
|
6287
6362
|
unreadable: [],
|
|
@@ -9294,6 +9369,7 @@ async function scrubStack(stack, region, stateBackend, lockManager, opts) {
|
|
|
9294
9369
|
...Object.keys(parameters).length > 0 && { parameters },
|
|
9295
9370
|
...Object.keys(conditions).length > 0 && { conditions },
|
|
9296
9371
|
stackName: stack.stackName,
|
|
9372
|
+
stackIdTail: () => stackIdTailOf(state, stack.stackName),
|
|
9297
9373
|
stateBackend: resolverStateBackend,
|
|
9298
9374
|
...recordedSecretValues && { recordedSecretValues },
|
|
9299
9375
|
producerRegions,
|
|
@@ -16662,6 +16738,7 @@ async function buildResolvedParametersPerStack(args) {
|
|
|
16662
16738
|
secretNameSink: /* @__PURE__ */ new Map(),
|
|
16663
16739
|
parameters: parentParamValues,
|
|
16664
16740
|
stackName: parentNode.cdkdName,
|
|
16741
|
+
stackIdTail: () => stackIdTailOf(parentNode.state, parentNode.cdkdName),
|
|
16665
16742
|
...args.stateBackend && { stateBackend: args.stateBackend }
|
|
16666
16743
|
};
|
|
16667
16744
|
const { params, intrinsicSkipped } = await resolveChildImportParameters(parentNode.template, parentResolverContext, parentLogicalId, args.resolver);
|
|
@@ -21296,7 +21373,7 @@ async function runRollbackReplay(ctx) {
|
|
|
21296
21373
|
...carriedState,
|
|
21297
21374
|
...stackInstanceIdCarriedFrom(baseState),
|
|
21298
21375
|
...supersededAfterRollback(baseState, supersededHost),
|
|
21299
|
-
version:
|
|
21376
|
+
version: 16,
|
|
21300
21377
|
region,
|
|
21301
21378
|
resources: { ...stateResources },
|
|
21302
21379
|
...orphansAfterRollback(baseState, mintedOrphans),
|
|
@@ -24563,7 +24640,9 @@ async function resolveImportedProperties(stackState, template, region, stateBack
|
|
|
24563
24640
|
parameters
|
|
24564
24641
|
});
|
|
24565
24642
|
} catch (err) {
|
|
24566
|
-
|
|
24643
|
+
const message = `Template condition evaluation failed during import-time property resolution: ${describeAwsFailure(err).detail} — continuing without conditions.`;
|
|
24644
|
+
if (isSelectOutOfBounds(err)) logger.warn(message);
|
|
24645
|
+
else logger.debug(message);
|
|
24567
24646
|
}
|
|
24568
24647
|
const unboundParameterNames = Object.keys(template.Parameters ?? {}).filter((name) => isUnboundTemplateParameter(name, template, parameters));
|
|
24569
24648
|
let divergentParameters;
|
|
@@ -24592,7 +24671,8 @@ async function resolveImportedProperties(stackState, template, region, stateBack
|
|
|
24592
24671
|
...Object.keys(parameters).length > 0 && { parameters },
|
|
24593
24672
|
...Object.keys(conditions).length > 0 && { conditions },
|
|
24594
24673
|
stateBackend,
|
|
24595
|
-
stackName: stackState.stackName
|
|
24674
|
+
stackName: stackState.stackName,
|
|
24675
|
+
stackIdTail: () => stackIdTailOf(stackState, stackState.stackName)
|
|
24596
24676
|
};
|
|
24597
24677
|
const noEchoInputs = /* @__PURE__ */ new Map();
|
|
24598
24678
|
for (const [logicalId, resource] of entries) {
|
|
@@ -24811,7 +24891,7 @@ function buildStackState(stackName, region, rows, templateParser, template, exis
|
|
|
24811
24891
|
}
|
|
24812
24892
|
if (namesParameter?.failedClosed !== void 0) getLogger().debug(`The template's parameter dependence could not be judged (${namesParameter.failedClosed}): every prior observed-baseline refusal recorded without a reason is carried as an unverifiable-parameter refusal.`);
|
|
24813
24893
|
return {
|
|
24814
|
-
version:
|
|
24894
|
+
version: 16,
|
|
24815
24895
|
stackName,
|
|
24816
24896
|
region,
|
|
24817
24897
|
resources,
|
|
@@ -25097,6 +25177,14 @@ async function runLockedImport(ctx) {
|
|
|
25097
25177
|
}
|
|
25098
25178
|
}
|
|
25099
25179
|
const deployedParameters = !namesAnyDeclaredParameter(stateTemplate) ? void 0 : migrationCfnStackName !== void 0 ? await readDeployedParameters(migrationCfnStackName, regionClients.cloudFormation, logger, displaySafe(migrationCfnStackName)) : await readDeployedParameters(stackInfo.stackName, regionClients.cloudFormation, logger, displaySafe(stackInfo.stackName), { absentStackIsNoSource: true });
|
|
25180
|
+
if (existingState === null && typeof stateBackend.peekStackInstanceSibling === "function") {
|
|
25181
|
+
const sibling = await stateBackend.peekStackInstanceSibling(stackInfo.stackName, targetRegion);
|
|
25182
|
+
if (sibling?.stackIdFromInstance === true) stackState = {
|
|
25183
|
+
...stackState,
|
|
25184
|
+
stackInstanceId: sibling.stackInstanceId,
|
|
25185
|
+
stackIdFromInstance: true
|
|
25186
|
+
};
|
|
25187
|
+
}
|
|
25100
25188
|
const unsafeObservedBaselineLogicalIds = await withSharedDrainBudget(() => resolveImportedProperties(stackState, stateTemplate, targetRegion, stateBackend, logger, deployedParameters));
|
|
25101
25189
|
await captureObservedForImportedResources(stackState, providerRegistry, logger, unsafeObservedBaselineLogicalIds, rebuiltLogicalIdsFrom(rows, stateTemplate));
|
|
25102
25190
|
const saveOptions = {};
|
|
@@ -25387,20 +25475,21 @@ function hasSdkMetadata(error) {
|
|
|
25387
25475
|
async function loadStateForStack(stackName, synthRegion, opts) {
|
|
25388
25476
|
const logger = getLogger();
|
|
25389
25477
|
const prefix = opts.logPrefix ?? "--from-state";
|
|
25478
|
+
const warn = opts.warn ?? ((message) => logger.warn(message));
|
|
25390
25479
|
const region = canonicalizeRegion(opts.region ?? process.env["AWS_REGION"] ?? process.env["AWS_DEFAULT_REGION"] ?? synthRegion ?? "us-east-1");
|
|
25391
25480
|
const clientRegion = canonicalizeRegion(opts.region) || void 0;
|
|
25392
25481
|
let stateBucket;
|
|
25393
25482
|
try {
|
|
25394
25483
|
stateBucket = await resolveStateBucketWithDefault(opts.stateBucket, region);
|
|
25395
25484
|
} catch (err) {
|
|
25396
|
-
|
|
25485
|
+
warn(`${prefix}: could not resolve state bucket: ${describeLocalAwsFailureForWarn(err, "state bucket resolution")}. Falling back.`);
|
|
25397
25486
|
return;
|
|
25398
25487
|
}
|
|
25399
25488
|
const awsClients = new AwsClients({
|
|
25400
25489
|
...clientRegion !== void 0 && { region: clientRegion },
|
|
25401
25490
|
...opts.profile !== void 0 && { profile: opts.profile }
|
|
25402
25491
|
});
|
|
25403
|
-
setAwsClients(awsClients);
|
|
25492
|
+
if (!opts.scopedClients) setAwsClients(awsClients);
|
|
25404
25493
|
try {
|
|
25405
25494
|
const stateConfig = {
|
|
25406
25495
|
bucket: stateBucket,
|
|
@@ -25417,7 +25506,7 @@ async function loadStateForStack(stackName, synthRegion, opts) {
|
|
|
25417
25506
|
}
|
|
25418
25507
|
const refs = (await stateBackend.listStacks()).filter((r) => r.stackName === stackName);
|
|
25419
25508
|
if (refs.length === 0) {
|
|
25420
|
-
|
|
25509
|
+
warn(`${prefix}: no cdkd state found for stack '${stackName}' in bucket '${stateBucket}'. Was it deployed via 'cdkd deploy'? Falling back.`);
|
|
25421
25510
|
return;
|
|
25422
25511
|
}
|
|
25423
25512
|
const findByRegion = (candidate, source) => {
|
|
@@ -25426,7 +25515,7 @@ async function loadStateForStack(stackName, synthRegion, opts) {
|
|
|
25426
25515
|
const chosen = exact ?? folded[0];
|
|
25427
25516
|
if (folded.length > 1 && chosen) {
|
|
25428
25517
|
const how = exact ? `matches ${source} '${candidate}' exactly` : `no record spells ${source} '${candidate}' exactly, so this is a case-insensitive recovery`;
|
|
25429
|
-
|
|
25518
|
+
warn(`${prefix}: stack '${stackName}' has state under ${folded.length} case-variant spellings of ${source} '${candidate}' (${folded.map((r) => r.region ?? "(legacy)").join(", ")}). Reading '${chosen.region ?? "(legacy)"}' — ${how}.`);
|
|
25430
25519
|
}
|
|
25431
25520
|
return chosen;
|
|
25432
25521
|
};
|
|
@@ -25437,8 +25526,7 @@ async function loadStateForStack(stackName, synthRegion, opts) {
|
|
|
25437
25526
|
const requestedRegion = opts.rawStackRegion ?? opts.stackRegion;
|
|
25438
25527
|
const found = findByRegion(requestedRegion, "--stack-region");
|
|
25439
25528
|
if (!found) {
|
|
25440
|
-
|
|
25441
|
-
logger.warn(`${prefix}: stack '${stackName}' has no state in region '${requestedRegion}' (available: ${seen}). Falling back.`);
|
|
25529
|
+
warn(`${prefix}: stack '${stackName}' has no state in region '${requestedRegion}' (available: ${refs.map((r) => r.region ?? "(legacy)").join(", ")}). Falling back.`);
|
|
25442
25530
|
return;
|
|
25443
25531
|
}
|
|
25444
25532
|
targetRegion = found.region ?? requestedRegion;
|
|
@@ -25446,12 +25534,12 @@ async function loadStateForStack(stackName, synthRegion, opts) {
|
|
|
25446
25534
|
else if (refs.length === 1) targetRegion = refs[0].region ?? synthRegion ?? region;
|
|
25447
25535
|
else {
|
|
25448
25536
|
const seen = refs.map((r) => r.region === void 0 ? "(legacy)" : regionShown(r.region)).join(", ");
|
|
25449
|
-
|
|
25537
|
+
warn(`${prefix}: stack ${quotedOrDescribed(stackName, "stack name")} has state in multiple regions (${seen}). Re-run with --stack-region '<region>'. Falling back.`);
|
|
25450
25538
|
return;
|
|
25451
25539
|
}
|
|
25452
25540
|
const stateData = await stateBackend.getState(stackName, targetRegion);
|
|
25453
25541
|
if (!stateData) {
|
|
25454
|
-
|
|
25542
|
+
warn(`${prefix}: state record for '${stackName}' (${targetRegion}) returned empty. Falling back.`);
|
|
25455
25543
|
return;
|
|
25456
25544
|
}
|
|
25457
25545
|
logger.debug(`${prefix}: loaded state for ${stackName} (${targetRegion})`);
|
|
@@ -25461,7 +25549,8 @@ async function loadStateForStack(stackName, synthRegion, opts) {
|
|
|
25461
25549
|
stateBucket
|
|
25462
25550
|
};
|
|
25463
25551
|
} finally {
|
|
25464
|
-
|
|
25552
|
+
if (opts.scopedClients) awsClients.destroy();
|
|
25553
|
+
else resetAwsClients();
|
|
25465
25554
|
}
|
|
25466
25555
|
}
|
|
25467
25556
|
async function loadBootstrapContainerRepo(synthRegion, opts) {
|
|
@@ -25645,12 +25734,13 @@ function describeStateBucketAccessFailure(err) {
|
|
|
25645
25734
|
|
|
25646
25735
|
// src/local/s3-local-state-provider.ts
|
|
25647
25736
|
var S3LocalStateProvider = class {
|
|
25648
|
-
label
|
|
25737
|
+
label;
|
|
25649
25738
|
opts;
|
|
25650
25739
|
disposers = [];
|
|
25651
25740
|
warnedMalformedProducers = /* @__PURE__ */ new Set();
|
|
25652
25741
|
constructor(opts) {
|
|
25653
25742
|
this.opts = opts;
|
|
25743
|
+
this.label = opts.logPrefix ?? "--from-state";
|
|
25654
25744
|
}
|
|
25655
25745
|
async load(stackName, synthRegion) {
|
|
25656
25746
|
const loadOpts = {
|
|
@@ -25659,7 +25749,10 @@ var S3LocalStateProvider = class {
|
|
|
25659
25749
|
...this.opts.rawStackRegion !== void 0 && { rawStackRegion: this.opts.rawStackRegion },
|
|
25660
25750
|
...this.opts.stateBucket !== void 0 && { stateBucket: this.opts.stateBucket },
|
|
25661
25751
|
...this.opts.region !== void 0 && { region: this.opts.region },
|
|
25662
|
-
...this.opts.profile !== void 0 && { profile: this.opts.profile }
|
|
25752
|
+
...this.opts.profile !== void 0 && { profile: this.opts.profile },
|
|
25753
|
+
...this.opts.logPrefix !== void 0 && { logPrefix: this.opts.logPrefix },
|
|
25754
|
+
...this.opts.warn !== void 0 && { warn: this.opts.warn },
|
|
25755
|
+
...this.opts.scopedClients === true && { scopedClients: true }
|
|
25663
25756
|
};
|
|
25664
25757
|
const loaded = await loadStateForStack(stackName, synthRegion, loadOpts);
|
|
25665
25758
|
if (!loaded) return void 0;
|
|
@@ -25705,24 +25798,92 @@ var S3LocalStateProvider = class {
|
|
|
25705
25798
|
}
|
|
25706
25799
|
};
|
|
25707
25800
|
|
|
25801
|
+
// src/local/mixed-mode-state.ts
|
|
25802
|
+
const REAL_FROM_STATE_LABEL = "--from-state (real AWS)";
|
|
25803
|
+
function realMissReason(message) {
|
|
25804
|
+
return (message.startsWith(`${"--from-state (real AWS)"}: `) ? message.slice(25) : message).replace(/\s*Was it deployed via 'cdkd deploy'\?/, "").replace(/\s*Falling back\.\s*$/, "").replace(/\.\s*$/, "");
|
|
25805
|
+
}
|
|
25806
|
+
function serialQueue() {
|
|
25807
|
+
let tail = Promise.resolve();
|
|
25808
|
+
return (job) => {
|
|
25809
|
+
const run = tail.then(job, job);
|
|
25810
|
+
tail = run.catch(() => void 0);
|
|
25811
|
+
return run;
|
|
25812
|
+
};
|
|
25813
|
+
}
|
|
25814
|
+
function createMixedModeFromStateProvider(opts, realServices) {
|
|
25815
|
+
if (realServices.length === 0) return new S3LocalStateProvider(opts);
|
|
25816
|
+
const serial = serialQueue();
|
|
25817
|
+
const emulatorInner = new S3LocalStateProvider(opts);
|
|
25818
|
+
const emulator = {
|
|
25819
|
+
label: emulatorInner.label,
|
|
25820
|
+
load: (stackName, synthRegion) => serial(() => emulatorInner.load(stackName, synthRegion)),
|
|
25821
|
+
buildCrossStackResolver: (region) => serial(() => emulatorInner.buildCrossStackResolver(region)),
|
|
25822
|
+
dispose: () => emulatorInner.dispose()
|
|
25823
|
+
};
|
|
25824
|
+
let lastLoadError;
|
|
25825
|
+
const realInner = new S3LocalStateProvider({
|
|
25826
|
+
...opts,
|
|
25827
|
+
logPrefix: REAL_FROM_STATE_LABEL,
|
|
25828
|
+
warn: (message) => {
|
|
25829
|
+
lastLoadError ??= realMissReason(message);
|
|
25830
|
+
getLogger().debug(message);
|
|
25831
|
+
},
|
|
25832
|
+
scopedClients: true
|
|
25833
|
+
});
|
|
25834
|
+
return createMixedModeStateProvider({
|
|
25835
|
+
emulator,
|
|
25836
|
+
real: {
|
|
25837
|
+
label: REAL_FROM_STATE_LABEL,
|
|
25838
|
+
load: (stackName, synthRegion) => serial(() => runWithRealAws(async () => {
|
|
25839
|
+
lastLoadError = void 0;
|
|
25840
|
+
const region = canonicalizeRegion(opts.stackRegion ?? opts.region ?? synthRegion ?? process.env["AWS_REGION"] ?? process.env["AWS_DEFAULT_REGION"]) || "us-east-1";
|
|
25841
|
+
const clients = new AwsClients({
|
|
25842
|
+
region,
|
|
25843
|
+
...opts.profile && { profile: opts.profile }
|
|
25844
|
+
});
|
|
25845
|
+
try {
|
|
25846
|
+
return await runWithStackAwsClients(clients, () => realInner.load(stackName, synthRegion));
|
|
25847
|
+
} catch (err) {
|
|
25848
|
+
lastLoadError = realMissReason(err instanceof Error ? err.message : String(err));
|
|
25849
|
+
return;
|
|
25850
|
+
} finally {
|
|
25851
|
+
clients.destroy();
|
|
25852
|
+
}
|
|
25853
|
+
})),
|
|
25854
|
+
buildCrossStackResolver: () => Promise.resolve(void 0),
|
|
25855
|
+
getLastLoadError: () => lastLoadError,
|
|
25856
|
+
dispose: () => realInner.dispose()
|
|
25857
|
+
},
|
|
25858
|
+
realServices
|
|
25859
|
+
});
|
|
25860
|
+
}
|
|
25861
|
+
|
|
25708
25862
|
// src/cli/commands/local-state-source.ts
|
|
25709
|
-
const fromStateFactory = (options) => {
|
|
25863
|
+
const fromStateFactory = (options, behavior) => {
|
|
25864
|
+
const providerOpts = s3ProviderOptions(options);
|
|
25865
|
+
const mixed = getActiveWorkloadAwsWiring()?.mixed;
|
|
25866
|
+
if (!mixed) return new S3LocalStateProvider(providerOpts);
|
|
25867
|
+
const realServices = awsEmulatorRealServices(behavior.workload) ?? mixed.realServices;
|
|
25868
|
+
return createMixedModeFromStateProvider(providerOpts, realServices);
|
|
25869
|
+
};
|
|
25870
|
+
function s3ProviderOptions(options) {
|
|
25710
25871
|
const opts = options;
|
|
25711
25872
|
const clientRegion = canonicalizeRegion(opts.region) || void 0;
|
|
25712
25873
|
const stackRegion = canonicalizeRegion(opts.stackRegion) || void 0;
|
|
25713
25874
|
const rawStackRegion = opts.rawStackRegion || opts.stackRegion || void 0;
|
|
25714
|
-
return
|
|
25875
|
+
return {
|
|
25715
25876
|
statePrefix: opts.statePrefix,
|
|
25716
25877
|
...opts.stateBucket !== void 0 && { stateBucket: opts.stateBucket },
|
|
25717
25878
|
...clientRegion !== void 0 && { region: clientRegion },
|
|
25718
25879
|
...opts.profile !== void 0 && { profile: opts.profile },
|
|
25719
25880
|
...stackRegion !== void 0 && { stackRegion },
|
|
25720
25881
|
...rawStackRegion !== void 0 && { rawStackRegion }
|
|
25721
|
-
}
|
|
25722
|
-
}
|
|
25882
|
+
};
|
|
25883
|
+
}
|
|
25723
25884
|
const cdkdExtraStateProviders = { fromState: fromStateFactory };
|
|
25724
|
-
function createLocalStateProvider$1(options, cdkdStackName, synthRegion) {
|
|
25725
|
-
return createLocalStateProvider(options, cdkdStackName, synthRegion, cdkdExtraStateProviders);
|
|
25885
|
+
function createLocalStateProvider$1(options, cdkdStackName, synthRegion, behavior = {}) {
|
|
25886
|
+
return createLocalStateProvider(options, cdkdStackName, synthRegion, cdkdExtraStateProviders, behavior);
|
|
25726
25887
|
}
|
|
25727
25888
|
|
|
25728
25889
|
// src/local/docker-runner.ts
|
|
@@ -25763,6 +25924,7 @@ async function runDetached(opts) {
|
|
|
25763
25924
|
const wiring = getActiveWorkloadAwsWiring$1();
|
|
25764
25925
|
if (!wiring) return runDetachedContainer(opts);
|
|
25765
25926
|
const wired = await applyLocalAwsWiring(wiring, opts.env, opts.extraMounts ?? [], opts.mounts.map((m) => m.containerPath));
|
|
25927
|
+
if (opts.network === "host" && wiring.sidecar?.passthrough && wired.env["AWS_ENDPOINT_URL_SQS"] === wiring.sidecar.endpoint) delete wired.env["AWS_ENDPOINT_URL_SQS"];
|
|
25766
25928
|
const wiredOpts = {
|
|
25767
25929
|
...opts,
|
|
25768
25930
|
env: wired.env,
|
|
@@ -27271,22 +27433,30 @@ function dynamicReferenceSpecOptions(options) {
|
|
|
27271
27433
|
// src/local/dynamic-reference.ts
|
|
27272
27434
|
function createCallerDynamicReferenceResolver(profile) {
|
|
27273
27435
|
return new DynamicReferenceResolver({
|
|
27274
|
-
secretsManagerClientFactory: (region) =>
|
|
27275
|
-
|
|
27276
|
-
|
|
27277
|
-
|
|
27278
|
-
|
|
27279
|
-
|
|
27280
|
-
|
|
27281
|
-
|
|
27282
|
-
|
|
27283
|
-
|
|
27284
|
-
|
|
27285
|
-
|
|
27286
|
-
|
|
27287
|
-
|
|
27288
|
-
|
|
27289
|
-
|
|
27436
|
+
secretsManagerClientFactory: (region, route) => {
|
|
27437
|
+
const realAws = realAwsException("SECRETS_MANAGER", route.workload);
|
|
27438
|
+
return new SecretsManagerClient({
|
|
27439
|
+
...awsClientDefaults({
|
|
27440
|
+
profile,
|
|
27441
|
+
ignoreAssumedRole: true,
|
|
27442
|
+
realAws
|
|
27443
|
+
}),
|
|
27444
|
+
...region && { region: canonicalizeRegion(region) },
|
|
27445
|
+
...profile && { profile }
|
|
27446
|
+
});
|
|
27447
|
+
},
|
|
27448
|
+
ssmClientFactory: (region, route) => {
|
|
27449
|
+
const realAws = realAwsException("SSM", route.workload);
|
|
27450
|
+
return new SSMClient({
|
|
27451
|
+
...awsClientDefaults({
|
|
27452
|
+
profile,
|
|
27453
|
+
ignoreAssumedRole: true,
|
|
27454
|
+
realAws
|
|
27455
|
+
}),
|
|
27456
|
+
...region && { region: canonicalizeRegion(region) },
|
|
27457
|
+
...profile && { profile }
|
|
27458
|
+
});
|
|
27459
|
+
}
|
|
27290
27460
|
});
|
|
27291
27461
|
}
|
|
27292
27462
|
|
|
@@ -27373,6 +27543,10 @@ function isCredentialFresh(creds) {
|
|
|
27373
27543
|
return creds.expiration.getTime() - Date.now() > STS_CREDENTIAL_SAFETY_MARGIN_MS;
|
|
27374
27544
|
}
|
|
27375
27545
|
async function pullEcrImage(imageUri, options) {
|
|
27546
|
+
if (realAwsException("ECR", options.workload)) return runWithRealAws(() => pullEcrImageOnSide(imageUri, options, "real"));
|
|
27547
|
+
return pullEcrImageOnSide(imageUri, options, "default");
|
|
27548
|
+
}
|
|
27549
|
+
async function pullEcrImageOnSide(imageUri, options, side) {
|
|
27376
27550
|
const logger = getLogger().child("ecr-puller");
|
|
27377
27551
|
const parsed = parseEcrUri(imageUri);
|
|
27378
27552
|
if (!parsed) throw new LocalInvokeBuildError$1(`Image URI '${imageUri}' is not an ECR URI. cdkd local invoke v1 only authenticates against ECR for the deployed-image fallback path.`);
|
|
@@ -27384,7 +27558,7 @@ async function pullEcrImage(imageUri, options) {
|
|
|
27384
27558
|
return canonicalUri;
|
|
27385
27559
|
}
|
|
27386
27560
|
const credentialConfig = ambientCredentialConfig();
|
|
27387
|
-
const identityFingerprint = credentialFingerprint(credentialConfig);
|
|
27561
|
+
const identityFingerprint = injectiveKey(side, credentialFingerprint(credentialConfig));
|
|
27388
27562
|
const callerIdentityKey = injectiveKey(identityFingerprint, callerRegion ?? "_unset");
|
|
27389
27563
|
let callerAccount = CALLER_IDENTITY_CACHE.get(callerIdentityKey);
|
|
27390
27564
|
if (callerAccount === void 0) {
|
|
@@ -28168,7 +28342,7 @@ function readEnvOverridesFile$3(filePath) {
|
|
|
28168
28342
|
if (!filePath) return void 0;
|
|
28169
28343
|
let raw;
|
|
28170
28344
|
try {
|
|
28171
|
-
raw =
|
|
28345
|
+
raw = readEnvVarsFileText(filePath);
|
|
28172
28346
|
} catch (err) {
|
|
28173
28347
|
throw new Error(`Failed to read --env-vars file '${filePath}': ${describeAwsFailure(err).detail}`);
|
|
28174
28348
|
}
|
|
@@ -28203,7 +28377,8 @@ async function resolveProfileCredentials(profile) {
|
|
|
28203
28377
|
const sts = new STSClient({
|
|
28204
28378
|
...awsClientDefaults({
|
|
28205
28379
|
profile,
|
|
28206
|
-
ignoreAssumedRole: true
|
|
28380
|
+
ignoreAssumedRole: true,
|
|
28381
|
+
realAws: mixedModeActive()
|
|
28207
28382
|
}),
|
|
28208
28383
|
profile
|
|
28209
28384
|
});
|
|
@@ -28234,7 +28409,10 @@ async function assumeLambdaExecutionRole$1(roleArn, region) {
|
|
|
28234
28409
|
assertSendableRoleArn(roleArn);
|
|
28235
28410
|
const { STSClient } = await import("@aws-sdk/client-sts");
|
|
28236
28411
|
const sts = new STSClient({
|
|
28237
|
-
...awsClientDefaults({
|
|
28412
|
+
...awsClientDefaults({
|
|
28413
|
+
ignoreAssumedRole: true,
|
|
28414
|
+
realAws: mixedModeActive()
|
|
28415
|
+
}),
|
|
28238
28416
|
...region && { region }
|
|
28239
28417
|
});
|
|
28240
28418
|
try {
|
|
@@ -28258,243 +28436,6 @@ async function assumeLambdaExecutionRole$1(roleArn, region) {
|
|
|
28258
28436
|
}
|
|
28259
28437
|
}
|
|
28260
28438
|
|
|
28261
|
-
// src/cli/commands/local-start-api/container-spec.ts
|
|
28262
|
-
async function buildContainerSpec(args) {
|
|
28263
|
-
const { logicalId, stacks, overrides, assumeRole, containerHost, debugPort, stsRegion, inlineTmpDirs, layerTmpDirs, stateByStack, skipPull, layerRoleArn, profileCredentials, profileCredsFile, profile, stackRegionOverride } = args;
|
|
28264
|
-
const lambda = resolveLambdaByLogicalId(logicalId, stacks);
|
|
28265
|
-
let codeDir;
|
|
28266
|
-
let optDir;
|
|
28267
|
-
let imageRef;
|
|
28268
|
-
let platform;
|
|
28269
|
-
if (lambda.kind === "zip") {
|
|
28270
|
-
codeDir = lambda.codePath ?? materializeInlineCode$1(lambda.handler, lambda.inlineCode ?? "", resolveRuntimeFileExtension(lambda.runtime), inlineTmpDirs);
|
|
28271
|
-
optDir = await materializeLambdaLayers$1(lambda.layers, layerTmpDirs, layerRoleArn);
|
|
28272
|
-
platform = architectureToPlatform(lambda.architecture);
|
|
28273
|
-
} else {
|
|
28274
|
-
imageRef = (await resolveContainerImageForStartApi(lambda, skipPull)).imageRef;
|
|
28275
|
-
platform = architectureToPlatform(lambda.architecture);
|
|
28276
|
-
}
|
|
28277
|
-
let templateEnv = getTemplateEnv$1(lambda.resource);
|
|
28278
|
-
const stateBundle = stateByStack.get(lambda.stack.stackName);
|
|
28279
|
-
let stateAudit;
|
|
28280
|
-
if (stateBundle) {
|
|
28281
|
-
const context = { resources: stateBundle.state.resources };
|
|
28282
|
-
if (stateBundle.pseudoParameters) context.pseudoParameters = stateBundle.pseudoParameters;
|
|
28283
|
-
const { env, audit } = substituteEnvVarsFromState(templateEnv, context);
|
|
28284
|
-
templateEnv = env;
|
|
28285
|
-
stateAudit = audit;
|
|
28286
|
-
for (const key of audit.resolvedKeys) getLogger().debug(`Lambda ${logicalId}: --from-state substituted env var ${key}`);
|
|
28287
|
-
for (const { key, reason } of audit.unresolved) getLogger().warn(`Lambda ${logicalId}: --from-state could not substitute env var ${key} (${reason}). Override it via --env-vars or it will be dropped.`);
|
|
28288
|
-
}
|
|
28289
|
-
const lambdaCdkPath = readCdkPathOrUndefined(lambda.resource);
|
|
28290
|
-
const envResult = resolveEnvVars(logicalId, lambdaCdkPath, templateEnv, overrides);
|
|
28291
|
-
for (const key of envResult.unresolved) {
|
|
28292
|
-
if (stateAudit && stateAudit.unresolved.some((u) => u.key === key)) continue;
|
|
28293
|
-
const overrideKeyExample = lambdaCdkPath?.replace(/\/Resource$/, "") ?? logicalId;
|
|
28294
|
-
getLogger().warn(`Lambda ${logicalId}: env var ${key} contains a CloudFormation intrinsic and was dropped. Override it with --env-vars (e.g. {"${overrideKeyExample}":{"${key}":"<literal>"}}) or pass --from-state to recover deployed values.`);
|
|
28295
|
-
}
|
|
28296
|
-
const plaintextKeys = new Set(stateAudit?.sensitiveKeys ?? []);
|
|
28297
|
-
for (const key of keysNotFromTemplate(templateEnv, envResult.resolved)) plaintextKeys.add(key);
|
|
28298
|
-
const dynamicRefs = createCallerDynamicReferenceResolver(profile);
|
|
28299
|
-
let dynamic;
|
|
28300
|
-
try {
|
|
28301
|
-
dynamic = await resolveDynamicReferencesInEnv(envResult.resolved, {
|
|
28302
|
-
region: firstUsableRegion(stateBundle?.region, stackRegionOverride, lambda.stack.region, stsRegion),
|
|
28303
|
-
label: `Lambda ${logicalId}`,
|
|
28304
|
-
skipKeys: plaintextKeys,
|
|
28305
|
-
resolver: dynamicRefs
|
|
28306
|
-
});
|
|
28307
|
-
} finally {
|
|
28308
|
-
dynamicRefs.dispose();
|
|
28309
|
-
}
|
|
28310
|
-
const sensitiveKeyList = [...stateAudit?.sensitiveKeys ?? [], ...dynamic.resolvedKeys];
|
|
28311
|
-
const sensitiveEnvKeys = sensitiveKeyList.length > 0 ? new Set(sensitiveKeyList) : void 0;
|
|
28312
|
-
const dockerEnv = {
|
|
28313
|
-
AWS_LAMBDA_FUNCTION_NAME: logicalId,
|
|
28314
|
-
AWS_LAMBDA_FUNCTION_MEMORY_SIZE: String(lambda.memoryMb),
|
|
28315
|
-
AWS_LAMBDA_FUNCTION_TIMEOUT: String(lambda.timeoutSec),
|
|
28316
|
-
AWS_LAMBDA_FUNCTION_VERSION: "$LATEST",
|
|
28317
|
-
AWS_LAMBDA_LOG_GROUP_NAME: `/aws/lambda/${logicalId}`,
|
|
28318
|
-
AWS_LAMBDA_LOG_STREAM_NAME: "local",
|
|
28319
|
-
...dynamic.env
|
|
28320
|
-
};
|
|
28321
|
-
const roleArn = resolveStartApiAssumeRoleArn({
|
|
28322
|
-
logicalId,
|
|
28323
|
-
assumeRole,
|
|
28324
|
-
lambdaResource: lambda.resource,
|
|
28325
|
-
stateBundle
|
|
28326
|
-
});
|
|
28327
|
-
if (roleArn) {
|
|
28328
|
-
const creds = await assumeLambdaExecutionRole$1(roleArn, stsRegion);
|
|
28329
|
-
dockerEnv["AWS_ACCESS_KEY_ID"] = creds.accessKeyId;
|
|
28330
|
-
dockerEnv["AWS_SECRET_ACCESS_KEY"] = creds.secretAccessKey;
|
|
28331
|
-
dockerEnv["AWS_SESSION_TOKEN"] = creds.sessionToken;
|
|
28332
|
-
setContainerRegion(dockerEnv, stsRegion);
|
|
28333
|
-
} else {
|
|
28334
|
-
forwardAwsEnv$2(dockerEnv);
|
|
28335
|
-
const containerRegion = firstUsableRegion(stsRegion, lambda.stack.region);
|
|
28336
|
-
setContainerRegion(dockerEnv, containerRegion);
|
|
28337
|
-
if (profileCredentials) {
|
|
28338
|
-
dockerEnv["AWS_ACCESS_KEY_ID"] = profileCredentials.accessKeyId;
|
|
28339
|
-
dockerEnv["AWS_SECRET_ACCESS_KEY"] = profileCredentials.secretAccessKey;
|
|
28340
|
-
if (profileCredentials.sessionToken) dockerEnv["AWS_SESSION_TOKEN"] = profileCredentials.sessionToken;
|
|
28341
|
-
else delete dockerEnv["AWS_SESSION_TOKEN"];
|
|
28342
|
-
}
|
|
28343
|
-
if (profileCredsFile) {
|
|
28344
|
-
dockerEnv["AWS_SHARED_CREDENTIALS_FILE"] = profileCredsFile.containerPath;
|
|
28345
|
-
dockerEnv["AWS_PROFILE"] = profileCredsFile.profileName;
|
|
28346
|
-
}
|
|
28347
|
-
}
|
|
28348
|
-
if (debugPort !== void 0) dockerEnv["NODE_OPTIONS"] = `--inspect-brk=0.0.0.0:${debugPort}`;
|
|
28349
|
-
const tmpfs = lambda.ephemeralStorageMb !== void 0 ? {
|
|
28350
|
-
target: "/tmp",
|
|
28351
|
-
sizeMb: lambda.ephemeralStorageMb
|
|
28352
|
-
} : void 0;
|
|
28353
|
-
if (lambda.kind === "zip") return {
|
|
28354
|
-
kind: "zip",
|
|
28355
|
-
lambda,
|
|
28356
|
-
codeDir,
|
|
28357
|
-
platform,
|
|
28358
|
-
env: dockerEnv,
|
|
28359
|
-
...sensitiveEnvKeys !== void 0 && { sensitiveEnvKeys },
|
|
28360
|
-
containerHost,
|
|
28361
|
-
...optDir !== void 0 && { optDir },
|
|
28362
|
-
...debugPort !== void 0 && { debugPort },
|
|
28363
|
-
...tmpfs !== void 0 && { tmpfs },
|
|
28364
|
-
...profileCredsFile && { profileCredentialsFile: {
|
|
28365
|
-
hostPath: profileCredsFile.hostPath,
|
|
28366
|
-
containerPath: profileCredsFile.containerPath
|
|
28367
|
-
} }
|
|
28368
|
-
};
|
|
28369
|
-
const rie = await resolveRieWrap({
|
|
28370
|
-
image: imageRef,
|
|
28371
|
-
platform,
|
|
28372
|
-
entryPoint: lambda.imageConfig.entryPoint,
|
|
28373
|
-
command: lambda.imageConfig.command,
|
|
28374
|
-
skipPull
|
|
28375
|
-
});
|
|
28376
|
-
return {
|
|
28377
|
-
kind: "image",
|
|
28378
|
-
lambda,
|
|
28379
|
-
image: imageRef,
|
|
28380
|
-
platform,
|
|
28381
|
-
command: rie ? rie.cmd : lambda.imageConfig.command ?? [],
|
|
28382
|
-
...rie && {
|
|
28383
|
-
entryPoint: rie.entryPoint,
|
|
28384
|
-
rieMount: rie.mount
|
|
28385
|
-
},
|
|
28386
|
-
...!rie && lambda.imageConfig.entryPoint !== void 0 && lambda.imageConfig.entryPoint.length > 0 && { entryPoint: lambda.imageConfig.entryPoint },
|
|
28387
|
-
...lambda.imageConfig.workingDirectory !== void 0 && { workingDir: lambda.imageConfig.workingDirectory },
|
|
28388
|
-
env: dockerEnv,
|
|
28389
|
-
...sensitiveEnvKeys !== void 0 && { sensitiveEnvKeys },
|
|
28390
|
-
containerHost,
|
|
28391
|
-
...debugPort !== void 0 && { debugPort },
|
|
28392
|
-
...tmpfs !== void 0 && { tmpfs },
|
|
28393
|
-
...profileCredsFile && { profileCredentialsFile: {
|
|
28394
|
-
hostPath: profileCredsFile.hostPath,
|
|
28395
|
-
containerPath: profileCredsFile.containerPath
|
|
28396
|
-
} }
|
|
28397
|
-
};
|
|
28398
|
-
}
|
|
28399
|
-
async function resolveContainerImageForStartApi(lambda, skipPull) {
|
|
28400
|
-
const logger = getLogger();
|
|
28401
|
-
const localBuild = await resolveLocalBuildPlan$1(lambda);
|
|
28402
|
-
if (localBuild) return { imageRef: await buildContainerImage$1(localBuild.asset, localBuild.cdkOutDir, {
|
|
28403
|
-
assetOutdir: localBuild.assetOutdir,
|
|
28404
|
-
architecture: lambda.architecture
|
|
28405
|
-
}) };
|
|
28406
|
-
if (!parseEcrUri(lambda.imageUri)) throw new Error(`Container Lambda '${lambda.logicalId}' has no matching asset in cdk.out, and Code.ImageUri '${lambda.imageUri}' is not an ECR URI cdkd can authenticate against. Re-synthesize the CDK app (so cdk.out includes the build context) or deploy the image to ECR first.`);
|
|
28407
|
-
logger.info(`No matching cdk.out asset for ${lambda.imageUri}; falling back to ECR pull (uses your own credentials — this command has no --ecr-role-arn, so a cross-account image needs cross-account ECR permissions)...`);
|
|
28408
|
-
return { imageRef: await pullEcrImage(lambda.imageUri, { skipPull }) };
|
|
28409
|
-
}
|
|
28410
|
-
async function resolveLocalBuildPlan$1(lambda) {
|
|
28411
|
-
if (!lambda.stack.assetManifestPath) return void 0;
|
|
28412
|
-
const { manifestDir: cdkOutDir, assetOutdir } = assetPathDirs(lambda.stack);
|
|
28413
|
-
const manifest = await new AssetManifestLoader().loadStackManifest(lambda.stack, cdkOutDir);
|
|
28414
|
-
if (!manifest) return void 0;
|
|
28415
|
-
const entry = getDockerImageBySourceHash(manifest, lambda.imageUri);
|
|
28416
|
-
if (!entry) return void 0;
|
|
28417
|
-
return {
|
|
28418
|
-
asset: entry.asset,
|
|
28419
|
-
cdkOutDir,
|
|
28420
|
-
assetOutdir
|
|
28421
|
-
};
|
|
28422
|
-
}
|
|
28423
|
-
async function materializeLambdaLayers$1(layers, layerTmpDirs, layerRoleArn) {
|
|
28424
|
-
if (layers.length === 0) return void 0;
|
|
28425
|
-
const flat = [];
|
|
28426
|
-
for (const layer of layers) {
|
|
28427
|
-
if (layer.kind === "asset") {
|
|
28428
|
-
flat.push({
|
|
28429
|
-
logicalId: layer.logicalId,
|
|
28430
|
-
assetPath: layer.assetPath
|
|
28431
|
-
});
|
|
28432
|
-
continue;
|
|
28433
|
-
}
|
|
28434
|
-
const dir = await materializeLayerFromArn(layer, { ...layerRoleArn !== void 0 && { roleArn: explicitRoleArnOrThrow("--layer-role-arn", layerRoleArn) } });
|
|
28435
|
-
layerTmpDirs.add(dir);
|
|
28436
|
-
flat.push({
|
|
28437
|
-
logicalId: layer.arn,
|
|
28438
|
-
assetPath: dir
|
|
28439
|
-
});
|
|
28440
|
-
}
|
|
28441
|
-
if (flat.length === 1) return flat[0].assetPath;
|
|
28442
|
-
const dir = mkdtempSync(path.join(tmpdir(), "cdkd-local-start-api-layers-"));
|
|
28443
|
-
try {
|
|
28444
|
-
for (const layer of flat) copyLayerTreeLastWins(layer.assetPath, dir);
|
|
28445
|
-
} catch (error) {
|
|
28446
|
-
rmSync(dir, {
|
|
28447
|
-
recursive: true,
|
|
28448
|
-
force: true
|
|
28449
|
-
});
|
|
28450
|
-
throw error;
|
|
28451
|
-
}
|
|
28452
|
-
layerTmpDirs.add(dir);
|
|
28453
|
-
return dir;
|
|
28454
|
-
}
|
|
28455
|
-
|
|
28456
|
-
// src/cli/commands/local-start-api/reload.ts
|
|
28457
|
-
async function reloadAllServers(args) {
|
|
28458
|
-
const { synthesizeAndBuild, servers, buildPool, logger, isClosing, retiredPoolDisposals } = args;
|
|
28459
|
-
let material;
|
|
28460
|
-
try {
|
|
28461
|
-
material = await synthesizeAndBuild();
|
|
28462
|
-
} catch (err) {
|
|
28463
|
-
logger.warn(`cdk synth failed during reload; keeping previous version. (${describeAwsFailure(err).detail})`);
|
|
28464
|
-
return;
|
|
28465
|
-
}
|
|
28466
|
-
if (isClosing?.()) return;
|
|
28467
|
-
const newGroups = groupRoutesByServer(material.routes);
|
|
28468
|
-
const newByKey = new Map(newGroups.map((g) => [g.serverKey, g]));
|
|
28469
|
-
const oldKeys = new Set(servers.map((s) => s.group.serverKey));
|
|
28470
|
-
const newKeys = new Set(newByKey.keys());
|
|
28471
|
-
const added = [...newKeys].filter((k) => !oldKeys.has(k));
|
|
28472
|
-
const removed = [...oldKeys].filter((k) => !newKeys.has(k));
|
|
28473
|
-
if (added.length > 0) logger.warn(`Reload detected new API surface(s): ${added.join(", ")}. Restart 'cdkd local start-api' to serve them.`);
|
|
28474
|
-
if (removed.length > 0) logger.warn(`Reload detected removed API surface(s): ${removed.join(", ")}. Their servers will keep serving stale routes until restart.`);
|
|
28475
|
-
for (const booted of servers) {
|
|
28476
|
-
const group = newByKey.get(booted.group.serverKey);
|
|
28477
|
-
if (!group) continue;
|
|
28478
|
-
const newPool = buildPool(filterSpecsForGroup(group, material));
|
|
28479
|
-
const newState = {
|
|
28480
|
-
routes: group.routes,
|
|
28481
|
-
pool: newPool,
|
|
28482
|
-
corsConfigByApiId: corsConfigForGroup(group, material)
|
|
28483
|
-
};
|
|
28484
|
-
const previousState = booted.server.setServerState(newState);
|
|
28485
|
-
booted.group = group;
|
|
28486
|
-
const disposal = previousState.pool.dispose().catch((err) => {
|
|
28487
|
-
logger.debug(`Previous pool dispose() failed for ${group.displayName}: ${describeAwsFailure(err).detail}`);
|
|
28488
|
-
});
|
|
28489
|
-
retiredPoolDisposals?.add(disposal);
|
|
28490
|
-
disposal.then(() => retiredPoolDisposals?.delete(disposal));
|
|
28491
|
-
}
|
|
28492
|
-
printPerServerRouteTables(servers);
|
|
28493
|
-
const allRoutes = servers.flatMap((s) => s.group.routes.map((r) => r.route));
|
|
28494
|
-
warnUnsupportedRoutes(allRoutes, logger);
|
|
28495
|
-
warnSsrfRiskyIntegrations(allRoutes, logger);
|
|
28496
|
-
}
|
|
28497
|
-
|
|
28498
28439
|
// src/local/ecs-task-resolver/image.ts
|
|
28499
28440
|
const CDK_ASSET_IMAGE_REPO_RE = /(?:cdk-[a-z0-9]+|cdkd)-container-assets-/;
|
|
28500
28441
|
function extractEcrRepoComponent(uri) {
|
|
@@ -29295,6 +29236,10 @@ async function applyCrossStackResolverToTask(task, context) {
|
|
|
29295
29236
|
}
|
|
29296
29237
|
|
|
29297
29238
|
// src/cli/commands/local-start-api/state.ts
|
|
29239
|
+
function stateBundleKey(stackName, workload) {
|
|
29240
|
+
const real = awsEmulatorRealServices(workload);
|
|
29241
|
+
return real === void 0 ? stackName : JSON.stringify([stackName, real]);
|
|
29242
|
+
}
|
|
29298
29243
|
function envHasIntrinsicValue$1(templateEnv) {
|
|
29299
29244
|
if (!templateEnv) return false;
|
|
29300
29245
|
for (const v of Object.values(templateEnv)) {
|
|
@@ -29316,10 +29261,36 @@ async function loadStateForRoutedStacks(stacks, routes, routesWithAuth, options)
|
|
|
29316
29261
|
}
|
|
29317
29262
|
const stackHasIntrinsicEnv = (stackName) => intrinsicEnvStacks.has(stackName);
|
|
29318
29263
|
rejectExplicitCfnStackWithMultipleStacks(options, reachableStackNames.size);
|
|
29319
|
-
|
|
29264
|
+
const loads = /* @__PURE__ */ new Map();
|
|
29265
|
+
const lambdas = [];
|
|
29266
|
+
for (const ref of reachedLambdas(routes, routesWithAuth)) for (const owner of lambdaOwners(ref, stacks)) {
|
|
29267
|
+
const resource = owner.template.Resources?.[ref.logicalId];
|
|
29268
|
+
lambdas.push({
|
|
29269
|
+
stackName: owner.stackName,
|
|
29270
|
+
workload: {
|
|
29271
|
+
logicalId: ref.logicalId,
|
|
29272
|
+
cdkPath: resource ? readCdkPathOrUndefined(resource) : void 0
|
|
29273
|
+
}
|
|
29274
|
+
});
|
|
29275
|
+
}
|
|
29276
|
+
for (const { stackName } of lambdas) {
|
|
29277
|
+
const key = stateBundleKey(stackName, UNNAMED_WORKLOAD);
|
|
29278
|
+
if (!loads.has(key)) loads.set(key, {
|
|
29279
|
+
stackName,
|
|
29280
|
+
workload: UNNAMED_WORKLOAD
|
|
29281
|
+
});
|
|
29282
|
+
}
|
|
29283
|
+
for (const group of groupWorkloadsRoutedApart(lambdas, (l) => l.workload)) for (const { stackName } of group.items) {
|
|
29284
|
+
const key = stateBundleKey(stackName, group.workload);
|
|
29285
|
+
if (!loads.has(key)) loads.set(key, {
|
|
29286
|
+
stackName,
|
|
29287
|
+
workload: group.workload
|
|
29288
|
+
});
|
|
29289
|
+
}
|
|
29290
|
+
for (const [key, { stackName, workload }] of loads) {
|
|
29320
29291
|
const stack = stacks.find((s) => s.stackName === stackName);
|
|
29321
29292
|
if (!stack) continue;
|
|
29322
|
-
const provider = createLocalStateProvider$1(options, stack.stackName, stack.region);
|
|
29293
|
+
const provider = createLocalStateProvider$1(options, stack.stackName, stack.region, { workload });
|
|
29323
29294
|
if (!provider) continue;
|
|
29324
29295
|
try {
|
|
29325
29296
|
const loaded = await provider.load(stack.stackName, stack.region);
|
|
@@ -29338,7 +29309,7 @@ async function loadStateForRoutedStacks(stacks, routes, routesWithAuth, options)
|
|
|
29338
29309
|
const pseudo = await resolvePseudoParametersForStartApi(loaded.region, options);
|
|
29339
29310
|
if (pseudo) bundle.pseudoParameters = pseudo;
|
|
29340
29311
|
}
|
|
29341
|
-
out.set(
|
|
29312
|
+
out.set(key, bundle);
|
|
29342
29313
|
logger.debug(`${provider.label}: loaded state for ${stackName} (${loaded.region})`);
|
|
29343
29314
|
} finally {
|
|
29344
29315
|
provider.dispose();
|
|
@@ -29354,19 +29325,25 @@ async function resolvePseudoParametersForStartApi(stateRegion, options) {
|
|
|
29354
29325
|
try {
|
|
29355
29326
|
const { STSClient, GetCallerIdentityCommand } = await import("@aws-sdk/client-sts");
|
|
29356
29327
|
let sts;
|
|
29357
|
-
if (!options.fromState)
|
|
29328
|
+
if (!options.fromState) {
|
|
29329
|
+
const realAws = realAwsException("STS");
|
|
29330
|
+
sts = new STSClient({
|
|
29331
|
+
...awsClientDefaults({
|
|
29332
|
+
profile: options.profile,
|
|
29333
|
+
ignoreAssumedRole: true,
|
|
29334
|
+
realAws
|
|
29335
|
+
}),
|
|
29336
|
+
...region && { region },
|
|
29337
|
+
...options.profile && { profile: options.profile }
|
|
29338
|
+
});
|
|
29339
|
+
} else sts = new STSClient({
|
|
29358
29340
|
...awsClientDefaults({
|
|
29359
29341
|
profile: options.profile,
|
|
29360
|
-
|
|
29342
|
+
realAws: realAwsException("STS")
|
|
29361
29343
|
}),
|
|
29362
29344
|
...region && { region },
|
|
29363
29345
|
...options.profile && { profile: options.profile }
|
|
29364
29346
|
});
|
|
29365
|
-
else sts = new STSClient({
|
|
29366
|
-
...awsClientDefaults({ profile: options.profile }),
|
|
29367
|
-
...region && { region },
|
|
29368
|
-
...options.profile && { profile: options.profile }
|
|
29369
|
-
});
|
|
29370
29347
|
try {
|
|
29371
29348
|
accountId = (await sts.send(new GetCallerIdentityCommand({}))).Account;
|
|
29372
29349
|
} finally {
|
|
@@ -29387,6 +29364,263 @@ async function resolvePseudoParametersForStartApi(stateRegion, options) {
|
|
|
29387
29364
|
return Object.keys(bag).length === 0 ? void 0 : bag;
|
|
29388
29365
|
}
|
|
29389
29366
|
|
|
29367
|
+
// src/cli/commands/local-start-api/container-spec.ts
|
|
29368
|
+
async function buildContainerSpec(args) {
|
|
29369
|
+
const { logicalId, stacks, overrides, assumeRole, containerHost, debugPort, stsRegion, inlineTmpDirs, layerTmpDirs, stateByStack, stateSourceActive, skipPull, layerRoleArn, profileCredentials, profileCredsFile, profile, stackRegionOverride } = args;
|
|
29370
|
+
const lambda = resolveLambdaByLogicalId(logicalId, stacks);
|
|
29371
|
+
let codeDir;
|
|
29372
|
+
let optDir;
|
|
29373
|
+
let imageRef;
|
|
29374
|
+
let platform;
|
|
29375
|
+
if (lambda.kind === "zip") {
|
|
29376
|
+
codeDir = lambda.codePath ?? materializeInlineCode$1(lambda.handler, lambda.inlineCode ?? "", resolveRuntimeFileExtension(lambda.runtime), inlineTmpDirs);
|
|
29377
|
+
optDir = await materializeLambdaLayers$1(lambda.layers, layerTmpDirs, layerRoleArn, {
|
|
29378
|
+
logicalId,
|
|
29379
|
+
cdkPath: readCdkPathOrUndefined(lambda.resource)
|
|
29380
|
+
});
|
|
29381
|
+
platform = architectureToPlatform(lambda.architecture);
|
|
29382
|
+
} else {
|
|
29383
|
+
imageRef = (await resolveContainerImageForStartApi(lambda, skipPull)).imageRef;
|
|
29384
|
+
platform = architectureToPlatform(lambda.architecture);
|
|
29385
|
+
}
|
|
29386
|
+
let templateEnv = getTemplateEnv$1(lambda.resource);
|
|
29387
|
+
const stateBundle = stateByStack.get(stateBundleKey(lambda.stack.stackName, {
|
|
29388
|
+
logicalId,
|
|
29389
|
+
cdkPath: readCdkPathOrUndefined(lambda.resource)
|
|
29390
|
+
}));
|
|
29391
|
+
let stateAudit;
|
|
29392
|
+
if (stateBundle) {
|
|
29393
|
+
const context = { resources: stateBundle.state.resources };
|
|
29394
|
+
if (stateBundle.pseudoParameters) context.pseudoParameters = stateBundle.pseudoParameters;
|
|
29395
|
+
const { env, audit } = substituteEnvVarsFromState(templateEnv, context);
|
|
29396
|
+
templateEnv = env;
|
|
29397
|
+
stateAudit = audit;
|
|
29398
|
+
for (const key of audit.resolvedKeys) getLogger().debug(`Lambda ${logicalId}: --from-state substituted env var ${key}`);
|
|
29399
|
+
for (const { key, reason } of audit.unresolved) getLogger().warn(`Lambda ${logicalId}: --from-state could not substitute env var ${key} (${reason}). Override it via --env-vars or it will be dropped.`);
|
|
29400
|
+
}
|
|
29401
|
+
const lambdaCdkPath = readCdkPathOrUndefined(lambda.resource);
|
|
29402
|
+
const envResult = resolveEnvVars(logicalId, lambdaCdkPath, templateEnv, overrides);
|
|
29403
|
+
for (const key of envResult.unresolved) {
|
|
29404
|
+
if (stateAudit && stateAudit.unresolved.some((u) => u.key === key)) continue;
|
|
29405
|
+
const overrideKeyExample = lambdaCdkPath?.replace(/\/Resource$/, "") ?? logicalId;
|
|
29406
|
+
getLogger().warn(`Lambda ${logicalId}: env var ${key} contains a CloudFormation intrinsic and was dropped. Override it with --env-vars (e.g. {"${overrideKeyExample}":{"${key}":"<literal>"}}) or pass --from-state to recover deployed values.`);
|
|
29407
|
+
}
|
|
29408
|
+
warnAwsEmulatorStateSourceHint(envResult.unresolved.length, stateSourceActive === true);
|
|
29409
|
+
const plaintextKeys = new Set(stateAudit?.sensitiveKeys ?? []);
|
|
29410
|
+
for (const key of keysNotFromTemplate(templateEnv, envResult.resolved)) plaintextKeys.add(key);
|
|
29411
|
+
const dynamicRefs = createCallerDynamicReferenceResolver(profile);
|
|
29412
|
+
let dynamic;
|
|
29413
|
+
try {
|
|
29414
|
+
dynamic = await resolveDynamicReferencesInEnv(envResult.resolved, {
|
|
29415
|
+
workload: {
|
|
29416
|
+
logicalId,
|
|
29417
|
+
cdkPath: lambdaCdkPath
|
|
29418
|
+
},
|
|
29419
|
+
region: firstUsableRegion(stateBundle?.region, stackRegionOverride, lambda.stack.region, stsRegion),
|
|
29420
|
+
label: `Lambda ${logicalId}`,
|
|
29421
|
+
skipKeys: plaintextKeys,
|
|
29422
|
+
resolver: dynamicRefs
|
|
29423
|
+
});
|
|
29424
|
+
} finally {
|
|
29425
|
+
dynamicRefs.dispose();
|
|
29426
|
+
}
|
|
29427
|
+
const sensitiveKeyList = [...stateAudit?.sensitiveKeys ?? [], ...dynamic.resolvedKeys];
|
|
29428
|
+
const sensitiveEnvKeys = sensitiveKeyList.length > 0 ? new Set(sensitiveKeyList) : void 0;
|
|
29429
|
+
const dockerEnv = {
|
|
29430
|
+
AWS_LAMBDA_FUNCTION_NAME: logicalId,
|
|
29431
|
+
AWS_LAMBDA_FUNCTION_MEMORY_SIZE: String(lambda.memoryMb),
|
|
29432
|
+
AWS_LAMBDA_FUNCTION_TIMEOUT: String(lambda.timeoutSec),
|
|
29433
|
+
AWS_LAMBDA_FUNCTION_VERSION: "$LATEST",
|
|
29434
|
+
AWS_LAMBDA_LOG_GROUP_NAME: `/aws/lambda/${logicalId}`,
|
|
29435
|
+
AWS_LAMBDA_LOG_STREAM_NAME: "local",
|
|
29436
|
+
...dynamic.env
|
|
29437
|
+
};
|
|
29438
|
+
const roleArn = resolveStartApiAssumeRoleArn({
|
|
29439
|
+
logicalId,
|
|
29440
|
+
assumeRole,
|
|
29441
|
+
lambdaResource: lambda.resource,
|
|
29442
|
+
stateBundle
|
|
29443
|
+
});
|
|
29444
|
+
if (roleArn) {
|
|
29445
|
+
const creds = await assumeLambdaExecutionRole$1(roleArn, stsRegion);
|
|
29446
|
+
dockerEnv["AWS_ACCESS_KEY_ID"] = creds.accessKeyId;
|
|
29447
|
+
dockerEnv["AWS_SECRET_ACCESS_KEY"] = creds.secretAccessKey;
|
|
29448
|
+
dockerEnv["AWS_SESSION_TOKEN"] = creds.sessionToken;
|
|
29449
|
+
setContainerRegion(dockerEnv, stsRegion);
|
|
29450
|
+
} else {
|
|
29451
|
+
forwardAwsEnv$2(dockerEnv);
|
|
29452
|
+
const containerRegion = firstUsableRegion(stsRegion, lambda.stack.region);
|
|
29453
|
+
setContainerRegion(dockerEnv, containerRegion);
|
|
29454
|
+
if (profileCredentials) {
|
|
29455
|
+
dockerEnv["AWS_ACCESS_KEY_ID"] = profileCredentials.accessKeyId;
|
|
29456
|
+
dockerEnv["AWS_SECRET_ACCESS_KEY"] = profileCredentials.secretAccessKey;
|
|
29457
|
+
if (profileCredentials.sessionToken) dockerEnv["AWS_SESSION_TOKEN"] = profileCredentials.sessionToken;
|
|
29458
|
+
else delete dockerEnv["AWS_SESSION_TOKEN"];
|
|
29459
|
+
}
|
|
29460
|
+
if (profileCredsFile) {
|
|
29461
|
+
dockerEnv["AWS_SHARED_CREDENTIALS_FILE"] = profileCredsFile.containerPath;
|
|
29462
|
+
dockerEnv["AWS_PROFILE"] = profileCredsFile.profileName;
|
|
29463
|
+
}
|
|
29464
|
+
}
|
|
29465
|
+
if (debugPort !== void 0) dockerEnv["NODE_OPTIONS"] = `--inspect-brk=0.0.0.0:${debugPort}`;
|
|
29466
|
+
const tmpfs = lambda.ephemeralStorageMb !== void 0 ? {
|
|
29467
|
+
target: "/tmp",
|
|
29468
|
+
sizeMb: lambda.ephemeralStorageMb
|
|
29469
|
+
} : void 0;
|
|
29470
|
+
if (lambda.kind === "zip") return {
|
|
29471
|
+
kind: "zip",
|
|
29472
|
+
lambda,
|
|
29473
|
+
codeDir,
|
|
29474
|
+
platform,
|
|
29475
|
+
env: dockerEnv,
|
|
29476
|
+
...sensitiveEnvKeys !== void 0 && { sensitiveEnvKeys },
|
|
29477
|
+
containerHost,
|
|
29478
|
+
...optDir !== void 0 && { optDir },
|
|
29479
|
+
...debugPort !== void 0 && { debugPort },
|
|
29480
|
+
...tmpfs !== void 0 && { tmpfs },
|
|
29481
|
+
...profileCredsFile && { profileCredentialsFile: {
|
|
29482
|
+
hostPath: profileCredsFile.hostPath,
|
|
29483
|
+
containerPath: profileCredsFile.containerPath
|
|
29484
|
+
} }
|
|
29485
|
+
};
|
|
29486
|
+
const rie = await resolveRieWrap({
|
|
29487
|
+
image: imageRef,
|
|
29488
|
+
platform,
|
|
29489
|
+
entryPoint: lambda.imageConfig.entryPoint,
|
|
29490
|
+
command: lambda.imageConfig.command,
|
|
29491
|
+
skipPull
|
|
29492
|
+
});
|
|
29493
|
+
return {
|
|
29494
|
+
kind: "image",
|
|
29495
|
+
lambda,
|
|
29496
|
+
image: imageRef,
|
|
29497
|
+
platform,
|
|
29498
|
+
command: rie ? rie.cmd : lambda.imageConfig.command ?? [],
|
|
29499
|
+
...rie && {
|
|
29500
|
+
entryPoint: rie.entryPoint,
|
|
29501
|
+
rieMount: rie.mount
|
|
29502
|
+
},
|
|
29503
|
+
...!rie && lambda.imageConfig.entryPoint !== void 0 && lambda.imageConfig.entryPoint.length > 0 && { entryPoint: lambda.imageConfig.entryPoint },
|
|
29504
|
+
...lambda.imageConfig.workingDirectory !== void 0 && { workingDir: lambda.imageConfig.workingDirectory },
|
|
29505
|
+
env: dockerEnv,
|
|
29506
|
+
...sensitiveEnvKeys !== void 0 && { sensitiveEnvKeys },
|
|
29507
|
+
containerHost,
|
|
29508
|
+
...debugPort !== void 0 && { debugPort },
|
|
29509
|
+
...tmpfs !== void 0 && { tmpfs },
|
|
29510
|
+
...profileCredsFile && { profileCredentialsFile: {
|
|
29511
|
+
hostPath: profileCredsFile.hostPath,
|
|
29512
|
+
containerPath: profileCredsFile.containerPath
|
|
29513
|
+
} }
|
|
29514
|
+
};
|
|
29515
|
+
}
|
|
29516
|
+
async function resolveContainerImageForStartApi(lambda, skipPull) {
|
|
29517
|
+
const logger = getLogger();
|
|
29518
|
+
const localBuild = await resolveLocalBuildPlan$1(lambda);
|
|
29519
|
+
if (localBuild) return { imageRef: await buildContainerImage$1(localBuild.asset, localBuild.cdkOutDir, {
|
|
29520
|
+
assetOutdir: localBuild.assetOutdir,
|
|
29521
|
+
architecture: lambda.architecture
|
|
29522
|
+
}) };
|
|
29523
|
+
if (!parseEcrUri(lambda.imageUri)) throw new Error(`Container Lambda '${lambda.logicalId}' has no matching asset in cdk.out, and Code.ImageUri '${lambda.imageUri}' is not an ECR URI cdkd can authenticate against. Re-synthesize the CDK app (so cdk.out includes the build context) or deploy the image to ECR first.`);
|
|
29524
|
+
logger.info(`No matching cdk.out asset for ${lambda.imageUri}; falling back to ECR pull (uses your own credentials — this command has no --ecr-role-arn, so a cross-account image needs cross-account ECR permissions)...`);
|
|
29525
|
+
return { imageRef: await pullEcrImage(lambda.imageUri, {
|
|
29526
|
+
skipPull,
|
|
29527
|
+
workload: {
|
|
29528
|
+
logicalId: lambda.logicalId,
|
|
29529
|
+
cdkPath: readCdkPathOrUndefined(lambda.resource)
|
|
29530
|
+
}
|
|
29531
|
+
}) };
|
|
29532
|
+
}
|
|
29533
|
+
async function resolveLocalBuildPlan$1(lambda) {
|
|
29534
|
+
if (!lambda.stack.assetManifestPath) return void 0;
|
|
29535
|
+
const { manifestDir: cdkOutDir, assetOutdir } = assetPathDirs(lambda.stack);
|
|
29536
|
+
const manifest = await new AssetManifestLoader().loadStackManifest(lambda.stack, cdkOutDir);
|
|
29537
|
+
if (!manifest) return void 0;
|
|
29538
|
+
const entry = getDockerImageBySourceHash(manifest, lambda.imageUri);
|
|
29539
|
+
if (!entry) return void 0;
|
|
29540
|
+
return {
|
|
29541
|
+
asset: entry.asset,
|
|
29542
|
+
cdkOutDir,
|
|
29543
|
+
assetOutdir
|
|
29544
|
+
};
|
|
29545
|
+
}
|
|
29546
|
+
async function materializeLambdaLayers$1(layers, layerTmpDirs, layerRoleArn, workload) {
|
|
29547
|
+
if (layers.length === 0) return void 0;
|
|
29548
|
+
const flat = [];
|
|
29549
|
+
for (const layer of layers) {
|
|
29550
|
+
if (layer.kind === "asset") {
|
|
29551
|
+
flat.push({
|
|
29552
|
+
logicalId: layer.logicalId,
|
|
29553
|
+
assetPath: layer.assetPath
|
|
29554
|
+
});
|
|
29555
|
+
continue;
|
|
29556
|
+
}
|
|
29557
|
+
const dir = await materializeLayerFromArn(layer, {
|
|
29558
|
+
...workload && { workload },
|
|
29559
|
+
...layerRoleArn !== void 0 && { roleArn: explicitRoleArnOrThrow("--layer-role-arn", layerRoleArn) }
|
|
29560
|
+
});
|
|
29561
|
+
layerTmpDirs.add(dir);
|
|
29562
|
+
flat.push({
|
|
29563
|
+
logicalId: layer.arn,
|
|
29564
|
+
assetPath: dir
|
|
29565
|
+
});
|
|
29566
|
+
}
|
|
29567
|
+
if (flat.length === 1) return flat[0].assetPath;
|
|
29568
|
+
const dir = mkdtempSync(path.join(tmpdir(), "cdkd-local-start-api-layers-"));
|
|
29569
|
+
try {
|
|
29570
|
+
for (const layer of flat) copyLayerTreeLastWins(layer.assetPath, dir);
|
|
29571
|
+
} catch (error) {
|
|
29572
|
+
rmSync(dir, {
|
|
29573
|
+
recursive: true,
|
|
29574
|
+
force: true
|
|
29575
|
+
});
|
|
29576
|
+
throw error;
|
|
29577
|
+
}
|
|
29578
|
+
layerTmpDirs.add(dir);
|
|
29579
|
+
return dir;
|
|
29580
|
+
}
|
|
29581
|
+
|
|
29582
|
+
// src/cli/commands/local-start-api/reload.ts
|
|
29583
|
+
async function reloadAllServers(args) {
|
|
29584
|
+
const { synthesizeAndBuild, servers, buildPool, logger, isClosing, retiredPoolDisposals } = args;
|
|
29585
|
+
let material;
|
|
29586
|
+
try {
|
|
29587
|
+
material = await synthesizeAndBuild();
|
|
29588
|
+
} catch (err) {
|
|
29589
|
+
logger.warn(`cdk synth failed during reload; keeping previous version. (${describeAwsFailure(err).detail})`);
|
|
29590
|
+
return;
|
|
29591
|
+
}
|
|
29592
|
+
if (isClosing?.()) return;
|
|
29593
|
+
const newGroups = groupRoutesByServer(material.routes);
|
|
29594
|
+
const newByKey = new Map(newGroups.map((g) => [g.serverKey, g]));
|
|
29595
|
+
const oldKeys = new Set(servers.map((s) => s.group.serverKey));
|
|
29596
|
+
const newKeys = new Set(newByKey.keys());
|
|
29597
|
+
const added = [...newKeys].filter((k) => !oldKeys.has(k));
|
|
29598
|
+
const removed = [...oldKeys].filter((k) => !newKeys.has(k));
|
|
29599
|
+
if (added.length > 0) logger.warn(`Reload detected new API surface(s): ${added.join(", ")}. Restart 'cdkd local start-api' to serve them.`);
|
|
29600
|
+
if (removed.length > 0) logger.warn(`Reload detected removed API surface(s): ${removed.join(", ")}. Their servers will keep serving stale routes until restart.`);
|
|
29601
|
+
for (const booted of servers) {
|
|
29602
|
+
const group = newByKey.get(booted.group.serverKey);
|
|
29603
|
+
if (!group) continue;
|
|
29604
|
+
const newPool = buildPool(filterSpecsForGroup(group, material));
|
|
29605
|
+
const newState = {
|
|
29606
|
+
routes: group.routes,
|
|
29607
|
+
pool: newPool,
|
|
29608
|
+
corsConfigByApiId: corsConfigForGroup(group, material)
|
|
29609
|
+
};
|
|
29610
|
+
const previousState = booted.server.setServerState(newState);
|
|
29611
|
+
booted.group = group;
|
|
29612
|
+
const disposal = previousState.pool.dispose().catch((err) => {
|
|
29613
|
+
logger.debug(`Previous pool dispose() failed for ${group.displayName}: ${describeAwsFailure(err).detail}`);
|
|
29614
|
+
});
|
|
29615
|
+
retiredPoolDisposals?.add(disposal);
|
|
29616
|
+
disposal.then(() => retiredPoolDisposals?.delete(disposal));
|
|
29617
|
+
}
|
|
29618
|
+
printPerServerRouteTables(servers);
|
|
29619
|
+
const allRoutes = servers.flatMap((s) => s.group.routes.map((r) => r.route));
|
|
29620
|
+
warnUnsupportedRoutes(allRoutes, logger);
|
|
29621
|
+
warnSsrfRiskyIntegrations(allRoutes, logger);
|
|
29622
|
+
}
|
|
29623
|
+
|
|
29390
29624
|
// src/cli/commands/local-start-api/command.ts
|
|
29391
29625
|
function formatServerListeningBanner(scheme, host, port, pathSuffix, label) {
|
|
29392
29626
|
return `Server listening on ${scheme}://${formatAuthority(host, port)}${pathSuffix} (${label})\n`;
|
|
@@ -29473,7 +29707,8 @@ async function localStartApiCommand(target, options) {
|
|
|
29473
29707
|
...overrides !== void 0 && { overrides }
|
|
29474
29708
|
});
|
|
29475
29709
|
const corsConfigByStack = buildCorsConfigByStack(targetStacks);
|
|
29476
|
-
const
|
|
29710
|
+
const stateSourceActive = options.fromState || isCfnFlagPresent(options);
|
|
29711
|
+
const stateByStack = stateSourceActive ? await loadStateForRoutedStacks(targetStacks, routes, routesWithAuth, options) : /* @__PURE__ */ new Map();
|
|
29477
29712
|
const profileCredentials = await profileCredentialsForWorkload(options.profile, resolveProfileCredentials);
|
|
29478
29713
|
if (options.profile && profileCredentials && !profileCredsFile) profileCredsFile = await writeProfileCredentialsFile(options.profile, profileCredentials, {
|
|
29479
29714
|
onDirCreated: (hostPath) => {
|
|
@@ -29494,6 +29729,7 @@ async function localStartApiCommand(target, options) {
|
|
|
29494
29729
|
inlineTmpDirs,
|
|
29495
29730
|
layerTmpDirs,
|
|
29496
29731
|
stateByStack,
|
|
29732
|
+
stateSourceActive,
|
|
29497
29733
|
skipPull: options.pull === false,
|
|
29498
29734
|
...options.layerRoleArn !== void 0 && { layerRoleArn: options.layerRoleArn },
|
|
29499
29735
|
...profileCredentials && { profileCredentials },
|
|
@@ -29828,19 +30064,46 @@ var EcsSecretsResolutionError = class EcsSecretsResolutionError extends Error {
|
|
|
29828
30064
|
async function resolveEcsSecrets(entries, options = {}) {
|
|
29829
30065
|
if (entries.length === 0) return [];
|
|
29830
30066
|
const logger = getLogger().child("ecs-secrets");
|
|
29831
|
-
const
|
|
29832
|
-
|
|
29833
|
-
|
|
29834
|
-
|
|
29835
|
-
|
|
29836
|
-
|
|
29837
|
-
|
|
29838
|
-
|
|
29839
|
-
|
|
29840
|
-
|
|
30067
|
+
const owned = [];
|
|
30068
|
+
const secretsClients = /* @__PURE__ */ new Map();
|
|
30069
|
+
const ssmClients = /* @__PURE__ */ new Map();
|
|
30070
|
+
const secretsFor = (containerName) => {
|
|
30071
|
+
if (options.secretsManagerClient) return options.secretsManagerClient;
|
|
30072
|
+
const realAws = realAwsException("SECRETS_MANAGER", { containerName });
|
|
30073
|
+
let client = secretsClients.get(realAws);
|
|
30074
|
+
if (!client) {
|
|
30075
|
+
client = new SecretsManagerClient({
|
|
30076
|
+
...awsClientDefaults({
|
|
30077
|
+
ignoreAssumedRole: true,
|
|
30078
|
+
realAws
|
|
30079
|
+
}),
|
|
30080
|
+
...options.region && { region: options.region }
|
|
30081
|
+
});
|
|
30082
|
+
secretsClients.set(realAws, client);
|
|
30083
|
+
owned.push(client);
|
|
30084
|
+
}
|
|
30085
|
+
return client;
|
|
30086
|
+
};
|
|
30087
|
+
const ssmFor = (containerName) => {
|
|
30088
|
+
if (options.ssmClient) return options.ssmClient;
|
|
30089
|
+
const realAws = realAwsException("SSM", { containerName });
|
|
30090
|
+
let client = ssmClients.get(realAws);
|
|
30091
|
+
if (!client) {
|
|
30092
|
+
client = new SSMClient({
|
|
30093
|
+
...awsClientDefaults({
|
|
30094
|
+
ignoreAssumedRole: true,
|
|
30095
|
+
realAws
|
|
30096
|
+
}),
|
|
30097
|
+
...options.region && { region: options.region }
|
|
30098
|
+
});
|
|
30099
|
+
ssmClients.set(realAws, client);
|
|
30100
|
+
owned.push(client);
|
|
30101
|
+
}
|
|
30102
|
+
return client;
|
|
30103
|
+
};
|
|
29841
30104
|
try {
|
|
29842
30105
|
return await Promise.all(entries.map(async (entry) => {
|
|
29843
|
-
const value = await resolveOne(entry,
|
|
30106
|
+
const value = await resolveOne(entry, () => secretsFor(entry.containerName), () => ssmFor(entry.containerName));
|
|
29844
30107
|
logger.debug(`Resolved secret ${displayIdent(entry.containerName)}.${displayIdent(entry.name)} (${displayIdent(entry.valueFrom, { maxCodePoints: SECRET_REF_MAX_CODE_POINTS })})`);
|
|
29845
30108
|
return {
|
|
29846
30109
|
...entry,
|
|
@@ -29848,16 +30111,15 @@ async function resolveEcsSecrets(entries, options = {}) {
|
|
|
29848
30111
|
};
|
|
29849
30112
|
}));
|
|
29850
30113
|
} finally {
|
|
29851
|
-
|
|
29852
|
-
if (ownsSsmClient) ssmClient.destroy();
|
|
30114
|
+
for (const c of owned) c.destroy();
|
|
29853
30115
|
}
|
|
29854
30116
|
}
|
|
29855
30117
|
async function resolveOne(entry, secretsClient, ssmClient) {
|
|
29856
30118
|
const arn = entry.valueFrom;
|
|
29857
30119
|
const shape = classifySecretArn(arn);
|
|
29858
30120
|
switch (shape.kind) {
|
|
29859
|
-
case "secrets-manager": return resolveSecretsManager(entry, shape, secretsClient);
|
|
29860
|
-
case "ssm": return resolveSsm(entry, shape, ssmClient);
|
|
30121
|
+
case "secrets-manager": return resolveSecretsManager(entry, shape, secretsClient());
|
|
30122
|
+
case "ssm": return resolveSsm(entry, shape, ssmClient());
|
|
29861
30123
|
case "unknown": throw new EcsSecretsResolutionError(`Container ${displayIdent(entry.containerName)} secret ${displayIdent(entry.name)} references an unsupported ValueFrom shape ${displayIdent(arn, { maxCodePoints: SECRET_REF_MAX_CODE_POINTS })}. Expected Secrets Manager ARN (optionally with :<json-key>::) or SSM Parameter ARN.`);
|
|
29862
30124
|
}
|
|
29863
30125
|
}
|
|
@@ -30289,7 +30551,14 @@ function buildDockerRunArgs(opts) {
|
|
|
30289
30551
|
ownerPublish.push(publish);
|
|
30290
30552
|
}
|
|
30291
30553
|
const wiring = getActiveWorkloadAwsWiring();
|
|
30292
|
-
const
|
|
30554
|
+
const previewEnv = {};
|
|
30555
|
+
for (const [k, v] of Object.entries(container.environment)) defineOwnKey(previewEnv, k, v);
|
|
30556
|
+
if (opts.envOverrides) {
|
|
30557
|
+
applyOverrideMap(previewEnv, opts.envOverrides["Parameters"]);
|
|
30558
|
+
applyOverrideMap(previewEnv, opts.envOverrides[container.name]);
|
|
30559
|
+
}
|
|
30560
|
+
const emulatorKeysOnly = workloadGetsEmulatorKeysOnly(previewEnv, wiring);
|
|
30561
|
+
const profileCredentialsFile = emulatorKeysOnly ? void 0 : opts.profileCredentialsFile;
|
|
30293
30562
|
if (profileCredentialsFile) both("-v", `${profileCredentialsFile.hostPath}:${profileCredentialsFile.containerPath}:ro`);
|
|
30294
30563
|
for (const m of wiring?.mounts ?? []) if (!container.mountPoints.some((mp) => mp.containerPath === m.containerPath)) both("-v", `${m.hostPath}:${m.containerPath}:ro`);
|
|
30295
30564
|
for (const mp of container.mountPoints) {
|
|
@@ -30314,6 +30583,12 @@ function buildDockerRunArgs(opts) {
|
|
|
30314
30583
|
...opts.sidecarIp !== void 0 && { sidecarIp: opts.sidecarIp }
|
|
30315
30584
|
});
|
|
30316
30585
|
Object.assign(finalEnv, metaEnv);
|
|
30586
|
+
if (opts.mixedModeRealCredentials && wiring?.mixed && !emulatorKeysOnly) {
|
|
30587
|
+
delete finalEnv["AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"];
|
|
30588
|
+
finalEnv["AWS_ACCESS_KEY_ID"] = opts.mixedModeRealCredentials.accessKeyId;
|
|
30589
|
+
finalEnv["AWS_SECRET_ACCESS_KEY"] = opts.mixedModeRealCredentials.secretAccessKey;
|
|
30590
|
+
if (opts.mixedModeRealCredentials.sessionToken) finalEnv["AWS_SESSION_TOKEN"] = opts.mixedModeRealCredentials.sessionToken;
|
|
30591
|
+
}
|
|
30317
30592
|
if (profileCredentialsFile) {
|
|
30318
30593
|
finalEnv["AWS_SHARED_CREDENTIALS_FILE"] = profileCredentialsFile.containerPath;
|
|
30319
30594
|
finalEnv["AWS_PROFILE"] = profileCredentialsFile.profileName;
|
|
@@ -30418,6 +30693,7 @@ async function prepareOneImage(task, container, options) {
|
|
|
30418
30693
|
await pullImage(image.uri, options.skipPull);
|
|
30419
30694
|
return image.uri;
|
|
30420
30695
|
case "ecr": return pullEcrImage(image.uri, {
|
|
30696
|
+
workload: { containerName: container.name },
|
|
30421
30697
|
skipPull: options.skipPull,
|
|
30422
30698
|
...options.region !== void 0 && { region: options.region },
|
|
30423
30699
|
...options.ecrRoleArn !== void 0 && { ecrRoleArn: options.ecrRoleArn }
|
|
@@ -30505,16 +30781,19 @@ async function realizeDockerVolumes(volumes, state) {
|
|
|
30505
30781
|
// src/local/ecs-task-runner/loopback-forwarder.ts
|
|
30506
30782
|
const execFileAsync$2 = promisify(execFile);
|
|
30507
30783
|
async function startNamespaceForwarder(state, forwarder, containerName, ports, wiring) {
|
|
30508
|
-
const label = wiring.mode === "emulator" ? `--aws-emulator ${wiring.emulatorEndpoint?.url ?? ""}` : "The AWS endpoint override (AWS_ENDPOINT_URL*)";
|
|
30784
|
+
const label = wiring.mode === "emulator" ? `--aws-emulator ${wiring.emulatorEndpoint?.url ?? ""}` : wiring.mixed ? `--aws-emulator ${wiring.mixed.emulatorEndpoint.url} (mixed mode)` : "The AWS endpoint override (AWS_ENDPOINT_URL*)";
|
|
30785
|
+
const plan = loopbackForwarderPlan(wiring, ports);
|
|
30786
|
+
const fatal = wiring.mode === "emulator" || plan.resignConfigHostPath !== void 0;
|
|
30509
30787
|
await prepareLocalLoopbackForwarder(wiring);
|
|
30510
30788
|
const { name } = forwarder;
|
|
30511
30789
|
const args = buildNamespaceOwnerForwarderDockerArgs({
|
|
30512
30790
|
name,
|
|
30513
30791
|
namespace: forwarder.namespace,
|
|
30514
|
-
ports,
|
|
30792
|
+
ports: plan.ports,
|
|
30515
30793
|
probe: wiring.probeHealth ? "health" : "tcp",
|
|
30516
30794
|
...wiring.caHostPath ? { caHostPath: wiring.caHostPath } : {},
|
|
30517
|
-
...wiring.skipPull ? { skipPull: true } : {}
|
|
30795
|
+
...wiring.skipPull ? { skipPull: true } : {},
|
|
30796
|
+
...plan.resignConfigHostPath ? { resignConfigHostPath: plan.resignConfigHostPath } : {}
|
|
30518
30797
|
});
|
|
30519
30798
|
getLogger().child("ecs-runner").debug(`Starting loopback forwarder ${name} for ports ${ports.join(",")}`);
|
|
30520
30799
|
try {
|
|
@@ -30534,8 +30813,8 @@ async function startNamespaceForwarder(state, forwarder, containerName, ports, w
|
|
|
30534
30813
|
} catch (err) {
|
|
30535
30814
|
if (state.closing) throw interruptedError();
|
|
30536
30815
|
await removeNamespaceForwarder(state, name);
|
|
30537
|
-
if (
|
|
30538
|
-
return failed(state,
|
|
30816
|
+
if (fatal) throw err;
|
|
30817
|
+
return failed(state, fatal, `start:${containerName}`, `${label}: ${err.message}`);
|
|
30539
30818
|
}
|
|
30540
30819
|
let result;
|
|
30541
30820
|
try {
|
|
@@ -30543,12 +30822,12 @@ async function startNamespaceForwarder(state, forwarder, containerName, ports, w
|
|
|
30543
30822
|
} catch (err) {
|
|
30544
30823
|
if (state.closing) throw interruptedError();
|
|
30545
30824
|
await removeNamespaceForwarder(state, name);
|
|
30546
|
-
return failed(state,
|
|
30825
|
+
return failed(state, fatal, `start:${containerName}`, `${label}: ${err.message}`);
|
|
30547
30826
|
}
|
|
30548
30827
|
if (state.closing) throw interruptedError();
|
|
30549
30828
|
if (result.ok) return true;
|
|
30550
30829
|
await removeNamespaceForwarder(state, name);
|
|
30551
|
-
return failed(state,
|
|
30830
|
+
return failed(state, fatal, String(result.failedPort ?? 0), describeForwarderFailure(result, label));
|
|
30552
30831
|
}
|
|
30553
30832
|
async function runForwarderContainer(args, containerName) {
|
|
30554
30833
|
try {
|
|
@@ -30561,8 +30840,8 @@ async function removeNamespaceForwarder(state, name) {
|
|
|
30561
30840
|
await removeContainer(name);
|
|
30562
30841
|
state.forwarders = state.forwarders.filter((f) => f.name !== name);
|
|
30563
30842
|
}
|
|
30564
|
-
function failed(state,
|
|
30565
|
-
if (
|
|
30843
|
+
function failed(state, fatal, key, message) {
|
|
30844
|
+
if (fatal) throw new CdkdError(message, "LOCAL_AWS_EMULATOR_FORWARDER_FAILED");
|
|
30566
30845
|
state.forwarderWarnings ??= /* @__PURE__ */ new Set();
|
|
30567
30846
|
if (!state.forwarderWarnings.has(key)) {
|
|
30568
30847
|
state.forwarderWarnings.add(key);
|
|
@@ -30587,10 +30866,12 @@ function describeDetachedForwarders(state) {
|
|
|
30587
30866
|
const forwarders = joined.map((f) => f.name).join(", ");
|
|
30588
30867
|
return safeMsg`Under the loopback AWS endpoint, these task containers share the network of a forwarder container, so that filter does not list them: ${containers}. Remove them before their forwarders: ${forwarders}.`;
|
|
30589
30868
|
}
|
|
30869
|
+
const DROPPED_ENTRY = /(?:^|: )(?:Environment|Secret) '.*' dropped:/;
|
|
30590
30870
|
async function runEcsTask(task, options, state) {
|
|
30591
30871
|
const logger = getLogger();
|
|
30592
30872
|
if (task.containers.length === 0) throw new EcsTaskRunnerError(`Task '${task.taskDefinitionLogicalId}' has no containers — nothing to run.`);
|
|
30593
30873
|
for (const w of task.warnings) logger.warn(w);
|
|
30874
|
+
warnAwsEmulatorStateSourceHint(task.warnings.filter((w) => DROPPED_ENTRY.test(w)).length, options.stateSourceGiven === true);
|
|
30594
30875
|
const dag = buildDependencyGraph(task.containers);
|
|
30595
30876
|
const startOrder = topoSort(dag, task.containers);
|
|
30596
30877
|
const finchRefusals = [];
|
|
@@ -30640,6 +30921,7 @@ async function runEcsTask(task, options, state) {
|
|
|
30640
30921
|
const tokenKeys = new Set(dynamicReferenceEnvKeys(c, options.envOverrides));
|
|
30641
30922
|
if (tokenKeys.size === 0) continue;
|
|
30642
30923
|
dynamicEnvByContainer.set(c.name, await resolveDynamicReferencesInEnv(c.environment, {
|
|
30924
|
+
workload: { containerName: c.name },
|
|
30643
30925
|
region: firstUsableRegion(options.stateRecordRegion, options.stackRegion, task.stack.region, options.region),
|
|
30644
30926
|
label: `Container ${c.name}`,
|
|
30645
30927
|
skipKeys: new Set(Object.keys(c.environment).filter((k) => !tokenKeys.has(k))),
|
|
@@ -30715,7 +30997,8 @@ async function runEcsTask(task, options, state) {
|
|
|
30715
30997
|
...options.skipHostPortPublish ? { skipHostPortPublish: true } : {},
|
|
30716
30998
|
...mergedAddHostFlags.length > 0 ? { addHostFlags: mergedAddHostFlags } : {},
|
|
30717
30999
|
...(options.networkAliasesByContainer?.get(container.name)?.length ?? 0) > 0 ? { networkAliases: options.networkAliasesByContainer.get(container.name) } : {},
|
|
30718
|
-
...options.profileCredentialsFile && { profileCredentialsFile: options.profileCredentialsFile }
|
|
31000
|
+
...options.profileCredentialsFile && { profileCredentialsFile: options.profileCredentialsFile },
|
|
31001
|
+
...options.mixedModeRealCredentials && { mixedModeRealCredentials: options.mixedModeRealCredentials }
|
|
30719
31002
|
});
|
|
30720
31003
|
dockerCmds.set(container.name, built.args);
|
|
30721
31004
|
dockerLoopbackPorts.set(container.name, built.loopbackPorts);
|
|
@@ -30813,13 +31096,17 @@ async function resolvePlaceholderAccount(arn, source) {
|
|
|
30813
31096
|
if (readFromCfnStack(source)) sts = new STSClient({
|
|
30814
31097
|
...awsClientDefaults({
|
|
30815
31098
|
profile,
|
|
30816
|
-
ignoreAssumedRole: true
|
|
31099
|
+
ignoreAssumedRole: true,
|
|
31100
|
+
realAws: realAwsException("STS")
|
|
30817
31101
|
}),
|
|
30818
31102
|
...region && { region },
|
|
30819
31103
|
...profile && { profile }
|
|
30820
31104
|
});
|
|
30821
31105
|
else sts = new STSClient({
|
|
30822
|
-
...awsClientDefaults({
|
|
31106
|
+
...awsClientDefaults({
|
|
31107
|
+
profile,
|
|
31108
|
+
realAws: realAwsException("STS")
|
|
31109
|
+
}),
|
|
30823
31110
|
...region && { region },
|
|
30824
31111
|
...profile && { profile }
|
|
30825
31112
|
});
|
|
@@ -30839,7 +31126,10 @@ async function assumeTaskRole(roleArn, region) {
|
|
|
30839
31126
|
assertSendableRoleArn(roleArn);
|
|
30840
31127
|
const { STSClient } = await import("@aws-sdk/client-sts");
|
|
30841
31128
|
const sts = new STSClient({
|
|
30842
|
-
...awsClientDefaults({
|
|
31129
|
+
...awsClientDefaults({
|
|
31130
|
+
ignoreAssumedRole: true,
|
|
31131
|
+
realAws: mixedModeActive()
|
|
31132
|
+
}),
|
|
30843
31133
|
...region && { region }
|
|
30844
31134
|
});
|
|
30845
31135
|
try {
|
|
@@ -30869,13 +31159,17 @@ async function resolveStackAccountId$1(source) {
|
|
|
30869
31159
|
if (readFromCfnStack(source)) sts = new STSClient({
|
|
30870
31160
|
...awsClientDefaults({
|
|
30871
31161
|
profile,
|
|
30872
|
-
ignoreAssumedRole: true
|
|
31162
|
+
ignoreAssumedRole: true,
|
|
31163
|
+
realAws: realAwsException("STS")
|
|
30873
31164
|
}),
|
|
30874
31165
|
...region && { region },
|
|
30875
31166
|
...profile && { profile }
|
|
30876
31167
|
});
|
|
30877
31168
|
else sts = new STSClient({
|
|
30878
|
-
...awsClientDefaults({
|
|
31169
|
+
...awsClientDefaults({
|
|
31170
|
+
profile,
|
|
31171
|
+
realAws: realAwsException("STS")
|
|
31172
|
+
}),
|
|
30879
31173
|
...region && { region },
|
|
30880
31174
|
...profile && { profile }
|
|
30881
31175
|
});
|
|
@@ -30968,7 +31262,7 @@ function readEnvOverridesFile$2(filePath) {
|
|
|
30968
31262
|
if (!filePath) return void 0;
|
|
30969
31263
|
let raw;
|
|
30970
31264
|
try {
|
|
30971
|
-
raw =
|
|
31265
|
+
raw = readEnvVarsFileText(filePath);
|
|
30972
31266
|
} catch (err) {
|
|
30973
31267
|
throw new Error(`Failed to read --env-vars file '${filePath}': ${describeAwsFailure(err).detail}`);
|
|
30974
31268
|
}
|
|
@@ -30987,12 +31281,21 @@ function readEnvOverridesFile$2(filePath) {
|
|
|
30987
31281
|
async function resolveSidecarCredentials(options, assumedCredentials) {
|
|
30988
31282
|
const wiring = getActiveWorkloadAwsWiring();
|
|
30989
31283
|
if (wiring?.mode === "emulator") return wiring.emulatorCredentials;
|
|
31284
|
+
if (wiring?.mixed) return wiring.mixed.emulatorCredentials;
|
|
30990
31285
|
if (assumedCredentials) return assumedCredentials;
|
|
30991
31286
|
if (options.profile) return resolveProfileCredentials(options.profile);
|
|
30992
31287
|
return resolveHostDefaultCredentials();
|
|
30993
31288
|
}
|
|
30994
31289
|
async function resolveTaskCredentialChannels(options, assumedCredentials, opts) {
|
|
30995
31290
|
const sidecarCredentials = await resolveSidecarCredentials(options, assumedCredentials);
|
|
31291
|
+
if (getActiveWorkloadAwsWiring()?.mixed) {
|
|
31292
|
+
const real = assumedCredentials ?? (options.profile ? await resolveProfileCredentials(options.profile) : await resolveHostDefaultCredentials());
|
|
31293
|
+
return {
|
|
31294
|
+
sidecarCredentials,
|
|
31295
|
+
profileCredsFile: void 0,
|
|
31296
|
+
...real && { mixedModeRealCredentials: real }
|
|
31297
|
+
};
|
|
31298
|
+
}
|
|
30996
31299
|
const emulator = getActiveWorkloadAwsWiring()?.mode === "emulator";
|
|
30997
31300
|
if (options.profile && sidecarCredentials && !assumedCredentials && !emulator) return {
|
|
30998
31301
|
sidecarCredentials,
|
|
@@ -31013,6 +31316,7 @@ function buildRunEcsTaskOptions(options, channels, extra = {}) {
|
|
|
31013
31316
|
};
|
|
31014
31317
|
if (extra.envOverrides) runOpts.envOverrides = extra.envOverrides;
|
|
31015
31318
|
if (channels.sidecarCredentials) runOpts.taskCredentials = channels.sidecarCredentials;
|
|
31319
|
+
if (channels.mixedModeRealCredentials) runOpts.mixedModeRealCredentials = channels.mixedModeRealCredentials;
|
|
31016
31320
|
if (extra.resolvedRoleArn) runOpts.taskRoleArn = extra.resolvedRoleArn;
|
|
31017
31321
|
if (options.platform) runOpts.platformOverride = options.platform;
|
|
31018
31322
|
if (options.region) runOpts.region = options.region;
|
|
@@ -31149,9 +31453,10 @@ async function localRunTaskCommand(target, options) {
|
|
|
31149
31453
|
const parsed = parseEcsTarget(target);
|
|
31150
31454
|
const candidate = pickCandidateStack(parsed, target, stacks);
|
|
31151
31455
|
refuseFailedLookups(candidate ? [candidate] : [], stacks, failedLookups);
|
|
31152
|
-
stateProvider = createLocalStateProvider$1(options, candidate?.stackName ?? "", candidate?.region);
|
|
31456
|
+
stateProvider = createLocalStateProvider$1(options, candidate?.stackName ?? "", candidate?.region, getActiveWorkloadAwsWiring$1()?.mixed ? { workload: UNNAMED_WORKLOAD } : {});
|
|
31153
31457
|
const { context: imageContext, stateRecordRegion } = await buildEcsImageResolutionContext$1(candidate, stateProvider, options);
|
|
31154
31458
|
const task = resolveEcsTaskTarget(target, stacks, imageContext);
|
|
31459
|
+
await applyPerContainerNames(task, target, stacks, candidate, options, imageContext);
|
|
31155
31460
|
const canPrompt = options.interactiveOverrides !== false && Boolean(process.stdin.isTTY && process.stdout.isTTY);
|
|
31156
31461
|
if (!options.imageOverride?.length && !canPrompt) assertEcsTaskImagesResolvable(task);
|
|
31157
31462
|
logger.info(`Target: ${task.stack.stackName}/${task.taskDefinitionLogicalId} (family=${task.family}, containers=${task.containers.length})`);
|
|
@@ -31167,9 +31472,10 @@ async function localRunTaskCommand(target, options) {
|
|
|
31167
31472
|
...imageContext?.pseudoParameters && { pseudoParameters: imageContext.pseudoParameters },
|
|
31168
31473
|
consumerRegion,
|
|
31169
31474
|
crossStackResolver: resolver,
|
|
31170
|
-
resolveDynamicReferences: (value, producerRegion) => dynamicRefs.resolveString(value, {
|
|
31475
|
+
resolveDynamicReferences: (value, producerRegion, workload) => dynamicRefs.resolveString(value, {
|
|
31171
31476
|
region: producerRegion,
|
|
31172
31477
|
consumer: `Task ${task.taskDefinitionLogicalId} cross-stack env value`,
|
|
31478
|
+
workload,
|
|
31173
31479
|
overridable: false
|
|
31174
31480
|
})
|
|
31175
31481
|
};
|
|
@@ -31217,6 +31523,7 @@ async function localRunTaskCommand(target, options) {
|
|
|
31217
31523
|
});
|
|
31218
31524
|
const hostGatewayExtraHosts = await resolveHostGatewayExtraHosts();
|
|
31219
31525
|
if (hostGatewayExtraHosts.length > 0) runOpts.hostGatewayExtraHosts = hostGatewayExtraHosts;
|
|
31526
|
+
if (stateProvider) runOpts.stateSourceGiven = true;
|
|
31220
31527
|
const imageOverrideResult = await resolveRunTaskImageOverride({
|
|
31221
31528
|
task,
|
|
31222
31529
|
target,
|
|
@@ -31252,6 +31559,32 @@ async function localRunTaskCommand(target, options) {
|
|
|
31252
31559
|
if (sigintHandler) process.off("SIGINT", sigintHandler);
|
|
31253
31560
|
}
|
|
31254
31561
|
}
|
|
31562
|
+
async function applyPerContainerNames(task, target, stacks, candidate, options, baseContext) {
|
|
31563
|
+
if (!getActiveWorkloadAwsWiring$1()?.mixed || !candidate || !baseContext) return;
|
|
31564
|
+
const groups = groupWorkloadsRoutedApart(task.containers, (c) => ({ containerName: c.name }));
|
|
31565
|
+
for (const group of groups) {
|
|
31566
|
+
const names = group.items.map((c) => c.name);
|
|
31567
|
+
const provider = createLocalStateProvider$1(options, candidate.stackName, candidate.region, { workload: group.workload });
|
|
31568
|
+
if (!provider) continue;
|
|
31569
|
+
try {
|
|
31570
|
+
const loaded = await provider.load(candidate.stackName, candidate.region);
|
|
31571
|
+
if (!loaded) continue;
|
|
31572
|
+
const own = resolveEcsTaskTarget(target, stacks, {
|
|
31573
|
+
...baseContext,
|
|
31574
|
+
stateResources: loaded.resources
|
|
31575
|
+
});
|
|
31576
|
+
for (const name of names) {
|
|
31577
|
+
const mine = own.containers.find((c) => c.name === name);
|
|
31578
|
+
const into = task.containers.find((c) => c.name === name);
|
|
31579
|
+
if (!mine || !into) continue;
|
|
31580
|
+
into.environment = mine.environment;
|
|
31581
|
+
into.secrets = mine.secrets;
|
|
31582
|
+
}
|
|
31583
|
+
} finally {
|
|
31584
|
+
provider.dispose();
|
|
31585
|
+
}
|
|
31586
|
+
}
|
|
31587
|
+
}
|
|
31255
31588
|
|
|
31256
31589
|
// src/cli/commands/local-run-task.ts
|
|
31257
31590
|
function createLocalRunTaskCommand() {
|
|
@@ -31606,7 +31939,7 @@ function readEnvOverridesFile$1(filePath) {
|
|
|
31606
31939
|
if (!filePath) return void 0;
|
|
31607
31940
|
let raw;
|
|
31608
31941
|
try {
|
|
31609
|
-
raw =
|
|
31942
|
+
raw = readEnvVarsFileText(filePath);
|
|
31610
31943
|
} catch (err) {
|
|
31611
31944
|
throw new CdkdError(`Failed to read --env-vars file '${filePath}': ${describeAwsFailure(err).detail}`, "LOCAL_INVOKE_AGENTCORE_ENV_VARS_READ_FAILED");
|
|
31612
31945
|
}
|
|
@@ -31634,6 +31967,10 @@ async function buildContainerEnvWith(resolved, options, profileCredentials, prof
|
|
|
31634
31967
|
const logger = getLogger();
|
|
31635
31968
|
const overrides = readEnvOverridesFile$1(options.envVars);
|
|
31636
31969
|
const cdkPath = readCdkPathOrUndefined(resolved.resource);
|
|
31970
|
+
const workload = {
|
|
31971
|
+
logicalId: resolved.logicalId,
|
|
31972
|
+
cdkPath
|
|
31973
|
+
};
|
|
31637
31974
|
const overriddenKeys = keysOverriddenBy(resolved.environmentVariables, (env) => resolveEnvVars(resolved.logicalId, cdkPath, env, overrides).resolved);
|
|
31638
31975
|
let templateEnv = withoutKeys(resolved.environmentVariables, overriddenKeys);
|
|
31639
31976
|
const sensitiveEnvKeys = /* @__PURE__ */ new Set();
|
|
@@ -31643,7 +31980,8 @@ async function buildContainerEnvWith(resolved, options, profileCredentials, prof
|
|
|
31643
31980
|
consumerRegion: loaded.region,
|
|
31644
31981
|
resolveDynamicReferences: (value, producerRegion) => dynamicRefs.resolveString(value, {
|
|
31645
31982
|
region: producerRegion,
|
|
31646
|
-
consumer: `AgentCore Runtime ${resolved.logicalId} cross-stack env value
|
|
31983
|
+
consumer: `AgentCore Runtime ${resolved.logicalId} cross-stack env value`,
|
|
31984
|
+
workload
|
|
31647
31985
|
})
|
|
31648
31986
|
};
|
|
31649
31987
|
const pseudo = imageContext?.pseudoParameters ?? derivePseudoParametersFromRegion$1(loaded.region);
|
|
@@ -31663,9 +32001,11 @@ async function buildContainerEnvWith(resolved, options, profileCredentials, prof
|
|
|
31663
32001
|
const overrideKeyExample = cdkPath?.replace(/\/Resource$/, "") ?? resolved.logicalId;
|
|
31664
32002
|
logger.warn(`Environment variable ${key} contains a CloudFormation intrinsic and was dropped. Override it with --env-vars (e.g. {"${overrideKeyExample}":{"${key}":"<literal>"}}), or pass a state-source flag (e.g. --from-cfn-stack) to recover deployed values.`);
|
|
31665
32003
|
}
|
|
32004
|
+
warnAwsEmulatorStateSourceHint(envResult.unresolved.length, stateProvider !== void 0);
|
|
31666
32005
|
const skipKeys = keysNotFromTemplate(templateEnv, envResult.resolved);
|
|
31667
32006
|
for (const key of sensitiveEnvKeys) skipKeys.add(key);
|
|
31668
32007
|
const dynamic = await resolveDynamicReferencesInEnv(envResult.resolved, {
|
|
32008
|
+
workload,
|
|
31669
32009
|
region: firstUsableRegion(loaded?.region, options.stackRegion, resolved.stack.region, options.region),
|
|
31670
32010
|
label: `AgentCore Runtime ${resolved.logicalId}`,
|
|
31671
32011
|
skipKeys,
|
|
@@ -31694,13 +32034,17 @@ async function resolveStackAccountId(region, profile, fromState, fromCfnStack) {
|
|
|
31694
32034
|
if (!fromState && fromCfnStack !== void 0 && fromCfnStack !== false) sts = new STSClient({
|
|
31695
32035
|
...awsClientDefaults({
|
|
31696
32036
|
profile,
|
|
31697
|
-
ignoreAssumedRole: true
|
|
32037
|
+
ignoreAssumedRole: true,
|
|
32038
|
+
realAws: realAwsException("STS")
|
|
31698
32039
|
}),
|
|
31699
32040
|
...region && { region },
|
|
31700
32041
|
...profile && { profile }
|
|
31701
32042
|
});
|
|
31702
32043
|
else sts = new STSClient({
|
|
31703
|
-
...awsClientDefaults({
|
|
32044
|
+
...awsClientDefaults({
|
|
32045
|
+
profile,
|
|
32046
|
+
realAws: realAwsException("STS")
|
|
32047
|
+
}),
|
|
31704
32048
|
...region && { region },
|
|
31705
32049
|
...profile && { profile }
|
|
31706
32050
|
});
|
|
@@ -31785,7 +32129,10 @@ async function assumeAgentCoreExecutionRole(roleArn, region) {
|
|
|
31785
32129
|
assertSendableRoleArn(roleArn, (m) => new CdkdError(m, "LOCAL_INVOKE_AGENTCORE_ASSUME_ROLE_INVALID"));
|
|
31786
32130
|
const { STSClient } = await import("@aws-sdk/client-sts");
|
|
31787
32131
|
const sts = new STSClient({
|
|
31788
|
-
...awsClientDefaults({
|
|
32132
|
+
...awsClientDefaults({
|
|
32133
|
+
ignoreAssumedRole: true,
|
|
32134
|
+
realAws: mixedModeActive()
|
|
32135
|
+
}),
|
|
31789
32136
|
...region && { region }
|
|
31790
32137
|
});
|
|
31791
32138
|
try {
|
|
@@ -31897,6 +32244,10 @@ async function resolveAgentCoreImage(resolved, options, assemblyDir, loaded) {
|
|
|
31897
32244
|
if (parseEcrUri(containerUri)) {
|
|
31898
32245
|
logger.info(`Pulling agent image from ECR: ${containerUri}`);
|
|
31899
32246
|
return pullEcrImage(containerUri, {
|
|
32247
|
+
workload: {
|
|
32248
|
+
logicalId: resolved.logicalId,
|
|
32249
|
+
cdkPath: readCdkPathOrUndefined(resolved.resource)
|
|
32250
|
+
},
|
|
31900
32251
|
skipPull: options.pull === false,
|
|
31901
32252
|
...options.region !== void 0 && { region: options.region },
|
|
31902
32253
|
...options.ecrRoleArn !== void 0 && { ecrRoleArn: options.ecrRoleArn },
|
|
@@ -31952,6 +32303,10 @@ async function resolveAgentCoreCodeImageFromS3(resolved, code, s3Source, options
|
|
|
31952
32303
|
}));
|
|
31953
32304
|
}
|
|
31954
32305
|
const bundle = await downloadAndExtractS3Bundle(location, {
|
|
32306
|
+
workload: {
|
|
32307
|
+
logicalId: resolved.logicalId,
|
|
32308
|
+
cdkPath: readCdkPathOrUndefined(resolved.resource)
|
|
32309
|
+
},
|
|
31955
32310
|
...region !== void 0 && { region },
|
|
31956
32311
|
...options.profile !== void 0 && { profile: options.profile },
|
|
31957
32312
|
...credentials !== void 0 && { credentials }
|
|
@@ -32325,7 +32680,7 @@ async function localInvokeAgentCoreCommand(target, options) {
|
|
|
32325
32680
|
});
|
|
32326
32681
|
const candidate = pickAgentCoreCandidateStack$1(resolvedTarget, stacks);
|
|
32327
32682
|
refuseFailedLookups(candidate ? [candidate] : [], stacks, failedLookups);
|
|
32328
|
-
stateProvider = createLocalStateProvider$1(options, candidate?.stackName ?? "", await resolveCfnFallbackRegion(options, candidate?.region));
|
|
32683
|
+
stateProvider = createLocalStateProvider$1(options, candidate?.stackName ?? "", await resolveCfnFallbackRegion(options, candidate?.region), { workload: agentCoreTargetWorkload(resolvedTarget, stacks) });
|
|
32329
32684
|
const { context: imageContext, loaded: loadedState } = stateProvider && candidate ? await buildAgentCoreImageContext(candidate, stateProvider, options) : {
|
|
32330
32685
|
context: void 0,
|
|
32331
32686
|
loaded: void 0
|
|
@@ -32522,6 +32877,16 @@ async function localInvokeAgentCoreCommand(target, options) {
|
|
|
32522
32877
|
if (sigintHandler) process.off("SIGINT", sigintHandler);
|
|
32523
32878
|
}
|
|
32524
32879
|
}
|
|
32880
|
+
function agentCoreTargetWorkload(target, stacks) {
|
|
32881
|
+
const hits = listTargets([...stacks]).agentCoreRuntimes.filter((e) => e.qualifiedId === target || e.displayPath === target || e.logicalId === target);
|
|
32882
|
+
if (hits.length !== 1) return void 0;
|
|
32883
|
+
const hit = hits[0];
|
|
32884
|
+
const path = ((stacks.find((s) => s.stackName === hit.stackName)?.template.Resources?.[hit.logicalId])?.Metadata)?.["aws:cdk:path"];
|
|
32885
|
+
return {
|
|
32886
|
+
logicalId: hit.logicalId,
|
|
32887
|
+
cdkPath: typeof path === "string" ? path : void 0
|
|
32888
|
+
};
|
|
32889
|
+
}
|
|
32525
32890
|
|
|
32526
32891
|
// src/cli/commands/local-invoke-agentcore.ts
|
|
32527
32892
|
function parseTimeoutMs(raw) {
|
|
@@ -32640,7 +33005,10 @@ async function assumeLambdaExecutionRole(roleArn, region) {
|
|
|
32640
33005
|
assertSendableRoleArn(roleArn, (m) => new CdkdError(m, "LOCAL_INVOKE_ASSUME_ROLE_INVALID"));
|
|
32641
33006
|
const { STSClient } = await import("@aws-sdk/client-sts");
|
|
32642
33007
|
const sts = new STSClient({
|
|
32643
|
-
...awsClientDefaults({
|
|
33008
|
+
...awsClientDefaults({
|
|
33009
|
+
ignoreAssumedRole: true,
|
|
33010
|
+
realAws: mixedModeActive()
|
|
33011
|
+
}),
|
|
32644
33012
|
...region && { region }
|
|
32645
33013
|
});
|
|
32646
33014
|
try {
|
|
@@ -32806,7 +33174,10 @@ async function resolveZipImagePlan(lambda, options) {
|
|
|
32806
33174
|
}
|
|
32807
33175
|
const image = resolveRuntimeImage(lambda.runtime);
|
|
32808
33176
|
await pullImage(image, options.pull === false);
|
|
32809
|
-
const layerPlan = await materializeLambdaLayersIncludingArns(lambda.layers, options
|
|
33177
|
+
const layerPlan = await materializeLambdaLayersIncludingArns(lambda.layers, options, {
|
|
33178
|
+
logicalId: lambda.logicalId,
|
|
33179
|
+
cdkPath: readCdkPathOrUndefined(lambda.resource)
|
|
33180
|
+
});
|
|
32810
33181
|
const containerCodePath = resolveRuntimeCodeMountPath(lambda.runtime);
|
|
32811
33182
|
const tmpfs = resolveTmpfsForLambda(lambda);
|
|
32812
33183
|
return {
|
|
@@ -32825,7 +33196,7 @@ async function resolveZipImagePlan(lambda, options) {
|
|
|
32825
33196
|
...tmpfs !== void 0 && { tmpfs }
|
|
32826
33197
|
};
|
|
32827
33198
|
}
|
|
32828
|
-
async function materializeLambdaLayersIncludingArns(layers, options) {
|
|
33199
|
+
async function materializeLambdaLayersIncludingArns(layers, options, workload) {
|
|
32829
33200
|
const extraTmpDirs = [];
|
|
32830
33201
|
const flat = [];
|
|
32831
33202
|
for (const layer of layers) {
|
|
@@ -32836,7 +33207,10 @@ async function materializeLambdaLayersIncludingArns(layers, options) {
|
|
|
32836
33207
|
});
|
|
32837
33208
|
continue;
|
|
32838
33209
|
}
|
|
32839
|
-
const dir = await materializeLayerFromArn(layer, {
|
|
33210
|
+
const dir = await materializeLayerFromArn(layer, {
|
|
33211
|
+
...workload && { workload },
|
|
33212
|
+
...options.layerRoleArn !== void 0 && { roleArn: explicitRoleArnOrThrow("--layer-role-arn", options.layerRoleArn) }
|
|
33213
|
+
});
|
|
32840
33214
|
extraTmpDirs.push(dir);
|
|
32841
33215
|
flat.push({
|
|
32842
33216
|
logicalId: layer.arn,
|
|
@@ -32926,19 +33300,25 @@ async function resolvePseudoParametersForInvoke(stackRegion, options) {
|
|
|
32926
33300
|
try {
|
|
32927
33301
|
const { STSClient, GetCallerIdentityCommand } = await import("@aws-sdk/client-sts");
|
|
32928
33302
|
let sts;
|
|
32929
|
-
if (!options.fromState)
|
|
33303
|
+
if (!options.fromState) {
|
|
33304
|
+
const realAws = realAwsException("STS");
|
|
33305
|
+
sts = new STSClient({
|
|
33306
|
+
...awsClientDefaults({
|
|
33307
|
+
profile: options.profile,
|
|
33308
|
+
ignoreAssumedRole: true,
|
|
33309
|
+
realAws
|
|
33310
|
+
}),
|
|
33311
|
+
...region && { region },
|
|
33312
|
+
...options.profile && { profile: options.profile }
|
|
33313
|
+
});
|
|
33314
|
+
} else sts = new STSClient({
|
|
32930
33315
|
...awsClientDefaults({
|
|
32931
33316
|
profile: options.profile,
|
|
32932
|
-
|
|
33317
|
+
realAws: realAwsException("STS")
|
|
32933
33318
|
}),
|
|
32934
33319
|
...region && { region },
|
|
32935
33320
|
...options.profile && { profile: options.profile }
|
|
32936
33321
|
});
|
|
32937
|
-
else sts = new STSClient({
|
|
32938
|
-
...awsClientDefaults({ profile: options.profile }),
|
|
32939
|
-
...region && { region },
|
|
32940
|
-
...options.profile && { profile: options.profile }
|
|
32941
|
-
});
|
|
32942
33322
|
try {
|
|
32943
33323
|
accountId = (await sts.send(new GetCallerIdentityCommand({}))).Account;
|
|
32944
33324
|
} finally {
|
|
@@ -32969,7 +33349,7 @@ function readEnvOverridesFile(filePath) {
|
|
|
32969
33349
|
if (!filePath) return void 0;
|
|
32970
33350
|
let raw;
|
|
32971
33351
|
try {
|
|
32972
|
-
raw =
|
|
33352
|
+
raw = readEnvVarsFileText(filePath);
|
|
32973
33353
|
} catch (err) {
|
|
32974
33354
|
throw new Error(`Failed to read --env-vars file '${filePath}': ${describeAwsFailure(err).detail}`);
|
|
32975
33355
|
}
|
|
@@ -33166,7 +33546,11 @@ async function resolveInvokeTemplateEnvWith(lambda, options, dynamicRefs) {
|
|
|
33166
33546
|
const lambdaCdkPath = readCdkPathOrUndefined(lambda.resource);
|
|
33167
33547
|
const overriddenKeys = keysOverriddenBy(declaredEnv, (env) => resolveEnvVars(lambda.logicalId, lambdaCdkPath, env, overrides).resolved);
|
|
33168
33548
|
let templateEnv = declaredEnv && withoutKeys(declaredEnv, overriddenKeys);
|
|
33169
|
-
const
|
|
33549
|
+
const workload = {
|
|
33550
|
+
logicalId: lambda.logicalId,
|
|
33551
|
+
cdkPath: lambdaCdkPath
|
|
33552
|
+
};
|
|
33553
|
+
const stateProvider = createLocalStateProvider$1(options, lambda.stack.stackName, lambda.stack.region, { workload });
|
|
33170
33554
|
if (stateProvider) try {
|
|
33171
33555
|
const loaded = await stateProvider.load(lambda.stack.stackName, lambda.stack.region);
|
|
33172
33556
|
if (loaded) {
|
|
@@ -33183,7 +33567,8 @@ async function resolveInvokeTemplateEnvWith(lambda, options, dynamicRefs) {
|
|
|
33183
33567
|
consumerRegion: loaded.region,
|
|
33184
33568
|
resolveDynamicReferences: (value, producerRegion) => dynamicRefs.resolveString(value, {
|
|
33185
33569
|
region: producerRegion,
|
|
33186
|
-
consumer: `Lambda ${lambda.logicalId} cross-stack env value
|
|
33570
|
+
consumer: `Lambda ${lambda.logicalId} cross-stack env value`,
|
|
33571
|
+
workload
|
|
33187
33572
|
})
|
|
33188
33573
|
};
|
|
33189
33574
|
if (envHasIntrinsicValue(templateEnv)) {
|
|
@@ -33210,9 +33595,14 @@ async function resolveInvokeTemplateEnvWith(lambda, options, dynamicRefs) {
|
|
|
33210
33595
|
const overrideKeyExample = lambdaCdkPath?.replace(/\/Resource$/, "") ?? lambda.logicalId;
|
|
33211
33596
|
logger.warn(`Environment variable ${key} contains a CloudFormation intrinsic and was dropped. Override it with --env-vars (e.g. {"${overrideKeyExample}":{"${key}":"<literal>"}}), or pass --from-state (cdkd-deployed) / --from-cfn-stack (cdk-deployed) to recover deployed values.`);
|
|
33212
33597
|
}
|
|
33598
|
+
warnAwsEmulatorStateSourceHint(envResult.unresolved.length, stateProvider !== void 0);
|
|
33213
33599
|
const plaintextKeys = new Set(stateAudit?.sensitiveKeys ?? []);
|
|
33214
33600
|
for (const key of keysNotFromTemplate(templateEnv, envResult.resolved)) plaintextKeys.add(key);
|
|
33215
33601
|
const dynamic = await resolveDynamicReferencesInEnv(envResult.resolved, {
|
|
33602
|
+
workload: {
|
|
33603
|
+
logicalId: lambda.logicalId,
|
|
33604
|
+
cdkPath: readCdkPathOrUndefined(lambda.resource)
|
|
33605
|
+
},
|
|
33216
33606
|
region: firstUsableRegion(ownerRegion, options.stackRegion, lambda.stack.region, options.region),
|
|
33217
33607
|
label: `Lambda ${lambda.logicalId}`,
|
|
33218
33608
|
skipKeys: plaintextKeys,
|
|
@@ -33242,6 +33632,10 @@ async function resolveContainerImagePlan(lambda, options) {
|
|
|
33242
33632
|
if (!parseEcrUri(lambda.imageUri)) throw new Error(`Container Lambda '${lambda.logicalId}' has no matching asset in cdk.out, and Code.ImageUri '${lambda.imageUri}' is not an ECR URI cdkd can authenticate against. Re-synthesize the CDK app (so cdk.out includes the build context) or deploy the image to ECR first.`);
|
|
33243
33633
|
logger.info(`No matching cdk.out asset for ${lambda.imageUri}; falling back to ECR pull (cross-region is supported — the ECR client is built for the image URI's region; pass --ecr-role-arn for a cross-account image)...`);
|
|
33244
33634
|
imageRef = await pullEcrImage(lambda.imageUri, {
|
|
33635
|
+
workload: {
|
|
33636
|
+
logicalId: lambda.logicalId,
|
|
33637
|
+
cdkPath: readCdkPathOrUndefined(lambda.resource)
|
|
33638
|
+
},
|
|
33245
33639
|
skipPull: options.pull === false,
|
|
33246
33640
|
...options.region !== void 0 && { region: options.region },
|
|
33247
33641
|
...options.ecrRoleArn !== void 0 && { ecrRoleArn: options.ecrRoleArn }
|
|
@@ -33300,11 +33694,13 @@ const CDKD_EMBED_CONFIG = {
|
|
|
33300
33694
|
setLevel: (level) => getLogger().setLevel(level),
|
|
33301
33695
|
getLevel: () => getLogger().getLevel()
|
|
33302
33696
|
},
|
|
33303
|
-
workloadIdentity: "caller"
|
|
33697
|
+
workloadIdentity: "caller",
|
|
33698
|
+
awsEmulatorSqsSidecar: true,
|
|
33699
|
+
deployCommand: "cdkd deploy"
|
|
33304
33700
|
};
|
|
33305
33701
|
function createLocalCommand() {
|
|
33306
33702
|
setEmbedConfig(CDKD_EMBED_CONFIG);
|
|
33307
|
-
setAwsEndpointOverrideSource(
|
|
33703
|
+
setAwsEndpointOverrideSource(mixedModeEmulatorOverride);
|
|
33308
33704
|
const local = new Command("local").description("Local execution of Lambda functions (RIE) and ECS task definitions (Docker required)");
|
|
33309
33705
|
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));
|
|
33310
33706
|
[
|
|
@@ -33397,4 +33793,4 @@ function collectVerbFlags(program) {
|
|
|
33397
33793
|
}
|
|
33398
33794
|
|
|
33399
33795
|
export { resolveSecretDerivedPrincipals as a, buildProgram, isResolvableSecretPrincipalList as i, runDestroyForStack as n, canonicalizeIpProtocolValue as o, holdsUnprovenSecretPrincipalToken as r, canonicalizeIpv4Cidr as t };
|
|
33400
|
-
//# sourceMappingURL=program-
|
|
33796
|
+
//# sourceMappingURL=program-BU5T28eB.js.map
|