@go-to-k/cdkd 0.276.5 → 0.277.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/{asg-provider-Wm3Q60jN.js → asg-provider-CxIBBjfh.js} +2 -2
- package/dist/{asg-provider-Wm3Q60jN.js.map → asg-provider-CxIBBjfh.js.map} +1 -1
- package/dist/cli.js +332 -16
- package/dist/cli.js.map +1 -1
- package/dist/{deploy-engine-BwPdeLbJ.js → deploy-engine-D8y2IFYY.js} +4 -3
- package/dist/{deploy-engine-BwPdeLbJ.js.map → deploy-engine-D8y2IFYY.js.map} +1 -1
- package/dist/index.js +1 -1
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { $ as DagBuilder, A as red, At as resolveApp, B as isTerminationProtectionPropagationError, Bt as CFN_TEMPLATE_URL_LIMIT, C as isStatefulRecreateTargetSync, Ct as runDockerStreaming, D as cyan, Dt as synthesisStatusMessage, E as bold, Et as Synthesizer, F as ProviderRegistry, Ft as resolveStateBucketWithDefaultAndSource, G as normalizeAwsTagsToCfn, Gt as AssemblyReader, H as cfnRefValueFromPhysicalId, Ht as findLargeInlineResources, I as findActionableSilentDrops, It as resolveUseCdkBootstrapAssets, J as applyRoleArnIfSet, Jt as resolveBucketRegion, K as resolveExplicitPhysicalId, Kt as processStackMessages, L as CloudControlProvider, Lt as stateBucketExistenceConfirmed, M as IAMRoleProvider, Mt as resolveCaptureObservedState, N as collectInlinePolicyNamesManagedBySiblings, Nt as resolveSkipPrefix, O as gray, Ot as getDefaultStateBucketName, P as clearOnUpdateRemoval, Pt as resolveStateBucketWithDefault, Q as isRetryableTransientError, Qt as setAwsClients, R as slowCcOperationTimeoutMs, Rt as warnDeprecatedNoPrefixCliFlag, S as MULTI_REGION_RECREATE_BLOCKED_TYPES, St as runDockerForeground, T as formatResourceLine, Tt as getDockerImageBySourceHash, U as refStateLookupFromResource, Ut as uploadCfnTemplate, V as IntrinsicFunctionResolver, Vt as MIGRATE_TMP_PREFIX, W as WAFv2WebACLProvider, Wt as expectedOwnerParam, X as describeTypeWithThrottleRetry, Xt as getAwsClients, Y as DiffCalculator, Yt as AwsClients, Z as withRetry, Zt as resetAwsClients, _ as createPreDeleteFinalSnapshot, _t as validateAssetBucketName, a as DeploymentEventsStore, an as LocalMigrateError, at as AssetPublisher, b as unsupportedFinalSnapshotError, bn as normalizeAwsError, bt as formatDockerLoginError, c as replayFailedOperations, cn as MissingCdkCliError, ct as buildAssetRedirectMap, d as IMPLICIT_DELETE_DEPENDENCIES, dn as ProvisioningError, dt as rewriteTemplateAssetReferences, en as CdkdError, et as TemplateParser, f as computeImplicitDeleteEdges, fn as ResourceTimeoutError, ft as AssetModeResolver, g as ccRoutedFinalSnapshotError, gt as parseBootstrapMarker, h as buildFinalSnapshotIdentifier, hn as StackTerminationProtectionError, ht as getBootstrapMarkerKey, i as DeploymentEventsReader, in as LocalInvokeBuildError$1, it as shouldRetainResource, j as yellow, jt as resolveAutoAssetStorage, k as green, kt as getLegacyStateBucketName, l as replayRollback, ln as NestedStackChildDirectDestroyError, lt as createAssetRedirectResolver, m as PRE_DELETE_SNAPSHOT_TYPES, mn as StackHasActiveImportsError, mt as ensureAssetStorage, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nt as S3StateBackend, o as planFailedOps, on as LocalStartServiceError, ot as stringifyValue, p as ATOMIC_FINAL_SNAPSHOT_TYPES, pn as ResourceUpdateNotSupportedError, pt as BOOTSTRAP_MARKER_PREFIX, q as assertRegionMatch, r as DeployEngine, rn as DeployCancelledError, rt as rebuildClientForBucketRegion, s as planRollback, st as WorkGraph, t as DEFAULT_RESOURCE_TIMEOUT_MS, tt as LockManager, u as withResourceDeadline, un as PartialFailureError, ut as loadPublishableAssetManifest, v as isFinalSnapshotError, vt as validateContainerRepoName, w as renderStatefulReason, wt as AssetManifestLoader, x as extractDeploymentEventError, xn as withErrorHandling, xt as getDockerCmd, y as refusesFinalSnapshot, yt as buildDockerImage, z as disableInstanceApiTermination, zt as CFN_TEMPLATE_BODY_LIMIT } from "./deploy-engine-
|
|
2
|
+
import { $ as DagBuilder, A as red, At as resolveApp, B as isTerminationProtectionPropagationError, Bt as CFN_TEMPLATE_URL_LIMIT, C as isStatefulRecreateTargetSync, Ct as runDockerStreaming, D as cyan, Dt as synthesisStatusMessage, E as bold, Et as Synthesizer, F as ProviderRegistry, Ft as resolveStateBucketWithDefaultAndSource, G as normalizeAwsTagsToCfn, Gt as AssemblyReader, H as cfnRefValueFromPhysicalId, Ht as findLargeInlineResources, I as findActionableSilentDrops, It as resolveUseCdkBootstrapAssets, J as applyRoleArnIfSet, Jt as resolveBucketRegion, K as resolveExplicitPhysicalId, Kt as processStackMessages, L as CloudControlProvider, Lt as stateBucketExistenceConfirmed, M as IAMRoleProvider, Mt as resolveCaptureObservedState, N as collectInlinePolicyNamesManagedBySiblings, Nt as resolveSkipPrefix, O as gray, Ot as getDefaultStateBucketName, P as clearOnUpdateRemoval, Pt as resolveStateBucketWithDefault, Q as isRetryableTransientError, Qt as setAwsClients, R as slowCcOperationTimeoutMs, Rt as warnDeprecatedNoPrefixCliFlag, S as MULTI_REGION_RECREATE_BLOCKED_TYPES, St as runDockerForeground, T as formatResourceLine, Tt as getDockerImageBySourceHash, U as refStateLookupFromResource, Ut as uploadCfnTemplate, V as IntrinsicFunctionResolver, Vt as MIGRATE_TMP_PREFIX, W as WAFv2WebACLProvider, Wt as expectedOwnerParam, X as describeTypeWithThrottleRetry, Xt as getAwsClients, Y as DiffCalculator, Yt as AwsClients, Z as withRetry, Zt as resetAwsClients, _ as createPreDeleteFinalSnapshot, _t as validateAssetBucketName, a as DeploymentEventsStore, an as LocalMigrateError, at as AssetPublisher, b as unsupportedFinalSnapshotError, bn as normalizeAwsError, bt as formatDockerLoginError, c as replayFailedOperations, cn as MissingCdkCliError, ct as buildAssetRedirectMap, d as IMPLICIT_DELETE_DEPENDENCIES, dn as ProvisioningError, dt as rewriteTemplateAssetReferences, en as CdkdError, et as TemplateParser, f as computeImplicitDeleteEdges, fn as ResourceTimeoutError, ft as AssetModeResolver, g as ccRoutedFinalSnapshotError, gt as parseBootstrapMarker, h as buildFinalSnapshotIdentifier, hn as StackTerminationProtectionError, ht as getBootstrapMarkerKey, i as DeploymentEventsReader, in as LocalInvokeBuildError$1, it as shouldRetainResource, j as yellow, jt as resolveAutoAssetStorage, k as green, kt as getLegacyStateBucketName, l as replayRollback, ln as NestedStackChildDirectDestroyError, lt as createAssetRedirectResolver, m as PRE_DELETE_SNAPSHOT_TYPES, mn as StackHasActiveImportsError, mt as ensureAssetStorage, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nt as S3StateBackend, o as planFailedOps, on as LocalStartServiceError, ot as stringifyValue, p as ATOMIC_FINAL_SNAPSHOT_TYPES, pn as ResourceUpdateNotSupportedError, pt as BOOTSTRAP_MARKER_PREFIX, q as assertRegionMatch, r as DeployEngine, rn as DeployCancelledError, rt as rebuildClientForBucketRegion, s as planRollback, st as WorkGraph, t as DEFAULT_RESOURCE_TIMEOUT_MS, tt as LockManager, u as withResourceDeadline, un as PartialFailureError, ut as loadPublishableAssetManifest, v as isFinalSnapshotError, vt as validateContainerRepoName, w as renderStatefulReason, wt as AssetManifestLoader, x as extractDeploymentEventError, xn as withErrorHandling, xt as getDockerCmd, y as refusesFinalSnapshot, yt as buildDockerImage, z as disableInstanceApiTermination, zt as CFN_TEMPLATE_BODY_LIMIT } from "./deploy-engine-D8y2IFYY.js";
|
|
3
3
|
import { a as getLiveRenderer, c as PATTERN_B_RESOURCE_TYPES, d as generateResourceNameWithFallback, f as withSkipPrefix, i as runStackBuffered, n as getLogger, o as PATTERN_B_NAME_OPTIONS, p as withStackName, s as PATTERN_B_NAME_PROPERTIES, u as generateResourceName } from "./logger-BYMEE-BS.js";
|
|
4
|
-
import { t as ASGProvider } from "./asg-provider-
|
|
4
|
+
import { t as ASGProvider } from "./asg-provider-CxIBBjfh.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, DeleteBucketIntelligentTieringConfigurationCommand, DeleteBucketInventoryConfigurationCommand, DeleteBucketLifecycleCommand, DeleteBucketMetricsConfigurationCommand, DeleteBucketPolicyCommand, DeleteBucketReplicationCommand, DeleteBucketTaggingCommand, DeleteBucketWebsiteCommand, DeleteObjectsCommand, GetBucketAccelerateConfigurationCommand, GetBucketCorsCommand, GetBucketEncryptionCommand, GetBucketLifecycleConfigurationCommand, GetBucketLocationCommand, GetBucketLoggingCommand, GetBucketNotificationConfigurationCommand, 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";
|
|
@@ -14168,8 +14168,8 @@ function buildDeleteParams(properties) {
|
|
|
14168
14168
|
function toDate(value) {
|
|
14169
14169
|
if (value === void 0) return void 0;
|
|
14170
14170
|
if (value instanceof Date) return value;
|
|
14171
|
-
const parsed = new Date(
|
|
14172
|
-
if (Number.isNaN(parsed.getTime())) throw new Error(`Configuration.ExcludedTimeRanges contains an unparsable time value: ${
|
|
14171
|
+
const parsed = typeof value === "string" || typeof value === "number" ? new Date(value) : /* @__PURE__ */ new Date(NaN);
|
|
14172
|
+
if (Number.isNaN(parsed.getTime())) throw new Error(`Configuration.ExcludedTimeRanges contains an unparsable time value: ${JSON.stringify(value)}`);
|
|
14173
14173
|
return parsed;
|
|
14174
14174
|
}
|
|
14175
14175
|
/**
|
|
@@ -21042,6 +21042,79 @@ const QUANTITY_ITEM_FIELDS = [
|
|
|
21042
21042
|
"Aliases"
|
|
21043
21043
|
];
|
|
21044
21044
|
/**
|
|
21045
|
+
* `ViewerCertificate` members whose ACRONYM CASING differs between the CFn
|
|
21046
|
+
* resource schema and the CloudFront API (issue #1370). The CFn template
|
|
21047
|
+
* carries the left-hand spelling; the SDK model only knows the right-hand
|
|
21048
|
+
* one, so an unrenamed key silently never reaches AWS — a custom-domain
|
|
21049
|
+
* distribution then fails to create ("Your ViewerCertificate is missing one
|
|
21050
|
+
* of ACMCertificateArn, IAMCertificateId, or CloudFrontDefaultCertificate").
|
|
21051
|
+
*/
|
|
21052
|
+
const VIEWER_CERTIFICATE_CFN_TO_SDK = {
|
|
21053
|
+
AcmCertificateArn: "ACMCertificateArn",
|
|
21054
|
+
SslSupportMethod: "SSLSupportMethod",
|
|
21055
|
+
IamCertificateId: "IAMCertificateId"
|
|
21056
|
+
};
|
|
21057
|
+
/**
|
|
21058
|
+
* Top-level `DistributionConfig` members with the same CFn-vs-SDK casing
|
|
21059
|
+
* divergence (issue #1370): the template's `IPV6Enabled` is `IsIPV6Enabled`
|
|
21060
|
+
* in the SDK model, so it was silently dropped (IPv6 ended up disabled).
|
|
21061
|
+
*/
|
|
21062
|
+
const TOP_LEVEL_CFN_TO_SDK = { IPV6Enabled: "IsIPV6Enabled" };
|
|
21063
|
+
/**
|
|
21064
|
+
* CloudFormation defaults applied when a top-level `DistributionConfig`
|
|
21065
|
+
* member present in the PREVIOUS template is REMOVED from the new one
|
|
21066
|
+
* (issue #1371). `UpdateDistribution` is a read-modify-write API taking the
|
|
21067
|
+
* complete config, so the update path merges the template over the live
|
|
21068
|
+
* config — but a member the user deleted from the template must reset to
|
|
21069
|
+
* its CloudFormation default (CFn semantics), not silently keep its live
|
|
21070
|
+
* value. Values are in SDK shape.
|
|
21071
|
+
*
|
|
21072
|
+
* Sources: the AWS::CloudFront::Distribution registry schema `default`
|
|
21073
|
+
* annotations (Comment / DefaultRootObject / HttpVersion / PriceClass /
|
|
21074
|
+
* Restrictions / ViewerCertificate / WebACLId — verified via
|
|
21075
|
+
* `cloudformation:DescribeType`, 2026-08-09); list members reset to the
|
|
21076
|
+
* empty `{ Quantity: 0, Items: [] }` wrapper (removing a list property
|
|
21077
|
+
* means "no items"); `Logging` to the API's documented off shape. Removed
|
|
21078
|
+
* members with NO entry here (e.g. `IsIPV6Enabled` / `Staging` — no
|
|
21079
|
+
* schema-documented default) keep their live value with a warning: a
|
|
21080
|
+
* visible conservative choice, never a silent guess.
|
|
21081
|
+
*/
|
|
21082
|
+
const REMOVAL_RESET_DEFAULTS = {
|
|
21083
|
+
Aliases: {
|
|
21084
|
+
Quantity: 0,
|
|
21085
|
+
Items: []
|
|
21086
|
+
},
|
|
21087
|
+
CacheBehaviors: {
|
|
21088
|
+
Quantity: 0,
|
|
21089
|
+
Items: []
|
|
21090
|
+
},
|
|
21091
|
+
Comment: "",
|
|
21092
|
+
CustomErrorResponses: {
|
|
21093
|
+
Quantity: 0,
|
|
21094
|
+
Items: []
|
|
21095
|
+
},
|
|
21096
|
+
DefaultRootObject: "",
|
|
21097
|
+
HttpVersion: "http1.1",
|
|
21098
|
+
Logging: {
|
|
21099
|
+
Enabled: false,
|
|
21100
|
+
IncludeCookies: false,
|
|
21101
|
+
Bucket: "",
|
|
21102
|
+
Prefix: ""
|
|
21103
|
+
},
|
|
21104
|
+
OriginGroups: {
|
|
21105
|
+
Quantity: 0,
|
|
21106
|
+
Items: []
|
|
21107
|
+
},
|
|
21108
|
+
PriceClass: "PriceClass_All",
|
|
21109
|
+
Restrictions: { GeoRestriction: {
|
|
21110
|
+
RestrictionType: "none",
|
|
21111
|
+
Quantity: 0,
|
|
21112
|
+
Items: []
|
|
21113
|
+
} },
|
|
21114
|
+
ViewerCertificate: { CloudFrontDefaultCertificate: true },
|
|
21115
|
+
WebACLId: ""
|
|
21116
|
+
};
|
|
21117
|
+
/**
|
|
21045
21118
|
* Nested fields inside each CacheBehavior / DefaultCacheBehavior that use
|
|
21046
21119
|
* the Quantity + Items pattern.
|
|
21047
21120
|
*/
|
|
@@ -21107,8 +21180,18 @@ var CloudFrontDistributionProvider = class {
|
|
|
21107
21180
|
/**
|
|
21108
21181
|
* Update a CloudFront Distribution
|
|
21109
21182
|
*
|
|
21110
|
-
*
|
|
21111
|
-
*
|
|
21183
|
+
* `UpdateDistribution` is a read-modify-write API that expects the COMPLETE
|
|
21184
|
+
* configuration, while a CFn template legitimately omits every optional
|
|
21185
|
+
* member the user did not set — sending the template verbatim fails on the
|
|
21186
|
+
* first required-on-update member the template lacks ("WebACLId is missing
|
|
21187
|
+
* for the resource", issue #1371). So the update merges per top-level
|
|
21188
|
+
* member: `GetDistributionConfigCommand`'s current config is the base, the
|
|
21189
|
+
* template is the authority for every member it carries, a member REMOVED
|
|
21190
|
+
* since the previous template resets to its CloudFormation default
|
|
21191
|
+
* (matching CFn's omission-resets semantics rather than silently keeping
|
|
21192
|
+
* the live value), and `CallerReference` is always preserved from the
|
|
21193
|
+
* current config. Then calls `UpdateDistributionCommand` with the required
|
|
21194
|
+
* IfMatch ETag.
|
|
21112
21195
|
*/
|
|
21113
21196
|
async update(logicalId, physicalId, resourceType, properties, previousProperties) {
|
|
21114
21197
|
this.logger.debug(`Updating CloudFront Distribution ${logicalId}: ${physicalId}`);
|
|
@@ -21117,10 +21200,8 @@ var CloudFrontDistributionProvider = class {
|
|
|
21117
21200
|
const etag = getConfigResponse.ETag;
|
|
21118
21201
|
const currentConfig = getConfigResponse.DistributionConfig;
|
|
21119
21202
|
const newDistributionConfig = properties["DistributionConfig"] ?? {};
|
|
21120
|
-
const
|
|
21121
|
-
|
|
21122
|
-
CallerReference: currentConfig.CallerReference
|
|
21123
|
-
});
|
|
21203
|
+
const previousDistributionConfig = previousProperties["DistributionConfig"] ?? {};
|
|
21204
|
+
const sdkConfig = this.mergeUpdateConfig(currentConfig, newDistributionConfig, previousDistributionConfig, logicalId);
|
|
21124
21205
|
await this.cloudFrontClient.send(new UpdateDistributionCommand({
|
|
21125
21206
|
Id: physicalId,
|
|
21126
21207
|
IfMatch: etag,
|
|
@@ -21276,6 +21357,21 @@ var CloudFrontDistributionProvider = class {
|
|
|
21276
21357
|
return ["DistributionConfig.CallerReference", "DistributionConfig.Logging.Bucket"];
|
|
21277
21358
|
}
|
|
21278
21359
|
/**
|
|
21360
|
+
* Plain-string arrays that are semantically UNORDERED sets, per
|
|
21361
|
+
* {@link ResourceProvider.getDriftUnorderedPaths}.
|
|
21362
|
+
*
|
|
21363
|
+
* `GeoRestriction.Locations` is a set of ISO country codes — the
|
|
21364
|
+
* CloudFront API reference documents no ordering semantics and the
|
|
21365
|
+
* service does not echo the submitted order back (observed live in the
|
|
21366
|
+
* `s3-cloudfront` integ, 2026-08-09: a template `[JP, US]` allowlist
|
|
21367
|
+
* read back as `[US, JP]`), so a positional compare fires guaranteed
|
|
21368
|
+
* phantom drift on any multi-country restriction.
|
|
21369
|
+
*/
|
|
21370
|
+
getDriftUnorderedPaths(resourceType) {
|
|
21371
|
+
if (resourceType !== "AWS::CloudFront::Distribution") return [];
|
|
21372
|
+
return ["DistributionConfig.Restrictions.GeoRestriction.Locations"];
|
|
21373
|
+
}
|
|
21374
|
+
/**
|
|
21279
21375
|
* Get resource attribute (for Fn::GetAtt resolution)
|
|
21280
21376
|
*/
|
|
21281
21377
|
async getAttribute(physicalId, _resourceType, attributeName) {
|
|
@@ -21361,6 +21457,124 @@ var CloudFrontDistributionProvider = class {
|
|
|
21361
21457
|
}
|
|
21362
21458
|
}
|
|
21363
21459
|
/**
|
|
21460
|
+
* Build the complete SDK-shape `DistributionConfig` for an update
|
|
21461
|
+
* (issue #1371). Per top-level member:
|
|
21462
|
+
*
|
|
21463
|
+
* - present in the new template -> template value (authority)
|
|
21464
|
+
* - removed since the previous template -> CloudFormation default
|
|
21465
|
+
* ({@link REMOVAL_RESET_DEFAULTS}); a member with no known default keeps
|
|
21466
|
+
* its live value with a WARN (visible, never a silent decision)
|
|
21467
|
+
* - never templated -> live value from `currentConfig`
|
|
21468
|
+
* (the AWS-side default filled at create, or an out-of-band setting cdkd
|
|
21469
|
+
* never managed)
|
|
21470
|
+
*
|
|
21471
|
+
* One deliberate exception to the never-templated rule: `Comment` is
|
|
21472
|
+
* always present in `templateSdk` ({@link convertToSdkFormat} injects
|
|
21473
|
+
* `''` when absent — the SDK requires a non-null string), so an
|
|
21474
|
+
* untemplated Comment resets to `''` rather than keeping the live value.
|
|
21475
|
+
* That matches its CFn registry-schema default and the pre-merge
|
|
21476
|
+
* behavior.
|
|
21477
|
+
*
|
|
21478
|
+
* `CallerReference` is always preserved from the current config (a
|
|
21479
|
+
* create-time idempotency token the template never carries).
|
|
21480
|
+
*/
|
|
21481
|
+
mergeUpdateConfig(currentConfig, newDistributionConfig, previousDistributionConfig, logicalId) {
|
|
21482
|
+
const templateSdk = this.convertToSdkFormat(newDistributionConfig);
|
|
21483
|
+
const previousSdk = this.convertToSdkFormat(previousDistributionConfig);
|
|
21484
|
+
const merged = { ...currentConfig };
|
|
21485
|
+
for (const key of Object.keys(previousSdk)) {
|
|
21486
|
+
if (key in templateSdk || key === "CallerReference") continue;
|
|
21487
|
+
if (key in REMOVAL_RESET_DEFAULTS) merged[key] = structuredClone(REMOVAL_RESET_DEFAULTS[key]);
|
|
21488
|
+
else {
|
|
21489
|
+
const cfnKey = Object.entries(TOP_LEVEL_CFN_TO_SDK).find(([, sdkKey]) => sdkKey === key)?.[0] ?? key;
|
|
21490
|
+
this.logger.warn(`CloudFront Distribution ${logicalId}: '${cfnKey}' was removed from the template but has no known CloudFormation default; keeping the live value. Set the property explicitly in the template to control it.`);
|
|
21491
|
+
}
|
|
21492
|
+
}
|
|
21493
|
+
Object.assign(merged, templateSdk);
|
|
21494
|
+
merged["CallerReference"] = currentConfig["CallerReference"];
|
|
21495
|
+
this.completeRequiredUpdateFields(merged);
|
|
21496
|
+
return merged;
|
|
21497
|
+
}
|
|
21498
|
+
/**
|
|
21499
|
+
* Fill the sub-fields `UpdateDistribution` REQUIRES but a CFn template
|
|
21500
|
+
* legitimately omits (issue #1371, second layer). The top-level merge
|
|
21501
|
+
* makes the payload complete per member, but the template-authoritative
|
|
21502
|
+
* `Origins` / `DefaultCacheBehavior` / `CacheBehaviors` members carry the
|
|
21503
|
+
* template's SPARSE sub-shapes, and the API — which accepts them sparse
|
|
21504
|
+
* on CREATE — rejects an update with per-field errors ("The
|
|
21505
|
+
* 'OriginCustomHeaders' field is missing", "OriginReadTimeout is required
|
|
21506
|
+
* for updates", "The parameter SmoothStreaming flag is missing", ...).
|
|
21507
|
+
*
|
|
21508
|
+
* The set below is the EMPIRICALLY REQUIRED list (probed live against
|
|
21509
|
+
* UpdateDistribution, 2026-08-09) plus its symmetric CFn-default
|
|
21510
|
+
* companions (`FunctionAssociations` / `TrustedSigners` /
|
|
21511
|
+
* `TrustedKeyGroups` — same association/signer family, filled with the
|
|
21512
|
+
* same disabled/empty CFn defaults CloudFormation submits for an
|
|
21513
|
+
* omitted property). Values a template DOES carry always win — every
|
|
21514
|
+
* fill is absent-only. Legacy `ForwardedValues`-mode TTLs are
|
|
21515
|
+
* deliberately NOT filled (they are forbidden alongside `CachePolicyId`,
|
|
21516
|
+
* so a wrong guess would break the modern mode; a legacy template that
|
|
21517
|
+
* needs them fails loudly and can be added here).
|
|
21518
|
+
*/
|
|
21519
|
+
completeRequiredUpdateFields(config) {
|
|
21520
|
+
const origins = config["Origins"];
|
|
21521
|
+
if (origins && Array.isArray(origins["Items"])) origins["Items"] = origins["Items"].map((origin) => {
|
|
21522
|
+
const o = { ...origin };
|
|
21523
|
+
if (o["OriginPath"] === void 0) o["OriginPath"] = "";
|
|
21524
|
+
if (o["CustomHeaders"] === void 0) o["CustomHeaders"] = {
|
|
21525
|
+
Quantity: 0,
|
|
21526
|
+
Items: []
|
|
21527
|
+
};
|
|
21528
|
+
if (o["CustomOriginConfig"] && typeof o["CustomOriginConfig"] === "object") {
|
|
21529
|
+
const c = { ...o["CustomOriginConfig"] };
|
|
21530
|
+
if (c["OriginReadTimeout"] === void 0) c["OriginReadTimeout"] = 30;
|
|
21531
|
+
if (c["OriginKeepaliveTimeout"] === void 0) c["OriginKeepaliveTimeout"] = 5;
|
|
21532
|
+
o["CustomOriginConfig"] = c;
|
|
21533
|
+
}
|
|
21534
|
+
return o;
|
|
21535
|
+
});
|
|
21536
|
+
const fillBehavior = (behavior) => {
|
|
21537
|
+
const b = { ...behavior };
|
|
21538
|
+
if (b["SmoothStreaming"] === void 0) b["SmoothStreaming"] = false;
|
|
21539
|
+
if (b["FieldLevelEncryptionId"] === void 0) b["FieldLevelEncryptionId"] = "";
|
|
21540
|
+
if (b["LambdaFunctionAssociations"] === void 0) b["LambdaFunctionAssociations"] = {
|
|
21541
|
+
Quantity: 0,
|
|
21542
|
+
Items: []
|
|
21543
|
+
};
|
|
21544
|
+
if (b["FunctionAssociations"] === void 0) b["FunctionAssociations"] = {
|
|
21545
|
+
Quantity: 0,
|
|
21546
|
+
Items: []
|
|
21547
|
+
};
|
|
21548
|
+
if (b["TrustedSigners"] === void 0) b["TrustedSigners"] = {
|
|
21549
|
+
Enabled: false,
|
|
21550
|
+
Quantity: 0
|
|
21551
|
+
};
|
|
21552
|
+
if (b["TrustedKeyGroups"] === void 0) b["TrustedKeyGroups"] = {
|
|
21553
|
+
Enabled: false,
|
|
21554
|
+
Quantity: 0
|
|
21555
|
+
};
|
|
21556
|
+
if (b["AllowedMethods"] === void 0) b["AllowedMethods"] = {
|
|
21557
|
+
Quantity: 2,
|
|
21558
|
+
Items: ["GET", "HEAD"],
|
|
21559
|
+
CachedMethods: {
|
|
21560
|
+
Quantity: 2,
|
|
21561
|
+
Items: ["GET", "HEAD"]
|
|
21562
|
+
}
|
|
21563
|
+
};
|
|
21564
|
+
else if (b["AllowedMethods"] && typeof b["AllowedMethods"] === "object" && b["AllowedMethods"]["CachedMethods"] === void 0) b["AllowedMethods"] = {
|
|
21565
|
+
...b["AllowedMethods"],
|
|
21566
|
+
CachedMethods: {
|
|
21567
|
+
Quantity: 2,
|
|
21568
|
+
Items: ["GET", "HEAD"]
|
|
21569
|
+
}
|
|
21570
|
+
};
|
|
21571
|
+
return b;
|
|
21572
|
+
};
|
|
21573
|
+
if (config["DefaultCacheBehavior"] && typeof config["DefaultCacheBehavior"] === "object") config["DefaultCacheBehavior"] = fillBehavior(config["DefaultCacheBehavior"]);
|
|
21574
|
+
const cacheBehaviors = config["CacheBehaviors"];
|
|
21575
|
+
if (cacheBehaviors && Array.isArray(cacheBehaviors["Items"])) cacheBehaviors["Items"] = cacheBehaviors["Items"].map((cb) => fillBehavior(cb));
|
|
21576
|
+
}
|
|
21577
|
+
/**
|
|
21364
21578
|
* Convert CDK/CloudFormation DistributionConfig format to SDK format.
|
|
21365
21579
|
*
|
|
21366
21580
|
* The main transformation is adding Quantity fields where the SDK expects
|
|
@@ -21370,21 +21584,49 @@ var CloudFrontDistributionProvider = class {
|
|
|
21370
21584
|
convertToSdkFormat(config) {
|
|
21371
21585
|
const result = { ...config };
|
|
21372
21586
|
if (result["Comment"] === null || result["Comment"] === void 0) result["Comment"] = "";
|
|
21587
|
+
for (const [cfnKey, sdkKey] of Object.entries(TOP_LEVEL_CFN_TO_SDK)) if (result[cfnKey] !== void 0) {
|
|
21588
|
+
result[sdkKey] = result[cfnKey];
|
|
21589
|
+
delete result[cfnKey];
|
|
21590
|
+
}
|
|
21591
|
+
if (result["ViewerCertificate"] && typeof result["ViewerCertificate"] === "object") {
|
|
21592
|
+
const viewerCertificate = { ...result["ViewerCertificate"] };
|
|
21593
|
+
for (const [cfnKey, sdkKey] of Object.entries(VIEWER_CERTIFICATE_CFN_TO_SDK)) if (viewerCertificate[cfnKey] !== void 0) {
|
|
21594
|
+
viewerCertificate[sdkKey] = viewerCertificate[cfnKey];
|
|
21595
|
+
delete viewerCertificate[cfnKey];
|
|
21596
|
+
}
|
|
21597
|
+
result["ViewerCertificate"] = viewerCertificate;
|
|
21598
|
+
}
|
|
21599
|
+
if (result["Restrictions"] && typeof result["Restrictions"] === "object") {
|
|
21600
|
+
const restrictions = { ...result["Restrictions"] };
|
|
21601
|
+
if (restrictions["GeoRestriction"] && typeof restrictions["GeoRestriction"] === "object") {
|
|
21602
|
+
const geo = { ...restrictions["GeoRestriction"] };
|
|
21603
|
+
if (Array.isArray(geo["Locations"])) {
|
|
21604
|
+
geo["Items"] = geo["Locations"];
|
|
21605
|
+
delete geo["Locations"];
|
|
21606
|
+
}
|
|
21607
|
+
if (geo["Quantity"] === void 0) geo["Quantity"] = Array.isArray(geo["Items"]) ? geo["Items"].length : 0;
|
|
21608
|
+
restrictions["GeoRestriction"] = geo;
|
|
21609
|
+
}
|
|
21610
|
+
result["Restrictions"] = restrictions;
|
|
21611
|
+
}
|
|
21373
21612
|
if (result["Logging"] && typeof result["Logging"] === "object") {
|
|
21374
|
-
const logging = result["Logging"];
|
|
21613
|
+
const logging = { ...result["Logging"] };
|
|
21375
21614
|
if (logging["IncludeCookies"] === void 0) logging["IncludeCookies"] = false;
|
|
21376
21615
|
if (logging["Enabled"] === void 0) logging["Enabled"] = true;
|
|
21377
21616
|
if (logging["Prefix"] === void 0) logging["Prefix"] = "";
|
|
21617
|
+
result["Logging"] = logging;
|
|
21378
21618
|
}
|
|
21379
21619
|
for (const field of QUANTITY_ITEM_FIELDS) if (result[field] !== void 0) result[field] = this.wrapWithQuantity(result[field]);
|
|
21380
21620
|
if (result["DefaultCacheBehavior"] && typeof result["DefaultCacheBehavior"] === "object") result["DefaultCacheBehavior"] = this.convertCacheBehavior(result["DefaultCacheBehavior"]);
|
|
21381
21621
|
if (result["CacheBehaviors"] && typeof result["CacheBehaviors"] === "object") {
|
|
21382
|
-
const cacheBehaviors = result["CacheBehaviors"];
|
|
21622
|
+
const cacheBehaviors = { ...result["CacheBehaviors"] };
|
|
21383
21623
|
if (Array.isArray(cacheBehaviors["Items"])) cacheBehaviors["Items"] = cacheBehaviors["Items"].map((cb) => this.convertCacheBehavior(cb));
|
|
21624
|
+
result["CacheBehaviors"] = cacheBehaviors;
|
|
21384
21625
|
}
|
|
21385
21626
|
if (result["Origins"] && typeof result["Origins"] === "object") {
|
|
21386
|
-
const origins = result["Origins"];
|
|
21627
|
+
const origins = { ...result["Origins"] };
|
|
21387
21628
|
if (Array.isArray(origins["Items"])) origins["Items"] = origins["Items"].map((origin) => this.convertOrigin(origin));
|
|
21629
|
+
result["Origins"] = origins;
|
|
21388
21630
|
}
|
|
21389
21631
|
return result;
|
|
21390
21632
|
}
|
|
@@ -21415,6 +21657,31 @@ var CloudFrontDistributionProvider = class {
|
|
|
21415
21657
|
convertToCfnFormat(config) {
|
|
21416
21658
|
const result = { ...config };
|
|
21417
21659
|
delete result["CallerReference"];
|
|
21660
|
+
for (const [cfnKey, sdkKey] of Object.entries(TOP_LEVEL_CFN_TO_SDK)) if (result[sdkKey] !== void 0) {
|
|
21661
|
+
result[cfnKey] = result[sdkKey];
|
|
21662
|
+
delete result[sdkKey];
|
|
21663
|
+
}
|
|
21664
|
+
if (result["ViewerCertificate"] && typeof result["ViewerCertificate"] === "object") {
|
|
21665
|
+
const viewerCertificate = { ...result["ViewerCertificate"] };
|
|
21666
|
+
for (const [cfnKey, sdkKey] of Object.entries(VIEWER_CERTIFICATE_CFN_TO_SDK)) if (viewerCertificate[sdkKey] !== void 0) {
|
|
21667
|
+
viewerCertificate[cfnKey] = viewerCertificate[sdkKey];
|
|
21668
|
+
delete viewerCertificate[sdkKey];
|
|
21669
|
+
}
|
|
21670
|
+
result["ViewerCertificate"] = viewerCertificate;
|
|
21671
|
+
}
|
|
21672
|
+
if (result["Restrictions"] && typeof result["Restrictions"] === "object") {
|
|
21673
|
+
const restrictions = { ...result["Restrictions"] };
|
|
21674
|
+
if (restrictions["GeoRestriction"] && typeof restrictions["GeoRestriction"] === "object") {
|
|
21675
|
+
const geo = { ...restrictions["GeoRestriction"] };
|
|
21676
|
+
if (Array.isArray(geo["Items"])) {
|
|
21677
|
+
geo["Locations"] = geo["Items"];
|
|
21678
|
+
delete geo["Items"];
|
|
21679
|
+
}
|
|
21680
|
+
delete geo["Quantity"];
|
|
21681
|
+
restrictions["GeoRestriction"] = geo;
|
|
21682
|
+
}
|
|
21683
|
+
result["Restrictions"] = restrictions;
|
|
21684
|
+
}
|
|
21418
21685
|
for (const field of QUANTITY_ITEM_FIELDS) if (result[field] !== void 0) result[field] = this.unwrapQuantity(result[field]);
|
|
21419
21686
|
if (result["DefaultCacheBehavior"] && typeof result["DefaultCacheBehavior"] === "object") result["DefaultCacheBehavior"] = this.revertCacheBehavior(result["DefaultCacheBehavior"]);
|
|
21420
21687
|
if (Array.isArray(result["CacheBehaviors"])) result["CacheBehaviors"] = result["CacheBehaviors"].map((cb) => this.revertCacheBehavior(cb));
|
|
@@ -21459,10 +21726,16 @@ var CloudFrontDistributionProvider = class {
|
|
|
21459
21726
|
*/
|
|
21460
21727
|
revertOrigin(origin) {
|
|
21461
21728
|
const result = { ...origin };
|
|
21462
|
-
if (result["CustomHeaders"] !== void 0)
|
|
21729
|
+
if (result["CustomHeaders"] !== void 0) {
|
|
21730
|
+
result["OriginCustomHeaders"] = this.unwrapQuantity(result["CustomHeaders"]);
|
|
21731
|
+
delete result["CustomHeaders"];
|
|
21732
|
+
}
|
|
21463
21733
|
if (result["CustomOriginConfig"] && typeof result["CustomOriginConfig"] === "object") {
|
|
21464
21734
|
const customOriginConfig = { ...result["CustomOriginConfig"] };
|
|
21465
|
-
if (customOriginConfig["OriginSslProtocols"] !== void 0)
|
|
21735
|
+
if (customOriginConfig["OriginSslProtocols"] !== void 0) {
|
|
21736
|
+
customOriginConfig["OriginSSLProtocols"] = this.unwrapQuantity(customOriginConfig["OriginSslProtocols"]);
|
|
21737
|
+
delete customOriginConfig["OriginSslProtocols"];
|
|
21738
|
+
}
|
|
21466
21739
|
result["CustomOriginConfig"] = customOriginConfig;
|
|
21467
21740
|
}
|
|
21468
21741
|
return result;
|
|
@@ -21518,6 +21791,15 @@ var CloudFrontDistributionProvider = class {
|
|
|
21518
21791
|
const parts = fieldPath.split(".");
|
|
21519
21792
|
this.applyQuantityAtPath(result, parts);
|
|
21520
21793
|
}
|
|
21794
|
+
if (result["CachedMethods"] !== void 0) {
|
|
21795
|
+
const allowedMethods = result["AllowedMethods"] && typeof result["AllowedMethods"] === "object" ? { ...result["AllowedMethods"] } : {
|
|
21796
|
+
Quantity: 2,
|
|
21797
|
+
Items: ["GET", "HEAD"]
|
|
21798
|
+
};
|
|
21799
|
+
allowedMethods["CachedMethods"] = result["CachedMethods"];
|
|
21800
|
+
result["AllowedMethods"] = allowedMethods;
|
|
21801
|
+
delete result["CachedMethods"];
|
|
21802
|
+
}
|
|
21521
21803
|
return result;
|
|
21522
21804
|
}
|
|
21523
21805
|
/**
|
|
@@ -21526,9 +21808,17 @@ var CloudFrontDistributionProvider = class {
|
|
|
21526
21808
|
*/
|
|
21527
21809
|
convertOrigin(origin) {
|
|
21528
21810
|
const result = { ...origin };
|
|
21811
|
+
if (result["OriginCustomHeaders"] !== void 0) {
|
|
21812
|
+
result["CustomHeaders"] = result["OriginCustomHeaders"];
|
|
21813
|
+
delete result["OriginCustomHeaders"];
|
|
21814
|
+
}
|
|
21529
21815
|
if (result["CustomHeaders"] !== void 0) result["CustomHeaders"] = this.wrapWithQuantity(result["CustomHeaders"]);
|
|
21530
21816
|
if (result["CustomOriginConfig"] && typeof result["CustomOriginConfig"] === "object") {
|
|
21531
21817
|
const customOriginConfig = { ...result["CustomOriginConfig"] };
|
|
21818
|
+
if (customOriginConfig["OriginSSLProtocols"] !== void 0) {
|
|
21819
|
+
customOriginConfig["OriginSslProtocols"] = customOriginConfig["OriginSSLProtocols"];
|
|
21820
|
+
delete customOriginConfig["OriginSSLProtocols"];
|
|
21821
|
+
}
|
|
21532
21822
|
if (customOriginConfig["OriginSslProtocols"] !== void 0) customOriginConfig["OriginSslProtocols"] = this.wrapWithQuantity(customOriginConfig["OriginSslProtocols"]);
|
|
21533
21823
|
if (customOriginConfig["HTTPPort"] === null || customOriginConfig["HTTPPort"] === void 0) customOriginConfig["HTTPPort"] = 80;
|
|
21534
21824
|
if (customOriginConfig["HTTPSPort"] === null || customOriginConfig["HTTPSPort"] === void 0) customOriginConfig["HTTPSPort"] = 443;
|
|
@@ -23732,10 +24022,27 @@ var ECSProvider = class {
|
|
|
23732
24022
|
dockerVolumeConfiguration: this.convertDockerVolumeConfiguration(v["DockerVolumeConfiguration"]),
|
|
23733
24023
|
efsVolumeConfiguration: this.convertEFSVolumeConfiguration(v["EFSVolumeConfiguration"]),
|
|
23734
24024
|
fsxWindowsFileServerVolumeConfiguration: this.convertFSxWindowsVolumeConfiguration(v["FSxWindowsFileServerVolumeConfiguration"]),
|
|
24025
|
+
s3filesVolumeConfiguration: this.convertS3FilesVolumeConfiguration(v["S3FilesVolumeConfiguration"]),
|
|
23735
24026
|
configuredAtLaunch: this.coerceBool(v["ConfiguredAtLaunch"])
|
|
23736
24027
|
}));
|
|
23737
24028
|
}
|
|
23738
24029
|
/**
|
|
24030
|
+
* Convert CFn Volumes[].S3FilesVolumeConfiguration to ECS SDK format.
|
|
24031
|
+
* CFn: `{FileSystemArn, AccessPointArn, RootDirectory,
|
|
24032
|
+
* TransitEncryptionPort}` -> SDK members of the same spelling modulo the
|
|
24033
|
+
* first-letter flip. The parent key itself is the irregular one (see
|
|
24034
|
+
* `convertVolumes`).
|
|
24035
|
+
*/
|
|
24036
|
+
convertS3FilesVolumeConfiguration(config) {
|
|
24037
|
+
if (!config) return void 0;
|
|
24038
|
+
return {
|
|
24039
|
+
fileSystemArn: config["FileSystemArn"],
|
|
24040
|
+
accessPointArn: config["AccessPointArn"],
|
|
24041
|
+
rootDirectory: config["RootDirectory"],
|
|
24042
|
+
transitEncryptionPort: config["TransitEncryptionPort"] !== void 0 ? Number(config["TransitEncryptionPort"]) : void 0
|
|
24043
|
+
};
|
|
24044
|
+
}
|
|
24045
|
+
/**
|
|
23739
24046
|
* Convert CFn Volumes[].Host to ECS SDK format.
|
|
23740
24047
|
* CFn: `{SourcePath}` -> SDK: `{sourcePath}`.
|
|
23741
24048
|
*/
|
|
@@ -23862,6 +24169,15 @@ var ECSProvider = class {
|
|
|
23862
24169
|
}
|
|
23863
24170
|
out["EFSVolumeConfiguration"] = efs;
|
|
23864
24171
|
}
|
|
24172
|
+
if (v.s3filesVolumeConfiguration !== void 0) {
|
|
24173
|
+
const s = v.s3filesVolumeConfiguration;
|
|
24174
|
+
const s3f = {};
|
|
24175
|
+
if (s.fileSystemArn !== void 0) s3f["FileSystemArn"] = s.fileSystemArn;
|
|
24176
|
+
if (s.accessPointArn !== void 0) s3f["AccessPointArn"] = s.accessPointArn;
|
|
24177
|
+
if (s.rootDirectory !== void 0) s3f["RootDirectory"] = s.rootDirectory;
|
|
24178
|
+
if (s.transitEncryptionPort !== void 0) s3f["TransitEncryptionPort"] = s.transitEncryptionPort;
|
|
24179
|
+
out["S3FilesVolumeConfiguration"] = s3f;
|
|
24180
|
+
}
|
|
23865
24181
|
if (v.fsxWindowsFileServerVolumeConfiguration !== void 0) {
|
|
23866
24182
|
const f = v.fsxWindowsFileServerVolumeConfiguration;
|
|
23867
24183
|
const fsx = {};
|
|
@@ -63769,7 +64085,7 @@ function createMigrateCommand() {
|
|
|
63769
64085
|
*/
|
|
63770
64086
|
function buildProgram() {
|
|
63771
64087
|
const program = new Command();
|
|
63772
|
-
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.
|
|
64088
|
+
program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.277.0");
|
|
63773
64089
|
program.hook("preAction", (_thisCommand, actionCommand) => {
|
|
63774
64090
|
const { profile } = actionCommand.optsWithGlobals();
|
|
63775
64091
|
if (profile !== void 0) process.env["AWS_PROFILE"] = profile;
|