@cdkd/cli 0.347.0 → 0.348.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-BV_xDm4m.js → ambient-client-defaults-7acjxfyN.js} +3 -3
- package/dist/{ambient-client-defaults-BV_xDm4m.js.map → ambient-client-defaults-7acjxfyN.js.map} +1 -1
- package/dist/{asg-provider-fpr4ZEfp.js → asg-provider-r1ojkIvF.js} +5 -5
- package/dist/{asg-provider-fpr4ZEfp.js.map → asg-provider-r1ojkIvF.js.map} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{db-instance-modify-retry-BbBT68Qa.js → db-instance-modify-retry-BaSXzEMy.js} +4 -4
- package/dist/{db-instance-modify-retry-BbBT68Qa.js.map → db-instance-modify-retry-BaSXzEMy.js.map} +1 -1
- package/dist/{deploy-engine-DMWjQ_C2.js → deploy-engine-2XoVAu4C.js} +209 -42
- package/dist/deploy-engine-2XoVAu4C.js.map +1 -0
- package/dist/{ecr-uri-C2FWGsrX.js → ecr-uri-C1_heDAt.js} +3 -3
- package/dist/{ecr-uri-C2FWGsrX.js.map → ecr-uri-C1_heDAt.js.map} +1 -1
- package/dist/{iam-role-provider-70-NzlFV.js → iam-role-provider-BnLtoKcW.js} +5 -5
- package/dist/{iam-role-provider-70-NzlFV.js.map → iam-role-provider-BnLtoKcW.js.map} +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/{aws-failure-text-jomzO3aT.js → logger-DmQRya0S.js} +148 -59
- package/dist/logger-DmQRya0S.js.map +1 -0
- package/dist/{neptune-provider-CX4BHKjZ.js → neptune-provider-lzti8HIF.js} +6 -6
- package/dist/{neptune-provider-CX4BHKjZ.js.map → neptune-provider-lzti8HIF.js.map} +1 -1
- package/dist/{program-BU5T28eB.js → program-DSlYCm_d.js} +408 -151
- package/dist/program-DSlYCm_d.js.map +1 -0
- package/dist/{provider-classes-cw32hLq9.js → provider-classes-RMTfwJPz.js} +19 -19
- package/dist/provider-classes-RMTfwJPz.js.map +1 -0
- package/dist/{rds-provider-CxSVX1d7.js → rds-provider-COq1pW0G.js} +52 -34
- package/dist/{rds-provider-CxSVX1d7.js.map → rds-provider-COq1pW0G.js.map} +1 -1
- package/dist/{read-replica-DtD9IDko.js → read-replica-sjvqi8Of.js} +78 -24
- package/dist/read-replica-sjvqi8Of.js.map +1 -0
- package/dist/{update-removal-CpGaCv-d.js → update-removal-D-FspP88.js} +3 -3
- package/dist/{update-removal-CpGaCv-d.js.map → update-removal-D-FspP88.js.map} +1 -1
- package/dist/{version-Bx-Ox9xU.js → version-DXmr3_M4.js} +2 -2
- package/dist/{version-Bx-Ox9xU.js.map → version-DXmr3_M4.js.map} +1 -1
- package/package.json +3 -2
- package/dist/aws-failure-text-jomzO3aT.js.map +0 -1
- package/dist/deploy-engine-DMWjQ_C2.js.map +0 -1
- package/dist/program-BU5T28eB.js.map +0 -1
- package/dist/provider-classes-cw32hLq9.js.map +0 -1
- package/dist/read-replica-DtD9IDko.js.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { t as getCdkdVersion } from "./version-
|
|
2
|
-
import { $ as
|
|
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-
|
|
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-
|
|
1
|
+
import { t as getCdkdVersion } from "./version-DXmr3_M4.js";
|
|
2
|
+
import { $ as withStackScope, B as generateResourceName, E as coerceCfnBoolean, I as PATTERN_B_NAME_OPTIONS, L as PATTERN_B_NAME_PROPERTIES, Q as withSkipPrefix, R as PATTERN_B_RESOURCE_TYPES, S as explicitNamePropertyFor, X as isNameGeneration, _t as truncateCodePoints, a as reserveStdoutForPayload, at as asIsMessage, ct as displayIdent, dt as isPasteableIdent, gt as terminalSafe, ht as stringifyJsonPayload, i as releaseStdoutForPayload, it as UNRENDERABLE, lt as displaySafe, m as verboseAwareText, mt as safeMsg, n as getLogger, nt as SECRET_REF_MAX_CODE_POINTS, ot as cutMarker, p as safeStringify, pt as plainIdentOr, r as isStdoutReservedForPayload, rt as STACK_REF_MAX_CODE_POINTS, s as runStackBuffered, st as displayAwsMessage, tt as SAFE_MSG_ALTERED_CHAR, u as describeAwsFailure, ut as displayStackName, y as getLiveRenderer, z as derivesPatternBName } from "./logger-DmQRya0S.js";
|
|
3
|
+
import { $a as poisonRenderedSpellingsCollidingIn, $d as setChildProcessAwsEnv, $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 CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION, Ai as withAttemptedItemsMasked, Al as identityKeyFor, An as rollbackOrphanIds, Ao as lacksRecordedTableArn, Ar as retiredNameGenerationsLeaving, As as malformedResourceEntriesWarning, Au as rewriteTemplateAssetReferences, Bd as describeJsonParseFailure, 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 warnDeprecatedNoPrefixCliFlag, 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 MIGRATE_TMP_PREFIX, 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 CFN_TEMPLATE_URL_LIMIT, 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 derivePartitionAndUrlSuffix, 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 hasPlainPrototype, Gl as wholeStringLeavesOf, Gn as DELETED_RESOURCE_REMEDY, Gr as exportNameNoEchoParameters, Gs as refuseMalformedResourcePropertiesForExport, Gu as describeDockerExecFailure, Hc as DagBuilder, Hd as utf8ByteLength, 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 refuseFailedLookups, 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 absoluteAssemblyPathEscape, 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 nullPrototypeRecord, 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 AssemblyReader, 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 expectedOwnerParam, 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 PARTITION_TABLE, 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 findLargeInlineResources, 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 canonicalizeRegion, 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 resolveAssemblyPath, 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 StageLoadError, 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 stateBucketExistenceConfirmed, 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 CFN_TEMPLATE_BODY_LIMIT, 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 defineOwnKey, 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 parseFailureDebugDetail, 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 hasOwnKey, 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 displayAssemblyPath, 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 describeFileReadFailure, 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 renderAssemblyPathEscape, 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 resolveSkipPrefix, _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 resolveStateBucketWithSource, bi as bold, bl as maskSecretsInError, bn as makeSiblingClaimReader, bs as previewableOrphanRecords, bu as isNotImplemented, c as inheritedProvenanceForChildDiff, cc as refuseMalformedOutputsForDestroy, cd as getDockerImageBySourceHash, 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 getDefaultStateBucketName, 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, ef as injectAwsRegion, 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 getLegacyStateBucketName, 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 resolveCaptureObservedState, 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 resolveAutoAssetStorage, 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 decodeListingKey, 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 uploadCfnTemplate, 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 Synthesizer, 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 resolveApp, 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 abortInFlightMultipartUploads, oo as assertFlagRoleArn, or as planRollback, ou as orphansCarriedFrom, p as readRecordedConditionVerdicts, pc as malformedResourcesWarning, pd as loadCdkJson, pi as supersededResourcesOf, pl as printingCorpusOf, pn as dropFailedCommands, po as callerEnvCredentials, pr as recordUnderIdIsNotOwn, pu as timePhase, qc as maskReadbackAtCoordinates, qd as ownValue, 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, rf as resolveBucketRegion, ri as destroyStackRecordsView, rl as liveMatchesUnresolvedTokenFrame, ro as producerLookupOver, ru as importableOutputs, s as crossStackOutputProvenanceSource, sc as refuseMalformedOutputs, sd as AssetManifestLoader, 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 injectedAwsRegionValue, 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 synthesisStatusMessage, 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 resolveStateBucketWithDefault, 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 ssmResolvedValueType, 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 resolveUseCdkBootstrapAssets, 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 resolveStateBucketWithDefaultAndSource, yl as errorCauseChain, yn as makeForeignHolderScan, ys as malformedOrphanRowsKeptWarning, yu as isAccessDenied, zd as processStackMessages, zl as provenPublicValue, zn as parseMappingFile, zo as carriesFetchableDynamicReference, zr as displayTextOrWithheld, zs as repairMalformedResourceEntriesForReadOnly, zt as refactorMarkerMovesOf, zu as validateAssetBucketName } from "./deploy-engine-2XoVAu4C.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-7acjxfyN.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-D-FspP88.js";
|
|
6
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-
|
|
7
|
+
import { a as getAssumedRoleCredentials, c as setAssumedRoleCredentials, h as formatAuthority, l as setAwsEndpointOverrideSource, m as runInStackAwsScope, n as awsClientDefaults, o as getPreAssumeEnvCredentials, r as awsEndpointOverrideActive, 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-C1_heDAt.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";
|
|
@@ -23,10 +23,10 @@ import { basename, dirname, isAbsolute, join, resolve } from "node:path";
|
|
|
23
23
|
import { execFile, spawn } from "node:child_process";
|
|
24
24
|
import { devNull, tmpdir } from "node:os";
|
|
25
25
|
import { BatchDeleteImageCommand, DeleteRepositoryCommand, DescribeImagesCommand as DescribeImagesCommand$1, ECRClient, GetAuthorizationTokenCommand } from "@aws-sdk/client-ecr";
|
|
26
|
+
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, dockerRegistryEnv, downloadAndExtractS3Bundle, effectiveLoopbackPorts, enforceImageOverrideOrphans, ensureForwarderImage, filterRoutesByApiIdentifier, firstUsableRegion, getActiveWorkloadAwsWiring, getActiveWorkloadAwsWiring as getActiveWorkloadAwsWiring$1, getAwsEndpointOverride, groupRoutesByServer, groupWorkloadsRoutedApart, handleConnectionsRequest, invokeAgentCore, invokeAgentCoreWs, isAwsServiceRoutedToEmulator, isRealAwsSentinel, keysNotFromTemplate, keysOverriddenBy, loopbackForwarderPlan, materializeLayerFromArn, mcpInvokeOnce, noImplicitEcrPullArgs, 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";
|
|
26
27
|
import { isDeepStrictEqual, promisify } from "node:util";
|
|
27
28
|
import graphlib from "graphlib";
|
|
28
29
|
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, 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";
|
|
@@ -488,6 +488,11 @@ function workloadGetsEmulatorKeysOnly(env, wiring) {
|
|
|
488
488
|
if (!wiring.mixed) return false;
|
|
489
489
|
return !Object.entries(env).some(([k, v]) => k !== "AWS_ENDPOINT_URL" && isRealAwsSentinel(k, v));
|
|
490
490
|
}
|
|
491
|
+
function taskRoleAssumedInRealAws(env, wiring) {
|
|
492
|
+
if (wiring?.mode === "emulator") return false;
|
|
493
|
+
if (!wiring?.mixed) return true;
|
|
494
|
+
return isRealAwsSentinel("AWS_ENDPOINT_URL_STS", env["AWS_ENDPOINT_URL_STS"]);
|
|
495
|
+
}
|
|
491
496
|
function mixedModeActive() {
|
|
492
497
|
return getActiveWorkloadAwsWiring$1()?.mixed !== void 0;
|
|
493
498
|
}
|
|
@@ -1217,6 +1222,50 @@ async function bootstrapDestroyCommand(options) {
|
|
|
1217
1222
|
}
|
|
1218
1223
|
}
|
|
1219
1224
|
|
|
1225
|
+
// src/cli/commands/bootstrap-state-bucket.ts
|
|
1226
|
+
async function createStateBucket(args) {
|
|
1227
|
+
const { s3, bucketName, region, report } = args;
|
|
1228
|
+
report(`Creating S3 bucket: ${bucketName} in region ${region}`);
|
|
1229
|
+
const createBucketParams = { Bucket: bucketName };
|
|
1230
|
+
if (region !== "us-east-1") createBucketParams.CreateBucketConfiguration = { LocationConstraint: region };
|
|
1231
|
+
await s3.send(new CreateBucketCommand(createBucketParams));
|
|
1232
|
+
report(`✓ Created S3 bucket: ${bucketName}`);
|
|
1233
|
+
}
|
|
1234
|
+
async function configureStateBucket(args) {
|
|
1235
|
+
const { s3, bucketName, accountId, report } = args;
|
|
1236
|
+
const logger = getLogger();
|
|
1237
|
+
logger.debug("Enabling bucket versioning...");
|
|
1238
|
+
await s3.send(new PutBucketVersioningCommand({
|
|
1239
|
+
Bucket: bucketName,
|
|
1240
|
+
ExpectedBucketOwner: accountId,
|
|
1241
|
+
VersioningConfiguration: { Status: "Enabled" }
|
|
1242
|
+
}));
|
|
1243
|
+
report("✓ Enabled bucket versioning");
|
|
1244
|
+
logger.debug("Enabling bucket encryption...");
|
|
1245
|
+
await s3.send(new PutBucketEncryptionCommand({
|
|
1246
|
+
Bucket: bucketName,
|
|
1247
|
+
ExpectedBucketOwner: accountId,
|
|
1248
|
+
ServerSideEncryptionConfiguration: { Rules: [{
|
|
1249
|
+
ApplyServerSideEncryptionByDefault: { SSEAlgorithm: "AES256" },
|
|
1250
|
+
BucketKeyEnabled: true
|
|
1251
|
+
}] }
|
|
1252
|
+
}));
|
|
1253
|
+
report("✓ Enabled bucket encryption (AES-256)");
|
|
1254
|
+
logger.debug("Setting bucket policy...");
|
|
1255
|
+
const bucketPolicy = buildDenyExternalAccessPolicy(bucketName, accountId, await s3.config.region());
|
|
1256
|
+
await s3.send(new PutBucketPolicyCommand({
|
|
1257
|
+
Bucket: bucketName,
|
|
1258
|
+
ExpectedBucketOwner: accountId,
|
|
1259
|
+
Policy: JSON.stringify(bucketPolicy)
|
|
1260
|
+
}));
|
|
1261
|
+
report("✓ Set bucket policy (deny external access)");
|
|
1262
|
+
logger.debug("Setting custom-resource response lifecycle rule...");
|
|
1263
|
+
const lifecycle = await applyCustomResourceResponseExpiration(s3, bucketName, { expectedBucketOwner: accountId });
|
|
1264
|
+
if (lifecycle.status === "failed" || lifecycle.status === "refused") logger.warn(customResourceResponseExpirationWarning(bucketName, lifecycle));
|
|
1265
|
+
else if (lifecycle.status === "added") report(safeMsg`✓ Set lifecycle rule (expire ${CUSTOM_RESOURCE_RESPONSE_PREFIX}/ responses after ${1} day)`);
|
|
1266
|
+
else report(safeMsg`✓ Lifecycle rule ${CUSTOM_RESOURCE_RESPONSE_LIFECYCLE_RULE_ID} already present (left unchanged)`);
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1220
1269
|
// src/cli/commands/bootstrap.ts
|
|
1221
1270
|
async function bootstrapCommand(options) {
|
|
1222
1271
|
const logger = getLogger();
|
|
@@ -1284,6 +1333,12 @@ async function bootstrapCommand(options) {
|
|
|
1284
1333
|
}
|
|
1285
1334
|
const rebuiltStateBucketClient = await rebuildClientForBucketRegion(s3Client, bucketName, { ...options.profile && { profile: options.profile } });
|
|
1286
1335
|
const stateBucketS3 = rebuiltStateBucketClient ?? s3Client;
|
|
1336
|
+
const stateBucketSetup = {
|
|
1337
|
+
s3: stateBucketS3,
|
|
1338
|
+
bucketName,
|
|
1339
|
+
accountId,
|
|
1340
|
+
report: (message) => logger.info(message)
|
|
1341
|
+
};
|
|
1287
1342
|
try {
|
|
1288
1343
|
let bucketExists = false;
|
|
1289
1344
|
try {
|
|
@@ -1311,45 +1366,14 @@ async function bootstrapCommand(options) {
|
|
|
1311
1366
|
logger.info(`State bucket ${bucketName} already exists — skipping reconfiguration (use --force to reconfigure)`);
|
|
1312
1367
|
skipStateBucketConfig = true;
|
|
1313
1368
|
} else logger.info("--force specified, continuing with existing bucket");
|
|
1314
|
-
} else {
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
logger.debug("Enabling bucket versioning...");
|
|
1323
|
-
await stateBucketS3.send(new PutBucketVersioningCommand({
|
|
1324
|
-
Bucket: bucketName,
|
|
1325
|
-
ExpectedBucketOwner: accountId,
|
|
1326
|
-
VersioningConfiguration: { Status: "Enabled" }
|
|
1327
|
-
}));
|
|
1328
|
-
logger.info("✓ Enabled bucket versioning");
|
|
1329
|
-
logger.debug("Enabling bucket encryption...");
|
|
1330
|
-
await stateBucketS3.send(new PutBucketEncryptionCommand({
|
|
1331
|
-
Bucket: bucketName,
|
|
1332
|
-
ExpectedBucketOwner: accountId,
|
|
1333
|
-
ServerSideEncryptionConfiguration: { Rules: [{
|
|
1334
|
-
ApplyServerSideEncryptionByDefault: { SSEAlgorithm: "AES256" },
|
|
1335
|
-
BucketKeyEnabled: true
|
|
1336
|
-
}] }
|
|
1337
|
-
}));
|
|
1338
|
-
logger.info("✓ Enabled bucket encryption (AES-256)");
|
|
1339
|
-
logger.debug("Setting bucket policy...");
|
|
1340
|
-
const bucketPolicy = buildDenyExternalAccessPolicy(bucketName, accountId, await stateBucketS3.config.region());
|
|
1341
|
-
await stateBucketS3.send(new PutBucketPolicyCommand({
|
|
1342
|
-
Bucket: bucketName,
|
|
1343
|
-
ExpectedBucketOwner: accountId,
|
|
1344
|
-
Policy: JSON.stringify(bucketPolicy)
|
|
1345
|
-
}));
|
|
1346
|
-
logger.info("✓ Set bucket policy (deny external access)");
|
|
1347
|
-
logger.debug("Setting custom-resource response lifecycle rule...");
|
|
1348
|
-
const lifecycle = await applyCustomResourceResponseExpiration(stateBucketS3, bucketName, { expectedBucketOwner: accountId });
|
|
1349
|
-
if (lifecycle.status === "failed" || lifecycle.status === "refused") logger.warn(customResourceResponseExpirationWarning(bucketName, lifecycle));
|
|
1350
|
-
else if (lifecycle.status === "added") logger.info(safeMsg`✓ Set lifecycle rule (expire ${CUSTOM_RESOURCE_RESPONSE_PREFIX}/ responses after ${1} day)`);
|
|
1351
|
-
else logger.info(safeMsg`✓ Lifecycle rule ${CUSTOM_RESOURCE_RESPONSE_LIFECYCLE_RULE_ID} already present (left unchanged)`);
|
|
1352
|
-
}
|
|
1369
|
+
} else await createStateBucket({
|
|
1370
|
+
...stateBucketSetup,
|
|
1371
|
+
region
|
|
1372
|
+
});
|
|
1373
|
+
if (!skipStateBucketConfig) await configureStateBucket({
|
|
1374
|
+
...stateBucketSetup,
|
|
1375
|
+
region
|
|
1376
|
+
});
|
|
1353
1377
|
let assetStorage;
|
|
1354
1378
|
if (options.assets) {
|
|
1355
1379
|
logger.info("\nSetting up cdkd asset storage...");
|
|
@@ -2209,7 +2233,7 @@ function collectCrossStackRefs(node, onRef, unconditional) {
|
|
|
2209
2233
|
// src/provisioning/register-providers.ts
|
|
2210
2234
|
let providerClasses;
|
|
2211
2235
|
function loadProviderClasses() {
|
|
2212
|
-
providerClasses ??= import("./provider-classes-
|
|
2236
|
+
providerClasses ??= import("./provider-classes-RMTfwJPz.js");
|
|
2213
2237
|
return providerClasses;
|
|
2214
2238
|
}
|
|
2215
2239
|
function registerAllProviders(registry, classes) {
|
|
@@ -2986,9 +3010,51 @@ var ExportIndexStore = class {
|
|
|
2986
3010
|
}
|
|
2987
3011
|
};
|
|
2988
3012
|
|
|
3013
|
+
// src/cli/commands/emulator-auto-bootstrap.ts
|
|
3014
|
+
async function ensureAwsEmulatorStateBucket(args) {
|
|
3015
|
+
if (!awsEndpointOverrideActive()) return void 0;
|
|
3016
|
+
const logger = getLogger();
|
|
3017
|
+
const accountId = (await args.sts.send(new GetCallerIdentityCommand({}))).Account;
|
|
3018
|
+
const bucketName = resolveStateBucketWithSource(args.cliBucket)?.bucket ?? getDefaultStateBucketName(accountId);
|
|
3019
|
+
try {
|
|
3020
|
+
await args.s3.send(new HeadBucketCommand({ Bucket: bucketName }));
|
|
3021
|
+
return;
|
|
3022
|
+
} catch (error) {
|
|
3023
|
+
const name = error.name;
|
|
3024
|
+
if (name !== "NotFound" && name !== "NoSuchBucket") return void 0;
|
|
3025
|
+
}
|
|
3026
|
+
const setup = {
|
|
3027
|
+
s3: args.s3,
|
|
3028
|
+
bucketName,
|
|
3029
|
+
accountId,
|
|
3030
|
+
region: args.region,
|
|
3031
|
+
report: (message) => logger.debug(message)
|
|
3032
|
+
};
|
|
3033
|
+
try {
|
|
3034
|
+
try {
|
|
3035
|
+
await createStateBucket(setup);
|
|
3036
|
+
} catch (error) {
|
|
3037
|
+
const code = error.name;
|
|
3038
|
+
if (code !== "BucketAlreadyOwnedByYou" && code !== "BucketAlreadyExists") throw error;
|
|
3039
|
+
}
|
|
3040
|
+
await configureStateBucket(setup);
|
|
3041
|
+
} catch (error) {
|
|
3042
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
3043
|
+
throw new CdkdError(safeMsg`AWS Emulator auto-bootstrap of state bucket ${bucketName} failed: ${msg}. ` + "Run `cdkd bootstrap --aws-emulator --force` to retry.", "AWS_EMULATOR_BOOTSTRAP_FAILED", error instanceof Error ? error : void 0);
|
|
3044
|
+
}
|
|
3045
|
+
logger.info(safeMsg`AWS Emulator had no cdkd bootstrap; bootstrapped it (state bucket ${bucketName}).`);
|
|
3046
|
+
return bucketName;
|
|
3047
|
+
}
|
|
3048
|
+
|
|
2989
3049
|
// src/cli/commands/deploy/prep.ts
|
|
2990
3050
|
async function prepareStateInfra(args) {
|
|
2991
3051
|
const { options, region, effectiveRegion, awsClients, logger } = args;
|
|
3052
|
+
if (!options.dryRun) await ensureAwsEmulatorStateBucket({
|
|
3053
|
+
cliBucket: options.stateBucket,
|
|
3054
|
+
region,
|
|
3055
|
+
s3: awsClients.s3,
|
|
3056
|
+
sts: awsClients.sts
|
|
3057
|
+
});
|
|
2992
3058
|
const resolvedStateBucket = await resolveStateBucketWithDefaultAndSource(options.stateBucket, region, legacyStateBucketFallbackRegion(effectiveRegion));
|
|
2993
3059
|
const stateBucket = resolvedStateBucket.bucket;
|
|
2994
3060
|
const preflightStateBackend = new S3StateBackend(awsClients.s3, {
|
|
@@ -3663,6 +3729,67 @@ function splitUpdatePartial(result) {
|
|
|
3663
3729
|
nestedUpdatePartial
|
|
3664
3730
|
};
|
|
3665
3731
|
}
|
|
3732
|
+
async function confirmAutoAssetStorageCreate(args) {
|
|
3733
|
+
const { assetRegion, accountId } = args;
|
|
3734
|
+
const logger = getLogger();
|
|
3735
|
+
if (awsEndpointOverrideActive()) {
|
|
3736
|
+
logger.info(safeMsg`Creating cdkd asset storage for region '${assetRegion}' in AWS Emulator ` + `(no prompt under --aws-emulator; opt out with --no-auto-asset-storage).`);
|
|
3737
|
+
return true;
|
|
3738
|
+
}
|
|
3739
|
+
if (args.yes || !process.stdin.isTTY) {
|
|
3740
|
+
logger.info(safeMsg`Creating cdkd asset storage for region '${assetRegion}' (first deploy into this ` + `region; opt out with --no-auto-asset-storage).`);
|
|
3741
|
+
return true;
|
|
3742
|
+
}
|
|
3743
|
+
return promptYesNo(`Region '${assetRegion}' has no cdkd asset storage yet. Create it now (S3 bucket cdkd-assets-${accountId}-${assetRegion} + container-asset ECR repo, out of 'cdk gc' reach)?`);
|
|
3744
|
+
}
|
|
3745
|
+
const FORCE_QUIT_ABORT_BUDGET_MS = 5e3;
|
|
3746
|
+
function exitAfterAbortingUploads(exit, write, abort = abortInFlightMultipartUploads, budgetMs = FORCE_QUIT_ABORT_BUDGET_MS) {
|
|
3747
|
+
let started;
|
|
3748
|
+
try {
|
|
3749
|
+
started = abort();
|
|
3750
|
+
} catch {
|
|
3751
|
+
started = {
|
|
3752
|
+
destinations: [],
|
|
3753
|
+
done: Promise.resolve()
|
|
3754
|
+
};
|
|
3755
|
+
}
|
|
3756
|
+
const { destinations } = started;
|
|
3757
|
+
let exited = false;
|
|
3758
|
+
const finish = (confirmed) => {
|
|
3759
|
+
if (exited) return;
|
|
3760
|
+
exited = true;
|
|
3761
|
+
if (destinations.length > 0) {
|
|
3762
|
+
const list = destinations.map((d) => displaySafe(d)).join(", ");
|
|
3763
|
+
write(confirmed ? `Interrupted: aborted the in-flight asset upload(s) ${list}.\n` : `Interrupted: exiting before the abort of the in-flight asset upload(s) ${list} was confirmed; the asset bucket's lifecycle rule removes what is left.\n`);
|
|
3764
|
+
}
|
|
3765
|
+
exit(130);
|
|
3766
|
+
};
|
|
3767
|
+
const timer = setTimeout(() => finish(false), budgetMs);
|
|
3768
|
+
return started.done.catch(() => void 0).then(() => {
|
|
3769
|
+
clearTimeout(timer);
|
|
3770
|
+
finish(true);
|
|
3771
|
+
});
|
|
3772
|
+
}
|
|
3773
|
+
function createDeploySigintHandler(options) {
|
|
3774
|
+
const write = options.write ?? ((text) => void process.stderr.write(text));
|
|
3775
|
+
const exit = options.exit ?? ((code) => process.exit(code));
|
|
3776
|
+
let signals = 0;
|
|
3777
|
+
return () => {
|
|
3778
|
+
signals++;
|
|
3779
|
+
if (signals === 1) {
|
|
3780
|
+
write("\nInterrupted — waiting for in-progress operations to complete...\n");
|
|
3781
|
+
options.onFirst();
|
|
3782
|
+
return;
|
|
3783
|
+
}
|
|
3784
|
+
if (signals > 2) {
|
|
3785
|
+
exit(130);
|
|
3786
|
+
return;
|
|
3787
|
+
}
|
|
3788
|
+
write(`
|
|
3789
|
+
Force-quit: stack locks may not be released. If the next run reports a lock, run this for EACH stack it names, in the region-qualified form — see the message that run prints.\nRelease with: ${forceQuitReleaseCommand()}\n`);
|
|
3790
|
+
exitAfterAbortingUploads(exit, write, options.abort, options.budgetMs);
|
|
3791
|
+
};
|
|
3792
|
+
}
|
|
3666
3793
|
|
|
3667
3794
|
// src/cli/commands/deploy/stack-deploy.ts
|
|
3668
3795
|
async function deployStackInScope(ctx, stackInfo, stackRegion, stackAwsClients) {
|
|
@@ -3977,15 +4104,9 @@ async function deployCommand(stacks, options) {
|
|
|
3977
4104
|
const callerIdentityPromise = fetchCallerIdentity(region);
|
|
3978
4105
|
callerIdentityPromise.catch(() => void 0);
|
|
3979
4106
|
let deployInterrupted = false;
|
|
3980
|
-
const topLevelSigintHandler = () => {
|
|
3981
|
-
if (deployInterrupted) {
|
|
3982
|
-
process.stderr.write(`
|
|
3983
|
-
Force-quit: stack locks may not be released. If the next run reports a lock, run this for EACH stack it names, in the region-qualified form — see the message that run prints.\nRelease with: ${forceQuitReleaseCommand()}\n`);
|
|
3984
|
-
process.exit(130);
|
|
3985
|
-
}
|
|
3986
|
-
process.stderr.write("\nInterrupted — waiting for in-progress operations to complete...\n");
|
|
4107
|
+
const topLevelSigintHandler = createDeploySigintHandler({ onFirst: () => {
|
|
3987
4108
|
deployInterrupted = true;
|
|
3988
|
-
};
|
|
4109
|
+
} });
|
|
3989
4110
|
process.on("SIGINT", topLevelSigintHandler);
|
|
3990
4111
|
const unforwardSigterm = forwardSigtermToSigint();
|
|
3991
4112
|
let preflightBackendForCleanup;
|
|
@@ -4102,13 +4223,11 @@ Force-quit: stack locks may not be released. If the next run reports a lock, run
|
|
|
4102
4223
|
const assetPublisher = new AssetPublisher();
|
|
4103
4224
|
const useCdkBootstrapAssets = resolveUseCdkBootstrapAssets(options.useCdkBootstrapAssets);
|
|
4104
4225
|
const autoAssetStorage = resolveAutoAssetStorage(options.autoAssetStorage);
|
|
4105
|
-
const confirmAutoAssetStorage =
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
return promptYesNo(`Region '${assetRegion}' has no cdkd asset storage yet. Create it now (S3 bucket cdkd-assets-${accountId}-${assetRegion} + container-asset ECR repo, out of 'cdk gc' reach)?`);
|
|
4111
|
-
};
|
|
4226
|
+
const confirmAutoAssetStorage = (assetRegion) => confirmAutoAssetStorageCreate({
|
|
4227
|
+
assetRegion,
|
|
4228
|
+
accountId,
|
|
4229
|
+
yes: options.yes === true
|
|
4230
|
+
});
|
|
4112
4231
|
const assetModeResolver = new AssetModeResolver(preflightStateBackend, accountId, {
|
|
4113
4232
|
...options.profile && { profile: options.profile },
|
|
4114
4233
|
...useCdkBootstrapAssets && { useCdkBootstrapAssets: true },
|
|
@@ -7768,7 +7887,7 @@ function abandonedScanWarning(subject, verdict) {
|
|
|
7768
7887
|
}
|
|
7769
7888
|
function abandonedScanStackNote(verdict, scans) {
|
|
7770
7889
|
const subject = `${scans} abandoned scan(s) above`;
|
|
7771
|
-
return verdict === "count" ? `${subject}: the resolver stops at the first {{resolve:...}} token it cannot fetch, so any secret after it in the same value recorded no needle and could not be rewritten. Re-run with --verbose for the cause of each
|
|
7890
|
+
return verdict === "count" ? `${subject}: the resolver stops at the first {{resolve:...}} token it cannot fetch, so any secret after it in the same value recorded no needle and could not be rewritten. ` + verboseAwareText("Re-run with --verbose for the cause of each.", "The cause of each is in the debug output above.") : `${subject}: the scan stopped on something cdkd scrub cannot resolve with template defaults alone — an unresolvable Ref or Fn::GetAtt, a parameter with no Default, or a reference whose own argument still holds an unsubstituted \${...}. These do NOT fail --fail, because scrub takes no --parameters and a gate failure here could not be cleared. Give the parameter a Default, or resolve the reference, to let scrub certify these records; otherwise accept that it cannot.`;
|
|
7772
7891
|
}
|
|
7773
7892
|
function abandonedScanVerdict(source, err) {
|
|
7774
7893
|
if (!carriesDynamicReference(source)) return "silent";
|
|
@@ -8940,7 +9059,7 @@ async function scrubStackRewritePass({ stack, region, stateBackend, opts, logger
|
|
|
8940
9059
|
const resolved = nestedRowParameters.get(logicalId);
|
|
8941
9060
|
const parameters = resolved?.complete === true ? nestedChildParameters(resolved.value) : void 0;
|
|
8942
9061
|
if (parameters === void 0) {
|
|
8943
|
-
refuse(`the Parameters ${shownStack} passes it could not be resolved to the values a deploy would hand it, so what it inherited is unknown`,
|
|
9062
|
+
refuse(`the Parameters ${shownStack} passes it could not be resolved to the values a deploy would hand it, so what it inherited is unknown`, verboseAwareText("Re-run cdkd scrub with --verbose to see which value failed to resolve, and fix that.", "The debug output above shows which value failed to resolve; fix that."));
|
|
8944
9063
|
continue;
|
|
8945
9064
|
}
|
|
8946
9065
|
nestedChildren.push({
|
|
@@ -12590,7 +12709,7 @@ function createIamPrincipalUniqueIdResolver(awsClients) {
|
|
|
12590
12709
|
const denied = /^AccessDenied|^NotAuthorized/i.test(name) || status === 403;
|
|
12591
12710
|
if (!warnedOnDenied && denied) {
|
|
12592
12711
|
warnedOnDenied = true;
|
|
12593
|
-
getLogger().warn(`Cannot read IAM principals (${name || "access denied"}). A resource policy whose principal AWS rendered as a unique id (AROA…/AIDA…) may therefore report drift that is only a spelling difference; grant iam:GetRole / iam:GetUser to resolve it, or re-run with --verbose for the full error.`);
|
|
12712
|
+
getLogger().warn(`Cannot read IAM principals (${name || "access denied"}). A resource policy whose principal AWS rendered as a unique id (AROA…/AIDA…) may therefore report drift that is only a spelling difference; grant iam:GetRole / iam:GetUser to resolve ` + safeMsg`it${verboseAwareText(", or re-run with --verbose for the full error", " (the full error is in the debug output)")}.`);
|
|
12594
12713
|
}
|
|
12595
12714
|
getLogger().debug(`Could not resolve the unique id of principal ${displayIdent(arn, { maxCodePoints: 613 })} (${displayAwsMessage(message)}); leaving the policy principal comparison untouched.`);
|
|
12596
12715
|
if (isThrottlingError(error)) return void 0;
|
|
@@ -21091,7 +21210,7 @@ function refuseDivergentRecordRegionForRollback(state, stackName, keyRegion, div
|
|
|
21091
21210
|
const resourceCount = isReadableBag(state.resources) ? Object.keys(state.resources).length : void 0;
|
|
21092
21211
|
if (resourceCount === 0 && provenOrphans === 0) return;
|
|
21093
21212
|
const lists = resourceCount === void 0 ? "its resources map cannot be read" : resourceCount > 0 ? `it still lists ${resourceCount} resource${resourceCount === 1 ? "" : "s"}` : `its journal holds ${provenOrphans} failed create${provenOrphans === 1 ? "" : "s"} whose resource the rollback would delete`;
|
|
21094
|
-
throw markNonRetryable(new CdkdError(`cdkd will not roll back ${plainOrDescribed(stackName, "stack name")} (${plainOrDescribed(keyRegion, "region")}): the state record read from that region's key carries a 'region' of its own (${describeRegionValueKind(divergentBodyRegion)}) that is not the key's, and ${lists} — so cdkd cannot tell which region they are in. cdkd stamps the key's region into every record it writes, so this record was not written by cdkd. The replay would issue every delete and revert against the key's region; if the record's own region is the honest half, each delete comes back not-found, which the replay reads as ALREADY DELETED — it would report the resource rolled back, drop it from the record, and leave it standing in the other region. Nothing was changed. Re-run with --verbose to see what the record's region field holds, repair that field to match the key it is stored under, and run the rollback again
|
|
21213
|
+
throw markNonRetryable(new CdkdError(`cdkd will not roll back ${plainOrDescribed(stackName, "stack name")} (${plainOrDescribed(keyRegion, "region")}): the state record read from that region's key carries a 'region' of its own (${describeRegionValueKind(divergentBodyRegion)}) that is not the key's, and ${lists} — so cdkd cannot tell which region they are in. cdkd stamps the key's region into every record it writes, so this record was not written by cdkd. The replay would issue every delete and revert against the key's region; if the record's own region is the honest half, each delete comes back not-found, which the replay reads as ALREADY DELETED — it would report the resource rolled back, drop it from the record, and leave it standing in the other region. Nothing was changed. ` + verboseAwareText("Re-run with --verbose to see what the record's region field holds, ", "The debug output shows what the record's region field holds; ") + "repair that field to match the key it is stored under, and run the rollback again.", STATE_REGION_DIVERGED));
|
|
21095
21214
|
}
|
|
21096
21215
|
function divergedDuringRollbackMessage(divergentBodyRegion) {
|
|
21097
21216
|
return `the state record was rewritten during this rollback, and the rewrite carries a 'region' of its own (${describeRegionValueKind(divergentBodyRegion)}) that is not the region of its key, so cdkd did not write over it`;
|
|
@@ -25236,7 +25355,6 @@ async function importCommand(stackArg, options) {
|
|
|
25236
25355
|
const effectiveRegion = await resolveEffectiveRegion(options);
|
|
25237
25356
|
exportInferredRegionForSdk(effectiveRegion);
|
|
25238
25357
|
const region = effectiveRegion.region;
|
|
25239
|
-
const stateBucket = await resolveStateBucketWithDefault(options.stateBucket, region, legacyStateBucketFallbackRegion(effectiveRegion));
|
|
25240
25358
|
if (options.region) {
|
|
25241
25359
|
process.env["AWS_REGION"] = options.region;
|
|
25242
25360
|
process.env["AWS_DEFAULT_REGION"] = options.region;
|
|
@@ -25248,6 +25366,13 @@ async function importCommand(stackArg, options) {
|
|
|
25248
25366
|
setAwsClients(awsClients);
|
|
25249
25367
|
let targetClients;
|
|
25250
25368
|
try {
|
|
25369
|
+
if (!options.dryRun) await ensureAwsEmulatorStateBucket({
|
|
25370
|
+
cliBucket: options.stateBucket,
|
|
25371
|
+
region,
|
|
25372
|
+
s3: awsClients.s3,
|
|
25373
|
+
sts: awsClients.sts
|
|
25374
|
+
});
|
|
25375
|
+
const stateBucket = await resolveStateBucketWithDefault(options.stateBucket, region, legacyStateBucketFallbackRegion(effectiveRegion));
|
|
25251
25376
|
const stateConfig = {
|
|
25252
25377
|
bucket: stateBucket,
|
|
25253
25378
|
prefix: options.statePrefix
|
|
@@ -25967,7 +26092,7 @@ async function runDetachedContainer(opts) {
|
|
|
25967
26092
|
args.push("--entrypoint", opts.entryPoint[0]);
|
|
25968
26093
|
entryPointTail = opts.entryPoint.slice(1);
|
|
25969
26094
|
}
|
|
25970
|
-
args.push(opts.image, ...entryPointTail, ...opts.cmd);
|
|
26095
|
+
args.push(...noImplicitEcrPullArgs(opts.image), opts.image, ...entryPointTail, ...opts.cmd);
|
|
25971
26096
|
const logger = getLogger().child("docker");
|
|
25972
26097
|
logger.debug(`${getDockerCmd()} ${redactDockerArgvValues(args).join(" ")}`);
|
|
25973
26098
|
if (collisions.length > 0) logger.warn(`Env var(s) ${collisions.map((k) => JSON.stringify(k)).join(", ")} share a name with a variable the container client reads (docker, or the CDK_DOCKER binary) or have a malformed name (empty, or containing '=' / NUL), and were NOT passed to the container at all (a colliding name would hijack that client; a malformed name cannot form a valid environment variable). Rename the env var if the container needs it.`);
|
|
@@ -27542,6 +27667,7 @@ function isCredentialFresh(creds) {
|
|
|
27542
27667
|
if (!creds.expiration) return false;
|
|
27543
27668
|
return creds.expiration.getTime() - Date.now() > STS_CREDENTIAL_SAFETY_MARGIN_MS;
|
|
27544
27669
|
}
|
|
27670
|
+
const ECR_EMULATOR_REFUSAL = (image) => `--aws-emulator: image ${image} is in a real ECR registry, and ECR is not excepted to real AWS for this workload, so it is not pulled (AWS Emulator serves no registry docker can pull from). To pull it from real ECR with your real identity, except ECR for the workload in the --env-vars file ("AWS_ENDPOINT_URL_ECR": "real-aws", under "Parameters" or the workload's own section); or pull the image yourself and pass --no-pull.`;
|
|
27545
27671
|
async function pullEcrImage(imageUri, options) {
|
|
27546
27672
|
if (realAwsException("ECR", options.workload)) return runWithRealAws(() => pullEcrImageOnSide(imageUri, options, "real"));
|
|
27547
27673
|
return pullEcrImageOnSide(imageUri, options, "default");
|
|
@@ -27557,6 +27683,7 @@ async function pullEcrImageOnSide(imageUri, options, side) {
|
|
|
27557
27683
|
await verifyImageInLocalCache(canonicalUri);
|
|
27558
27684
|
return canonicalUri;
|
|
27559
27685
|
}
|
|
27686
|
+
if (side === "default" && isAwsServiceRoutedToEmulator("ECR", options.workload)) throw new LocalInvokeBuildError$1(ECR_EMULATOR_REFUSAL(displayIdent(canonicalUri)));
|
|
27560
27687
|
const credentialConfig = ambientCredentialConfig();
|
|
27561
27688
|
const identityFingerprint = injectiveKey(side, credentialFingerprint(credentialConfig));
|
|
27562
27689
|
const callerIdentityKey = injectiveKey(identityFingerprint, callerRegion ?? "_unset");
|
|
@@ -27605,8 +27732,9 @@ async function pullEcrImageOnSide(imageUri, options, side) {
|
|
|
27605
27732
|
region: parsed.region,
|
|
27606
27733
|
...assumed && { credentials: assumed }
|
|
27607
27734
|
});
|
|
27735
|
+
const dockerEnv = dockerRegistryEnv(options.workload);
|
|
27608
27736
|
try {
|
|
27609
|
-
await ecrLogin(ecr, {
|
|
27737
|
+
await ecrLogin(ecr, dockerEnv, {
|
|
27610
27738
|
accountId: parsed.accountId,
|
|
27611
27739
|
region: parsed.region,
|
|
27612
27740
|
registryHost: canonicalUri.slice(0, canonicalUri.indexOf("/"))
|
|
@@ -27617,7 +27745,7 @@ async function pullEcrImageOnSide(imageUri, options, side) {
|
|
|
27617
27745
|
logger.info(`Pulling ${canonicalUri}...`);
|
|
27618
27746
|
const pullArgs = ["pull", canonicalUri];
|
|
27619
27747
|
try {
|
|
27620
|
-
await runDockerForeground(pullArgs);
|
|
27748
|
+
await runDockerForeground(pullArgs, { env: dockerEnv });
|
|
27621
27749
|
} catch (err) {
|
|
27622
27750
|
throw new LocalInvokeBuildError$1(`docker pull ${canonicalUri} failed: ${describeDockerFailure(err, pullArgs)}`, redactedDockerCause(err, pullArgs));
|
|
27623
27751
|
}
|
|
@@ -27651,7 +27779,7 @@ async function assumeRoleForEcr(roleArn, callerRegion, credentialConfig, logger)
|
|
|
27651
27779
|
sts.destroy();
|
|
27652
27780
|
}
|
|
27653
27781
|
}
|
|
27654
|
-
async function ecrLogin(client, target) {
|
|
27782
|
+
async function ecrLogin(client, dockerEnv, target) {
|
|
27655
27783
|
const { accountId, region, registryHost } = target;
|
|
27656
27784
|
getLogger().child("ecr-puller").debug(`ECR login (account=${accountId}, region=${region}, host=${registryHost})`);
|
|
27657
27785
|
let response;
|
|
@@ -27674,7 +27802,10 @@ async function ecrLogin(client, target) {
|
|
|
27674
27802
|
endpoint
|
|
27675
27803
|
];
|
|
27676
27804
|
try {
|
|
27677
|
-
await runDockerStreaming(loginArgs, {
|
|
27805
|
+
await runDockerStreaming(loginArgs, {
|
|
27806
|
+
input: password,
|
|
27807
|
+
env: dockerEnv
|
|
27808
|
+
});
|
|
27678
27809
|
} catch (err) {
|
|
27679
27810
|
throw new LocalInvokeBuildError$1(`ECR login failed: ${formatDockerLoginError(describeDockerFailure(err, loginArgs), endpoint)}`, redactedDockerCause(err, loginArgs));
|
|
27680
27811
|
}
|
|
@@ -28581,6 +28712,67 @@ function extractImageString(value) {
|
|
|
28581
28712
|
}
|
|
28582
28713
|
}
|
|
28583
28714
|
|
|
28715
|
+
// src/local/ecs-task-resolver/role-arn.ts
|
|
28716
|
+
const TASK_ROLE_ACCOUNT_PLACEHOLDER = "${AWS::AccountId}";
|
|
28717
|
+
const TASK_ROLE_PARTITION_PLACEHOLDER = "${AWS::Partition}";
|
|
28718
|
+
function placeholderRoleArn(pathAndName) {
|
|
28719
|
+
return `arn:${TASK_ROLE_PARTITION_PLACEHOLDER}:iam::${TASK_ROLE_ACCOUNT_PLACEHOLDER}:role${pathAndName}`;
|
|
28720
|
+
}
|
|
28721
|
+
function sameStackRoleLogicalId(value, resources) {
|
|
28722
|
+
if (!value || typeof value !== "object") return void 0;
|
|
28723
|
+
const obj = value;
|
|
28724
|
+
let refLogicalId;
|
|
28725
|
+
if ("Ref" in obj && typeof obj["Ref"] === "string") refLogicalId = obj["Ref"];
|
|
28726
|
+
else if ("Fn::GetAtt" in obj) {
|
|
28727
|
+
const arg = obj["Fn::GetAtt"];
|
|
28728
|
+
if (Array.isArray(arg) && typeof arg[0] === "string") {
|
|
28729
|
+
const attr = typeof arg[1] === "string" ? arg[1] : "";
|
|
28730
|
+
if (attr === "" || attr === "Arn") refLogicalId = arg[0];
|
|
28731
|
+
}
|
|
28732
|
+
}
|
|
28733
|
+
if (refLogicalId === void 0) return void 0;
|
|
28734
|
+
return resources[refLogicalId]?.Type === "AWS::IAM::Role" ? refLogicalId : void 0;
|
|
28735
|
+
}
|
|
28736
|
+
function roleArnFromStateRecord(logicalId, role, subContext) {
|
|
28737
|
+
if (!subContext) return { reason: "no-state" };
|
|
28738
|
+
const record = subContext.resources[logicalId];
|
|
28739
|
+
if (!record) return { reason: "no-record" };
|
|
28740
|
+
const arn = record.attributes?.["Arn"];
|
|
28741
|
+
if (typeof arn === "string" && arn.length > 0) return { arn };
|
|
28742
|
+
const name = record.physicalId;
|
|
28743
|
+
if (typeof name !== "string" || name.length === 0) return { reason: "no-record" };
|
|
28744
|
+
const rawPath = role.Properties?.["Path"];
|
|
28745
|
+
if (rawPath === void 0) return { arn: placeholderRoleArn(`/${name}`) };
|
|
28746
|
+
if (typeof rawPath !== "string" || !/^\/(?:.*\/)?$/.test(rawPath)) return { reason: "path-not-literal" };
|
|
28747
|
+
return { arn: placeholderRoleArn(`${rawPath}${name}`) };
|
|
28748
|
+
}
|
|
28749
|
+
function resolveRoleArn(value, resources, subContext) {
|
|
28750
|
+
if (value === void 0 || value === null) return {};
|
|
28751
|
+
if (typeof value === "string") return { arn: value };
|
|
28752
|
+
if (typeof value !== "object") return {};
|
|
28753
|
+
const obj = value;
|
|
28754
|
+
if ("Ref" in obj || "Fn::GetAtt" in obj) {
|
|
28755
|
+
const logicalId = sameStackRoleLogicalId(value, resources);
|
|
28756
|
+
if (logicalId === void 0) return {};
|
|
28757
|
+
const fromState = roleArnFromStateRecord(logicalId, resources[logicalId], subContext);
|
|
28758
|
+
if ("arn" in fromState) return { arn: fromState.arn };
|
|
28759
|
+
return {
|
|
28760
|
+
arn: placeholderRoleArn(`/${logicalId}`),
|
|
28761
|
+
unresolved: {
|
|
28762
|
+
logicalId,
|
|
28763
|
+
reason: fromState.reason
|
|
28764
|
+
}
|
|
28765
|
+
};
|
|
28766
|
+
}
|
|
28767
|
+
if ("Fn::Join" in obj || "Fn::Sub" in obj) {
|
|
28768
|
+
if (!subContext) return {};
|
|
28769
|
+
const sub = substituteAgainstState(value, subContext);
|
|
28770
|
+
if (sub.kind === "literal" && typeof sub.value === "string" && sub.value.length > 0) return { arn: sub.value };
|
|
28771
|
+
return {};
|
|
28772
|
+
}
|
|
28773
|
+
return {};
|
|
28774
|
+
}
|
|
28775
|
+
|
|
28584
28776
|
// src/local/ecs-task-resolver/needs.ts
|
|
28585
28777
|
function detectEcsImageResolutionNeeds(stack) {
|
|
28586
28778
|
const resources = stack.template.Resources ?? {};
|
|
@@ -28589,6 +28781,7 @@ function detectEcsImageResolutionNeeds(stack) {
|
|
|
28589
28781
|
let needsEnvOrSecretSubstitution = false;
|
|
28590
28782
|
let needsCrossStackResolver = false;
|
|
28591
28783
|
let needsAssetRepoMarker = false;
|
|
28784
|
+
let needsTaskRoleState = false;
|
|
28592
28785
|
for (const res of Object.values(resources)) {
|
|
28593
28786
|
if (res.Type !== "AWS::ECS::TaskDefinition") continue;
|
|
28594
28787
|
const props = res.Properties ?? {};
|
|
@@ -28615,6 +28808,7 @@ function detectEcsImageResolutionNeeds(stack) {
|
|
|
28615
28808
|
break;
|
|
28616
28809
|
}
|
|
28617
28810
|
}
|
|
28811
|
+
if (sameStackRoleLogicalId(props["TaskRoleArn"], resources) !== void 0) needsTaskRoleState = true;
|
|
28618
28812
|
if (isFnJoinOrSubIntrinsic(props["TaskRoleArn"]) || isFnJoinOrSubIntrinsic(props["ExecutionRoleArn"])) needsEnvOrSecretSubstitution = true;
|
|
28619
28813
|
}
|
|
28620
28814
|
return {
|
|
@@ -28622,7 +28816,8 @@ function detectEcsImageResolutionNeeds(stack) {
|
|
|
28622
28816
|
needsStateResources,
|
|
28623
28817
|
needsEnvOrSecretSubstitution,
|
|
28624
28818
|
needsCrossStackResolver,
|
|
28625
|
-
needsAssetRepoMarker
|
|
28819
|
+
needsAssetRepoMarker,
|
|
28820
|
+
needsTaskRoleState
|
|
28626
28821
|
};
|
|
28627
28822
|
}
|
|
28628
28823
|
function containerHasCrossStackEnvOrSecret(c) {
|
|
@@ -28939,34 +29134,6 @@ function buildSubstitutionContextFromImageContext(context) {
|
|
|
28939
29134
|
return subContext;
|
|
28940
29135
|
}
|
|
28941
29136
|
|
|
28942
|
-
// src/local/ecs-task-resolver/role-arn.ts
|
|
28943
|
-
const TASK_ROLE_ACCOUNT_PLACEHOLDER = "${AWS::AccountId}";
|
|
28944
|
-
function resolveRoleArn(value, resources, subContext) {
|
|
28945
|
-
if (value === void 0 || value === null) return void 0;
|
|
28946
|
-
if (typeof value === "string") return value;
|
|
28947
|
-
if (typeof value !== "object") return void 0;
|
|
28948
|
-
const obj = value;
|
|
28949
|
-
let refLogicalId;
|
|
28950
|
-
if ("Ref" in obj && typeof obj["Ref"] === "string") refLogicalId = obj["Ref"];
|
|
28951
|
-
else if ("Fn::GetAtt" in obj) {
|
|
28952
|
-
const arg = obj["Fn::GetAtt"];
|
|
28953
|
-
if (Array.isArray(arg) && typeof arg[0] === "string") {
|
|
28954
|
-
const attr = typeof arg[1] === "string" ? arg[1] : "";
|
|
28955
|
-
if (attr === "" || attr === "Arn") refLogicalId = arg[0];
|
|
28956
|
-
}
|
|
28957
|
-
}
|
|
28958
|
-
if (refLogicalId !== void 0) {
|
|
28959
|
-
if (resources[refLogicalId]?.Type !== "AWS::IAM::Role") return void 0;
|
|
28960
|
-
return `arn:aws:iam::${TASK_ROLE_ACCOUNT_PLACEHOLDER}:role/${refLogicalId}`;
|
|
28961
|
-
}
|
|
28962
|
-
if ("Fn::Join" in obj || "Fn::Sub" in obj) {
|
|
28963
|
-
if (!subContext) return void 0;
|
|
28964
|
-
const sub = substituteAgainstState(value, subContext);
|
|
28965
|
-
if (sub.kind === "literal" && typeof sub.value === "string" && sub.value.length > 0) return sub.value;
|
|
28966
|
-
return;
|
|
28967
|
-
}
|
|
28968
|
-
}
|
|
28969
|
-
|
|
28970
29137
|
// src/local/ecs-task-resolver/volume.ts
|
|
28971
29138
|
function parseVolume(raw, idx, taskLogicalId, subContext) {
|
|
28972
29139
|
if (!raw || typeof raw !== "object") throw new EcsTaskResolutionError(`Task '${taskLogicalId}' Volumes[${idx}] is not an object.`);
|
|
@@ -29101,8 +29268,13 @@ function extractTaskDefinitionProperties(stack, logicalId, resource, context) {
|
|
|
29101
29268
|
if (props["ProxyConfiguration"]) warnings.push(`Task definition '${logicalId}' declares 'ProxyConfiguration' (custom Envoy / App Mesh bootstrap), which is NOT honored by 'cdkd local start-service' / 'cdkd local run-task' in v1. Local execution will run without the configured proxy. See design doc § 2 for the rationale.`);
|
|
29102
29269
|
const resources = stack.template.Resources ?? {};
|
|
29103
29270
|
const subContext = buildSubstitutionContextFromImageContext(context);
|
|
29104
|
-
const
|
|
29105
|
-
|
|
29271
|
+
const roleSubContext = context?.ignoreStateForRoles && subContext ? {
|
|
29272
|
+
...subContext,
|
|
29273
|
+
resources: Object.fromEntries(Object.entries(subContext.resources).filter(([, r]) => r.resourceType !== "AWS::IAM::Role"))
|
|
29274
|
+
} : subContext;
|
|
29275
|
+
const taskRole = resolveRoleArn(props["TaskRoleArn"], resources, roleSubContext);
|
|
29276
|
+
const taskRoleArn = taskRole.arn;
|
|
29277
|
+
const executionRoleArn = resolveRoleArn(props["ExecutionRoleArn"], resources, roleSubContext).arn;
|
|
29106
29278
|
const runtimePlatform = parseRuntimePlatform(props["RuntimePlatform"]);
|
|
29107
29279
|
const rawContainers = props["ContainerDefinitions"];
|
|
29108
29280
|
if (!Array.isArray(rawContainers) || rawContainers.length === 0) throw new EcsTaskResolutionError(`Task definition '${logicalId}' has no ContainerDefinitions.`);
|
|
@@ -29123,6 +29295,7 @@ function extractTaskDefinitionProperties(stack, logicalId, resource, context) {
|
|
|
29123
29295
|
warnings
|
|
29124
29296
|
};
|
|
29125
29297
|
if (taskRoleArn !== void 0) out.taskRoleArn = taskRoleArn;
|
|
29298
|
+
if (taskRole.unresolved !== void 0) out.taskRoleUnresolved = taskRole.unresolved;
|
|
29126
29299
|
if (executionRoleArn !== void 0) out.executionRoleArn = executionRoleArn;
|
|
29127
29300
|
if (runtimePlatform !== void 0) out.runtimePlatform = runtimePlatform;
|
|
29128
29301
|
return out;
|
|
@@ -29518,7 +29691,11 @@ async function resolveContainerImageForStartApi(lambda, skipPull) {
|
|
|
29518
29691
|
const localBuild = await resolveLocalBuildPlan$1(lambda);
|
|
29519
29692
|
if (localBuild) return { imageRef: await buildContainerImage$1(localBuild.asset, localBuild.cdkOutDir, {
|
|
29520
29693
|
assetOutdir: localBuild.assetOutdir,
|
|
29521
|
-
architecture: lambda.architecture
|
|
29694
|
+
architecture: lambda.architecture,
|
|
29695
|
+
workload: {
|
|
29696
|
+
logicalId: lambda.logicalId,
|
|
29697
|
+
cdkPath: readCdkPathOrUndefined(lambda.resource)
|
|
29698
|
+
}
|
|
29522
29699
|
}) };
|
|
29523
29700
|
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
29701
|
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)...`);
|
|
@@ -30513,6 +30690,15 @@ function groupSecretsByContainer(resolved) {
|
|
|
30513
30690
|
}
|
|
30514
30691
|
return out;
|
|
30515
30692
|
}
|
|
30693
|
+
function previewContainerEnv(container, envOverrides) {
|
|
30694
|
+
const previewEnv = {};
|
|
30695
|
+
for (const [k, v] of Object.entries(container.environment)) defineOwnKey(previewEnv, k, v);
|
|
30696
|
+
if (envOverrides) {
|
|
30697
|
+
applyOverrideMap(previewEnv, envOverrides["Parameters"]);
|
|
30698
|
+
applyOverrideMap(previewEnv, envOverrides[container.name]);
|
|
30699
|
+
}
|
|
30700
|
+
return previewEnv;
|
|
30701
|
+
}
|
|
30516
30702
|
function buildDockerRunArgs(opts) {
|
|
30517
30703
|
const { task, container, image, network, volumeByName, secrets, containerHost, roleArn } = opts;
|
|
30518
30704
|
const args = ["run", "-d"];
|
|
@@ -30551,12 +30737,7 @@ function buildDockerRunArgs(opts) {
|
|
|
30551
30737
|
ownerPublish.push(publish);
|
|
30552
30738
|
}
|
|
30553
30739
|
const wiring = getActiveWorkloadAwsWiring();
|
|
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
|
-
}
|
|
30740
|
+
const previewEnv = previewContainerEnv(container, opts.envOverrides);
|
|
30560
30741
|
const emulatorKeysOnly = workloadGetsEmulatorKeysOnly(previewEnv, wiring);
|
|
30561
30742
|
const profileCredentialsFile = emulatorKeysOnly ? void 0 : opts.profileCredentialsFile;
|
|
30562
30743
|
if (profileCredentialsFile) both("-v", `${profileCredentialsFile.hostPath}:${profileCredentialsFile.containerPath}:ro`);
|
|
@@ -30583,11 +30764,12 @@ function buildDockerRunArgs(opts) {
|
|
|
30583
30764
|
...opts.sidecarIp !== void 0 && { sidecarIp: opts.sidecarIp }
|
|
30584
30765
|
});
|
|
30585
30766
|
Object.assign(finalEnv, metaEnv);
|
|
30586
|
-
|
|
30767
|
+
const mixedReal = taskRoleAssumedInRealAws(previewEnv, wiring) && opts.mixedModeRealTaskCredentials || opts.mixedModeRealCredentials;
|
|
30768
|
+
if (mixedReal && wiring?.mixed && !emulatorKeysOnly) {
|
|
30587
30769
|
delete finalEnv["AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"];
|
|
30588
|
-
finalEnv["AWS_ACCESS_KEY_ID"] =
|
|
30589
|
-
finalEnv["AWS_SECRET_ACCESS_KEY"] =
|
|
30590
|
-
if (
|
|
30770
|
+
finalEnv["AWS_ACCESS_KEY_ID"] = mixedReal.accessKeyId;
|
|
30771
|
+
finalEnv["AWS_SECRET_ACCESS_KEY"] = mixedReal.secretAccessKey;
|
|
30772
|
+
if (mixedReal.sessionToken) finalEnv["AWS_SESSION_TOKEN"] = mixedReal.sessionToken;
|
|
30591
30773
|
}
|
|
30592
30774
|
if (profileCredentialsFile) {
|
|
30593
30775
|
finalEnv["AWS_SHARED_CREDENTIALS_FILE"] = profileCredentialsFile.containerPath;
|
|
@@ -30601,10 +30783,16 @@ function buildDockerRunArgs(opts) {
|
|
|
30601
30783
|
applyOverrideMap(finalEnv, overrides["Parameters"]);
|
|
30602
30784
|
applyOverrideMap(finalEnv, overrides[container.name]);
|
|
30603
30785
|
}
|
|
30604
|
-
if (wiring)
|
|
30605
|
-
|
|
30606
|
-
|
|
30607
|
-
|
|
30786
|
+
if (wiring) {
|
|
30787
|
+
const task = opts.emulatorTaskCredentials;
|
|
30788
|
+
finalEnv = applyWorkloadAwsWiringToEnv(finalEnv, wiring.mode === "emulator" ? task ? {
|
|
30789
|
+
...wiring,
|
|
30790
|
+
emulatorCredentials: task
|
|
30791
|
+
} : wiring : {
|
|
30792
|
+
...wiring,
|
|
30793
|
+
env: {}
|
|
30794
|
+
});
|
|
30795
|
+
}
|
|
30608
30796
|
const sensitiveKeys = /* @__PURE__ */ new Set([
|
|
30609
30797
|
...SENSITIVE_ENV_KEYS,
|
|
30610
30798
|
...secrets.map((s) => s.name),
|
|
@@ -30635,7 +30823,7 @@ function buildDockerRunArgs(opts) {
|
|
|
30635
30823
|
both("--entrypoint", container.entryPoint[0]);
|
|
30636
30824
|
entryPointTail = container.entryPoint.slice(1);
|
|
30637
30825
|
}
|
|
30638
|
-
both(image, ...entryPointTail, ...container.command ?? []);
|
|
30826
|
+
both(...noImplicitEcrPullArgs(image), image, ...entryPointTail, ...container.command ?? []);
|
|
30639
30827
|
const loopbackPorts = wiring ? effectiveLoopbackPorts(finalEnv, wiring) : [];
|
|
30640
30828
|
return {
|
|
30641
30829
|
args,
|
|
@@ -30712,6 +30900,7 @@ async function prepareOneImage(task, container, options) {
|
|
|
30712
30900
|
const tag = `cdkd-local-run-task-${(image.assetHash ?? "single").slice(0, 16)}`;
|
|
30713
30901
|
const actualTag = await buildDockerImage(asset, cdkOutDir, {
|
|
30714
30902
|
tag,
|
|
30903
|
+
workload: { containerName: container.name },
|
|
30715
30904
|
...task.stack.assetOutdir !== void 0 && { assetOutdir: task.stack.assetOutdir },
|
|
30716
30905
|
...options.platformOverride !== void 0 && { platform: options.platformOverride },
|
|
30717
30906
|
wrapError: (stderr) => new LocalInvokeBuildError$1(`docker build failed for ECS container ${displayIdent(container.name)} (${asset.source.directory !== void 0 ? displayAssemblyPath(asset.source.directory) : asset.source.executable ? redactDockerArgvValues(asset.source.executable).join(" ") : void 0}): ${displaySafe(stderr)}`)
|
|
@@ -30998,7 +31187,9 @@ async function runEcsTask(task, options, state) {
|
|
|
30998
31187
|
...mergedAddHostFlags.length > 0 ? { addHostFlags: mergedAddHostFlags } : {},
|
|
30999
31188
|
...(options.networkAliasesByContainer?.get(container.name)?.length ?? 0) > 0 ? { networkAliases: options.networkAliasesByContainer.get(container.name) } : {},
|
|
31000
31189
|
...options.profileCredentialsFile && { profileCredentialsFile: options.profileCredentialsFile },
|
|
31001
|
-
...options.mixedModeRealCredentials && { mixedModeRealCredentials: options.mixedModeRealCredentials }
|
|
31190
|
+
...options.mixedModeRealCredentials && { mixedModeRealCredentials: options.mixedModeRealCredentials },
|
|
31191
|
+
...options.mixedModeRealTaskCredentials && { mixedModeRealTaskCredentials: options.mixedModeRealTaskCredentials },
|
|
31192
|
+
...options.emulatorTaskCredentials && { emulatorTaskCredentials: options.emulatorTaskCredentials }
|
|
31002
31193
|
});
|
|
31003
31194
|
dockerCmds.set(container.name, built.args);
|
|
31004
31195
|
dockerLoopbackPorts.set(container.name, built.loopbackPorts);
|
|
@@ -31088,16 +31279,16 @@ async function runEcsTask(task, options, state) {
|
|
|
31088
31279
|
function readFromCfnStack(source) {
|
|
31089
31280
|
return source.fromState !== true && source.fromCfnStack !== void 0 && source.fromCfnStack !== false;
|
|
31090
31281
|
}
|
|
31091
|
-
async function resolvePlaceholderAccount(arn, source) {
|
|
31282
|
+
async function resolvePlaceholderAccount(arn, source, route) {
|
|
31092
31283
|
const { region, profile } = source;
|
|
31093
|
-
if (!arn.includes("${AWS::AccountId}")) return arn;
|
|
31284
|
+
if (!arn.includes("${AWS::AccountId}") && !arn.includes("${AWS::Partition}")) return arn;
|
|
31094
31285
|
const { STSClient, GetCallerIdentityCommand } = await import("@aws-sdk/client-sts");
|
|
31095
31286
|
let sts;
|
|
31096
31287
|
if (readFromCfnStack(source)) sts = new STSClient({
|
|
31097
31288
|
...awsClientDefaults({
|
|
31098
31289
|
profile,
|
|
31099
31290
|
ignoreAssumedRole: true,
|
|
31100
|
-
realAws:
|
|
31291
|
+
realAws: route.realAws
|
|
31101
31292
|
}),
|
|
31102
31293
|
...region && { region },
|
|
31103
31294
|
...profile && { profile }
|
|
@@ -31105,15 +31296,17 @@ async function resolvePlaceholderAccount(arn, source) {
|
|
|
31105
31296
|
else sts = new STSClient({
|
|
31106
31297
|
...awsClientDefaults({
|
|
31107
31298
|
profile,
|
|
31108
|
-
realAws:
|
|
31299
|
+
realAws: route.realAws
|
|
31109
31300
|
}),
|
|
31110
31301
|
...region && { region },
|
|
31111
31302
|
...profile && { profile }
|
|
31112
31303
|
});
|
|
31113
31304
|
try {
|
|
31114
|
-
const
|
|
31305
|
+
const identity = await sts.send(new GetCallerIdentityCommand({}));
|
|
31306
|
+
const account = identity.Account;
|
|
31115
31307
|
if (!account) throw new CdkdError(`--assume-task-role: GetCallerIdentity returned no Account; cannot resolve placeholder ARN ${plainIdentOr(arn, VALUE_NOT_SHOWN, { maxCodePoints: 613 })}. Pass the ARN explicitly: --assume-task-role '<arn>'`, "LOCAL_RUN_TASK_PLACEHOLDER_NO_ACCOUNT");
|
|
31116
|
-
|
|
31308
|
+
const partition = partitionOfArn(identity.Arn);
|
|
31309
|
+
return arn.split(TASK_ROLE_ACCOUNT_PLACEHOLDER).join(account).split(TASK_ROLE_PARTITION_PLACEHOLDER).join(partition);
|
|
31117
31310
|
} catch (err) {
|
|
31118
31311
|
if (err instanceof CdkdError) throw err;
|
|
31119
31312
|
const rendered = describeLocalAwsFailureForWarn(err, "STS GetCallerIdentity");
|
|
@@ -31122,13 +31315,27 @@ async function resolvePlaceholderAccount(arn, source) {
|
|
|
31122
31315
|
sts.destroy();
|
|
31123
31316
|
}
|
|
31124
31317
|
}
|
|
31125
|
-
|
|
31318
|
+
function taskRoleNameIsLogicalIdWarning(logicalId, reason) {
|
|
31319
|
+
const id = displayIdent(logicalId);
|
|
31320
|
+
switch (reason) {
|
|
31321
|
+
case "no-state-source": return `--assume-task-role: TaskRoleArn references the same-stack role ${id}, and without --from-state (cdkd-deployed) or --from-cfn-stack (cdk-deployed) cdkd cannot read the name it was deployed under, so cdkd assumes a role named ${id}. A role CDK names for you is deployed as '<Stack>-<LogicalId>-<suffix>', where AssumeRole fails: pass --from-state / --from-cfn-stack, or pass the ARN explicitly: --assume-task-role '<arn>'.`;
|
|
31322
|
+
case "state-not-read": return `--assume-task-role: cdkd read no state record for the task role ${id} (the target names no single stack, or the stack has no record: it is not deployed), so cdkd assumes a role named ${id}. Name the stack in the target ('<Stack>:<LogicalId>' or a display path), deploy the stack first, or pass the ARN explicitly: --assume-task-role '<arn>'.`;
|
|
31323
|
+
case "mixed-mode-emulator-iam": return `--assume-task-role: in AWS Emulator mixed mode the task role is assumed in real AWS, but the state record's IAM roles are the emulator's, so cdkd does not read ${id} from it and assumes a role named ${id}. Mark IAM as a "real-aws" exception under Parameters (AWS_ENDPOINT_URL_IAM), or pass the ARN explicitly: --assume-task-role '<arn>'.`;
|
|
31324
|
+
case "no-record": return `--assume-task-role: the state source has no record of the task role ${id}, so cdkd assumes a role named ${id}. Deploy the stack first, or pass the ARN explicitly: --assume-task-role '<arn>'.`;
|
|
31325
|
+
case "path-not-literal": return `--assume-task-role: the template's Path for the task role ${id} is not a literal IAM path, so cdkd cannot build its ARN from the stack's record, so cdkd assumes a role named ${id}. Pass the ARN explicitly: --assume-task-role '<arn>'.`;
|
|
31326
|
+
}
|
|
31327
|
+
}
|
|
31328
|
+
function partitionOfArn(arn) {
|
|
31329
|
+
const segment = arn?.split(":")[1];
|
|
31330
|
+
return arn?.startsWith("arn:") && segment ? segment : "aws";
|
|
31331
|
+
}
|
|
31332
|
+
async function assumeTaskRole(roleArn, region, route) {
|
|
31126
31333
|
assertSendableRoleArn(roleArn);
|
|
31127
31334
|
const { STSClient } = await import("@aws-sdk/client-sts");
|
|
31128
31335
|
const sts = new STSClient({
|
|
31129
31336
|
...awsClientDefaults({
|
|
31130
31337
|
ignoreAssumedRole: true,
|
|
31131
|
-
realAws:
|
|
31338
|
+
realAws: route.realAws
|
|
31132
31339
|
}),
|
|
31133
31340
|
...region && { region }
|
|
31134
31341
|
});
|
|
@@ -31189,8 +31396,11 @@ async function buildEcsImageResolutionContext$1(candidate, stateProvider, option
|
|
|
31189
31396
|
const logger = getLogger();
|
|
31190
31397
|
if (!candidate) return {};
|
|
31191
31398
|
const needs = detectEcsImageResolutionNeeds(candidate);
|
|
31192
|
-
|
|
31399
|
+
const roleRecordUsable = !taskRoleRecordIsEmulatorSide();
|
|
31400
|
+
const wantsStateForTaskRole = !!stateProvider && needs.needsTaskRoleState && options.assumeTaskRole === true && roleRecordUsable;
|
|
31401
|
+
if (!needs.needsPseudoParameters && !needs.needsStateResources && !needs.needsEnvOrSecretSubstitution && !needs.needsAssetRepoMarker && !wantsStateForTaskRole) return {};
|
|
31193
31402
|
const ctx = {};
|
|
31403
|
+
if (!roleRecordUsable) ctx.ignoreStateForRoles = true;
|
|
31194
31404
|
let stateRecordRegion;
|
|
31195
31405
|
const wantsPseudoForEnvOrSecret = !!stateProvider && needs.needsEnvOrSecretSubstitution;
|
|
31196
31406
|
if (needs.needsPseudoParameters || wantsPseudoForEnvOrSecret) {
|
|
@@ -31217,7 +31427,7 @@ async function buildEcsImageResolutionContext$1(candidate, stateProvider, option
|
|
|
31217
31427
|
}
|
|
31218
31428
|
};
|
|
31219
31429
|
}
|
|
31220
|
-
const wantsState = needs.needsStateResources || needs.needsEnvOrSecretSubstitution;
|
|
31430
|
+
const wantsState = needs.needsStateResources || needs.needsEnvOrSecretSubstitution || wantsStateForTaskRole;
|
|
31221
31431
|
if (stateProvider && wantsState) {
|
|
31222
31432
|
const loaded = await stateProvider.load(candidate.stackName, candidate.region);
|
|
31223
31433
|
if (loaded) {
|
|
@@ -31245,6 +31455,9 @@ async function buildEcsImageResolutionContext$1(candidate, stateProvider, option
|
|
|
31245
31455
|
...stateRecordRegion !== void 0 && { stateRecordRegion }
|
|
31246
31456
|
};
|
|
31247
31457
|
}
|
|
31458
|
+
function taskRoleRecordIsEmulatorSide() {
|
|
31459
|
+
return getActiveWorkloadAwsWiring$1()?.mixed !== void 0 && !realAwsException("IAM");
|
|
31460
|
+
}
|
|
31248
31461
|
function pickCandidateStack(parsed, target, stacks) {
|
|
31249
31462
|
const byPrefix = stackForPathFormTarget(parsed, target, stacks);
|
|
31250
31463
|
if (byPrefix) return byPrefix;
|
|
@@ -31278,26 +31491,48 @@ function readEnvOverridesFile$2(filePath) {
|
|
|
31278
31491
|
}
|
|
31279
31492
|
|
|
31280
31493
|
// src/cli/commands/local-run-task/credentials.ts
|
|
31281
|
-
async function resolveSidecarCredentials(options, assumedCredentials) {
|
|
31494
|
+
async function resolveSidecarCredentials(options, assumedCredentials, emulatorTaskCredentials) {
|
|
31282
31495
|
const wiring = getActiveWorkloadAwsWiring();
|
|
31283
|
-
if (wiring?.mode === "emulator"
|
|
31284
|
-
|
|
31496
|
+
if (wiring?.mode === "emulator" || wiring?.mixed) {
|
|
31497
|
+
if (emulatorTaskCredentials) return emulatorTaskCredentials;
|
|
31498
|
+
return wiring.mode === "emulator" ? wiring.emulatorCredentials : wiring.mixed?.emulatorCredentials;
|
|
31499
|
+
}
|
|
31285
31500
|
if (assumedCredentials) return assumedCredentials;
|
|
31286
31501
|
if (options.profile) return resolveProfileCredentials(options.profile);
|
|
31287
31502
|
return resolveHostDefaultCredentials();
|
|
31288
31503
|
}
|
|
31504
|
+
function planTaskRoleCredentials(containers, envOverrides, roleRequested) {
|
|
31505
|
+
const wiring = getActiveWorkloadAwsWiring();
|
|
31506
|
+
const envs = containers.map((c) => previewContainerEnv(c, envOverrides));
|
|
31507
|
+
const realSts = envs.map((env) => taskRoleAssumedInRealAws(env, wiring));
|
|
31508
|
+
const assumeInRealAws = roleRequested && realSts.some((r) => r);
|
|
31509
|
+
return {
|
|
31510
|
+
assumeInRealAws,
|
|
31511
|
+
assumeInEmulator: roleRequested && wiring?.mode === "emulator",
|
|
31512
|
+
ignoredInMixedMode: roleRequested && wiring?.mixed !== void 0 && !assumeInRealAws,
|
|
31513
|
+
callerIdentityNeeded: envs.some((env, i) => !workloadGetsEmulatorKeysOnly(env, wiring) && !(assumeInRealAws && realSts[i]))
|
|
31514
|
+
};
|
|
31515
|
+
}
|
|
31289
31516
|
async function resolveTaskCredentialChannels(options, assumedCredentials, opts) {
|
|
31290
|
-
const
|
|
31517
|
+
const emulatorTaskCredentials = opts?.emulatorTaskCredentials;
|
|
31518
|
+
const sidecarCredentials = await resolveSidecarCredentials(options, assumedCredentials, emulatorTaskCredentials);
|
|
31519
|
+
const emulatorTask = emulatorTaskCredentials && { emulatorTaskCredentials };
|
|
31291
31520
|
if (getActiveWorkloadAwsWiring()?.mixed) {
|
|
31292
|
-
const
|
|
31521
|
+
const caller = opts?.callerIdentityNeeded === false ? void 0 : options.profile ? await resolveProfileCredentials(options.profile) : await resolveHostDefaultCredentials();
|
|
31293
31522
|
return {
|
|
31294
31523
|
sidecarCredentials,
|
|
31295
31524
|
profileCredsFile: void 0,
|
|
31296
|
-
...
|
|
31525
|
+
...caller && { mixedModeRealCredentials: caller },
|
|
31526
|
+
...assumedCredentials && { mixedModeRealTaskCredentials: assumedCredentials },
|
|
31527
|
+
...emulatorTask
|
|
31297
31528
|
};
|
|
31298
31529
|
}
|
|
31299
|
-
|
|
31300
|
-
|
|
31530
|
+
if (getActiveWorkloadAwsWiring()?.mode === "emulator") return {
|
|
31531
|
+
sidecarCredentials,
|
|
31532
|
+
profileCredsFile: void 0,
|
|
31533
|
+
...emulatorTask
|
|
31534
|
+
};
|
|
31535
|
+
if (options.profile && sidecarCredentials && !assumedCredentials) return {
|
|
31301
31536
|
sidecarCredentials,
|
|
31302
31537
|
profileCredsFile: await writeProfileCredentialsFile(options.profile, sidecarCredentials, opts)
|
|
31303
31538
|
};
|
|
@@ -31317,6 +31552,8 @@ function buildRunEcsTaskOptions(options, channels, extra = {}) {
|
|
|
31317
31552
|
if (extra.envOverrides) runOpts.envOverrides = extra.envOverrides;
|
|
31318
31553
|
if (channels.sidecarCredentials) runOpts.taskCredentials = channels.sidecarCredentials;
|
|
31319
31554
|
if (channels.mixedModeRealCredentials) runOpts.mixedModeRealCredentials = channels.mixedModeRealCredentials;
|
|
31555
|
+
if (channels.mixedModeRealTaskCredentials) runOpts.mixedModeRealTaskCredentials = channels.mixedModeRealTaskCredentials;
|
|
31556
|
+
if (channels.emulatorTaskCredentials) runOpts.emulatorTaskCredentials = channels.emulatorTaskCredentials;
|
|
31320
31557
|
if (extra.resolvedRoleArn) runOpts.taskRoleArn = extra.resolvedRoleArn;
|
|
31321
31558
|
if (options.platform) runOpts.platformOverride = options.platform;
|
|
31322
31559
|
if (options.region) runOpts.region = options.region;
|
|
@@ -31497,15 +31734,26 @@ async function localRunTaskCommand(target, options) {
|
|
|
31497
31734
|
cleanup().then(() => process.exit(130));
|
|
31498
31735
|
};
|
|
31499
31736
|
process.on("SIGINT", sigintHandler);
|
|
31737
|
+
const envOverrides = readEnvOverridesFile$2(options.envVars);
|
|
31738
|
+
const roleRequested = options.assumeTaskRole === true || typeof options.assumeTaskRole === "string";
|
|
31739
|
+
const plan = planTaskRoleCredentials(task.containers, envOverrides, roleRequested);
|
|
31740
|
+
if (plan.ignoredInMixedMode) logger.warn("--assume-task-role has no effect in AWS Emulator mixed mode unless a container marks STS as an exception (AWS_ENDPOINT_URL_STS=\"real-aws\"): calls to the emulator are re-signed with the emulator's keys, so the role is not assumed.");
|
|
31500
31741
|
let assumedCredentials;
|
|
31742
|
+
let emulatorTaskCredentials;
|
|
31501
31743
|
let resolvedRoleArn;
|
|
31502
|
-
|
|
31503
|
-
|
|
31504
|
-
|
|
31505
|
-
|
|
31506
|
-
|
|
31507
|
-
|
|
31508
|
-
|
|
31744
|
+
const assumes = plan.assumeInRealAws || plan.assumeInEmulator;
|
|
31745
|
+
if (options.assumeTaskRole === true && !task.taskRoleArn && assumes) throw new Error("--assume-task-role passed without an ARN but the task definition has no resolvable TaskRoleArn. Either the task definition does not set TaskRoleArn, or it points at a resource cdkd cannot resolve to an IAM Role at synth time. Pass the ARN explicitly: --assume-task-role '<arn>'");
|
|
31746
|
+
const roleArnTemplate = options.assumeTaskRole === true ? task.taskRoleArn : typeof options.assumeTaskRole === "string" ? options.assumeTaskRole : void 0;
|
|
31747
|
+
if (roleArnTemplate !== void 0 && assumes) {
|
|
31748
|
+
const realAws = plan.assumeInRealAws;
|
|
31749
|
+
if (options.assumeTaskRole === true && task.taskRoleUnresolved !== void 0) {
|
|
31750
|
+
const { logicalId, reason } = task.taskRoleUnresolved;
|
|
31751
|
+
logger.warn(taskRoleNameIsLogicalIdWarning(logicalId, !stateProvider ? "no-state-source" : taskRoleRecordIsEmulatorSide() ? "mixed-mode-emulator-iam" : reason === "no-state" ? "state-not-read" : reason));
|
|
31752
|
+
}
|
|
31753
|
+
resolvedRoleArn = options.assumeTaskRole === true ? await resolvePlaceholderAccount(roleArnTemplate, options, { realAws }) : roleArnTemplate;
|
|
31754
|
+
const creds = await assumeTaskRole(resolvedRoleArn, options.region, { realAws });
|
|
31755
|
+
if (realAws) assumedCredentials = creds;
|
|
31756
|
+
else emulatorTaskCredentials = creds;
|
|
31509
31757
|
}
|
|
31510
31758
|
channels = await resolveTaskCredentialChannels(options, assumedCredentials, {
|
|
31511
31759
|
onDirCreated: (hostPath) => {
|
|
@@ -31513,9 +31761,10 @@ async function localRunTaskCommand(target, options) {
|
|
|
31513
31761
|
},
|
|
31514
31762
|
onDirRemoved: () => {
|
|
31515
31763
|
credsHostPath = void 0;
|
|
31516
|
-
}
|
|
31764
|
+
},
|
|
31765
|
+
emulatorTaskCredentials,
|
|
31766
|
+
callerIdentityNeeded: plan.callerIdentityNeeded
|
|
31517
31767
|
});
|
|
31518
|
-
const envOverrides = readEnvOverridesFile$2(options.envVars);
|
|
31519
31768
|
const runOpts = buildRunEcsTaskOptions(options, channels, {
|
|
31520
31769
|
...envOverrides !== void 0 && { envOverrides },
|
|
31521
31770
|
...resolvedRoleArn !== void 0 && { resolvedRoleArn },
|
|
@@ -32237,7 +32486,11 @@ async function resolveAgentCoreImage(resolved, options, assemblyDir, loaded) {
|
|
|
32237
32486
|
if (entry) return buildContainerImage$1(entry.asset, cdkOutDir, {
|
|
32238
32487
|
assetOutdir: assemblyDir,
|
|
32239
32488
|
architecture,
|
|
32240
|
-
noBuild: options.build === false
|
|
32489
|
+
noBuild: options.build === false,
|
|
32490
|
+
workload: {
|
|
32491
|
+
logicalId: resolved.logicalId,
|
|
32492
|
+
cdkPath: readCdkPathOrUndefined(resolved.resource)
|
|
32493
|
+
}
|
|
32241
32494
|
});
|
|
32242
32495
|
}
|
|
32243
32496
|
}
|
|
@@ -33626,7 +33879,11 @@ async function resolveContainerImagePlan(lambda, options) {
|
|
|
33626
33879
|
if (localBuild) imageRef = await buildContainerImage$1(localBuild.asset, localBuild.cdkOutDir, {
|
|
33627
33880
|
assetOutdir: localBuild.assetOutdir,
|
|
33628
33881
|
architecture: lambda.architecture,
|
|
33629
|
-
noBuild: options.build === false
|
|
33882
|
+
noBuild: options.build === false,
|
|
33883
|
+
workload: {
|
|
33884
|
+
logicalId: lambda.logicalId,
|
|
33885
|
+
cdkPath: readCdkPathOrUndefined(lambda.resource)
|
|
33886
|
+
}
|
|
33630
33887
|
});
|
|
33631
33888
|
else {
|
|
33632
33889
|
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.`);
|
|
@@ -33793,4 +34050,4 @@ function collectVerbFlags(program) {
|
|
|
33793
34050
|
}
|
|
33794
34051
|
|
|
33795
34052
|
export { resolveSecretDerivedPrincipals as a, buildProgram, isResolvableSecretPrincipalList as i, runDestroyForStack as n, canonicalizeIpProtocolValue as o, holdsUnprovenSecretPrincipalToken as r, canonicalizeIpv4Cidr as t };
|
|
33796
|
-
//# sourceMappingURL=program-
|
|
34053
|
+
//# sourceMappingURL=program-DSlYCm_d.js.map
|