@go-to-k/cdkd 0.291.12 → 0.291.14
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/{asg-provider-BTiCRWQZ.js → asg-provider-EkJQ0mD9.js} +2 -2
- package/dist/{asg-provider-BTiCRWQZ.js.map → asg-provider-EkJQ0mD9.js.map} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{deploy-engine-CqKbD4yk.js → deploy-engine-WVUZ-Jm8.js} +137 -33
- package/dist/deploy-engine-WVUZ-Jm8.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/{program-BwCSQ51f.js → program-D7aismcf.js} +277 -50
- package/dist/{program-BwCSQ51f.js.map → program-D7aismcf.js.map} +1 -1
- package/dist/{version-CdZXcCGn.js → version-DHj4zq1f.js} +2 -2
- package/dist/{version-CdZXcCGn.js.map → version-DHj4zq1f.js.map} +1 -1
- package/package.json +2 -2
- package/dist/deploy-engine-CqKbD4yk.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { $ as yellow, $a as
|
|
1
|
+
import { $ as yellow, $a as normalizeAwsError, $i as uploadCfnTemplate, $n as repairMalformedResourcePropertiesForReadOnly, $r as createAssetRedirectResolver, $t as requireConfigObject, A as createPreDeleteFinalSnapshot, Ai as warnFinchArgvExposure, An as malformedOutputsRefusalMessage, Ar as S3StateBackend, At as carriesDynamicReference, B as isStatefulRecreateTargetSync, Bi as resolveAutoAssetStorage, Bn as refuseMalformedOrphansForDestroy, Br as hasReadableExportSet, Bt as isSettledInstanceState, C as namesAnyDeclaredParameter, Ci as getDockerCmd, Cn as isReadableResourceEntry, Cr as pathCrossesDottedKey, Ct as UNSPECIFIED_SKIP_REASON, D as PRE_DELETE_SNAPSHOT_TYPES, Da as resetAwsClients, Di as redactDockerArgvValues, Dn as malformedOrphanRecordsWarning, Dr as redactSecretsForState, Dt as disableInstanceApiTermination, E as ATOMIC_FINAL_SNAPSHOT_TYPES, Ea as getAwsClients, Ei as partitionSensitiveEnv, En as malformedLocalOutputsWarning, Er as recoverMaskedOutput, Et as isWaitAbandonedError, F as extractDeploymentEventError, Fa as DeployCancelledError, Fi as Synthesizer, Fn as malformedResourcesWarning, Fr as forceQuitRecoveryClause, Ft as isImpossibleEmptyStoredAttribute, G as toCfnInteger, Ga as ResourceTimeoutError, Gi as resolveUseCdkBootstrapAssets, Gn as refuseMalformedResourceEntries, Gr as isReadableBag, Gt as coerceCfnBoolean, H as WARM_THROUGHPUT_MEMBERS, Ha as NestedStackChildDirectDestroyError, Hi as resolveSkipPrefix, Hn as refuseMalformedOutputs, Hr as hasUnverifiableParameterRefusal, Ht as normalizeAwsTagsToCfn, I as makeSiblingClaimReader, Ia as DynamicReferenceRegionAmbiguousError, Ii as synthesisStatusMessage, In as malformedStateRefusalMessage, Ir as formatLockExpiry, It as isNamelessDynamicReferenceError, J as bold, Ja as StackTerminationProtectionError, Ji as ssmResolvedValueType, Jn as refuseMalformedResourcesForDestroy, Jr as shouldRetainResource, Jt as configIntegerRefusal, K as toFiniteNumber, Ka as ResourceUpdateNotSupportedError, Ki as stateBucketExistenceConfirmed, Kn as refuseMalformedResourceEntriesForOrphan, Kr as orphansAfterRollback, Kt as coerceCfnInteger, L as planOrphanAdoption, La as IntrinsicResolutionRefusalError, Li as getDefaultStateBucketName, Ln as refuseDivergentRecordRegionForDestroy, Lr as CUSTOM_RESOURCE_RESPONSE_PREFIX, Lt as isUnboundTemplateParameter, M as refusesFinalSnapshot, Mi as stripControlChars, Mn as malformedRenderedContainersWarning, Mr as UNREPRODUCIBLE_LOCK_CLAUSE, Mt as cfnRefValueFromPhysicalId, N as unsupportedFinalSnapshotError, Na as CrossAccountSecretRefusalError, Ni as AssetManifestLoader, Nn as malformedResourceEntriesWarning, Nr as buildForceUnlockCommand, Nt as coerceParameterTypedValue, O as buildFinalSnapshotIdentifier, Oa as runWithStackAwsClients, Oi as runDockerForeground, On as malformedOrphansRefusalMessage, Or as scrubResourceRecord, Ot as isTerminationProtectionPropagationError, P as makeCanonicalizePropertiesFn, Pi as getDockerImageBySourceHash, Pn as malformedResourcePropertiesWarning, Pr as buildLockContentionMessage, Pt as getAccountInfo, Q as red, Qi as findLargeInlineResources, Qn as repairMalformedResourceEntriesForReadOnly, Qr as buildAssetRedirectMap, Qt as requireConfigArray, R as MULTI_REGION_RECREATE_BLOCKED_TYPES, Ra as LocalInvokeBuildError$1, Ri as getLegacyStateBucketName, Rn as refuseMalformedNestedChildOutputs, Rr as DEFAULT_STATE_PREFIX, Rt as parameterTypeMayLoseSecretIdentity, S as computeParameterTaint, Sa as resolveAssemblyPath, Si as formatDockerLoginError, Sn as hasReadableResources, Sr as maskSecretsInText, St as slowCcOperationTimeoutMs, T as resourcesNamingDeclaredParameter, Ta as AwsClients, Ti as isMalformedEnvKey, Tn as malformedExportSourceWarning, Tr as recordMaskOnlyValuesIn, Tt as deleteSkipReason, U as coerceWarmThroughput$1, Ua as PartialFailureError, Ui as resolveStateBucketWithDefault, Un as refuseMalformedOutputsForDestroy, Ur as importableOutputKeys, Ut as resolveExplicitPhysicalId, V as renderStatefulReason, Va as MalformedProducerRecordRefusalError, Vi as resolveCaptureObservedState, Vn as refuseMalformedOrphansForOrphan, Vr as hasReasonlessBaselineRefusal, Vt as WAFv2WebACLProvider, W as isWarmThroughputDecrease, Wa as ProvisioningError, Wi as resolveStateBucketWithDefaultAndSource, Wn as refuseMalformedResourceAttributesForOrphan, Wr as importableOutputs, Wt as assertRegionMatch, X as gray, Xa as SynthesisError, Xi as CFN_TEMPLATE_URL_LIMIT, Xn as repairMalformedOrphansForReadOnly, Xr as stringifyValue, Xt as readConfigString, Y as cyan, Yi as CFN_TEMPLATE_BODY_LIMIT, Yn as refuseMalformedState, Yr as AssetPublisher, Yt as configStringRefusal, Z as green, Zi as MIGRATE_TMP_PREFIX, Zn as repairMalformedOutputsForReadOnly, Zr as WorkGraph, Zt as replayWarn, _ as bagHoldsSecretExpression, _a as nullPrototypeRecord, _i as describeDockerCapturedOutput, _n as UNREADABLE_ORPHANS_CONTAINER_ROW, _r as identityKeyFor, _t as endCommandInterruptScope, a as DeploymentEventsStore, aa as decodeListingKey, ai as ensureAssetStorage, an as s3BucketDomainName, ao as isThrottlingError, ar as describeTypeWithThrottleRetry, at as secretBearingStateKeyWarning, b as mergeNoChangeOutputs, ba as displayAssemblyPath, bi as dockerSpawnEnvWithSensitive, bn as hasReadableOrphans, br as markSameGenerationBag, bt as startInterruptWatch, c as replayFailedOperations, ca as canonicalizeRegion, ci as parseBootstrapMarker, cn as s3BucketWebsiteUrl, co as markRedactedCause, cr as TemplateParser, ct as IAMRoleProvider, d as updatePartialMessage, da as failedStageNote, di as validateContainerRepoName, dn as applyCallerIdentityCredentials, do as safeStringify, dr as STATE_SOURCED_READBACK_RULES, dt as ProviderRegistry, ea as CUSTOM_RESOURCE_RESPONSE_OBJECT_DESCRIPTION, ei as loadPublishableAssetManifest, en as requireConfigString, eo as withErrorHandling, er as repairMalformedResourcesForReadOnly, et as collectDeclaredOutputNames, f as updatePartialReason, fa as globMatches, fi as buildDenyExternalAccessPolicy, fn as callerEnvCredentials, fr as TEMPLATE_SOURCED_RULES, ft as wouldReturnToSdkProvider, g as computeImplicitDeleteEdges, ga as hasPlainPrototype, gi as warnManifestExecutable, gn as STATE_RESOURCES_MALFORMED, gr as errorCauseChain, gt as beginCommandInterruptScope, h as IMPLICIT_DELETE_DEPENDENCIES, ha as hasOwnKey, hi as resolveDockerContextDirectory, hn as INTRINSIC_KEYS, hr as dynamicReferenceTokens, ht as maskerOrIdentity, i as DeploymentEventsReader, ia as producerRecordKey, ii as assertAssetBucketRegion, in as s3BucketArn, io as isRetryableTransientError, ir as findSilentDropProperties, it as secretBearing, j as isFinalSnapshotError, ja as CdkdError, ji as escapeRegExp, jn as malformedOutputsWarning, jr as rebuildClientForBucketRegion, jt as carriesFetchableDynamicReference, k as ccRoutedFinalSnapshotError, ka as setAwsClients, ki as runDockerStreaming, kn as malformedOrphansWarning, kr as LockManager, kt as IntrinsicFunctionResolver, l as replayRollback, la as derivePartitionAndUrlSuffix, li as readBootstrapMarkerBody, ln as applyRoleArnIfSet, lo as retryClassificationText, lr as STATE_SOURCED_BASELINE_RULES, lt as collectInlinePolicyNamesManagedBySiblings, m as maskingRetryLogger, ma as defineOwnKey, mi as buildDockerImage, mn as DiffCalculator, mr as createSecretMasker, mt as maskDeep, n as DEFAULT_RESOURCE_WARN_AFTER_MS, na as injectiveKeyPrefix, ni as AssetModeResolver, nn as producerRegionsFromState, no as shellQuote, nr as safeStackName, nt as exportAliasCollisionScrubWarning, o as planFailedOps, oa as expectedOwnerParam, oi as getBootstrapMarkerKey, on as s3BucketDualStackDomainName, oo as isTransientServerError, or as withRetry, ot as secretSafeKeyDisplay, p as withResourceDeadline, pa as processStackMessages, pi as assertCdkLocalDockerContextContained, pn as envCredentialsAreAssumedRole, pr as carriesSecretMask, pt as createMaskedRetryLogger, q as formatResourceLine, qa as StackHasActiveImportsError, qi as warnDeprecatedNoPrefixCliFlag, qn as refuseMalformedResourcePropertiesForOrphan, qr as orphansCarriedFrom, qt as configBooleanRefusal, r as DeployEngine, ra as producerCoordinateKey, ri as BOOTSTRAP_MARKER_PREFIX, rn as withSharedDrainBudget, ro as isMarkedNonRetryable, rr as findActionableSilentDrops, rt as isExportAliasCollision, s as planRollback, sa as PARTITION_TABLE, si as isCrossRegionRedirect, sn as s3BucketRegionalDomainName, so as markNonRetryable, sr as DagBuilder, st as getCurrentResourceSecrets, t as DEFAULT_RESOURCE_TIMEOUT_MS, ta as injectiveKey, ti as rewriteTemplateAssetReferences, tn as classifyReplaySecretRegion, to as pasteableCommand, tr as safeRegion, tt as collectPublishedOutputNames, u as resolveReplacementOldType, ua as AssemblyReader, ui as validateAssetBucketName, un as AWS_CREDENTIAL_ENV_KEYS, uo as describeAwsFailure, ur as STATE_SOURCED_CROSS_GENERATION_RULES, ut as clearOnUpdateRemoval, v as isSecretBearingReferenceString, va as ownValue, vi as describeDockerExecFailure, vn as UNREADABLE_RESOURCES_MAP_ROW, vr as isSingleDynamicReferenceToken, vt as interruptWatchListenerCount, w as reachableDivergentParameters, wa as resolveBucketRegion, wi as isDockerClientEnvKey, wn as malformedExportNamesWarning, wr as recordMaskOnlyValue, wt as deleteIndeterminateGuards, x as bindingSkippedOutputs, xa as renderAssemblyPathEscape, xi as finchSecretArgvRefusal, xn as hasReadableOutputs, xr as maskSecretsInError, xt as CloudControlProvider, y as keptWholeReasonText, ya as absoluteAssemblyPathEscape, yi as describeDockerFailure, yn as displayLogicalId, yr as isUncertifiedBaselineMaskPosition, yt as isInterruptedWaitError, z as isStatefulRecreateTargetForReplace, za as LocalStartServiceError, zi as resolveApp, zn as refuseMalformedOrphans, zr as exportNamesCarriedFrom, zt as refStateLookupFromResource } from "./deploy-engine-WVUZ-Jm8.js";
|
|
2
2
|
import { C as displayAwsMessage, D as truncateCodePoints, E as isPasteableIdent, S as UNRENDERABLE, T as displaySafe, _ as withSkipPrefix, b as SECRET_REF_MAX_CODE_POINTS, c as PATTERN_B_NAME_OPTIONS, f as explicitNamePropertyFor, h as getCurrentStackName, i as reserveStdoutForPayload, l as PATTERN_B_NAME_PROPERTIES, m as generateResourceNameWithFallback, n as getLogger, o as runStackBuffered, p as generateResourceName, s as getLiveRenderer, u as PATTERN_B_RESOURCE_TYPES, v as withStackName, w as displayIdent, x as STACK_REF_MAX_CODE_POINTS } from "./logger-GASr9bAF.js";
|
|
3
3
|
import { n as awsClientDefaults, s as ambientRegion } from "./aws-client-defaults-jISU4PHo.js";
|
|
4
|
-
import { t as getCdkdVersion } from "./version-
|
|
5
|
-
import { a as renderDisableCommand, i as protectedReplacementAdvice, r as UNNAMEABLE_ID_CLAUSE, t as ASGProvider } from "./asg-provider-
|
|
4
|
+
import { t as getCdkdVersion } from "./version-DHj4zq1f.js";
|
|
5
|
+
import { a as renderDisableCommand, i as protectedReplacementAdvice, r as UNNAMEABLE_ID_CLAUSE, t as ASGProvider } from "./asg-provider-EkJQ0mD9.js";
|
|
6
6
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
7
7
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
8
8
|
import { CopyObjectCommand, CreateBucketCommand, DeleteBucketAnalyticsConfigurationCommand, DeleteBucketCommand, DeleteBucketCorsCommand, DeleteBucketEncryptionCommand, DeleteBucketIntelligentTieringConfigurationCommand, DeleteBucketInventoryConfigurationCommand, DeleteBucketLifecycleCommand, DeleteBucketMetricsConfigurationCommand, DeleteBucketOwnershipControlsCommand, DeleteBucketPolicyCommand, DeleteBucketReplicationCommand, DeleteBucketTaggingCommand, DeleteBucketWebsiteCommand, DeleteObjectsCommand, GetBucketAccelerateConfigurationCommand, GetBucketCorsCommand, GetBucketEncryptionCommand, GetBucketLifecycleConfigurationCommand, GetBucketLocationCommand, GetBucketLoggingCommand, GetBucketNotificationConfigurationCommand, GetBucketOwnershipControlsCommand, GetBucketPolicyCommand, GetBucketReplicationCommand, GetBucketTaggingCommand, GetBucketVersioningCommand, GetBucketWebsiteCommand, GetObjectCommand, GetObjectLockConfigurationCommand, GetPublicAccessBlockCommand, HeadBucketCommand, ListBucketAnalyticsConfigurationsCommand, ListBucketIntelligentTieringConfigurationsCommand, ListBucketInventoryConfigurationsCommand, ListBucketMetricsConfigurationsCommand, ListObjectVersionsCommand, ListObjectsV2Command, NoSuchBucket, NotFound, PutBucketAccelerateConfigurationCommand, PutBucketAnalyticsConfigurationCommand, PutBucketCorsCommand, PutBucketEncryptionCommand, PutBucketIntelligentTieringConfigurationCommand, PutBucketInventoryConfigurationCommand, PutBucketLifecycleConfigurationCommand, PutBucketLoggingCommand, PutBucketMetricsConfigurationCommand, PutBucketNotificationConfigurationCommand, PutBucketOwnershipControlsCommand, PutBucketPolicyCommand, PutBucketReplicationCommand, PutBucketTaggingCommand, PutBucketVersioningCommand, PutBucketWebsiteCommand, PutObjectCommand, PutObjectLockConfigurationCommand, PutPublicAccessBlockCommand, S3Client, S3ServiceException } from "@aws-sdk/client-s3";
|
|
@@ -2397,7 +2397,7 @@ function resolveVerboseTemplatePath(outputDir, stackName) {
|
|
|
2397
2397
|
try {
|
|
2398
2398
|
linked = lstatSync(resolved.path).isSymbolicLink();
|
|
2399
2399
|
} catch {}
|
|
2400
|
-
if (linked) throw new SynthesisError(`Stack '${displaySafe(stackName)}' would write its template over a symbolic link at
|
|
2400
|
+
if (linked) throw new SynthesisError(`Stack '${displaySafe(stackName)}' would write its template over a symbolic link at ${displayAssemblyPath(resolved.path)}. cdkd writes a stack's template as a regular file beside the assembly; a symbolic link there redirects the write to wherever it points, so this indicates the synth output was hand-modified or generated by a non-CDK toolchain. Refusing to write it.`);
|
|
2401
2401
|
return resolved.path;
|
|
2402
2402
|
}
|
|
2403
2403
|
/**
|
|
@@ -3797,7 +3797,7 @@ const MAX_RENDERED_HOPS = 8;
|
|
|
3797
3797
|
* the two a reader needs.
|
|
3798
3798
|
*/
|
|
3799
3799
|
function renderChain(chain) {
|
|
3800
|
-
const hop = (h) => `'${displaySafe(h.logicalId)}' (${
|
|
3800
|
+
const hop = (h) => `'${displaySafe(h.logicalId)}' (${displayAssemblyPath(h.templatePath)})`;
|
|
3801
3801
|
if (chain.length <= MAX_RENDERED_HOPS) return chain.map(hop).join(" -> ");
|
|
3802
3802
|
const keep = MAX_RENDERED_HOPS / 2;
|
|
3803
3803
|
return [
|
|
@@ -3828,8 +3828,8 @@ function renderNestedTemplateTreeDefect(defect, stackName, action) {
|
|
|
3828
3828
|
}
|
|
3829
3829
|
if (defect.kind === "too-large") return `The nested template tree under stack '${displaySafe(stackName)}' has more than ${MAX_ROWS_FOLLOWED} nested-stack rows to follow (the walk stopped at ${renderChain(defect.chain)}). That is far beyond any CDK-generated assembly. Symlinked directories can give one template file many paths, which multiplies the tree without ever repeating on one chain. Refusing to ${action}.`;
|
|
3830
3830
|
if (defect.kind === "too-deep") return `The nested template tree under stack '${displaySafe(stackName)}' nests more than ${512} levels deep: ${renderChain(defect.chain)}. No tree that deep can deploy, because each level lengthens the child's state key and S3 caps a key at 1024 bytes. ${provenance}`;
|
|
3831
|
-
if (defect.kind === "escaping-path") return `The nested template tree under stack '${displaySafe(stackName)}' has nested stack '${displaySafe(defect.logicalId)}' (reached through ${renderChain(defect.chain)}) with Metadata['aws:asset:path']
|
|
3832
|
-
return `The nested template tree under stack '${displaySafe(stackName)}' has nested stack '${displaySafe(defect.logicalId)}' (reached through ${renderChain(defect.chain)}) with Metadata['aws:asset:path']
|
|
3831
|
+
if (defect.kind === "escaping-path") return `The nested template tree under stack '${displaySafe(stackName)}' has nested stack '${displaySafe(defect.logicalId)}' (reached through ${renderChain(defect.chain)}) with Metadata['aws:asset:path']=${displayAssemblyPath(defect.assetPath)} which ${renderAssemblyPathEscape(defect.escape, defect.dir, action)}`;
|
|
3832
|
+
return `The nested template tree under stack '${displaySafe(stackName)}' has nested stack '${displaySafe(defect.logicalId)}' (reached through ${renderChain(defect.chain)}) with Metadata['aws:asset:path']=${displayAssemblyPath(defect.assetPath)} which is absolute. ${provenance}`;
|
|
3833
3833
|
}
|
|
3834
3834
|
|
|
3835
3835
|
//#endregion
|
|
@@ -15261,8 +15261,7 @@ var LambdaUrlProvider = class {
|
|
|
15261
15261
|
}
|
|
15262
15262
|
if (!changed) return {
|
|
15263
15263
|
physicalId,
|
|
15264
|
-
wasReplaced: false
|
|
15265
|
-
attributes: {}
|
|
15264
|
+
wasReplaced: false
|
|
15266
15265
|
};
|
|
15267
15266
|
let authTypeUnusable = false;
|
|
15268
15267
|
const requestedAuthType = requireConfigString(properties["AuthType"], "NONE", "AWS::Lambda::Url AuthType", { onUnusable: (message) => {
|
|
@@ -15404,13 +15403,31 @@ var LambdaUrlProvider = class {
|
|
|
15404
15403
|
* Users adopting an existing function URL should pass
|
|
15405
15404
|
* `--resource <logicalId>=<functionArnOrName>` (matching the physical id
|
|
15406
15405
|
* format returned by `create()`).
|
|
15406
|
+
*
|
|
15407
|
+
* The override is read back with `GetFunctionUrlConfig` so the record gets
|
|
15408
|
+
* the same `FunctionUrl` / `FunctionArn` attributes `create()` records
|
|
15409
|
+
* (issue #3624). Neither can be built from the physical id, so without them
|
|
15410
|
+
* a sibling's `Fn::GetAtt [<Url>, FunctionUrl]` (a CloudFront
|
|
15411
|
+
* `FunctionUrlOrigin`) stays an unresolved intrinsic in its imported record.
|
|
15412
|
+
* The deploy-time stale-attribute heal (#1852) re-reads through this method
|
|
15413
|
+
* too. Returns `null` when no URL config exists behind the id.
|
|
15407
15414
|
*/
|
|
15408
15415
|
async import(input) {
|
|
15409
|
-
if (input.knownPhysicalId) return
|
|
15416
|
+
if (!input.knownPhysicalId) return null;
|
|
15417
|
+
let resp;
|
|
15418
|
+
try {
|
|
15419
|
+
resp = await this.lambdaClient.send(new GetFunctionUrlConfigCommand({ FunctionName: input.knownPhysicalId }));
|
|
15420
|
+
} catch (err) {
|
|
15421
|
+
if (err instanceof ResourceNotFoundException) return null;
|
|
15422
|
+
throw err;
|
|
15423
|
+
}
|
|
15424
|
+
return {
|
|
15410
15425
|
physicalId: input.knownPhysicalId,
|
|
15411
|
-
attributes: {
|
|
15426
|
+
attributes: definedAttributes({
|
|
15427
|
+
FunctionUrl: resp.FunctionUrl,
|
|
15428
|
+
FunctionArn: resp.FunctionArn
|
|
15429
|
+
})
|
|
15412
15430
|
};
|
|
15413
|
-
return null;
|
|
15414
15431
|
}
|
|
15415
15432
|
/**
|
|
15416
15433
|
* Build CORS configuration from CDK properties.
|
|
@@ -58787,7 +58804,10 @@ var EMRInstanceGroupConfigProvider = class {
|
|
|
58787
58804
|
this.logger.debug(`Successfully added EMR instance group ${logicalId}: ${groupId}`);
|
|
58788
58805
|
return {
|
|
58789
58806
|
physicalId: groupId,
|
|
58790
|
-
attributes: {
|
|
58807
|
+
attributes: {
|
|
58808
|
+
Id: groupId,
|
|
58809
|
+
InstanceGroupId: groupId
|
|
58810
|
+
}
|
|
58791
58811
|
};
|
|
58792
58812
|
} catch (error) {
|
|
58793
58813
|
if (error instanceof ProvisioningError) throw error;
|
|
@@ -58858,7 +58878,10 @@ var EMRInstanceGroupConfigProvider = class {
|
|
|
58858
58878
|
return {
|
|
58859
58879
|
physicalId,
|
|
58860
58880
|
wasReplaced: false,
|
|
58861
|
-
attributes: {
|
|
58881
|
+
attributes: {
|
|
58882
|
+
Id: physicalId,
|
|
58883
|
+
InstanceGroupId: physicalId
|
|
58884
|
+
}
|
|
58862
58885
|
};
|
|
58863
58886
|
} catch (error) {
|
|
58864
58887
|
if (error instanceof ProvisioningError || error instanceof ResourceUpdateNotSupportedError) throw error;
|
|
@@ -58891,7 +58914,7 @@ var EMRInstanceGroupConfigProvider = class {
|
|
|
58891
58914
|
this.logger.debug(`EMR instance group ${physicalId} (role ${role ?? "unknown"}) has no standalone delete API; its instances are released when the parent cluster terminates. Removing cdkd state only.`);
|
|
58892
58915
|
}
|
|
58893
58916
|
async getAttribute(physicalId, _resourceType, attributeName) {
|
|
58894
|
-
if (attributeName === "Id") return physicalId;
|
|
58917
|
+
if (attributeName === "Id" || attributeName === "InstanceGroupId") return physicalId;
|
|
58895
58918
|
}
|
|
58896
58919
|
/**
|
|
58897
58920
|
* Poll until the group is `RUNNING` AND its `RunningInstanceCount` equals
|
|
@@ -65439,18 +65462,18 @@ var NestedStackProvider = class {
|
|
|
65439
65462
|
try {
|
|
65440
65463
|
raw = fs.readFileSync(templatePath, "utf-8");
|
|
65441
65464
|
} catch (err) {
|
|
65442
|
-
throw new Error(`Failed to read nested template at ${
|
|
65465
|
+
throw new Error(`Failed to read nested template at ${displayAssemblyPath(templatePath)}: ${displaySafe(err instanceof Error ? err.message : String(err))}`);
|
|
65443
65466
|
}
|
|
65444
65467
|
let template;
|
|
65445
65468
|
try {
|
|
65446
65469
|
template = JSON.parse(raw);
|
|
65447
65470
|
} catch (err) {
|
|
65448
|
-
throw new Error(`Failed to parse nested template at ${
|
|
65471
|
+
throw new Error(`Failed to parse nested template at ${displayAssemblyPath(templatePath)}: ${displaySafe(err instanceof Error ? err.message : String(err))}`);
|
|
65449
65472
|
}
|
|
65450
65473
|
const grandchildTemplates = this.indexGrandchildTemplates(template, templatePath);
|
|
65451
65474
|
if (assetRedirect) {
|
|
65452
65475
|
const n = rewriteTemplateAssetReferences(template, assetRedirect);
|
|
65453
|
-
if (n > 0) this.logger.debug(`Rewrote ${n} asset reference(s) to cdkd asset storage in nested template ${
|
|
65476
|
+
if (n > 0) this.logger.debug(`Rewrote ${n} asset reference(s) to cdkd asset storage in nested template ${displayAssemblyPath(templatePath)}`);
|
|
65454
65477
|
}
|
|
65455
65478
|
return {
|
|
65456
65479
|
template,
|
|
@@ -65461,9 +65484,9 @@ var NestedStackProvider = class {
|
|
|
65461
65484
|
const dir = path.dirname(childTemplatePath);
|
|
65462
65485
|
const result = Object.create(null);
|
|
65463
65486
|
for (const { logicalId: grandLogicalId, assetPath } of listNestedTemplateRows(childTemplate)) {
|
|
65464
|
-
if (isAbsoluteCrossPlatform$1(assetPath)) throw markNonRetryable(/* @__PURE__ */ new Error(`NestedStackProvider: nested-stack '${displaySafe(grandLogicalId)}' has Metadata['aws:asset:path']
|
|
65487
|
+
if (isAbsoluteCrossPlatform$1(assetPath)) throw markNonRetryable(/* @__PURE__ */ new Error(`NestedStackProvider: nested-stack '${displaySafe(grandLogicalId)}' has Metadata['aws:asset:path']=${displayAssemblyPath(assetPath)} which is absolute. CDK emits relative asset paths for nested templates; an absolute path indicates the synth output was hand-modified or generated by a non-CDK toolchain. Refusing to load.`));
|
|
65465
65488
|
const resolved = resolveAssemblyPath(dir, assetPath);
|
|
65466
|
-
if (!resolved.contained) throw markNonRetryable(/* @__PURE__ */ new Error(`NestedStackProvider: nested-stack '${displaySafe(grandLogicalId)}' has Metadata['aws:asset:path']
|
|
65489
|
+
if (!resolved.contained) throw markNonRetryable(/* @__PURE__ */ new Error(`NestedStackProvider: nested-stack '${displaySafe(grandLogicalId)}' has Metadata['aws:asset:path']=${displayAssemblyPath(assetPath)} which ${renderAssemblyPathEscape(resolved, dir)}`));
|
|
65467
65490
|
result[grandLogicalId] = resolved.path;
|
|
65468
65491
|
}
|
|
65469
65492
|
return result;
|
|
@@ -68375,9 +68398,9 @@ function indexNestedChildTemplates(template, templatePath) {
|
|
|
68375
68398
|
if (resource?.Type !== "AWS::CloudFormation::Stack") continue;
|
|
68376
68399
|
const assetPath = resource.Metadata?.["aws:asset:path"];
|
|
68377
68400
|
if (typeof assetPath !== "string" || assetPath.length === 0) continue;
|
|
68378
|
-
if (isAbsoluteCrossPlatform(assetPath)) throw new Error(`Nested stack '${displaySafe(logicalId)}' has Metadata['aws:asset:path']
|
|
68401
|
+
if (isAbsoluteCrossPlatform(assetPath)) throw new Error(`Nested stack '${displaySafe(logicalId)}' has Metadata['aws:asset:path']=${displayAssemblyPath(assetPath)} which is absolute. CDK emits relative asset paths for nested templates; an absolute path indicates the synth output was hand-modified or generated by a non-CDK toolchain. Refusing to load.`);
|
|
68379
68402
|
const resolved = resolveAssemblyPath(dir, assetPath);
|
|
68380
|
-
if (!resolved.contained) throw new Error(`Nested stack '${displaySafe(logicalId)}' has Metadata['aws:asset:path']
|
|
68403
|
+
if (!resolved.contained) throw new Error(`Nested stack '${displaySafe(logicalId)}' has Metadata['aws:asset:path']=${displayAssemblyPath(assetPath)} which ${renderAssemblyPathEscape(resolved, dir)}`);
|
|
68381
68404
|
result[logicalId] = resolved.path;
|
|
68382
68405
|
}
|
|
68383
68406
|
return result;
|
|
@@ -68770,7 +68793,7 @@ async function buildDiffTree(args) {
|
|
|
68770
68793
|
if (!childTemplatePath) throw new Error(`Nested template file not found for ${NESTED_STACK_RESOURCE_TYPE} '${logicalId}' under stack '${stackName}'. Verify the synth output emits Metadata['aws:asset:path'] on this resource (CDK 2.x cdk.NestedStack does so by default), then re-run synth.`);
|
|
68771
68794
|
const childStackName = `${stackName}~${logicalId}`;
|
|
68772
68795
|
const resolvedChildPath = path.resolve(childTemplatePath);
|
|
68773
|
-
if (ancestorTemplatePaths?.has(resolvedChildPath) === true) throw new Error(`Nested stack '${displaySafe(logicalId)}' under stack '${displaySafe(stackName)}' resolves to nested template
|
|
68796
|
+
if (ancestorTemplatePaths?.has(resolvedChildPath) === true) throw new Error(`Nested stack '${displaySafe(logicalId)}' under stack '${displaySafe(stackName)}' resolves to nested template ${displayAssemblyPath(resolvedChildPath)}, which is already being diffed higher up the same nesting chain. Its Metadata['aws:asset:path'] closes a cycle; CDK emits an acyclic nested template tree, so this indicates the synth output was hand-modified or generated by a non-CDK toolchain. Refusing to diff.`);
|
|
68774
68797
|
const childAncestorTemplatePaths = new Set(ancestorTemplatePaths ?? []).add(resolvedChildPath);
|
|
68775
68798
|
const childTemplate = readNestedTemplate(childTemplatePath);
|
|
68776
68799
|
if (assetRedirect) rewriteTemplateAssetReferences(childTemplate, assetRedirect);
|
|
@@ -72863,6 +72886,36 @@ function deepEqual(a, b) {
|
|
|
72863
72886
|
}
|
|
72864
72887
|
return true;
|
|
72865
72888
|
}
|
|
72889
|
+
/**
|
|
72890
|
+
* {@link deepEqual}, except that a `mask` STRING on the state side matches any
|
|
72891
|
+
* STRING on the AWS side (issue
|
|
72892
|
+
* [#3595](https://github.com/go-to-k/cdkd/issues/3595)).
|
|
72893
|
+
*
|
|
72894
|
+
* Answers "do these two differ ANYWHERE other than at a masked position?" —
|
|
72895
|
+
* the question that separates a baseline cdkd could not certify from real
|
|
72896
|
+
* drift beside it. Positional and shape-strict on purpose: an array whose
|
|
72897
|
+
* length changed or whose elements AWS reordered is NOT equal, because a mask
|
|
72898
|
+
* cannot say which element it stood for, and treating a reorder as equal would
|
|
72899
|
+
* hide an edit. Only a string can match a mask, since the redaction masks
|
|
72900
|
+
* string leaves alone.
|
|
72901
|
+
*/
|
|
72902
|
+
function equalModuloMask(state, aws, mask) {
|
|
72903
|
+
const a = jsonForm(state);
|
|
72904
|
+
const b = jsonForm(aws);
|
|
72905
|
+
if (a === mask && typeof b === "string") return true;
|
|
72906
|
+
if (a === b) return true;
|
|
72907
|
+
if (a === null || b === null || a === void 0 || b === void 0) return a === b;
|
|
72908
|
+
if (typeof a !== typeof b || typeof a !== "object") return false;
|
|
72909
|
+
if (Array.isArray(a) || Array.isArray(b)) {
|
|
72910
|
+
if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) return false;
|
|
72911
|
+
return a.every((v, i) => equalModuloMask(v, b[i], mask));
|
|
72912
|
+
}
|
|
72913
|
+
const aObj = a;
|
|
72914
|
+
const bObj = b;
|
|
72915
|
+
const aKeys = Object.keys(aObj);
|
|
72916
|
+
if (aKeys.length !== Object.keys(bObj).length) return false;
|
|
72917
|
+
return aKeys.every((key) => Object.prototype.hasOwnProperty.call(bObj, key) && equalModuloMask(aObj[key], bObj[key], mask));
|
|
72918
|
+
}
|
|
72866
72919
|
function isPlainObject(value) {
|
|
72867
72920
|
return typeof value === "object" && value !== null;
|
|
72868
72921
|
}
|
|
@@ -73608,6 +73661,10 @@ const UNCOMPARED_REASONS = {
|
|
|
73608
73661
|
kind: "unknown",
|
|
73609
73662
|
phrase: "only PARTIALLY compared: cdkd refused to resolve a dynamic reference their state records"
|
|
73610
73663
|
},
|
|
73664
|
+
uncertifiedBaseline: {
|
|
73665
|
+
kind: "unknown",
|
|
73666
|
+
phrase: "only PARTIALLY compared: their recorded baseline holds the redaction mask where cdkd could not tell which live value a secret reference became"
|
|
73667
|
+
},
|
|
73611
73668
|
unresolvedToken: {
|
|
73612
73669
|
kind: "unknown",
|
|
73613
73670
|
phrase: "only PARTIALLY compared: their state records a `{{resolve:...}}` spelling cdkd resolves for nobody, which no re-run can clear"
|
|
@@ -73644,6 +73701,7 @@ const UNCOMPARED_REASONS = {
|
|
|
73644
73701
|
const ANY_OF_IT_COMPARED = {
|
|
73645
73702
|
refused: true,
|
|
73646
73703
|
unresolvedToken: true,
|
|
73704
|
+
uncertifiedBaseline: true,
|
|
73647
73705
|
readFailed: false,
|
|
73648
73706
|
baselineRefused: false,
|
|
73649
73707
|
unreadableRecord: false
|
|
@@ -74182,7 +74240,8 @@ function notComparedReason(cause) {
|
|
|
74182
74240
|
unresolvedToken: "its state records a `{{resolve:...}}` spelling cdkd resolves for nobody (permanent; a re-run cannot clear it)",
|
|
74183
74241
|
readFailed: "the read or comparison threw, so NONE of its properties were compared",
|
|
74184
74242
|
unreadableRecord: "its state record is not readable as a resource — not an object, or carrying no resource type — so there was nothing to compare (repair or re-import the record)",
|
|
74185
|
-
baselineRefused: "a `cdkd import` run refused to capture its observed baseline, so the only baseline available is the recorded properties that refusal already found untrustworthy (deploy a change to this resource to restore one)"
|
|
74243
|
+
baselineRefused: "a `cdkd import` run refused to capture its observed baseline, so the only baseline available is the recorded properties that refusal already found untrustworthy (deploy a change to this resource to restore one)",
|
|
74244
|
+
uncertifiedBaseline: "its recorded baseline holds the redaction mask at a position cdkd could not pair with the secret reference there, so that position was not compared — every other property was (deploy a change to this resource to re-capture the baseline)"
|
|
74186
74245
|
}[cause];
|
|
74187
74246
|
}
|
|
74188
74247
|
/**
|
|
@@ -74399,6 +74458,54 @@ async function resolveStateSecretExpressions(props, resolvers, secrets, options)
|
|
|
74399
74458
|
return await walk(props, "");
|
|
74400
74459
|
}
|
|
74401
74460
|
/**
|
|
74461
|
+
* Split off the changes that exist ONLY because the observed baseline holds an
|
|
74462
|
+
* uncertified-position mask (issue
|
|
74463
|
+
* [#3595](https://github.com/go-to-k/cdkd/issues/3595)).
|
|
74464
|
+
*
|
|
74465
|
+
* Issue [#2852](https://github.com/go-to-k/cdkd/issues/2852) writes
|
|
74466
|
+
* {@link SECRET_MASK} into `observedProperties` at every position the readback
|
|
74467
|
+
* walk could not pair with a dynamic reference in the source. No live value
|
|
74468
|
+
* equals the mask, so before this every such resource read `drifted` on every
|
|
74469
|
+
* run — a change nobody made, which `--accept` refused and no no-change deploy
|
|
74470
|
+
* cleared. The position is not drifted; it is UNKNOWN, and is reported that
|
|
74471
|
+
* way (`uncertifiedBaseline`, exit 2) instead.
|
|
74472
|
+
*
|
|
74473
|
+
* A change qualifies only when all three hold:
|
|
74474
|
+
*
|
|
74475
|
+
* - its state side carries a mask;
|
|
74476
|
+
* - the mask is the fail-closed class, not a `NoEcho` one
|
|
74477
|
+
* ({@link isUncertifiedBaselineMaskPosition}) — a `NoEcho` mask keeps the
|
|
74478
|
+
* issue #2274 disposition;
|
|
74479
|
+
* - the two sides are equal once each masked string is allowed to match any
|
|
74480
|
+
* live string ({@link equalModuloMask}). Anything else — a length change, a
|
|
74481
|
+
* reorder, an edit beside the mask — stays real drift.
|
|
74482
|
+
*
|
|
74483
|
+
* Runs on the COMPARISON values, before {@link redactDriftChanges}: after it
|
|
74484
|
+
* the AWS side is itself a mask or an expression and the equality means
|
|
74485
|
+
* nothing. The split-off changes reach no printer, no `--json` payload and
|
|
74486
|
+
* neither remediation path; nothing about them is persisted or pushed.
|
|
74487
|
+
*
|
|
74488
|
+
* Accepted residuals, both inherent to a position cdkd cannot name: a secret
|
|
74489
|
+
* rotated (or edited) AT a masked position is not seen, and a masked element of
|
|
74490
|
+
* a declared-unordered array is sorted apart from its live counterpart and so
|
|
74491
|
+
* stays `drifted`.
|
|
74492
|
+
*/
|
|
74493
|
+
function partitionUncertifiedBaselineChanges(changes, properties, baseline) {
|
|
74494
|
+
const kept = [];
|
|
74495
|
+
const uncertifiedPaths = [];
|
|
74496
|
+
for (const change of changes) {
|
|
74497
|
+
if (carriesSecretMask(change.stateValue) && isUncertifiedBaselineMaskPosition(properties, change.path) && !pathCrossesDottedKey(baseline, change.path) && equalModuloMask(change.stateValue, change.awsValue, "***")) {
|
|
74498
|
+
uncertifiedPaths.push(change.path);
|
|
74499
|
+
continue;
|
|
74500
|
+
}
|
|
74501
|
+
kept.push(change);
|
|
74502
|
+
}
|
|
74503
|
+
return {
|
|
74504
|
+
kept,
|
|
74505
|
+
uncertifiedPaths
|
|
74506
|
+
};
|
|
74507
|
+
}
|
|
74508
|
+
/**
|
|
74402
74509
|
* Is a drift reported at `path` positioned on, or above, a known secret?
|
|
74403
74510
|
*
|
|
74404
74511
|
* The PREFIX direction is the one that matters: a secret sits at a leaf (or at
|
|
@@ -74472,7 +74579,7 @@ function acceptRefusalReason(change, maskedPaths) {
|
|
|
74472
74579
|
if (!maskedPaths.has(change.path)) return void 0;
|
|
74473
74580
|
if (change.path.includes("***")) return "its property NAME came back carrying a secret value, so cdkd cannot name the key to write — and no redaction pass can clear it either, since they all walk values and never keys. ROTATE the secret; that is the only remedy";
|
|
74474
74581
|
if (change.awsValue === void 0) return "AWS no longer reports it, and accepting an absence DELETES the key — which at or above a secret dynamic reference would erase the reference out of cdkd state. Use --revert to push it back, or re-deploy";
|
|
74475
|
-
if (change.stateValue === "***") return "cdkd does not know the value that belongs at this position — the baseline holds only the redaction mask, so accepting would write AWS-held plaintext over a deliberate redaction.
|
|
74582
|
+
if (change.stateValue === "***") return "cdkd does not know the value that belongs at this position — the baseline holds only the redaction mask, so accepting would write AWS-held plaintext over a deliberate redaction. A `cdkd deploy` that CHANGES this resource re-captures the baseline (a deploy that changes nothing does not); where the value came from a `NoEcho` custom resource, that custom resource must update too, so its handler supplies the value again";
|
|
74476
74583
|
return "it carries a secret dynamic reference and the value AWS currently holds is not the one the reference resolves to";
|
|
74477
74584
|
}
|
|
74478
74585
|
/**
|
|
@@ -74681,12 +74788,13 @@ async function runDriftForStack(stackName, region, stateBackend, providerRegistr
|
|
|
74681
74788
|
baseline: provider.canonicalizeDriftProperties(resource.resourceType, protocolNormalized.baseline),
|
|
74682
74789
|
aws: provider.canonicalizeDriftProperties(resource.resourceType, protocolNormalized.aws)
|
|
74683
74790
|
} : protocolNormalized;
|
|
74684
|
-
const
|
|
74791
|
+
const partitioned = partitionUncertifiedBaselineChanges(calculateResourceDrift(canonicalized.baseline, canonicalized.aws, {
|
|
74685
74792
|
ignorePaths: observedIgnorePaths.length ? [...ignorePaths, ...observedIgnorePaths] : ignorePaths,
|
|
74686
74793
|
unionWalkObjects: useObserved,
|
|
74687
74794
|
unorderedPaths
|
|
74688
|
-
}),
|
|
74689
|
-
const
|
|
74795
|
+
}), resource.properties ?? {}, baseline);
|
|
74796
|
+
const reported = redactDriftChanges(partitioned.kept, secrets, secretResolutionFailed ? seededSecretPaths : secretPaths, maskSecretPaths);
|
|
74797
|
+
const notComparedCause = secretResolutionFailed ? "refused" : partitioned.uncertifiedPaths.length > 0 ? "uncertifiedBaseline" : unresolvedTokens.size > 0 ? "unresolvedToken" : void 0;
|
|
74690
74798
|
if (reported.changes.length === 0) {
|
|
74691
74799
|
if (notComparedCause !== void 0) outcomes.push({
|
|
74692
74800
|
kind: "notCompared",
|
|
@@ -74706,6 +74814,8 @@ async function runDriftForStack(stackName, region, stateBackend, providerRegistr
|
|
|
74706
74814
|
...reported,
|
|
74707
74815
|
awsProperties: aws,
|
|
74708
74816
|
secrets,
|
|
74817
|
+
uncertifiedPaths: partitioned.uncertifiedPaths,
|
|
74818
|
+
secretsIncomplete: secretResolutionFailed || unresolvedTokens.size > 0,
|
|
74709
74819
|
notComparedCause
|
|
74710
74820
|
});
|
|
74711
74821
|
} catch (err) {
|
|
@@ -75713,6 +75823,108 @@ function corroboratedLeafCount(send, live, wildcardLeaf = isMaskLeaf) {
|
|
|
75713
75823
|
return deepEqualUnordered(send, live) ? 1 : void 0;
|
|
75714
75824
|
}
|
|
75715
75825
|
/**
|
|
75826
|
+
* Send AWS's OWN value at every uncertified-baseline position (issue
|
|
75827
|
+
* [#3595](https://github.com/go-to-k/cdkd/issues/3595)).
|
|
75828
|
+
*
|
|
75829
|
+
* Detection split those positions off because the baseline's `***` was the
|
|
75830
|
+
* only difference there, so there is nothing to revert at them. But
|
|
75831
|
+
* {@link buildRevertNewProperties} overlays whole TOP-LEVEL keys: a real change
|
|
75832
|
+
* elsewhere under the same key carries the baseline subtree — masks included —
|
|
75833
|
+
* into the send bag, and {@link preserveLiveValuesAtMaskedLeaves} then cannot
|
|
75834
|
+
* pair an anchor-less list and refuses the whole resource. Detection already
|
|
75835
|
+
* certified the alignment ({@link equalModuloMask} held on these very
|
|
75836
|
+
* positions), so the live subtree is copied in wholesale.
|
|
75837
|
+
*
|
|
75838
|
+
* Every live STRING standing where the baseline held the mask is registered as
|
|
75839
|
+
* a mask-only needle — at EVERY uncertified path, overlaid or not — as the mask
|
|
75840
|
+
* walk does for the leaves it copies: the value cdkd could not name may be a
|
|
75841
|
+
* secret, and the send bag is what the provider's log lines see. Registration
|
|
75842
|
+
* is POSITIONAL where the two sides line up, and covers every live string under
|
|
75843
|
+
* the path where they do not (over-masking fails safe). It is only the OVERLAY
|
|
75844
|
+
* that leaves a non-aligned path untouched, so the mask walk after this one
|
|
75845
|
+
* still refuses rather than guesses. The #1644 narrowing write does not rely on
|
|
75846
|
+
* the needles alone: {@link keepBaselineAtUncertifiedPaths} keeps the masked
|
|
75847
|
+
* baseline value at these paths whatever the value's length.
|
|
75848
|
+
*/
|
|
75849
|
+
function overlayLiveAtUncertifiedPaths(send, uncertifiedPaths, awsProperties, baseline, secrets, overlaidTopLevelKeys) {
|
|
75850
|
+
if (uncertifiedPaths.length === 0) return send;
|
|
75851
|
+
let out = send;
|
|
75852
|
+
for (const path of uncertifiedPaths) {
|
|
75853
|
+
const live = getAtPath(awsProperties, path);
|
|
75854
|
+
const masked = getAtPath(baseline, path);
|
|
75855
|
+
if (!(live !== void 0 && equalModuloMask(masked, live, "***"))) {
|
|
75856
|
+
if (live !== void 0) recordMaskOnlyValuesIn(live, secrets);
|
|
75857
|
+
continue;
|
|
75858
|
+
}
|
|
75859
|
+
const needles = [];
|
|
75860
|
+
const collect = (b, l) => {
|
|
75861
|
+
if (b === "***" && typeof l === "string") {
|
|
75862
|
+
needles.push(l);
|
|
75863
|
+
return;
|
|
75864
|
+
}
|
|
75865
|
+
if (Array.isArray(b) && Array.isArray(l)) {
|
|
75866
|
+
b.forEach((item, i) => collect(item, l[i]));
|
|
75867
|
+
return;
|
|
75868
|
+
}
|
|
75869
|
+
if (b !== null && typeof b === "object" && l !== null && typeof l === "object") {
|
|
75870
|
+
for (const key of Object.keys(b)) if (hasOwnKey(l, key)) collect(b[key], ownValue(l, key));
|
|
75871
|
+
}
|
|
75872
|
+
};
|
|
75873
|
+
collect(masked, live);
|
|
75874
|
+
for (const needle of needles) recordMaskOnlyValue(secrets, needle);
|
|
75875
|
+
const topLevelKey = path.split(".", 1)[0] ?? "";
|
|
75876
|
+
if (overlaidTopLevelKeys.has(topLevelKey)) out = withValueAtPath(out, path, live);
|
|
75877
|
+
}
|
|
75878
|
+
return out;
|
|
75879
|
+
}
|
|
75880
|
+
/**
|
|
75881
|
+
* Put the BASELINE's own value back at every uncertified-baseline path of a
|
|
75882
|
+
* #1644 narrowing delta (issue [#3595](https://github.com/go-to-k/cdkd/issues/3595)).
|
|
75883
|
+
*
|
|
75884
|
+
* The delta is the provider's echo of what it delivered, and at such a path
|
|
75885
|
+
* that is a live value cdkd could not name: the position source holds `***`
|
|
75886
|
+
* rather than a reference, so the fail-closed walk never fires there, and a
|
|
75887
|
+
* needle shorter than the substitution floor is never registered. Keeping the
|
|
75888
|
+
* masked baseline value there persists nothing new — the position was unknown
|
|
75889
|
+
* before the revert and stays unknown — whatever the value's length. A path
|
|
75890
|
+
* the delta does not reach (its top-level key was not narrowed, or was
|
|
75891
|
+
* dropped) is left alone. The WHOLE baseline subtree comes back, so a real
|
|
75892
|
+
* narrowing of an unmasked neighbour inside it is undone too; the next run
|
|
75893
|
+
* then reports that as drift (the comparison is shape-strict), which is the
|
|
75894
|
+
* safe side of persisting a value cdkd cannot name.
|
|
75895
|
+
*/
|
|
75896
|
+
function keepBaselineAtUncertifiedPaths(delta, uncertifiedPaths, baseline) {
|
|
75897
|
+
let out = delta;
|
|
75898
|
+
for (const path of uncertifiedPaths) {
|
|
75899
|
+
if (getAtPath(out, path) === void 0) continue;
|
|
75900
|
+
const kept = getAtPath(baseline, path);
|
|
75901
|
+
if (kept === void 0) continue;
|
|
75902
|
+
out = withValueAtPath(out, path, kept);
|
|
75903
|
+
}
|
|
75904
|
+
return out;
|
|
75905
|
+
}
|
|
75906
|
+
/**
|
|
75907
|
+
* `bag` with `value` at the dotted `path`, rebuilding each ancestor rather than
|
|
75908
|
+
* writing into it, so the caller's bag — shared with the detection outcome —
|
|
75909
|
+
* is never mutated. Own keys throughout, for `getAtPath`'s reason. A path whose
|
|
75910
|
+
* ancestor is not a plain object returns `bag` unchanged.
|
|
75911
|
+
*/
|
|
75912
|
+
function withValueAtPath(bag, path, value) {
|
|
75913
|
+
const [head, ...rest] = path.split(".");
|
|
75914
|
+
if (head === void 0) return bag;
|
|
75915
|
+
const out = {};
|
|
75916
|
+
for (const [k, v] of Object.entries(bag)) defineOwnKey(out, k, v);
|
|
75917
|
+
if (rest.length === 0) {
|
|
75918
|
+
defineOwnKey(out, head, value);
|
|
75919
|
+
return out;
|
|
75920
|
+
}
|
|
75921
|
+
const child = hasOwnKey(bag, head) ? ownValue(bag, head) : void 0;
|
|
75922
|
+
if (child === null || typeof child !== "object" || Array.isArray(child)) return bag;
|
|
75923
|
+
if (!hasPlainPrototype(child)) return bag;
|
|
75924
|
+
defineOwnKey(out, head, withValueAtPath(child, rest.join("."), value));
|
|
75925
|
+
return out;
|
|
75926
|
+
}
|
|
75927
|
+
/**
|
|
75716
75928
|
* Keep `cdkd drift --revert` from pushing a REDACTION MASK to AWS (issue
|
|
75717
75929
|
* [#2274](https://github.com/go-to-k/cdkd/issues/2274)).
|
|
75718
75930
|
*
|
|
@@ -76139,8 +76351,8 @@ async function runRevert(reports, providerRegistry, stateBackend, stateConfig, a
|
|
|
76139
76351
|
if (unresolvedTokens.size > 0) logger.warn(` ! [revert] ${report.stackName}/${outcome.logicalId} (${outcome.resourceType}): cdkd cannot resolve ${maskSecretsInText([...unresolvedTokens].join(", "), secrets)} — a property whose WHOLE value is one of these tokens is left UNCHANGED by this revert when cdkd can pair its position against AWS's report (a list element by an identity field, or by its list's own unchanged literal values). Where it cannot pair, and where a token is EMBEDDED in a longer string, the token is written literally, exactly as 'cdkd deploy' does, so a resolved value AWS holds there is overwritten.`);
|
|
76140
76352
|
let newProperties;
|
|
76141
76353
|
try {
|
|
76142
|
-
const
|
|
76143
|
-
const maskPreserved = preserveLiveValuesAtMaskedLeaves(unresolvedTokens.size > 0 ? preserveLiveValuesAtUnresolvedTokens(
|
|
76354
|
+
const certifiedOverlay = overlayLiveAtUncertifiedPaths(buildRevertNewProperties(outcome.changes, desiredProperties, outcome.awsProperties, { preserveUntemplated: stateResource.observedProperties === void 0 }), outcome.uncertifiedPaths, outcome.awsProperties, desiredProperties, secrets, new Set(outcome.changes.map((change) => change.path.split(".", 1)[0] ?? "")));
|
|
76355
|
+
const maskPreserved = preserveLiveValuesAtMaskedLeaves(unresolvedTokens.size > 0 ? preserveLiveValuesAtUnresolvedTokens(certifiedOverlay, outcome.awsProperties) : certifiedOverlay, outcome.awsProperties, secrets, certifiedOverlay);
|
|
76144
76356
|
if (maskPreserved.unpreservablePaths.length > 0) {
|
|
76145
76357
|
totalUnresolvable++;
|
|
76146
76358
|
logger.error(` ✗ ${report.stackName}/${outcome.logicalId} (${outcome.resourceType}): refused to revert ${maskSecretsInText(maskPreserved.unpreservablePaths.join(", "), secrets)} — the recorded baseline holds only the redaction mask there, and AWS reports nothing to preserve, so cdkd has no value it may write. Two causes leave such a mask, and the record does not say which: a NoEcho custom-resource value (force that custom resource to update — change one of its properties, e.g. a nonce — and re-deploy, so its handler runs again and supplies the value), or a readback position cdkd could not certify when the baseline was captured (deploy a change to this resource, so the baseline is recaptured against the template). An ordinary no-change re-deploy clears neither.`);
|
|
@@ -76165,7 +76377,7 @@ async function runRevert(reports, providerRegistry, stateBackend, stateConfig, a
|
|
|
76165
76377
|
try {
|
|
76166
76378
|
if (updateResult?.effectiveProperties) {
|
|
76167
76379
|
const delta = collectNarrowedTopLevelKeys(newProperties, updateResult.effectiveProperties);
|
|
76168
|
-
if (Object.keys(delta).length > 0) narrowedByLogicalId.set(outcome.logicalId, redactSecretsForState(delta, secrets, revertBaseline, stateResource.observedProperties !== void 0 ? STATE_SOURCED_BASELINE_RULES : STATE_SOURCED_READBACK_RULES));
|
|
76380
|
+
if (Object.keys(delta).length > 0) narrowedByLogicalId.set(outcome.logicalId, keepBaselineAtUncertifiedPaths(redactSecretsForState(delta, secrets, revertBaseline, stateResource.observedProperties !== void 0 ? STATE_SOURCED_BASELINE_RULES : STATE_SOURCED_READBACK_RULES), outcome.uncertifiedPaths, revertBaseline));
|
|
76169
76381
|
}
|
|
76170
76382
|
} catch (captureErr) {
|
|
76171
76383
|
logger.warn(` ${report.stackName}/${outcome.logicalId} (${outcome.resourceType}): reverted, but the provider's reported effective properties could not be read — ${maskSecretsInText(captureErr instanceof Error ? captureErr.message : String(captureErr), secrets)}`);
|
|
@@ -76320,7 +76532,7 @@ function printRevertPlan(reports, out) {
|
|
|
76320
76532
|
const stateResource = report.state.resources[o.logicalId];
|
|
76321
76533
|
if (stateResource) {
|
|
76322
76534
|
const preserved = findRevertPreservedTagKeys(o.changes, stateResource.observedProperties ?? stateResource.properties ?? {}, o.awsProperties);
|
|
76323
|
-
if (o.
|
|
76535
|
+
if (o.secretsIncomplete && preserved.length > 0) out.write(` ! ${preserved.length} AWS-authored tag(s) will be preserved, but cdkd could not resolve this resource's dynamic reference(s), so their names are withheld — they come from the live readback and cannot be checked for secrets without them.\n`);
|
|
76324
76536
|
else if (preserved.length > 0) {
|
|
76325
76537
|
const tagWord = preserved.length === 1 ? "tag" : "tags";
|
|
76326
76538
|
out.write(` ! reverting this tag list KEEPS ${preserved.length} AWS-authored ${tagWord} the baseline does not carry:\n`);
|
|
@@ -76331,7 +76543,7 @@ function printRevertPlan(reports, out) {
|
|
|
76331
76543
|
}
|
|
76332
76544
|
if (stateResource && stateResource.observedProperties === void 0) {
|
|
76333
76545
|
const unbaselined = findRevertUnbaselinedAwsKeys(o.changes, stateResource.properties ?? {}, o.awsProperties);
|
|
76334
|
-
if (o.
|
|
76546
|
+
if (o.secretsIncomplete && unbaselined.length > 0) out.write(` ! ${unbaselined.length} AWS-authored value(s) will be left untouched, but cdkd could not resolve this resource's dynamic reference(s), so their paths are withheld — they come from the live readback and cannot be checked for secrets without them.\n`);
|
|
76335
76547
|
else if (unbaselined.length > 0) {
|
|
76336
76548
|
const word = unbaselined.length === 1 ? "value" : "values";
|
|
76337
76549
|
out.write(` ! this resource has no observed-capture baseline, so the revert pushes the raw TEMPLATE and LEAVES ${unbaselined.length} AWS-authored ${word} untouched:\n`);
|
|
@@ -76482,8 +76694,13 @@ function writeHumanReport(reports) {
|
|
|
76482
76694
|
if (notCompared.length > 0) {
|
|
76483
76695
|
const notComparedAtAll = notCompared.filter((n) => !ANY_OF_IT_COMPARED[n.cause]).length;
|
|
76484
76696
|
const referenceCaused = notCompared.length - notComparedAtAll;
|
|
76697
|
+
const partialCauses = new Set(notCompared.filter((n) => ANY_OF_IT_COMPARED[n.cause]).map((n) => n.cause));
|
|
76698
|
+
const hasReferencePartial = partialCauses.has("refused") || partialCauses.has("unresolvedToken");
|
|
76699
|
+
const hasUncertified = partialCauses.has("uncertifiedBaseline");
|
|
76700
|
+
const partialClause = hasReferencePartial && !hasUncertified ? "cdkd could not, or refused to, resolve a dynamic reference their state records, so their secret-bearing properties were NOT compared" : hasUncertified && !hasReferencePartial ? "their recorded baseline holds the redaction mask at a position cdkd could not certify, so that position was NOT compared" : `some of their properties were NOT compared; each entry below names why`;
|
|
76701
|
+
const partialClauseShort = hasReferencePartial && !hasUncertified ? "a dynamic reference cdkd could not, or refused to, resolve" : hasUncertified && !hasReferencePartial ? "a baseline position cdkd could not certify" : "see each entry";
|
|
76485
76702
|
const atAllCause = Object.keys(UNCOMPARED_REASONS).filter((cause) => cause in ANY_OF_IT_COMPARED).filter((cause) => !ANY_OF_IT_COMPARED[cause] && notCompared.some((n) => n.cause === cause)).map((cause) => UNCOMPARED_REASONS[cause].phrase.replace(/^not compared AT ALL: /, "")).join("; ");
|
|
76486
|
-
process.stdout.write(notComparedAtAll === 0 ? `\n ${notCompared.length} resource(s) only PARTIALLY compared —
|
|
76703
|
+
process.stdout.write(notComparedAtAll === 0 ? `\n ${notCompared.length} resource(s) only PARTIALLY compared — ${partialClause}:\n` : `\n ${notCompared.length} resource(s) NOT fully compared — ${notComparedAtAll} not compared AT ALL (${atAllCause})` + (referenceCaused > 0 ? `, ${referenceCaused} only PARTIALLY compared (${partialClauseShort})` : "") + `:\n`);
|
|
76487
76704
|
for (const { outcome, cause } of notCompared) process.stdout.write(` ! ${outcome.logicalId} (${outcome.resourceType}) — ${notComparedReason(cause)}\n`);
|
|
76488
76705
|
}
|
|
76489
76706
|
if (unsupported.length > 0) {
|
|
@@ -79366,9 +79583,9 @@ function indexNestedTemplatePaths(template, templateDir) {
|
|
|
79366
79583
|
if (r.Type !== "AWS::CloudFormation::Stack") continue;
|
|
79367
79584
|
const assetPath = r.Metadata?.["aws:asset:path"];
|
|
79368
79585
|
if (typeof assetPath !== "string" || assetPath.length === 0) continue;
|
|
79369
|
-
if (path.isAbsolute(assetPath)) throw new Error(`cdkd export: nested-stack '${displaySafe(logicalId)}' has Metadata['aws:asset:path']
|
|
79586
|
+
if (path.isAbsolute(assetPath)) throw new Error(`cdkd export: nested-stack '${displaySafe(logicalId)}' has Metadata['aws:asset:path']=${displayAssemblyPath(assetPath)} which is absolute. CDK emits relative asset paths for nested templates.`);
|
|
79370
79587
|
const resolved = resolveAssemblyPath(templateDir, assetPath);
|
|
79371
|
-
if (!resolved.contained) throw new Error(`cdkd export: nested-stack '${displaySafe(logicalId)}' has Metadata['aws:asset:path']
|
|
79588
|
+
if (!resolved.contained) throw new Error(`cdkd export: nested-stack '${displaySafe(logicalId)}' has Metadata['aws:asset:path']=${displayAssemblyPath(assetPath)} which ${renderAssemblyPathEscape(resolved, templateDir)}`);
|
|
79372
79589
|
result[logicalId] = resolved.path;
|
|
79373
79590
|
}
|
|
79374
79591
|
return result;
|
|
@@ -89473,12 +89690,12 @@ function resolveAssetCodeDirectory(opts) {
|
|
|
89473
89690
|
if (isAbsolute(assetPath)) {
|
|
89474
89691
|
const absolute = resolve(assetPath);
|
|
89475
89692
|
const escape = absoluteAssemblyPathEscape(assetOutdir, absolute);
|
|
89476
|
-
if (escape !== void 0) getLogger().warn(`Lambda '${displaySafe(logicalId)}' has an absolute Metadata['aws:asset:path'] pointing outside the assembly:
|
|
89693
|
+
if (escape !== void 0) getLogger().warn(`Lambda '${displaySafe(logicalId)}' has an absolute Metadata['aws:asset:path'] pointing outside the assembly: ${displayAssemblyPath(absolute)}` + (escape.escape === "symlink" ? ` (through a symbolic link to ${displayAssemblyPath(escape.realPath)})` : "") + ". cdkd will bind-mount that directory into the container read-only, where the code in this assembly can read it. This is what cdk synth --no-staging emits, and is expected for it; if you did not synthesize with that flag, treat this assembly as untrusted.");
|
|
89477
89694
|
return absolute;
|
|
89478
89695
|
}
|
|
89479
89696
|
const resolved = resolveAssemblyPath(manifestDir, assetPath, { containWithin: assetOutdir });
|
|
89480
89697
|
if (!resolved.contained && resolved.escape === "lexical" && resolved.path === resolve(assetOutdir)) return resolved.path;
|
|
89481
|
-
if (!resolved.contained) throw wrapError(`Lambda '${displaySafe(logicalId)}' has Metadata['aws:asset:path']
|
|
89698
|
+
if (!resolved.contained) throw wrapError(`Lambda '${displaySafe(logicalId)}' has Metadata['aws:asset:path']=${displayAssemblyPath(assetPath)} which ${renderAssemblyPathEscape(resolved, assetOutdir, "mount it")}`);
|
|
89482
89699
|
return resolved.path;
|
|
89483
89700
|
}
|
|
89484
89701
|
/**
|
|
@@ -89544,7 +89761,7 @@ function resolveAssetCodePath$1(stack, logicalId, resource) {
|
|
|
89544
89761
|
assetOutdir,
|
|
89545
89762
|
logicalId
|
|
89546
89763
|
});
|
|
89547
|
-
if (!existsSync(abs) || !statSync(abs).isDirectory()) throw new LocalInvokeResolutionError(`Lambda '${displaySafe(logicalId)}' asset directory
|
|
89764
|
+
if (!existsSync(abs) || !statSync(abs).isDirectory()) throw new LocalInvokeResolutionError(`Lambda '${displaySafe(logicalId)}' asset directory ${displayAssemblyPath(abs)} does not exist or is not a directory. Re-synthesize the app and retry.`);
|
|
89548
89765
|
return abs;
|
|
89549
89766
|
}
|
|
89550
89767
|
/**
|
|
@@ -92621,7 +92838,7 @@ function clampConcurrency(input) {
|
|
|
92621
92838
|
async function localStartApiCommand(target, options) {
|
|
92622
92839
|
const logger = getLogger();
|
|
92623
92840
|
if (options.verbose) logger.setLevel("debug");
|
|
92624
|
-
|
|
92841
|
+
foldRegionOption(options);
|
|
92625
92842
|
if (options.stackRegion !== void 0) {
|
|
92626
92843
|
options.rawStackRegion = options.stackRegion;
|
|
92627
92844
|
options.stackRegion = canonicalizeRegion(options.stackRegion);
|
|
@@ -92746,7 +92963,7 @@ async function localStartApiCommand(target, options) {
|
|
|
92746
92963
|
assumeRole: options.assumeRole,
|
|
92747
92964
|
containerHost: options.containerHost,
|
|
92748
92965
|
...debugPortBase !== void 0 && { debugPort: debugPortBase + i },
|
|
92749
|
-
stsRegion: options.region ?? process.env["AWS_REGION"] ?? process.env["AWS_DEFAULT_REGION"],
|
|
92966
|
+
stsRegion: canonicalizeRegion(options.region ?? process.env["AWS_REGION"] ?? process.env["AWS_DEFAULT_REGION"]),
|
|
92750
92967
|
inlineTmpDirs,
|
|
92751
92968
|
layerTmpDirs,
|
|
92752
92969
|
stateByStack,
|
|
@@ -92814,7 +93031,7 @@ async function localStartApiCommand(target, options) {
|
|
|
92814
93031
|
for (const result of handles) if (result.status === "fulfilled") groupPool.release(result.value);
|
|
92815
93032
|
else logger.warn(`Pre-warm failed for one Lambda in ${group.displayName} (cold start cost will apply on first request): ${result.reason instanceof Error ? result.reason.message : String(result.reason)}`);
|
|
92816
93033
|
}
|
|
92817
|
-
const defaultRegion = options.region ?? process.env["AWS_REGION"] ?? process.env["AWS_DEFAULT_REGION"] ?? void 0;
|
|
93034
|
+
const defaultRegion = canonicalizeRegion(options.region ?? process.env["AWS_REGION"] ?? process.env["AWS_DEFAULT_REGION"] ?? void 0);
|
|
92818
93035
|
const started = await startApiServer({
|
|
92819
93036
|
state: groupState,
|
|
92820
93037
|
rieTimeoutMs,
|
|
@@ -92901,7 +93118,7 @@ async function localStartApiCommand(target, options) {
|
|
|
92901
93118
|
spec.env["AWS_ACCESS_KEY_ID"] = "AKIAIOSFODNN7EXAMPLE";
|
|
92902
93119
|
spec.env["AWS_SECRET_ACCESS_KEY"] = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY";
|
|
92903
93120
|
}
|
|
92904
|
-
if (!spec.env["AWS_REGION"]) spec.env["AWS_REGION"] = options.region ?? process.env["AWS_REGION"] ?? process.env["AWS_DEFAULT_REGION"] ?? "us-east-1";
|
|
93121
|
+
if (!spec.env["AWS_REGION"]) spec.env["AWS_REGION"] = canonicalizeRegion(options.region ?? process.env["AWS_REGION"] ?? process.env["AWS_DEFAULT_REGION"] ?? "us-east-1");
|
|
92905
93122
|
spec.extraHosts = [...spec.extraHosts ?? [], ...hostGatewayMapping];
|
|
92906
93123
|
}
|
|
92907
93124
|
wsServers.push({
|
|
@@ -93743,6 +93960,14 @@ function readEnvOverridesFile$3(filePath) {
|
|
|
93743
93960
|
* handler's AWS SDK calls can authenticate. Used when --assume-role is
|
|
93744
93961
|
* NOT set for that Lambda — SAM-compatible default.
|
|
93745
93962
|
*
|
|
93963
|
+
* Issue [#1843](https://github.com/go-to-k/cdkd/issues/1843): the two REGION
|
|
93964
|
+
* entries are folded through `canonicalizeRegion` on the way in and the
|
|
93965
|
+
* credentials are copied verbatim (an access key id is case-sensitive) — the
|
|
93966
|
+
* twin of `local-invoke.ts`'s `forwardAwsEnv`. The value becomes the
|
|
93967
|
+
* container's own `AWS_REGION`, and SDK endpoint resolution is case-sensitive.
|
|
93968
|
+
* Folded here as well as at the handler entry because this helper is exported
|
|
93969
|
+
* and must not depend on its caller having folded `process.env`.
|
|
93970
|
+
*
|
|
93746
93971
|
* Exported for unit-test isolation (`local-container-caller-identity.test.ts`),
|
|
93747
93972
|
* which drives the `--role-arn` cases without booting the API server.
|
|
93748
93973
|
*/
|
|
@@ -93752,9 +93977,11 @@ function forwardAwsEnv$2(env) {
|
|
|
93752
93977
|
"AWS_REGION",
|
|
93753
93978
|
"AWS_DEFAULT_REGION"
|
|
93754
93979
|
];
|
|
93980
|
+
const regionKeys = /* @__PURE__ */ new Set(["AWS_REGION", "AWS_DEFAULT_REGION"]);
|
|
93755
93981
|
for (const key of passThrough) {
|
|
93756
93982
|
const value = process.env[key];
|
|
93757
|
-
if (value
|
|
93983
|
+
if (value === void 0) continue;
|
|
93984
|
+
env[key] = regionKeys.has(key) ? canonicalizeRegion(value) : value;
|
|
93758
93985
|
}
|
|
93759
93986
|
applyCallerIdentityCredentials(env);
|
|
93760
93987
|
}
|
|
@@ -94907,7 +95134,7 @@ async function prepareOneImage(task, container, options) {
|
|
|
94907
95134
|
tag,
|
|
94908
95135
|
...task.stack.assetOutdir !== void 0 && { assetOutdir: task.stack.assetOutdir },
|
|
94909
95136
|
...options.platformOverride !== void 0 && { platform: options.platformOverride },
|
|
94910
|
-
wrapError: (stderr) => new LocalInvokeBuildError$1(`docker build failed for ECS container '${displaySafe(container.name)}' (${asset.source.directory !== void 0 ?
|
|
95137
|
+
wrapError: (stderr) => new LocalInvokeBuildError$1(`docker build failed for ECS container '${displaySafe(container.name)}' (${asset.source.directory !== void 0 ? displayAssemblyPath(asset.source.directory) : asset.source.executable ? redactDockerArgvValues(asset.source.executable).join(" ") : void 0}): ${displaySafe(stderr)}`)
|
|
94911
95138
|
});
|
|
94912
95139
|
if (actualTag !== tag) {
|
|
94913
95140
|
const tagArgs = [
|
|
@@ -95654,7 +95881,7 @@ function engineAssemblyRoot(outdir) {
|
|
|
95654
95881
|
if (!climbed) return outdir;
|
|
95655
95882
|
if (!warnedDerivedRoots.has(dir)) {
|
|
95656
95883
|
warnedDerivedRoots.add(dir);
|
|
95657
|
-
getLogger().warn(
|
|
95884
|
+
getLogger().warn(`${displayAssemblyPath(outdir)} is a cdk.Stage sub-assembly, so cdkd is treating its parent ${displayAssemblyPath(dir)} as the assembly root when it checks Docker build contexts — that is where cdk synth stages a Stage's assets. Everything under that parent is now inside the containment bound, including siblings of the directory you named.`);
|
|
95658
95885
|
}
|
|
95659
95886
|
return dir;
|
|
95660
95887
|
}
|
|
@@ -96664,12 +96891,12 @@ async function resolveAgentCoreCodeImage(resolved, code, options, architecture,
|
|
|
96664
96891
|
const manifest = await loader.loadManifest(cdkOutDir, resolved.stack.stackName);
|
|
96665
96892
|
const fileAssets = manifest ? loader.getFileAssets(manifest) : void 0;
|
|
96666
96893
|
const asset = fileAssets ? fileAssets.get(code.codeAssetHash) ?? findFileAssetByObjectKey(fileAssets, code.codeAssetHash) : void 0;
|
|
96667
|
-
if (!asset) throw new CdkdError(`AgentCore Runtime '${resolved.logicalId}' code bundle (asset ${code.codeAssetHash}) was not found in the cdk.out asset manifest. ${getEmbedConfig().cliName} invoke-agentcore runs a local from-source build of a fromCodeAsset bundle — re-synthesize the app so the asset is staged in cdk.out and retry. (A fromS3 bundle is downloaded from S3 instead; this runtime has no literal Code.S3.Bucket.)`, "LOCAL_INVOKE_AGENTCORE_CODE_ASSET_NOT_FOUND");
|
|
96894
|
+
if (!asset) throw new CdkdError(`AgentCore Runtime '${displaySafe(resolved.logicalId)}' code bundle (asset ${displaySafe(code.codeAssetHash)}) was not found in the cdk.out asset manifest. ${getEmbedConfig().cliName} invoke-agentcore runs a local from-source build of a fromCodeAsset bundle — re-synthesize the app so the asset is staged in cdk.out and retry. (A fromS3 bundle is downloaded from S3 instead; this runtime has no literal Code.S3.Bucket.)`, "LOCAL_INVOKE_AGENTCORE_CODE_ASSET_NOT_FOUND");
|
|
96668
96895
|
const sourceDir = loader.getAssetSourcePath(cdkOutDir, asset, {
|
|
96669
96896
|
assetOutdir: assemblyDir,
|
|
96670
96897
|
sink: "read that directory and build a local image from it"
|
|
96671
96898
|
});
|
|
96672
|
-
if (!existsSync(sourceDir) || !statSync(sourceDir).isDirectory()) throw new CdkdError(`AgentCore Runtime '${displaySafe(resolved.logicalId)}' code bundle source
|
|
96899
|
+
if (!existsSync(sourceDir) || !statSync(sourceDir).isDirectory()) throw new CdkdError(`AgentCore Runtime '${displaySafe(resolved.logicalId)}' code bundle source ${displayAssemblyPath(sourceDir)} does not exist or is not a directory. Re-synthesize the app and retry.`, "LOCAL_INVOKE_AGENTCORE_CODE_SOURCE_MISSING");
|
|
96673
96900
|
return buildAgentCoreCodeImage({
|
|
96674
96901
|
sourceDir,
|
|
96675
96902
|
runtime: code.runtime,
|
|
@@ -98369,7 +98596,7 @@ function applyProfileCredentialsOverlay(env, profileCreds, assumeRoleActive) {
|
|
|
98369
98596
|
*/
|
|
98370
98597
|
function resolveInlineCodeFilePath(dir, modulePath, fileExtension, handler) {
|
|
98371
98598
|
const resolved = resolveAssemblyPath(dir, `${modulePath}${fileExtension}`);
|
|
98372
|
-
if (!resolved.contained) throw new Error(`Handler
|
|
98599
|
+
if (!resolved.contained) throw new Error(`Handler ${displayAssemblyPath(handler)} names a module path that ${renderAssemblyPathEscape(resolved, dir, "materialize it", "A Handler's module path names a file inside the function's own code directory; one that leaves it would write the inline Code.ZipFile body to an arbitrary path on this machine. Refusing to materialize it.")}`);
|
|
98373
98600
|
return resolved.path;
|
|
98374
98601
|
}
|
|
98375
98602
|
/**
|
|
@@ -98580,4 +98807,4 @@ function buildProgram() {
|
|
|
98580
98807
|
|
|
98581
98808
|
//#endregion
|
|
98582
98809
|
export { buildProgram };
|
|
98583
|
-
//# sourceMappingURL=program-
|
|
98810
|
+
//# sourceMappingURL=program-D7aismcf.js.map
|