@go-to-k/cdkd 0.284.73 → 0.284.75
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-xXB0aei5.js → asg-provider-DdsyGm69.js} +2 -2
- package/dist/{asg-provider-xXB0aei5.js.map → asg-provider-DdsyGm69.js.map} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{deploy-engine-DjcVPGO-.js → deploy-engine-B6xURS3W.js} +81 -26
- package/dist/{deploy-engine-DjcVPGO-.js.map → deploy-engine-B6xURS3W.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/{program-BlS4t1DG.js → program-DQwxvn6O.js} +149 -26
- package/dist/{program-BlS4t1DG.js.map → program-DQwxvn6O.js.map} +1 -1
- package/dist/{version-NRgaYAmx.js → version-B8O0NnWg.js} +2 -2
- package/dist/{version-NRgaYAmx.js.map → version-B8O0NnWg.js.map} +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fr as formatError, G as IAMRoleProvider, Ht as DagBuilder, Ir as isCdkdError, J as ProviderRegistry, Lr as normalizeAwsError, Nr as StateError, Or as ProvisioningError, Pr as SynthesisError, Rn as Synthesizer, Rt as DiffCalculator, Ut as TemplateParser, cr as clearBucketRegionCache, dr as getAwsClients, fr as resetAwsClients, gr as ConfigError, hr as CdkdError, ln as AssetPublisher, lr as resolveBucketRegion, mr as AssetError, or as AssemblyReader, pr as setAwsClients, r as DeployEngine, rn as S3StateBackend, st as CloudControlProvider, tn as LockManager, ur as AwsClients, vr as DependencyError, wr as LockError } from "./deploy-engine-B6xURS3W.js";
|
|
2
2
|
import { i as setLogger, n as getLogger, t as ConsoleLogger } from "./logger-C9-E73FI.js";
|
|
3
3
|
|
|
4
4
|
export { AssemblyReader, AssetError, AssetPublisher, AwsClients, CdkdError, CloudControlProvider, ConfigError, ConsoleLogger, DagBuilder, DependencyError, DeployEngine, DiffCalculator, IAMRoleProvider, LockError, LockManager, ProviderRegistry, ProvisioningError, S3StateBackend, StateError, SynthesisError, Synthesizer, TemplateParser, clearBucketRegionCache, formatError, getAwsClients, getLogger, isCdkdError, normalizeAwsError, resetAwsClients, resolveBucketRegion, setAwsClients, setLogger };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $ as maskerOrIdentity, $n as
|
|
1
|
+
import { $ as maskerOrIdentity, $n as MIGRATE_TMP_PREFIX, $t as redactSecretsForState, A as renderStatefulReason, An as dockerSpawnEnvWithSensitive, Ar as ResourceUpdateNotSupportedError, At as classifyReplaySecretRegion, B as exportAliasCollisionScrubWarning, Bn as getDefaultStateBucketName, Br as isRetryableTransientError, Bt as describeTypeWithThrottleRetry, C as isFinalSnapshotError, Cn as isCrossRegionRedirect, Cr as LocalStartServiceError, Ct as configBooleanRefusal, D as extractDeploymentEventError, Dn as validateContainerRepoName, Dr as PartialFailureError, Dt as requireConfigArray, E as makeCanonicalizePropertiesFn, En as validateAssetBucketName, Er as NestedStackChildDirectDestroyError, Et as replayWarn, F as green, Fn as runDockerStreaming, Ft as s3BucketRegionalDomainName, G as IAMRoleProvider, Gn as resolveSkipPrefix, Gt as STATE_SOURCED_READBACK_RULES, H as secretBearingStateKeyWarning, Hn as resolveApp, Hr as markNonRetryable, Ht as DagBuilder, I as red, In as AssetManifestLoader, It as s3BucketWebsiteUrl, J as ProviderRegistry, Jn as resolveUseCdkBootstrapAssets, Jt as dynamicReferenceTokens, K as collectInlinePolicyNamesManagedBySiblings, Kn as resolveStateBucketWithDefault, Kt as TEMPLATE_SOURCED_RULES, L as yellow, Ln as getDockerImageBySourceHash, Lr as normalizeAwsError, Lt as applyRoleArnIfSet, M as bold, Mn as getDockerCmd, Mr as StackTerminationProtectionError, Mt as s3BucketArn, N as cyan, Nn as partitionSensitiveEnv, Nt as s3BucketDomainName, O as MULTI_REGION_RECREATE_BLOCKED_TYPES, On as buildDenyExternalAccessPolicy, Or as ProvisioningError, Ot as requireConfigObject, P as gray, Pn as runDockerForeground, Pt as s3BucketDualStackDomainName, Q as maskDeep, Qn as CFN_TEMPLATE_URL_LIMIT, Qt as maskSecretsInText, R as collectDeclaredOutputNames, Rn as Synthesizer, Rr as withErrorHandling, Rt as DiffCalculator, S as createPreDeleteFinalSnapshot, Sn as getBootstrapMarkerKey, Sr as LocalMigrateError, St as coerceCfnBoolean, T as unsupportedFinalSnapshotError, Tn as readBootstrapMarkerBody, Tr as MissingCdkCliError, Tt as readConfigString, U as stateKeySecretExposure, Un as resolveAutoAssetStorage, Ut as TemplateParser, V as isExportAliasCollision, Vn as getLegacyStateBucketName, Vr as isThrottlingError, Vt as withRetry, W as getCurrentResourceSecrets, Wn as resolveCaptureObservedState, Wt as STATE_SOURCED_CROSS_GENERATION_RULES, X as findSilentDropProperties, Xn as warnDeprecatedNoPrefixCliFlag, Xt as isSingleDynamicReferenceToken, Y as findActionableSilentDrops, Yn as stateBucketExistenceConfirmed, Yt as errorCauseChain, Z as createMaskedRetryLogger, Zn as CFN_TEMPLATE_BODY_LIMIT, Zt as maskSecretsInError, _ as computeImplicitDeleteEdges, _n as stripControlChars, _r as CrossAccountSecretRefusalError, _t as refStateLookupFromResource, a as DeploymentEventsStore, an as exportNamesCarriedFrom, ar as derivePartitionAndUrlSuffix, at as isInterruptedWaitError, b as buildFinalSnapshotIdentifier, bn as assertAssetBucketRegion, br as DynamicReferenceRegionAmbiguousError, bt as resolveExplicitPhysicalId, c as replayFailedOperations, cn as shouldRetainResource, ct as slowCcOperationTimeoutMs, d as updatePartialReason, dn as WorkGraph, dr as getAwsClients, dt as IntrinsicFunctionResolver, en as scrubResourceRecord, er as findLargeInlineResources, et as CUSTOM_RESOURCE_RESPONSE_PREFIX, f as UNSPECIFIED_SKIP_REASON, fn as buildAssetRedirectMap, fr as resetAwsClients, ft as carriesDynamicReference, g as IMPLICIT_DELETE_DEPENDENCIES, gn as escapeRegExp, gt as parameterTypeMayLoseSecretIdentity, h as maskingRetryLogger, hn as rewriteTemplateAssetReferences, hr as CdkdError, ht as isUnboundTemplateParameter, i as DeploymentEventsReader, in as rebuildClientForBucketRegion, ir as canonicalizeRegion, it as interruptWatchListenerCount, j as formatResourceLine, jn as formatDockerLoginError, jr as StackHasActiveImportsError, jt as producerRegionsFromState, k as isStatefulRecreateTargetSync, kn as buildDockerImage, kr as ResourceTimeoutError, kt as requireConfigString, l as replayRollback, ln as AssetPublisher, lr as resolveBucketRegion, lt as disableInstanceApiTermination, m as withResourceDeadline, mn as loadPublishableAssetManifest, mt as getAccountInfo, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nn as displaySafe, nr as expectedOwnerParam, nt as beginCommandInterruptScope, o as planFailedOps, on as importableOutputKeys, or as AssemblyReader, ot as startInterruptWatch, p as deleteSkipReason, pn as createAssetRedirectResolver, pr as setAwsClients, pt as cfnRefValueFromPhysicalId, q as clearOnUpdateRemoval, qn as resolveStateBucketWithDefaultAndSource, qt as createSecretMasker, r as DeployEngine, rn as S3StateBackend, rr as PARTITION_TABLE, rt as endCommandInterruptScope, s as planRollback, sn as importableOutputs, sr as processStackMessages, st as CloudControlProvider, t as DEFAULT_RESOURCE_TIMEOUT_MS, tn as LockManager, tr as uploadCfnTemplate, tt as DEFAULT_STATE_PREFIX, u as updatePartialMessage, un as stringifyValue, ur as AwsClients, ut as isTerminationProtectionPropagationError, v as ATOMIC_FINAL_SNAPSHOT_TYPES, vn as AssetModeResolver, vt as WAFv2WebACLProvider, w as refusesFinalSnapshot, wn as parseBootstrapMarker, wt as configStringRefusal, x as ccRoutedFinalSnapshotError, xn as ensureAssetStorage, xr as LocalInvokeBuildError$1, xt as assertRegionMatch, y as PRE_DELETE_SNAPSHOT_TYPES, yn as BOOTSTRAP_MARKER_PREFIX, yr as DeployCancelledError, yt as normalizeAwsTagsToCfn, z as collectPublishedOutputNames, zn as synthesisStatusMessage, zr as isMarkedNonRetryable, zt as INTRINSIC_KEYS } from "./deploy-engine-B6xURS3W.js";
|
|
2
2
|
import { a as runStackBuffered, c as PATTERN_B_NAME_PROPERTIES, d as generateResourceName, f as generateResourceNameWithFallback, g as withStackName, h as withSkipPrefix, l as PATTERN_B_RESOURCE_TYPES, n as getLogger, o as getLiveRenderer, p as getCurrentStackName, r as reserveStdoutForPayload, s as PATTERN_B_NAME_OPTIONS } from "./logger-C9-E73FI.js";
|
|
3
|
-
import { t as getCdkdVersion } from "./version-
|
|
4
|
-
import { t as ASGProvider } from "./asg-provider-
|
|
3
|
+
import { t as getCdkdVersion } from "./version-B8O0NnWg.js";
|
|
4
|
+
import { t as ASGProvider } from "./asg-provider-DdsyGm69.js";
|
|
5
5
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
6
6
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
7
7
|
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, 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";
|
|
@@ -78187,6 +78187,7 @@ async function resolveImportedProperties(stackState, template, region, stateBack
|
|
|
78187
78187
|
} catch (err) {
|
|
78188
78188
|
logger.debug(`Template condition evaluation failed during import-time property resolution: ${err instanceof Error ? err.message : String(err)} — continuing without conditions.`);
|
|
78189
78189
|
}
|
|
78190
|
+
const unboundParameterNames = Object.keys(template.Parameters ?? {}).filter((name) => isUnboundTemplateParameter(name, template, parameters));
|
|
78190
78191
|
const baseContext = {
|
|
78191
78192
|
template,
|
|
78192
78193
|
resources: stackState.resources,
|
|
@@ -78204,7 +78205,7 @@ async function resolveImportedProperties(stackState, template, region, stateBack
|
|
|
78204
78205
|
});
|
|
78205
78206
|
resource.properties = recordedSecretValues.size > 0 ? redactSecretsForState(resolved, recordedSecretValues, unresolvedProperties) : resolved;
|
|
78206
78207
|
} catch (err) {
|
|
78207
|
-
logger.warn(`Failed to resolve intrinsics in Properties for imported resource '${logicalId}' (${resource.resourceType}): ${err instanceof Error ? err.message : String(err)}. State will be written with the raw intrinsic shape, which may cause 'cdkd destroy' to fail on this resource — re-import once every referenced sibling is in state, or remove this resource via 'cdkd state orphan'.`);
|
|
78208
|
+
logger.warn(`Failed to resolve intrinsics in Properties for imported resource '${logicalId}' (${resource.resourceType}): ${err instanceof Error ? err.message : String(err)}. State will be written with the raw intrinsic shape, which may cause 'cdkd destroy' to fail on this resource — re-import once every referenced sibling is in state, or remove this resource via 'cdkd state orphan'.` + (unboundParameterNames.length > 0 ? ` This template also declares parameter(s) with no 'Default' that an import cannot bind (${unboundParameterNames.join(", ")}), and 'cdkd import' accepts no parameter values — if this property was built from one of those, re-importing a sibling will not change it: give the parameter a 'Default' in the template and re-import, or correct the recorded properties before the next 'cdkd deploy'.` : ""));
|
|
78208
78209
|
}
|
|
78209
78210
|
}
|
|
78210
78211
|
function printSummary(rows) {
|
|
@@ -79432,12 +79433,12 @@ function resolveLambdaLayers(stack, logicalId, props) {
|
|
|
79432
79433
|
for (let i = 0; i < layers.length; i++) {
|
|
79433
79434
|
const entry = layers[i];
|
|
79434
79435
|
if (typeof entry === "string") {
|
|
79435
|
-
const parsed =
|
|
79436
|
-
if (!parsed) throw new LocalInvokeResolutionError(`Lambda '${logicalId}' has a Layers entry [${i}] cdkd cannot resolve locally: literal string '${entry}'. Expected a same-stack Ref / Fn::GetAtt to an AWS::Lambda::LayerVersion OR a literal layer-version ARN of the form arn:aws:lambda:<region>:<account>:layer:<name>:<version>.`);
|
|
79436
|
+
const parsed = classifyLayerVersionArn(entry);
|
|
79437
|
+
if (!parsed.ok) throw new LocalInvokeResolutionError(`Lambda '${logicalId}' has a Layers entry [${i}] cdkd cannot resolve locally: literal string '${entry}'. Expected a same-stack Ref / Fn::GetAtt to an AWS::Lambda::LayerVersion OR a literal layer-version ARN of the form arn:aws:lambda:<region>:<account>:layer:<name>:<version>.` + describeLayerArnRejection(parsed.rejection));
|
|
79437
79438
|
out.push({
|
|
79438
79439
|
kind: "arn",
|
|
79439
|
-
logicalId: parsed.arn,
|
|
79440
|
-
...parsed
|
|
79440
|
+
logicalId: parsed.value.arn,
|
|
79441
|
+
...parsed.value
|
|
79441
79442
|
});
|
|
79442
79443
|
continue;
|
|
79443
79444
|
}
|
|
@@ -79456,29 +79457,151 @@ function resolveLambdaLayers(stack, logicalId, props) {
|
|
|
79456
79457
|
return out;
|
|
79457
79458
|
}
|
|
79458
79459
|
/**
|
|
79459
|
-
*
|
|
79460
|
+
* `arn:<partition>:lambda:<region>:<account>:layer:<name>:<version>`.
|
|
79460
79461
|
*
|
|
79461
|
-
*
|
|
79462
|
-
*
|
|
79463
|
-
* the
|
|
79464
|
-
* misinterpretation of hand-edited templates. The partition segment
|
|
79465
|
-
* accepts `aws` / `aws-cn` / `aws-us-gov` so GovCloud / China-region
|
|
79466
|
-
* ARNs work without code changes.
|
|
79467
|
-
*
|
|
79468
|
-
* Exported for unit testing.
|
|
79462
|
+
* The PARTITION group is deliberately loose. It is not validated by the
|
|
79463
|
+
* pattern at all — {@link classifyLayerVersionArn} checks it against the one
|
|
79464
|
+
* the REGION derives, which is a stronger check than any alternation.
|
|
79469
79465
|
*/
|
|
79470
|
-
|
|
79471
|
-
|
|
79472
|
-
|
|
79466
|
+
const LAYER_ARN_PATTERN = new RegExp(`^arn:([a-z][a-z0-9-]*):lambda:([a-z]{2,}(?:-[a-z]+)+-\\d+):(\\d{12}):layer:([A-Za-z0-9_-]+):(\\d+)$`);
|
|
79467
|
+
/**
|
|
79468
|
+
* Classify a Lambda layer-version ARN: its segments, or why it was refused.
|
|
79469
|
+
*
|
|
79470
|
+
* The single decision point behind both the resolved layer's fields and the
|
|
79471
|
+
* caller's error message, so the message cannot describe a different verdict
|
|
79472
|
+
* than the parse reached. An earlier revision had the message re-run the
|
|
79473
|
+
* pattern in a separate helper, which left an arm — "the partitions agree" —
|
|
79474
|
+
* that the sole call site could never reach, because it only asked after the
|
|
79475
|
+
* parse had already refused. One classifier with one return value removes the
|
|
79476
|
+
* arm rather than justifying it, and runs the regex once.
|
|
79477
|
+
*
|
|
79478
|
+
* **The partition is DERIVED from the region, not enumerated** (issue #2143).
|
|
79479
|
+
* The pre-#2143 spelling hard-listed `aws` / `aws-cn` / `aws-us-gov` and so
|
|
79480
|
+
* failed to parse a layer ARN in any of the other five partitions
|
|
79481
|
+
* (`aws-iso`, `aws-iso-b`, `aws-iso-e`, `aws-iso-f`, `aws-eusc`) — and the
|
|
79482
|
+
* caller HARD-THROWS on an unparsed ARN, so `cdkd local invoke` on a function
|
|
79483
|
+
* with a literal-ARN layer failed at RESOLUTION in each of them. Running the
|
|
79484
|
+
* region through `derivePartitionAndUrlSuffix` (`src/utils/aws-partition.ts`)
|
|
79485
|
+
* is what the repo already does everywhere else it needs a partition, so the
|
|
79486
|
+
* list is not spelled a fourth time and cannot go stale here independently.
|
|
79487
|
+
*
|
|
79488
|
+
* **This fixes the PARSE only, and the download behind it is still commercial-
|
|
79489
|
+
* only.** `materializeLayerFromArn` (`src/local/layer-arn-materializer.ts`) is
|
|
79490
|
+
* a one-line shim over cdk-local, whose implementation rebuilds the ARN with a
|
|
79491
|
+
* hardcoded `aws`:
|
|
79492
|
+
*
|
|
79493
|
+
* ```js
|
|
79494
|
+
* // node_modules/cdk-local/dist/local-studio-BBtUAVNy.js:15214
|
|
79495
|
+
* const command = await buildGetLayerVersionCommand(
|
|
79496
|
+
* `arn:aws:lambda:${layer.region}:${layer.accountId}:layer:${layer.name}`, Number(layer.version));
|
|
79497
|
+
* ```
|
|
79498
|
+
*
|
|
79499
|
+
* So a layer in ANY of the seven non-commercial partitions still fails at
|
|
79500
|
+
* `lambda:GetLayerVersion`. That includes `aws-cn` and `aws-us-gov`, which the
|
|
79501
|
+
* old alternation ALREADY parsed and which therefore gain nothing here. What
|
|
79502
|
+
* this change moves is confined to the five that previously did not parse
|
|
79503
|
+
* (`aws-iso`, `aws-iso-b`, `aws-iso-e`, `aws-iso-f`, `aws-eusc`): for them the
|
|
79504
|
+
* failure shifts from "cdkd cannot resolve locally" to an AWS-side error, so
|
|
79505
|
+
* the parse stops being the blocker and the message names the true one. That
|
|
79506
|
+
* is a real improvement and it is NOT end-to-end support; nothing in this repo
|
|
79507
|
+
* can make it so, and the remaining half is filed as go-to-k/cdk-local#575.
|
|
79508
|
+
*
|
|
79509
|
+
* Deriving also makes the pair SELF-CONSISTENT, which the alternation could
|
|
79510
|
+
* not: `arn:aws-cn:lambda:us-east-1:...` used to parse, pairing China's
|
|
79511
|
+
* partition with a commercial region. It is now REFUSED — a deliberate
|
|
79512
|
+
* behaviour break, asked for by issue #2143's own direction. Nothing is lost
|
|
79513
|
+
* by refusing early, since the commercial-ARN rebuild above means such a layer
|
|
79514
|
+
* could never have been fetched from the partition its ARN named.
|
|
79515
|
+
*
|
|
79516
|
+
* The fallback direction is worth stating, since `derivePartitionAndUrlSuffix`
|
|
79517
|
+
* answers `aws` for a region it does not recognise. A brand-new COMMERCIAL
|
|
79518
|
+
* region therefore still parses with `arn:aws:` — the direction that must keep
|
|
79519
|
+
* working before the table hears about it — while a brand-new region in a
|
|
79520
|
+
* future partition is rejected rather than mis-attributed to commercial, which
|
|
79521
|
+
* is the same trade every other consumer of that table makes.
|
|
79522
|
+
*
|
|
79523
|
+
* Deliberately NOT `isClientSafeRegion` (`intrinsic-function-resolver.ts`):
|
|
79524
|
+
* that predicate is charset-based because its job is to keep a value inside a
|
|
79525
|
+
* hostname label, so it accepts anything lower-case alphanumeric — including
|
|
79526
|
+
* strings no region grammar would admit. See the note it carries.
|
|
79527
|
+
*
|
|
79528
|
+
* THIS is the exported symbol, and a `parseLayerVersionArn` wrapper returning
|
|
79529
|
+
* `T | undefined` is deliberately not kept beside it. Once the caller moved to
|
|
79530
|
+
* the classifier, that wrapper had no `src/` reference left and existed only
|
|
79531
|
+
* for the tests — which `scripts/check-local-reachability.ts` reports as an
|
|
79532
|
+
* orphaned export, correctly. That critic's opt-out tag would have been a
|
|
79533
|
+
* false statement here — it means "cdk-local owns the live implementation",
|
|
79534
|
+
* and cdkd owns this one — so the wrapper is gone rather than tagged. Tests
|
|
79535
|
+
* drive this classifier or the real caller instead. (The tag is deliberately
|
|
79536
|
+
* not spelled out in this comment: the critic reads tags from JSDoc, so
|
|
79537
|
+
* naming it here registers an annotation on a LIVE symbol and is reported as
|
|
79538
|
+
* stale. Measured.)
|
|
79539
|
+
*/
|
|
79540
|
+
function classifyLayerVersionArn(input) {
|
|
79541
|
+
const m = LAYER_ARN_PATTERN.exec(input);
|
|
79542
|
+
if (!m) return {
|
|
79543
|
+
ok: false,
|
|
79544
|
+
rejection: { kind: "shape" }
|
|
79545
|
+
};
|
|
79546
|
+
const partition = m[1];
|
|
79547
|
+
const region = m[2];
|
|
79548
|
+
const derived = derivePartitionAndUrlSuffix(region).partition;
|
|
79549
|
+
if (derived !== partition) return {
|
|
79550
|
+
ok: false,
|
|
79551
|
+
rejection: {
|
|
79552
|
+
kind: "partition",
|
|
79553
|
+
partition,
|
|
79554
|
+
region,
|
|
79555
|
+
derived,
|
|
79556
|
+
derivedFromTable: derived !== "aws"
|
|
79557
|
+
}
|
|
79558
|
+
};
|
|
79473
79559
|
return {
|
|
79474
|
-
|
|
79475
|
-
|
|
79476
|
-
|
|
79477
|
-
|
|
79478
|
-
|
|
79560
|
+
ok: true,
|
|
79561
|
+
value: {
|
|
79562
|
+
arn: input,
|
|
79563
|
+
region,
|
|
79564
|
+
accountId: m[3],
|
|
79565
|
+
name: m[4],
|
|
79566
|
+
version: m[5]
|
|
79567
|
+
}
|
|
79479
79568
|
};
|
|
79480
79569
|
}
|
|
79481
79570
|
/**
|
|
79571
|
+
* The one sentence a reader cannot derive from the ARN in front of them.
|
|
79572
|
+
*
|
|
79573
|
+
* A `'shape'` rejection gets nothing appended, so the message is
|
|
79574
|
+
* byte-identical to what it has always been for every pre-#2143 refusal. A
|
|
79575
|
+
* `'partition'` rejection is the class this change newly refuses AND the one
|
|
79576
|
+
* that looks perfectly well formed, so it says what disagrees.
|
|
79577
|
+
*
|
|
79578
|
+
* The two `'partition'` arms differ in what cdkd actually KNOWS. On a
|
|
79579
|
+
* `PARTITION_TABLE` hit the derived partition is a fact and is stated as one.
|
|
79580
|
+
* On a miss it is a FALLBACK, so the sentence states the RESOLUTION instead of
|
|
79581
|
+
* asserting membership: `us-east-1` and a hypothetical `us-isog-east-1` both
|
|
79582
|
+
* derive `aws`, but only the first is really commercial, and a message that
|
|
79583
|
+
* cannot tell them apart teaches the reader something false about the second.
|
|
79584
|
+
*
|
|
79585
|
+
* **The miss arm is the COMMERCIAL arm, and that is not obvious from its
|
|
79586
|
+
* name.** `PARTITION_TABLE` (`src/utils/aws-partition.ts`) holds seven rows
|
|
79587
|
+
* and none of them is `aws` — the commercial partition is the fallback
|
|
79588
|
+
* `return` at the bottom of `derivePartitionAndUrlSuffix`, not a row. So
|
|
79589
|
+
* `derivedFromTable` is FALSE for every genuinely commercial region, the fact
|
|
79590
|
+
* arm can never render `derived === 'aws'`, and the miss arm always does. Its
|
|
79591
|
+
* wording therefore has to read correctly for `us-east-1` — the commonest
|
|
79592
|
+
* region there is, and the one the docs, the integ fixture and the changelog
|
|
79593
|
+
* all use as the canonical example. An earlier revision said "no partition
|
|
79594
|
+
* prefix **cdkd knows** matches that region", which is true of the mechanism
|
|
79595
|
+
* and reads as cdkd failing to recognise `us-east-1`; it now leads with the
|
|
79596
|
+
* prefix test and ends on the resolution, which is the fact the reader needs.
|
|
79597
|
+
*/
|
|
79598
|
+
function describeLayerArnRejection(rejection) {
|
|
79599
|
+
if (rejection.kind === "shape") return "";
|
|
79600
|
+
const { partition, region, derived, derivedFromTable } = rejection;
|
|
79601
|
+
const head = ` The partition '${partition}' does not match region '${region}'`;
|
|
79602
|
+
return derivedFromTable ? `${head}, which is in partition '${derived}'.` : `${head}: no partition prefix matches that region, so cdkd resolves it to the commercial partition '${derived}'.`;
|
|
79603
|
+
}
|
|
79604
|
+
/**
|
|
79482
79605
|
* Walk a single Layers-array entry and return the referenced layer's
|
|
79483
79606
|
* logical ID — or `undefined` for shapes we don't try to resolve in v1.
|
|
79484
79607
|
*
|
|
@@ -88423,4 +88546,4 @@ function buildProgram() {
|
|
|
88423
88546
|
|
|
88424
88547
|
//#endregion
|
|
88425
88548
|
export { buildProgram };
|
|
88426
|
-
//# sourceMappingURL=program-
|
|
88549
|
+
//# sourceMappingURL=program-DQwxvn6O.js.map
|