@go-to-k/cdkd 0.284.64 → 0.284.65
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-DGJz_iFy.js → asg-provider-CNwOmQGg.js} +2 -2
- package/dist/{asg-provider-DGJz_iFy.js.map → asg-provider-CNwOmQGg.js.map} +1 -1
- package/dist/cli.js +2 -2
- package/dist/{deploy-engine-BtqjWvh5.js → deploy-engine-52VBVCWI.js} +158 -17
- package/dist/deploy-engine-52VBVCWI.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/{program-I-xR_ceK.js → program-BfK9a98r.js} +140 -245
- package/dist/{program-I-xR_ceK.js.map → program-BfK9a98r.js.map} +1 -1
- package/dist/{version-BtSUTHs5.js → version-BtkYYOb6.js} +2 -2
- package/dist/{version-BtSUTHs5.js.map → version-BtkYYOb6.js.map} +1 -1
- package/package.json +1 -1
- package/dist/deploy-engine-BtqjWvh5.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as maskerOrIdentity, $n as findLargeInlineResources, $t as TemplateParser, A as renderStatefulReason, An as formatDockerLoginError, Ar as StackHasActiveImportsError, At as STATE_SOURCED_READBACK_RULES, B as exportAliasCollisionScrubWarning, Bn as getLegacyStateBucketName, Br as isThrottlingError, Bt as classifyReplaySecretRegion, C as isFinalSnapshotError, Cn as parseBootstrapMarker, Ct as configStringRefusal, D as extractDeploymentEventError, Dn as buildDenyExternalAccessPolicy, Dr as ProvisioningError, Dt as requireConfigObject, E as makeCanonicalizePropertiesFn, En as validateContainerRepoName, Er as PartialFailureError, Et as requireConfigArray, F as green, Fn as AssetManifestLoader, Ft as isSingleDynamicReferenceToken, G as IAMRoleProvider, Gn as resolveStateBucketWithDefault, Gt as s3BucketRegionalDomainName, H as secretBearingStateKeyWarning, Hn as resolveAutoAssetStorage, Ht as s3BucketArn, I as red, In as getDockerImageBySourceHash, Ir as normalizeAwsError, It as maskSecretsInError, J as ProviderRegistry, Jn as stateBucketExistenceConfirmed, Jt as DiffCalculator, K as collectInlinePolicyNamesManagedBySiblings, Kn as resolveStateBucketWithDefaultAndSource, Kt as s3BucketWebsiteUrl, L as yellow, Ln as Synthesizer, Lr as withErrorHandling, Lt as maskSecretsInText, M as bold, Mn as partitionSensitiveEnv, Mt as createSecretMasker, N as cyan, Nn as runDockerForeground, Nt as dynamicReferenceTokens, O as MULTI_REGION_RECREATE_BLOCKED_TYPES, On as buildDockerImage, Or as ResourceTimeoutError, Ot as requireConfigString, P as gray, Pn as runDockerStreaming, Pt as errorCauseChain, Q as maskDeep, Qn as MIGRATE_TMP_PREFIX, Qt as DagBuilder, R as collectDeclaredOutputNames, Rn as synthesisStatusMessage, Rr as isMarkedNonRetryable, Rt as redactSecretsForState, S as createPreDeleteFinalSnapshot, Sn as isCrossRegionRedirect, Sr as LocalStartServiceError, St as configBooleanRefusal, T as unsupportedFinalSnapshotError, Tn as validateAssetBucketName, Tr as NestedStackChildDirectDestroyError, Tt as replayWarn, U as stateKeySecretExposure, Un as resolveCaptureObservedState, Ut as s3BucketDomainName, V as isExportAliasCollision, Vn as resolveApp, Vr as markNonRetryable, Vt as producerRegionsFromState, W as getCurrentResourceSecrets, Wn as resolveSkipPrefix, Wt as s3BucketDualStackDomainName, X as findSilentDropProperties, Xn as CFN_TEMPLATE_BODY_LIMIT, Xt as describeTypeWithThrottleRetry, Y as findActionableSilentDrops, Yn as warnDeprecatedNoPrefixCliFlag, Yt as INTRINSIC_KEYS, Z as createMaskedRetryLogger, Zn as CFN_TEMPLATE_URL_LIMIT, Zt as withRetry, _ as computeImplicitDeleteEdges, _n as AssetModeResolver, _t as WAFv2WebACLProvider, a as DeploymentEventsStore, an as importableOutputKeys, ar as AssemblyReader, at as isInterruptedWaitError, b as buildFinalSnapshotIdentifier, bn as ensureAssetStorage, br as LocalInvokeBuildError$1, bt as assertRegionMatch, c as replayFailedOperations, cn as AssetPublisher, cr as resolveBucketRegion, ct as slowCcOperationTimeoutMs, d as updatePartialReason, dn as buildAssetRedirectMap, dr as resetAwsClients, dt as IntrinsicFunctionResolver, en as LockManager, er as uploadCfnTemplate, et as CUSTOM_RESOURCE_RESPONSE_PREFIX, f as UNSPECIFIED_SKIP_REASON, fn as createAssetRedirectResolver, fr as setAwsClients, ft as carriesDynamicReference, g as IMPLICIT_DELETE_DEPENDENCIES, gn as stripControlChars, gr as CrossAccountSecretRefusalError, gt as refStateLookupFromResource, h as maskingRetryLogger, hn as escapeRegExp, ht as parameterTypeMayLoseSecretIdentity, i as DeploymentEventsReader, in as exportNamesCarriedFrom, ir as derivePartitionAndUrlSuffix, it as interruptWatchListenerCount, j as formatResourceLine, jn as getDockerCmd, jr as StackTerminationProtectionError, jt as TEMPLATE_SOURCED_RULES, k as isStatefulRecreateTargetSync, kn as dockerSpawnEnvWithSensitive, kr as ResourceUpdateNotSupportedError, kt as STATE_SOURCED_CROSS_GENERATION_RULES, l as replayRollback, ln as stringifyValue, lr as AwsClients, lt as disableInstanceApiTermination, m as withResourceDeadline, mn as rewriteTemplateAssetReferences, mr as CdkdError, mt as getAccountInfo, n as DEFAULT_RESOURCE_WARN_AFTER_MS, nn as S3StateBackend, nr as PARTITION_TABLE, nt as beginCommandInterruptScope, o as planFailedOps, on as importableOutputs, or as processStackMessages, ot as startInterruptWatch, p as deleteSkipReason, pn as loadPublishableAssetManifest, pt as cfnRefValueFromPhysicalId, q as clearOnUpdateRemoval, qn as resolveUseCdkBootstrapAssets, qt as applyRoleArnIfSet, r as DeployEngine, rn as rebuildClientForBucketRegion, rr as canonicalizeRegion, rt as endCommandInterruptScope, s as planRollback, sn as shouldRetainResource, st as CloudControlProvider, t as DEFAULT_RESOURCE_TIMEOUT_MS, tn as displaySafe, tr as expectedOwnerParam, tt as DEFAULT_STATE_PREFIX, u as updatePartialMessage, un as WorkGraph, ur as getAwsClients, ut as isTerminationProtectionPropagationError, v as ATOMIC_FINAL_SNAPSHOT_TYPES, vn as BOOTSTRAP_MARKER_PREFIX, vr as DeployCancelledError, vt as normalizeAwsTagsToCfn, w as refusesFinalSnapshot, wn as readBootstrapMarkerBody, wr as MissingCdkCliError, wt as readConfigString, x as ccRoutedFinalSnapshotError, xn as getBootstrapMarkerKey, xr as LocalMigrateError, xt as coerceCfnBoolean, y as PRE_DELETE_SNAPSHOT_TYPES, yn as assertAssetBucketRegion, yr as DynamicReferenceRegionAmbiguousError, yt as resolveExplicitPhysicalId, z as collectPublishedOutputNames, zn as getDefaultStateBucketName, zr as isRetryableTransientError, zt as scrubResourceRecord } from "./deploy-engine-52VBVCWI.js";
|
|
2
2
|
import { a as getLiveRenderer, c as PATTERN_B_RESOURCE_TYPES, d as generateResourceNameWithFallback, f as getCurrentStackName, h as withStackName, i as runStackBuffered, m as withSkipPrefix, n as getLogger, o as PATTERN_B_NAME_OPTIONS, s as PATTERN_B_NAME_PROPERTIES, u as generateResourceName } from "./logger-zRrlbaQt.js";
|
|
3
|
-
import { t as getCdkdVersion } from "./version-
|
|
4
|
-
import { t as ASGProvider } from "./asg-provider-
|
|
3
|
+
import { t as getCdkdVersion } from "./version-BtkYYOb6.js";
|
|
4
|
+
import { t as ASGProvider } from "./asg-provider-CNwOmQGg.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";
|
|
@@ -6879,12 +6879,12 @@ function canonicalizeItemList(properties, key, fold) {
|
|
|
6879
6879
|
* exported from there because `resolveS3BucketDestination` is S3-specific
|
|
6880
6880
|
* branch selection, not a shared shape guard — the two only share the wording.
|
|
6881
6881
|
*/
|
|
6882
|
-
function describeValue$1(value) {
|
|
6882
|
+
function describeValue$1(value, maskSecrets = (text) => text) {
|
|
6883
6883
|
if (value === null) return "null";
|
|
6884
6884
|
if (Array.isArray(value)) return "an array";
|
|
6885
|
-
if (typeof value === "string") return `a string ${JSON.stringify(value)}`;
|
|
6886
|
-
if (isPlainObject$1(value)) return `an object with keys [${Object.keys(value).join(", ")}]`;
|
|
6887
|
-
return `a ${typeof value} (${String(value)})`;
|
|
6885
|
+
if (typeof value === "string") return `a string ${JSON.stringify(maskDeep(value, maskSecrets))}`;
|
|
6886
|
+
if (isPlainObject$1(value)) return `an object with keys [${Object.keys(value).map((key) => maskSecrets(key)).join(", ")}]`;
|
|
6887
|
+
return `a ${typeof value} (${maskSecrets(String(value))})`;
|
|
6888
6888
|
}
|
|
6889
6889
|
/**
|
|
6890
6890
|
* Coerce a CFn numeric to a finite number. CloudFormation is stringly typed —
|
|
@@ -7602,7 +7602,7 @@ var S3BucketProvider = class S3BucketProvider {
|
|
|
7602
7602
|
* refused on a warn-only path. The caller distinguishes the two by testing
|
|
7603
7603
|
* its own `Destination` value — see the `continue` at each call site.
|
|
7604
7604
|
*/
|
|
7605
|
-
resolveS3BucketDestination(dest, destinationPath, onUnusable) {
|
|
7605
|
+
resolveS3BucketDestination(dest, destinationPath, onUnusable, maskSecrets = (text) => text) {
|
|
7606
7606
|
const nestedPath = `${destinationPath}.S3BucketDestination`;
|
|
7607
7607
|
const drop = (message) => {
|
|
7608
7608
|
if (onUnusable) {
|
|
@@ -7612,11 +7612,11 @@ var S3BucketProvider = class S3BucketProvider {
|
|
|
7612
7612
|
throw new Error(message);
|
|
7613
7613
|
};
|
|
7614
7614
|
if (dest === void 0 || dest === null) return;
|
|
7615
|
-
if (!isPlainObject$1(dest)) return drop(`${destinationPath} must be an object (got ${describeValue$1(dest)}) — check for an unresolved intrinsic or a mis-nested template value; the destination would otherwise be dropped from the request with no error`);
|
|
7615
|
+
if (!isPlainObject$1(dest)) return drop(`${destinationPath} must be an object (got ${describeValue$1(dest, maskSecrets)}) — check for an unresolved intrinsic or a mis-nested template value; the destination would otherwise be dropped from the request with no error`);
|
|
7616
7616
|
const bag = isFlattenedDestination(dest) ? dest : dest["S3BucketDestination"];
|
|
7617
|
-
if (bag === void 0 || bag === null) return drop(`${destinationPath} carries neither a bucket (BucketArn / Bucket) nor a nested S3BucketDestination object (got ${describeValue$1(dest)}) — the destination would otherwise be dropped from the request with no error`);
|
|
7618
|
-
if (!isPlainObject$1(bag)) return drop(`${nestedPath} must be an object (got ${describeValue$1(bag)}) — check for an unresolved intrinsic or a mis-nested template value; the destination would otherwise be dropped from the request with no error`);
|
|
7619
|
-
if (!bag["BucketArn"] && !bag["Bucket"]) return drop(`${bag === dest ? destinationPath : nestedPath} has no destination bucket (BucketArn / Bucket) (got ${describeValue$1(bag)}) — the request would be rejected by S3, or silently carry no destination`);
|
|
7617
|
+
if (bag === void 0 || bag === null) return drop(`${destinationPath} carries neither a bucket (BucketArn / Bucket) nor a nested S3BucketDestination object (got ${describeValue$1(dest, maskSecrets)}) — the destination would otherwise be dropped from the request with no error`);
|
|
7618
|
+
if (!isPlainObject$1(bag)) return drop(`${nestedPath} must be an object (got ${describeValue$1(bag, maskSecrets)}) — check for an unresolved intrinsic or a mis-nested template value; the destination would otherwise be dropped from the request with no error`);
|
|
7619
|
+
if (!bag["BucketArn"] && !bag["Bucket"]) return drop(`${bag === dest ? destinationPath : nestedPath} has no destination bucket (BucketArn / Bucket) (got ${describeValue$1(bag, maskSecrets)}) — the request would be rejected by S3, or silently carry no destination`);
|
|
7620
7620
|
return bag;
|
|
7621
7621
|
}
|
|
7622
7622
|
/**
|
|
@@ -7632,7 +7632,7 @@ var S3BucketProvider = class S3BucketProvider {
|
|
|
7632
7632
|
* substituted default, so the item is recorded as SENT rather than as
|
|
7633
7633
|
* declared.
|
|
7634
7634
|
*/
|
|
7635
|
-
async applyAnalyticsConfigurations(bucketName, configs, onUnusable) {
|
|
7635
|
+
async applyAnalyticsConfigurations(bucketName, configs, onUnusable, maskSecrets = (text) => text) {
|
|
7636
7636
|
const skipped = [];
|
|
7637
7637
|
const substituted = /* @__PURE__ */ new Map();
|
|
7638
7638
|
let index = -1;
|
|
@@ -7673,7 +7673,7 @@ var S3BucketProvider = class S3BucketProvider {
|
|
|
7673
7673
|
const dataExport = rawDataExport;
|
|
7674
7674
|
const analyticsDestPath = "AWS::S3::Bucket AnalyticsConfigurations[].StorageClassAnalysis.DataExport.Destination";
|
|
7675
7675
|
const rawDest = dataExport["Destination"];
|
|
7676
|
-
const s3Dest = this.resolveS3BucketDestination(rawDest, analyticsDestPath, onUnusable);
|
|
7676
|
+
const s3Dest = this.resolveS3BucketDestination(rawDest, analyticsDestPath, onUnusable, maskSecrets);
|
|
7677
7677
|
if (s3Dest === void 0 && rawDest != null) {
|
|
7678
7678
|
skipped.push(index);
|
|
7679
7679
|
continue;
|
|
@@ -7783,7 +7783,7 @@ var S3BucketProvider = class S3BucketProvider {
|
|
|
7783
7783
|
* / the destination guard SKIP the item, while the destination `Format` read
|
|
7784
7784
|
* warns and SENDS a substituted default.
|
|
7785
7785
|
*/
|
|
7786
|
-
async applyInventoryConfigurations(bucketName, configs, onUnusable) {
|
|
7786
|
+
async applyInventoryConfigurations(bucketName, configs, onUnusable, maskSecrets = (text) => text) {
|
|
7787
7787
|
const skipped = [];
|
|
7788
7788
|
const substituted = /* @__PURE__ */ new Map();
|
|
7789
7789
|
let index = -1;
|
|
@@ -7803,7 +7803,7 @@ var S3BucketProvider = class S3BucketProvider {
|
|
|
7803
7803
|
}
|
|
7804
7804
|
const inventoryDestPath = "AWS::S3::Bucket InventoryConfigurations[].Destination";
|
|
7805
7805
|
const rawDest = config["Destination"];
|
|
7806
|
-
const s3Dest = this.resolveS3BucketDestination(rawDest, inventoryDestPath, onUnusable);
|
|
7806
|
+
const s3Dest = this.resolveS3BucketDestination(rawDest, inventoryDestPath, onUnusable, maskSecrets);
|
|
7807
7807
|
if (s3Dest === void 0 && rawDest != null) {
|
|
7808
7808
|
skipped.push(index);
|
|
7809
7809
|
continue;
|
|
@@ -8396,6 +8396,7 @@ var S3BucketProvider = class S3BucketProvider {
|
|
|
8396
8396
|
*/
|
|
8397
8397
|
async applySubConfigDiffs(bucketName, properties, previousProperties, context) {
|
|
8398
8398
|
const overrides = /* @__PURE__ */ new Map();
|
|
8399
|
+
const maskSecrets = maskerOrIdentity(context?.maskSecrets);
|
|
8399
8400
|
/** Record a WHOLE-BLOCK skip: the effective value is the previous one. */
|
|
8400
8401
|
const retainPrevious = (key) => {
|
|
8401
8402
|
overrides.set(key, previousProperties[key]);
|
|
@@ -8553,7 +8554,7 @@ var S3BucketProvider = class S3BucketProvider {
|
|
|
8553
8554
|
retainPreviousItems("MetricsConfigurations", metricsOutcomes);
|
|
8554
8555
|
const analyticsOutcomes = itemOutcomes();
|
|
8555
8556
|
await this.diffArrayConfigById(bucketName, previousProperties["AnalyticsConfigurations"], properties["AnalyticsConfigurations"], async (id, cfg) => {
|
|
8556
|
-
const outcome = await this.applyAnalyticsConfigurations(bucketName, [cfg], (m) => this.logger.warn(m));
|
|
8557
|
+
const outcome = await this.applyAnalyticsConfigurations(bucketName, [cfg], (m) => this.logger.warn(m), maskSecrets);
|
|
8557
8558
|
analyticsOutcomes.record(String(id), outcome);
|
|
8558
8559
|
}, async (id) => {
|
|
8559
8560
|
await this.s3Client.send(new DeleteBucketAnalyticsConfigurationCommand({
|
|
@@ -8577,7 +8578,7 @@ var S3BucketProvider = class S3BucketProvider {
|
|
|
8577
8578
|
retainPreviousItems("IntelligentTieringConfigurations", intelligentTieringOutcomes);
|
|
8578
8579
|
const inventoryOutcomes = itemOutcomes();
|
|
8579
8580
|
await this.diffArrayConfigById(bucketName, previousProperties["InventoryConfigurations"], properties["InventoryConfigurations"], async (id, cfg) => {
|
|
8580
|
-
const outcome = await this.applyInventoryConfigurations(bucketName, [cfg], (m) => this.logger.warn(m));
|
|
8581
|
+
const outcome = await this.applyInventoryConfigurations(bucketName, [cfg], (m) => this.logger.warn(m), maskSecrets);
|
|
8581
8582
|
inventoryOutcomes.record(String(id), outcome);
|
|
8582
8583
|
}, async (id) => {
|
|
8583
8584
|
await this.s3Client.send(new DeleteBucketInventoryConfigurationCommand({
|
|
@@ -8613,6 +8614,7 @@ var S3BucketProvider = class S3BucketProvider {
|
|
|
8613
8614
|
*/
|
|
8614
8615
|
async applyAllSubConfigsForCreate(bucketName, properties, context) {
|
|
8615
8616
|
const overrides = /* @__PURE__ */ new Map();
|
|
8617
|
+
const maskSecrets = maskerOrIdentity(context?.maskSecrets);
|
|
8616
8618
|
/**
|
|
8617
8619
|
* Record a WHOLE-BLOCK fold: the effective value is what was SENT (issue
|
|
8618
8620
|
* #1748). The create-path twin of `applySubConfigDiffs`'s helper of the same
|
|
@@ -8662,11 +8664,11 @@ var S3BucketProvider = class S3BucketProvider {
|
|
|
8662
8664
|
const metricsConfigs = properties["MetricsConfigurations"];
|
|
8663
8665
|
if (metricsConfigs && Array.isArray(metricsConfigs) && metricsConfigs.length > 0) recordItemOutcome("MetricsConfigurations", metricsConfigs, await this.applyMetricsConfigurations(bucketName, metricsConfigs, replayOnUnusable));
|
|
8664
8666
|
const analyticsConfigs = properties["AnalyticsConfigurations"];
|
|
8665
|
-
if (analyticsConfigs && Array.isArray(analyticsConfigs) && analyticsConfigs.length > 0) recordItemOutcome("AnalyticsConfigurations", analyticsConfigs, await this.applyAnalyticsConfigurations(bucketName, analyticsConfigs, replayOnUnusable));
|
|
8667
|
+
if (analyticsConfigs && Array.isArray(analyticsConfigs) && analyticsConfigs.length > 0) recordItemOutcome("AnalyticsConfigurations", analyticsConfigs, await this.applyAnalyticsConfigurations(bucketName, analyticsConfigs, replayOnUnusable, maskSecrets));
|
|
8666
8668
|
const itConfigs = properties["IntelligentTieringConfigurations"];
|
|
8667
8669
|
if (itConfigs && Array.isArray(itConfigs) && itConfigs.length > 0) recordItemOutcome("IntelligentTieringConfigurations", itConfigs, await this.applyIntelligentTieringConfigurations(bucketName, itConfigs, replayOnUnusable));
|
|
8668
8670
|
const inventoryConfigs = properties["InventoryConfigurations"];
|
|
8669
|
-
if (inventoryConfigs && Array.isArray(inventoryConfigs) && inventoryConfigs.length > 0) recordItemOutcome("InventoryConfigurations", inventoryConfigs, await this.applyInventoryConfigurations(bucketName, inventoryConfigs, replayOnUnusable));
|
|
8671
|
+
if (inventoryConfigs && Array.isArray(inventoryConfigs) && inventoryConfigs.length > 0) recordItemOutcome("InventoryConfigurations", inventoryConfigs, await this.applyInventoryConfigurations(bucketName, inventoryConfigs, replayOnUnusable, maskSecrets));
|
|
8670
8672
|
const replConfig = properties["ReplicationConfiguration"];
|
|
8671
8673
|
if (replConfig) {
|
|
8672
8674
|
if (!await this.applyReplicationConfiguration(bucketName, replConfig, replayOnUnusable)) overrides.set("ReplicationConfiguration", void 0);
|
|
@@ -10627,121 +10629,6 @@ function isSqsQueueUrl(value) {
|
|
|
10627
10629
|
return value.startsWith("https://sqs.") && value.includes("/");
|
|
10628
10630
|
}
|
|
10629
10631
|
|
|
10630
|
-
//#endregion
|
|
10631
|
-
//#region src/provisioning/masked-retry-logger.ts
|
|
10632
|
-
/**
|
|
10633
|
-
* The masker a caller supplied, or the identity function when it supplied
|
|
10634
|
-
* none.
|
|
10635
|
-
*
|
|
10636
|
-
* ABSENT MEANS UNMASKED, and that is the back-compatible default the contract
|
|
10637
|
-
* mandates — `create()` / `update()` are also reached from the import path,
|
|
10638
|
-
* from `cdkd drift --revert`, and from tests, and a provider must not care
|
|
10639
|
-
* which caller it got. Centralised here so no call site re-spells the `??`
|
|
10640
|
-
* and accidentally makes the capability required.
|
|
10641
|
-
*/
|
|
10642
|
-
function maskerOrIdentity(maskSecrets) {
|
|
10643
|
-
return maskSecrets ?? ((text) => text);
|
|
10644
|
-
}
|
|
10645
|
-
/**
|
|
10646
|
-
* A {@link RetryLogger} whose every line is routed through `maskSecrets`.
|
|
10647
|
-
*
|
|
10648
|
-
* `warn` is ALWAYS provided, never omitted. It is optional on `RetryLogger`,
|
|
10649
|
-
* and dropping it would silence the give-up summary on the calling path only —
|
|
10650
|
-
* trading a disclosure for the reporting hole issue #2018 closed. It goes
|
|
10651
|
-
* through the SAME mask as `debug` precisely because it is the line that
|
|
10652
|
-
* survives a run without `--verbose`; forwarding it unmasked would defeat the
|
|
10653
|
-
* fence at a HIGHER log level than the one the fence was written for.
|
|
10654
|
-
*
|
|
10655
|
-
* `logger` is typed structurally rather than as the concrete `Logger` so this
|
|
10656
|
-
* module stays a leaf and a test can pass two spies. That matches the
|
|
10657
|
-
* precedent already in the tree (`buildMfaConfigRequest` in
|
|
10658
|
-
* `cognito-provider.ts` takes an injected `logger?: { warn }`).
|
|
10659
|
-
*/
|
|
10660
|
-
function createMaskedRetryLogger(logger, maskSecrets) {
|
|
10661
|
-
const mask = maskerOrIdentity(maskSecrets);
|
|
10662
|
-
return {
|
|
10663
|
-
debug: (message) => logger.debug(mask(message)),
|
|
10664
|
-
warn: (message) => logger.warn(mask(message))
|
|
10665
|
-
};
|
|
10666
|
-
}
|
|
10667
|
-
/**
|
|
10668
|
-
* Depth cap for {@link maskDeep}.
|
|
10669
|
-
*
|
|
10670
|
-
* What it actually bounds is unbounded WORK on a pathologically deep bag — see
|
|
10671
|
-
* the rationale at the cap itself, which is the authority. It is NOT primarily
|
|
10672
|
-
* a cycle guard: a template-derived bag cannot be cyclic, so that justification
|
|
10673
|
-
* over-claims (issue #2176 security review). It does still terminate one, which
|
|
10674
|
-
* is why the walk is safe to share with a caller that might hand it something
|
|
10675
|
-
* other than a template bag.
|
|
10676
|
-
*
|
|
10677
|
-
* Deliberately generous. Every shape these warnings exist to describe is a
|
|
10678
|
-
* scalar, a list of scalars, or a small record, so the walk does not reach
|
|
10679
|
-
* depth 2 in practice.
|
|
10680
|
-
*/
|
|
10681
|
-
const MASK_WALK_MAX_DEPTH = 8;
|
|
10682
|
-
/**
|
|
10683
|
-
* What {@link maskDeep} substitutes for a subtree it declines to descend into.
|
|
10684
|
-
*
|
|
10685
|
-
* MUST equal `SECRET_MASK` in `src/deployment/secret-redaction.ts`. It is
|
|
10686
|
-
* spelled here rather than imported so this module keeps its single-import leaf
|
|
10687
|
-
* property (see the module note above); the two are fenced against drift by a
|
|
10688
|
-
* test that imports both.
|
|
10689
|
-
*/
|
|
10690
|
-
const MASK_WALK_DEPTH_CAP_MARKER = "***";
|
|
10691
|
-
/**
|
|
10692
|
-
* Mask every string LEAF and KEY of an arbitrary value, returning a structure
|
|
10693
|
-
* safe to `JSON.stringify` into a log line or an error message (issue
|
|
10694
|
-
* [#2176](https://github.com/go-to-k/cdkd/issues/2176)).
|
|
10695
|
-
*
|
|
10696
|
-
* THE ORDERING IS THE WHOLE POINT, and it is why masking the finished message
|
|
10697
|
-
* is not a substitute. `maskSecretsInText` matches by literal occurrence, so:
|
|
10698
|
-
*
|
|
10699
|
-
* 1. ESCAPING. `JSON.stringify` escapes `"`, `\` and newlines, so a secret
|
|
10700
|
-
* containing any of them no longer OCCURS in the stringified text and a
|
|
10701
|
-
* mask applied afterwards cannot find it. That is not an exotic case — it
|
|
10702
|
-
* is every Secrets Manager JSON document, the commonest real secret shape.
|
|
10703
|
-
* Measured on the pre-fix tree for #2176: a plaintext of
|
|
10704
|
-
* `{"user":"admin","pw":"hunter2"}` interpolated as
|
|
10705
|
-
* `${JSON.stringify(value)}` came through a message-level mask COMPLETELY
|
|
10706
|
-
* unchanged, while masking the leaves first rendered it `"***"`.
|
|
10707
|
-
* 2. LENGTH. A finished message is always longer than the value inside it, so
|
|
10708
|
-
* it can only ever reach `maskSecretsInText`'s SUBSTRING arm, which ignores
|
|
10709
|
-
* needles below `MIN_NEEDLE_LENGTH` (4). Handing the masker each RAW leaf
|
|
10710
|
-
* reaches the WHOLE-VALUE arm, which has no floor. Measured the same way: a
|
|
10711
|
-
* 3-character secret survived `Value 'abc' at 'pin' failed ...` intact.
|
|
10712
|
-
*
|
|
10713
|
-
* Neither pass subsumes the other, so providers do BOTH — this walk on the
|
|
10714
|
-
* value, and the assembled message through the masker as well. The masker is
|
|
10715
|
-
* idempotent, so the overlap is free.
|
|
10716
|
-
*
|
|
10717
|
-
* Keys are masked as well as values: `JSON.stringify` renders them into the
|
|
10718
|
-
* same line, so a resolved secret used as a map key would otherwise escape.
|
|
10719
|
-
*
|
|
10720
|
-
* WHY THIS LIVES HERE rather than as a private walk per provider. SIX
|
|
10721
|
-
* hand-rolled copies had already accumulated — `elbv2-provider.ts`,
|
|
10722
|
-
* `cognito-provider.ts`, `sns-topic-provider.ts`, `dynamodb-table-provider.ts`,
|
|
10723
|
-
* `dynamodb-globaltable-provider.ts` and `apigatewayv2-provider.ts` — and
|
|
10724
|
-
* `elbv2-provider.ts` carried the standing instruction that "a THIRD site is
|
|
10725
|
-
* the point at which this should move into `../masked-retry-logger.ts` ... and
|
|
10726
|
-
* all three converge on it". That trigger had fired and been missed twice over,
|
|
10727
|
-
* and the copies had already diverged exactly as predicted: FOUR of the six
|
|
10728
|
-
* carried NO depth cap at all.
|
|
10729
|
-
*
|
|
10730
|
-
* Worth recording how the last two were nearly missed AGAIN, because it is the
|
|
10731
|
-
* same failure one level up: the first sweep for this issue grepped for
|
|
10732
|
-
* `maskDeep` / `MASK_WALK_MAX_DEPTH` — the SPELLINGS the known copies used —
|
|
10733
|
-
* and the two survivors spell it `maskLeaf` / `maskLeafValue` with no named
|
|
10734
|
-
* constant. Grep for the SHAPE, not the name. These copies encode a security
|
|
10735
|
-
* contract, and a hardening applied to one silently leaves the others behind.
|
|
10736
|
-
*/
|
|
10737
|
-
function maskDeep(value, mask, depth = 0) {
|
|
10738
|
-
if (typeof value === "string") return mask(value);
|
|
10739
|
-
if (depth >= 8) return "***";
|
|
10740
|
-
if (Array.isArray(value)) return value.map((entry) => maskDeep(entry, mask, depth + 1));
|
|
10741
|
-
if (value !== null && typeof value === "object") return Object.fromEntries(Object.entries(value).map(([k, v]) => [mask(k), maskDeep(v, mask, depth + 1)]));
|
|
10742
|
-
return value;
|
|
10743
|
-
}
|
|
10744
|
-
|
|
10745
10632
|
//#endregion
|
|
10746
10633
|
//#region src/provisioning/providers/sns-topic-provider.ts
|
|
10747
10634
|
/**
|
|
@@ -10837,7 +10724,7 @@ var SNSTopicProvider = class {
|
|
|
10837
10724
|
}));
|
|
10838
10725
|
if (Array.isArray(properties["Subscription"])) {
|
|
10839
10726
|
const subscriptions = properties["Subscription"];
|
|
10840
|
-
for (const sub of subscriptions) await this.subscribeInline(topicArn, sub, logicalId);
|
|
10727
|
+
for (const sub of subscriptions) await this.subscribeInline(topicArn, sub, logicalId, maskSecrets);
|
|
10841
10728
|
}
|
|
10842
10729
|
} catch (innerError) {
|
|
10843
10730
|
try {
|
|
@@ -10961,7 +10848,7 @@ var SNSTopicProvider = class {
|
|
|
10961
10848
|
this.logger.debug(`Reset removed delivery status attribute ${attributeName} for topic ${physicalId}`);
|
|
10962
10849
|
}
|
|
10963
10850
|
}
|
|
10964
|
-
if (JSON.stringify(properties["Subscription"]) !== JSON.stringify(previousProperties["Subscription"])) await this.reconcileInlineSubscriptions(physicalId, previousProperties["Subscription"] || [], properties["Subscription"] || [], logicalId);
|
|
10851
|
+
if (JSON.stringify(properties["Subscription"]) !== JSON.stringify(previousProperties["Subscription"])) await this.reconcileInlineSubscriptions(physicalId, previousProperties["Subscription"] || [], properties["Subscription"] || [], logicalId, maskerOrIdentity(maskSecrets));
|
|
10965
10852
|
const newTags = properties["Tags"];
|
|
10966
10853
|
const oldTags = previousProperties["Tags"];
|
|
10967
10854
|
if (JSON.stringify(newTags) !== JSON.stringify(oldTags)) {
|
|
@@ -10999,10 +10886,10 @@ var SNSTopicProvider = class {
|
|
|
10999
10886
|
* verbatim — AWS's `SubscribeCommand` accepts `Attributes` as a
|
|
11000
10887
|
* `Record<string,string>`.
|
|
11001
10888
|
*/
|
|
11002
|
-
async subscribeInline(topicArn, sub, logicalId) {
|
|
10889
|
+
async subscribeInline(topicArn, sub, logicalId, mask) {
|
|
11003
10890
|
const protocol = sub["Protocol"];
|
|
11004
10891
|
const endpoint = sub["Endpoint"];
|
|
11005
|
-
if (typeof protocol !== "string" || typeof endpoint !== "string") throw new Error(`SNS topic ${logicalId}: inline Subscription entry requires string Protocol and Endpoint, got ${JSON.stringify(sub)}`);
|
|
10892
|
+
if (typeof protocol !== "string" || typeof endpoint !== "string") throw new Error(`SNS topic ${logicalId}: inline Subscription entry requires string Protocol and Endpoint, got ${JSON.stringify(maskDeep(sub, mask))}`);
|
|
11006
10893
|
const attributes = buildSubscriptionAttributes(sub);
|
|
11007
10894
|
const input = {
|
|
11008
10895
|
TopicArn: topicArn,
|
|
@@ -11032,11 +10919,11 @@ var SNSTopicProvider = class {
|
|
|
11032
10919
|
* The primary #980 silent-drop (create / add / remove / drift) is fixed; the
|
|
11033
10920
|
* attribute-only in-place update is a deliberately-scoped follow-up.
|
|
11034
10921
|
*/
|
|
11035
|
-
async reconcileInlineSubscriptions(topicArn, oldSubs, newSubs, logicalId) {
|
|
10922
|
+
async reconcileInlineSubscriptions(topicArn, oldSubs, newSubs, logicalId, mask) {
|
|
11036
10923
|
const key = (protocol, endpoint) => `${String(protocol)}${String(endpoint)}`;
|
|
11037
10924
|
const oldKeys = new Set(oldSubs.map((s) => key(s["Protocol"], s["Endpoint"])));
|
|
11038
10925
|
const newKeys = new Set(newSubs.map((s) => key(s["Protocol"], s["Endpoint"])));
|
|
11039
|
-
for (const sub of newSubs) if (!oldKeys.has(key(sub["Protocol"], sub["Endpoint"]))) await this.subscribeInline(topicArn, sub, logicalId);
|
|
10926
|
+
for (const sub of newSubs) if (!oldKeys.has(key(sub["Protocol"], sub["Endpoint"]))) await this.subscribeInline(topicArn, sub, logicalId, mask);
|
|
11040
10927
|
const removed = oldSubs.filter((s) => !newKeys.has(key(s["Protocol"], s["Endpoint"])));
|
|
11041
10928
|
if (removed.length === 0) return;
|
|
11042
10929
|
const arnByKey = /* @__PURE__ */ new Map();
|
|
@@ -12290,7 +12177,9 @@ var LambdaFunctionProvider = class {
|
|
|
12290
12177
|
/**
|
|
12291
12178
|
* Update a Lambda function
|
|
12292
12179
|
*/
|
|
12293
|
-
async update(logicalId, physicalId, resourceType, properties, previousProperties) {
|
|
12180
|
+
async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
|
|
12181
|
+
const mask = maskerOrIdentity(context?.maskSecrets);
|
|
12182
|
+
const debug = (message) => this.logger.debug(mask(message));
|
|
12294
12183
|
this.logger.debug(`Updating Lambda function ${logicalId}: ${physicalId}`);
|
|
12295
12184
|
try {
|
|
12296
12185
|
const configFields = [
|
|
@@ -12400,7 +12289,7 @@ var LambdaFunctionProvider = class {
|
|
|
12400
12289
|
const prevRuntimeManagementConfig = previousProperties["RuntimeManagementConfig"];
|
|
12401
12290
|
if (newRuntimeManagementConfig?.["UpdateRuntimeOn"] !== prevRuntimeManagementConfig?.["UpdateRuntimeOn"] || newRuntimeManagementConfig?.["RuntimeVersionArn"] !== prevRuntimeManagementConfig?.["RuntimeVersionArn"]) {
|
|
12402
12291
|
await this.putRuntimeManagementConfig(physicalId, newRuntimeManagementConfig ?? { UpdateRuntimeOn: "Auto" });
|
|
12403
|
-
|
|
12292
|
+
debug(`Updated RuntimeManagementConfig for Lambda function ${physicalId} to ${JSON.stringify(maskDeep(newRuntimeManagementConfig ?? { UpdateRuntimeOn: "Auto" }, mask))}`);
|
|
12404
12293
|
}
|
|
12405
12294
|
const getResponse = await this.lambdaClient.send(new GetFunctionCommand({ FunctionName: physicalId }));
|
|
12406
12295
|
const functionArn = getResponse.Configuration?.FunctionArn;
|
|
@@ -18085,10 +17974,10 @@ var DynamoDBTableProvider = class {
|
|
|
18085
17974
|
return;
|
|
18086
17975
|
}
|
|
18087
17976
|
if (isWarmThroughputDecrease(sendable, live?.WarmThroughput)) {
|
|
18088
|
-
warn(`GSI ${safeIndexName} on DynamoDB table ${physicalId}: the requested WarmThroughput ${JSON.stringify(sendable)} is lower than the ${JSON.stringify({
|
|
17977
|
+
warn(`GSI ${safeIndexName} on DynamoDB table ${physicalId}: the requested WarmThroughput ${JSON.stringify(maskDeep(sendable, maskSecrets))} is lower than the ${JSON.stringify(maskDeep({
|
|
18089
17978
|
ReadUnitsPerSecond: live?.WarmThroughput?.ReadUnitsPerSecond,
|
|
18090
17979
|
WriteUnitsPerSecond: live?.WarmThroughput?.WriteUnitsPerSecond
|
|
18091
|
-
})} DynamoDB currently holds for that index. Warm throughput only ever RISES with an index's traffic and cannot be lowered — AWS rejects the UpdateTable with "decreasing WarmThroughput is not supported" — so it was NOT sent and every other change on this table still applied. On a deploy this warning may be the only signal you get: a successful deploy re-captures AWS's current value as the drift baseline. If your template declares this index's WarmThroughput, set it to the value AWS holds (or remove it, which AWS treats as keeping the last-set value); if it does not, the value came from a cdkd state record and 'cdkd deploy' (or 'cdkd drift --accept') refreshes it.`);
|
|
17980
|
+
}, maskSecrets))} DynamoDB currently holds for that index. Warm throughput only ever RISES with an index's traffic and cannot be lowered — AWS rejects the UpdateTable with "decreasing WarmThroughput is not supported" — so it was NOT sent and every other change on this table still applied. On a deploy this warning may be the only signal you get: a successful deploy re-captures AWS's current value as the drift baseline. If your template declares this index's WarmThroughput, set it to the value AWS holds (or remove it, which AWS treats as keeping the last-set value); if it does not, the value came from a cdkd state record and 'cdkd deploy' (or 'cdkd drift --accept') refreshes it.`);
|
|
18092
17981
|
return;
|
|
18093
17982
|
}
|
|
18094
17983
|
return sendable;
|
|
@@ -18164,10 +18053,10 @@ var DynamoDBTableProvider = class {
|
|
|
18164
18053
|
skipWarmThroughputDecrease(logicalId, physicalId, desired, live, maskSecrets = (text) => text) {
|
|
18165
18054
|
const warn = (message) => this.logger.warn(maskSecrets(message));
|
|
18166
18055
|
if (!isWarmThroughputDecrease(desired, live)) return false;
|
|
18167
|
-
warn(`AWS::DynamoDB::Table ${logicalId}: the requested WarmThroughput ${JSON.stringify(desired)} is lower than the ${JSON.stringify({
|
|
18056
|
+
warn(`AWS::DynamoDB::Table ${logicalId}: the requested WarmThroughput ${JSON.stringify(maskDeep(desired, maskSecrets))} is lower than the ${JSON.stringify(maskDeep({
|
|
18168
18057
|
ReadUnitsPerSecond: live?.ReadUnitsPerSecond,
|
|
18169
18058
|
WriteUnitsPerSecond: live?.WriteUnitsPerSecond
|
|
18170
|
-
})} DynamoDB currently holds for table ${physicalId}. Warm throughput only ever RISES with a table's traffic and cannot be lowered — AWS rejects the UpdateTable with "decreasing WarmThroughput is not supported" — so it was NOT sent and every other change on this resource still applied. On a deploy this warning may be the only signal you get: a successful deploy re-captures AWS's current value as the drift baseline, so the next 'cdkd drift' reports this table clean (a 'cdkd drift --revert' records nothing and keeps reporting it). To make cdkd and AWS agree, set WarmThroughput to the value AWS holds (or remove the property, which AWS treats as keeping the last-set value).`);
|
|
18059
|
+
}, maskSecrets))} DynamoDB currently holds for table ${physicalId}. Warm throughput only ever RISES with a table's traffic and cannot be lowered — AWS rejects the UpdateTable with "decreasing WarmThroughput is not supported" — so it was NOT sent and every other change on this resource still applied. On a deploy this warning may be the only signal you get: a successful deploy re-captures AWS's current value as the drift baseline, so the next 'cdkd drift' reports this table clean (a 'cdkd drift --revert' records nothing and keeps reporting it). To make cdkd and AWS agree, set WarmThroughput to the value AWS holds (or remove the property, which AWS treats as keeping the last-set value).`);
|
|
18171
18060
|
return true;
|
|
18172
18061
|
}
|
|
18173
18062
|
/**
|
|
@@ -18823,7 +18712,7 @@ var DynamoDBGlobalTableProvider = class {
|
|
|
18823
18712
|
BillingMode: billingMode
|
|
18824
18713
|
};
|
|
18825
18714
|
const diagnostics = [];
|
|
18826
|
-
if (billingMode === "PROVISIONED") createParams.ProvisionedThroughput = derivePerCallProvisionedThroughput(properties, currentRegion, "min", diagnostics);
|
|
18715
|
+
if (billingMode === "PROVISIONED") createParams.ProvisionedThroughput = derivePerCallProvisionedThroughput(properties, currentRegion, "min", diagnostics, maskSecrets);
|
|
18827
18716
|
let effectiveProperties;
|
|
18828
18717
|
if (billingModeSubstituted) effectiveProperties = stripProvisionedCapacityKeys({
|
|
18829
18718
|
...properties,
|
|
@@ -18866,7 +18755,7 @@ var DynamoDBGlobalTableProvider = class {
|
|
|
18866
18755
|
sdkIndexes = toSdkGlobalSecondaryIndexes(properties, currentRegion, billingMode, "min", diagnostics, onUnusableCreateIndexes && ((message) => {
|
|
18867
18756
|
indexesOmitted = true;
|
|
18868
18757
|
onUnusableCreateIndexes(`${message} Omitting the malformed block, so this create carries NO indexes; the same value is REFUSED on a template-path create`);
|
|
18869
|
-
}));
|
|
18758
|
+
}), maskSecrets);
|
|
18870
18759
|
} catch (error) {
|
|
18871
18760
|
throw new ProvisioningError(error instanceof Error ? error.message : String(error), resourceType, logicalId, void 0, error instanceof Error ? error : void 0);
|
|
18872
18761
|
}
|
|
@@ -18905,7 +18794,7 @@ var DynamoDBGlobalTableProvider = class {
|
|
|
18905
18794
|
const dpeResolved = extractLocalDeletionProtection(properties, currentRegion);
|
|
18906
18795
|
if (dpeResolved !== void 0) createParams.DeletionProtectionEnabled = dpeResolved;
|
|
18907
18796
|
if (properties["TableClass"]) createParams.TableClass = properties["TableClass"];
|
|
18908
|
-
const createCeilings = collectTableOnDemandCeilings(properties, currentRegion, diagnostics);
|
|
18797
|
+
const createCeilings = collectTableOnDemandCeilings(properties, currentRegion, diagnostics, maskSecrets);
|
|
18909
18798
|
const createOnDemand = {
|
|
18910
18799
|
...createCeilings.read.value !== void 0 && { MaxReadRequestUnits: createCeilings.read.value },
|
|
18911
18800
|
...createCeilings.write.value !== void 0 && { MaxWriteRequestUnits: createCeilings.write.value }
|
|
@@ -18916,8 +18805,8 @@ var DynamoDBGlobalTableProvider = class {
|
|
|
18916
18805
|
for (const replica of replicas) {
|
|
18917
18806
|
const replicaRegion = replica["Region"];
|
|
18918
18807
|
if (!replicaRegion || replicaRegion === currentRegion) continue;
|
|
18919
|
-
toSdkReplicaGlobalSecondaryIndexes(replica["GlobalSecondaryIndexes"], billingMode, diagnostics);
|
|
18920
|
-
toSdkReplicaThroughputOverrides(replica, billingMode, diagnostics, {});
|
|
18808
|
+
toSdkReplicaGlobalSecondaryIndexes(replica["GlobalSecondaryIndexes"], billingMode, diagnostics, maskSecrets);
|
|
18809
|
+
toSdkReplicaThroughputOverrides(replica, billingMode, diagnostics, {}, maskSecrets);
|
|
18921
18810
|
}
|
|
18922
18811
|
this.reportThroughputDiagnostics(diagnostics, logicalId, tableName, maskSecrets);
|
|
18923
18812
|
try {
|
|
@@ -18932,7 +18821,7 @@ var DynamoDBGlobalTableProvider = class {
|
|
|
18932
18821
|
for (const replica of replicas) {
|
|
18933
18822
|
const region = replica["Region"];
|
|
18934
18823
|
if (!region || region === currentRegion) continue;
|
|
18935
|
-
await this.addReplica(tableName, replica, region, logicalId, billingMode);
|
|
18824
|
+
await this.addReplica(tableName, replica, region, logicalId, billingMode, void 0, maskSecrets);
|
|
18936
18825
|
}
|
|
18937
18826
|
for (const replica of replicas) {
|
|
18938
18827
|
const region = replica["Region"];
|
|
@@ -19064,12 +18953,12 @@ var DynamoDBGlobalTableProvider = class {
|
|
|
19064
18953
|
* is the granularity cdkd's pre-flight property-coverage check works at;
|
|
19065
18954
|
* these nested keys are tracked as a known gap, not a supported surface.
|
|
19066
18955
|
*/
|
|
19067
|
-
async addReplica(tableName, replica, region, logicalId, billingMode, diagnostics) {
|
|
18956
|
+
async addReplica(tableName, replica, region, logicalId, billingMode, diagnostics, maskSecrets = (text) => text) {
|
|
19068
18957
|
const create = { RegionName: region };
|
|
19069
18958
|
if (replica["KMSMasterKeyId"]) create.KMSMasterKeyId = replica["KMSMasterKeyId"];
|
|
19070
|
-
const replicaIndexes = toSdkReplicaGlobalSecondaryIndexes(replica["GlobalSecondaryIndexes"], billingMode, diagnostics);
|
|
18959
|
+
const replicaIndexes = toSdkReplicaGlobalSecondaryIndexes(replica["GlobalSecondaryIndexes"], billingMode, diagnostics, maskSecrets);
|
|
19071
18960
|
if (replicaIndexes) create.GlobalSecondaryIndexes = replicaIndexes;
|
|
19072
|
-
const tableOverrides = toSdkReplicaThroughputOverrides(replica, billingMode, diagnostics, {});
|
|
18961
|
+
const tableOverrides = toSdkReplicaThroughputOverrides(replica, billingMode, diagnostics, {}, maskSecrets);
|
|
19073
18962
|
if (tableOverrides.ProvisionedThroughputOverride) create.ProvisionedThroughputOverride = tableOverrides.ProvisionedThroughputOverride;
|
|
19074
18963
|
if (tableOverrides.OnDemandThroughputOverride) create.OnDemandThroughputOverride = tableOverrides.OnDemandThroughputOverride;
|
|
19075
18964
|
if (replica["TableClassOverride"]) create.TableClassOverride = replica["TableClassOverride"];
|
|
@@ -19161,9 +19050,9 @@ var DynamoDBGlobalTableProvider = class {
|
|
|
19161
19050
|
const newBilling = billingUnusable ? oldBilling : requestedBilling;
|
|
19162
19051
|
const onDemandCeilingLive = oldBilling === "PAY_PER_REQUEST" && newBilling === "PAY_PER_REQUEST";
|
|
19163
19052
|
const diagnostics = [];
|
|
19164
|
-
const desiredCeilings = collectTableOnDemandCeilings(properties, currentRegion, diagnostics);
|
|
19053
|
+
const desiredCeilings = collectTableOnDemandCeilings(properties, currentRegion, diagnostics, maskSecrets);
|
|
19165
19054
|
const flippingToProvisioned = oldBilling !== newBilling && newBilling === "PROVISIONED";
|
|
19166
|
-
if (flippingToProvisioned) derivePerCallProvisionedThroughput(properties, currentRegion, "seed", diagnostics);
|
|
19055
|
+
if (flippingToProvisioned) derivePerCallProvisionedThroughput(properties, currentRegion, "seed", diagnostics, maskSecrets);
|
|
19167
19056
|
let desiredGsiUnusable = false;
|
|
19168
19057
|
const onUnusableGsiBlock = (message) => {
|
|
19169
19058
|
desiredGsiUnusable = true;
|
|
@@ -19175,13 +19064,13 @@ var DynamoDBGlobalTableProvider = class {
|
|
|
19175
19064
|
warn(`AWS::DynamoDB::GlobalTable ${logicalId}: ${message} (recorded in cdkd state, not in the template) — using the table's LIVE indexes as the comparison baseline for this update, so a corrected template still applies.`);
|
|
19176
19065
|
};
|
|
19177
19066
|
const liveIndexNames = new Set((describeResp.Table?.GlobalSecondaryIndexes ?? []).map((live) => live.IndexName).filter((name) => typeof name === "string"));
|
|
19178
|
-
const desiredSdkIndexes = toSdkGlobalSecondaryIndexes(properties, currentRegion, newBilling, "min", flippingToProvisioned ? void 0 : diagnostics, onUnusableGsiBlock);
|
|
19179
|
-
if (flippingToProvisioned) toSdkGlobalSecondaryIndexes(properties, currentRegion, newBilling, "seed", diagnostics, onUnusableGsiBlock);
|
|
19067
|
+
const desiredSdkIndexes = toSdkGlobalSecondaryIndexes(properties, currentRegion, newBilling, "min", flippingToProvisioned ? void 0 : diagnostics, onUnusableGsiBlock, maskSecrets);
|
|
19068
|
+
if (flippingToProvisioned) toSdkGlobalSecondaryIndexes(properties, currentRegion, newBilling, "seed", diagnostics, onUnusableGsiBlock, maskSecrets);
|
|
19180
19069
|
for (const replica of properties["Replicas"] ?? []) {
|
|
19181
19070
|
const replicaRegion = asRecord$1(replica)?.["Region"];
|
|
19182
19071
|
if (typeof replicaRegion !== "string" || replicaRegion === currentRegion) continue;
|
|
19183
|
-
toSdkReplicaGlobalSecondaryIndexes(replica["GlobalSecondaryIndexes"], newBilling, diagnostics);
|
|
19184
|
-
toSdkReplicaThroughputOverrides(replica, newBilling, diagnostics, {});
|
|
19072
|
+
toSdkReplicaGlobalSecondaryIndexes(replica["GlobalSecondaryIndexes"], newBilling, diagnostics, maskSecrets);
|
|
19073
|
+
toSdkReplicaThroughputOverrides(replica, newBilling, diagnostics, {}, maskSecrets);
|
|
19185
19074
|
}
|
|
19186
19075
|
this.reportThroughputDiagnostics(diagnostics, logicalId, physicalId, maskSecrets);
|
|
19187
19076
|
const newDpe = extractLocalDeletionProtection(properties, currentRegion);
|
|
@@ -19230,7 +19119,7 @@ var DynamoDBGlobalTableProvider = class {
|
|
|
19230
19119
|
let previousGsiProbeUnusable = false;
|
|
19231
19120
|
toSdkGlobalSecondaryIndexes(previousProperties, currentRegion, oldBilling, "min", void 0, () => {
|
|
19232
19121
|
previousGsiProbeUnusable = true;
|
|
19233
|
-
});
|
|
19122
|
+
}, maskSecrets);
|
|
19234
19123
|
const previousIndexes = previousProperties["GlobalSecondaryIndexes"];
|
|
19235
19124
|
effectiveProperties = { ...effectiveProperties ?? properties };
|
|
19236
19125
|
if (!previousGsiProbeUnusable && previousIndexes !== void 0) effectiveProperties["GlobalSecondaryIndexes"] = [...previousIndexes];
|
|
@@ -19271,9 +19160,9 @@ var DynamoDBGlobalTableProvider = class {
|
|
|
19271
19160
|
BillingMode: newBilling
|
|
19272
19161
|
};
|
|
19273
19162
|
if (newBilling === "PROVISIONED") {
|
|
19274
|
-
billingUpdate.ProvisionedThroughput = derivePerCallProvisionedThroughput(properties, currentRegion, "seed");
|
|
19275
|
-
const provisionedIndexes = toSdkGlobalSecondaryIndexes(properties, currentRegion, newBilling, "seed", void 0, onUnusableGsiBlock);
|
|
19276
|
-
const previousFlipIndexes = toSdkGlobalSecondaryIndexes(previousProperties, currentRegion, newBilling, "seed", void 0, onUnusablePreviousGsiBlock);
|
|
19163
|
+
billingUpdate.ProvisionedThroughput = derivePerCallProvisionedThroughput(properties, currentRegion, "seed", void 0, maskSecrets);
|
|
19164
|
+
const provisionedIndexes = toSdkGlobalSecondaryIndexes(properties, currentRegion, newBilling, "seed", void 0, onUnusableGsiBlock, maskSecrets);
|
|
19165
|
+
const previousFlipIndexes = toSdkGlobalSecondaryIndexes(previousProperties, currentRegion, newBilling, "seed", void 0, onUnusablePreviousGsiBlock, maskSecrets);
|
|
19277
19166
|
if (desiredGsiUnusable || previousGsiUnusable) throw new ProvisioningError(`Cannot flip AWS::DynamoDB::GlobalTable ${logicalId} to PROVISIONED while its GlobalSecondaryIndexes block is unusable: AWS requires per-index provisioned capacity in the same UpdateTable, and it cannot be derived from a malformed block (nor read from a table that is still on-demand). Fix the GlobalSecondaryIndexes value — in the template, or in the cdkd state record on a rollback / drift --revert replay — and re-deploy. The table is unchanged.`, resourceType, logicalId, physicalId);
|
|
19278
19167
|
const previousByIndexName = /* @__PURE__ */ new Map();
|
|
19279
19168
|
for (const gsi of previousFlipIndexes) if (gsi.IndexName) previousByIndexName.set(gsi.IndexName, gsi);
|
|
@@ -19344,7 +19233,7 @@ var DynamoDBGlobalTableProvider = class {
|
|
|
19344
19233
|
for (const replica of replicaDiff.added) {
|
|
19345
19234
|
const region = replica["Region"];
|
|
19346
19235
|
if (!region || region === currentRegion) continue;
|
|
19347
|
-
await this.addReplica(physicalId, replica, region, logicalId, newBilling);
|
|
19236
|
+
await this.addReplica(physicalId, replica, region, logicalId, newBilling, void 0, maskSecrets);
|
|
19348
19237
|
const newReplicaTags = replica["Tags"];
|
|
19349
19238
|
await this.applyCrossRegionReplicaTagsDiff(tableArn, region, void 0, newReplicaTags, physicalId, maskSecrets);
|
|
19350
19239
|
const newReadAutoScaling = (replica["ReadProvisionedThroughputSettings"] ?? {})["ReadCapacityAutoScalingSettings"];
|
|
@@ -19377,13 +19266,13 @@ var DynamoDBGlobalTableProvider = class {
|
|
|
19377
19266
|
}
|
|
19378
19267
|
const updateAction = { RegionName: region };
|
|
19379
19268
|
if (replica["KMSMasterKeyId"] !== void 0) updateAction.KMSMasterKeyId = replica["KMSMasterKeyId"];
|
|
19380
|
-
const replicaIndexes = toSdkReplicaGlobalSecondaryIndexes(replica["GlobalSecondaryIndexes"], newBilling);
|
|
19269
|
+
const replicaIndexes = toSdkReplicaGlobalSecondaryIndexes(replica["GlobalSecondaryIndexes"], newBilling, void 0, maskSecrets);
|
|
19381
19270
|
if (replicaIndexes) updateAction.GlobalSecondaryIndexes = replicaIndexes;
|
|
19382
|
-
const replicaOverrides = toSdkReplicaThroughputOverrides(replica, newBilling, void 0, {});
|
|
19271
|
+
const replicaOverrides = toSdkReplicaThroughputOverrides(replica, newBilling, void 0, {}, maskSecrets);
|
|
19383
19272
|
if (replicaOverrides.ProvisionedThroughputOverride) updateAction.ProvisionedThroughputOverride = replicaOverrides.ProvisionedThroughputOverride;
|
|
19384
19273
|
if (replicaOverrides.OnDemandThroughputOverride) updateAction.OnDemandThroughputOverride = replicaOverrides.OnDemandThroughputOverride;
|
|
19385
19274
|
if (oldBilling === newBilling) {
|
|
19386
|
-
const oldReplicaOverrides = toSdkReplicaThroughputOverrides(oldReplica ?? {}, oldBilling, void 0, {});
|
|
19275
|
+
const oldReplicaOverrides = toSdkReplicaThroughputOverrides(oldReplica ?? {}, oldBilling, void 0, {}, maskSecrets);
|
|
19387
19276
|
const droppedOverrides = [];
|
|
19388
19277
|
if (oldReplicaOverrides.OnDemandThroughputOverride && !replicaOverrides.OnDemandThroughputOverride) droppedOverrides.push("ReadOnDemandThroughputSettings");
|
|
19389
19278
|
if (oldReplicaOverrides.ProvisionedThroughputOverride && !replicaOverrides.ProvisionedThroughputOverride) droppedOverrides.push("ReadProvisionedThroughputSettings");
|
|
@@ -19400,7 +19289,7 @@ var DynamoDBGlobalTableProvider = class {
|
|
|
19400
19289
|
}));
|
|
19401
19290
|
await this.waitForReplicaActive(physicalId, region, logicalId);
|
|
19402
19291
|
}
|
|
19403
|
-
const previousTranslatedIndexes = toSdkGlobalSecondaryIndexes(previousProperties, currentRegion, oldBilling, "min", void 0, onUnusablePreviousGsiBlock);
|
|
19292
|
+
const previousTranslatedIndexes = toSdkGlobalSecondaryIndexes(previousProperties, currentRegion, oldBilling, "min", void 0, onUnusablePreviousGsiBlock, maskSecrets);
|
|
19404
19293
|
const previousSdkIndexes = previousGsiUnusable ? buildLiveRecoveryGsiBaseline(desiredSdkIndexes, describeResp.Table?.GlobalSecondaryIndexes, {
|
|
19405
19294
|
carryLiveValues: oldBilling === newBilling && liveBillingMode === newBilling,
|
|
19406
19295
|
liveBillingMode,
|
|
@@ -20820,14 +20709,14 @@ function extractLocalDeletionProtection(props, region) {
|
|
|
20820
20709
|
* literal `ReadCapacityUnits`, which is taken before its auto-scaling
|
|
20821
20710
|
* members; 5 if absent.
|
|
20822
20711
|
*/
|
|
20823
|
-
function derivePerCallProvisionedThroughput(properties, region, source = "min", diagnostics) {
|
|
20712
|
+
function derivePerCallProvisionedThroughput(properties, region, source = "min", diagnostics, maskSecrets = (text) => text) {
|
|
20824
20713
|
const rawReplicas = properties["Replicas"];
|
|
20825
20714
|
const rawRead = (Array.isArray(rawReplicas) ? rawReplicas : []).find((r) => asRecord$1(r)?.["Region"] === region)?.["ReadProvisionedThroughputSettings"];
|
|
20826
20715
|
const rawWrite = properties["WriteProvisionedThroughputSettings"];
|
|
20827
20716
|
const read = deriveReadCapacityUnits(asRecord$1(rawRead), source);
|
|
20828
20717
|
const write = deriveWriteCapacityUnits(asRecord$1(rawWrite), source);
|
|
20829
|
-
if (read === void 0) reportUnresolvedProvisionedCapacity(rawRead, "Read", source, { appliedUnits: DEFAULT_CAPACITY_UNITS }, diagnostics, { blockName: "Replicas[local].ReadProvisionedThroughputSettings" });
|
|
20830
|
-
if (write === void 0) reportUnresolvedProvisionedCapacity(rawWrite, "Write", source, { appliedUnits: DEFAULT_CAPACITY_UNITS }, diagnostics, { blockName: "WriteProvisionedThroughputSettings" });
|
|
20718
|
+
if (read === void 0) reportUnresolvedProvisionedCapacity(rawRead, "Read", source, { appliedUnits: DEFAULT_CAPACITY_UNITS }, diagnostics, { blockName: "Replicas[local].ReadProvisionedThroughputSettings" }, maskSecrets);
|
|
20719
|
+
if (write === void 0) reportUnresolvedProvisionedCapacity(rawWrite, "Write", source, { appliedUnits: DEFAULT_CAPACITY_UNITS }, diagnostics, { blockName: "WriteProvisionedThroughputSettings" }, maskSecrets);
|
|
20831
20720
|
return {
|
|
20832
20721
|
ReadCapacityUnits: read ?? DEFAULT_CAPACITY_UNITS,
|
|
20833
20722
|
WriteCapacityUnits: write ?? DEFAULT_CAPACITY_UNITS
|
|
@@ -21110,7 +20999,7 @@ function warmThroughputDiagnostic(raw, coercion, indexName) {
|
|
|
21110
20999
|
* `ProvisionedThroughputOverride` / `OnDemandThroughputOverride` as "inherit
|
|
21111
21000
|
* the source table's settings".
|
|
21112
21001
|
*/
|
|
21113
|
-
function mergeExplicitThroughputBlock(explicit, derived, members, diagnostics, context) {
|
|
21002
|
+
function mergeExplicitThroughputBlock(explicit, derived, members, diagnostics, context, maskSecrets = (text) => text) {
|
|
21114
21003
|
const out = {};
|
|
21115
21004
|
for (const member of members) {
|
|
21116
21005
|
if (explicit && explicit[member] !== void 0) {
|
|
@@ -21123,7 +21012,7 @@ function mergeExplicitThroughputBlock(explicit, derived, members, diagnostics, c
|
|
|
21123
21012
|
kind: "unresolved-member",
|
|
21124
21013
|
...context.indexName !== void 0 && { indexName: context.indexName },
|
|
21125
21014
|
member,
|
|
21126
|
-
message: `${context.blockName}.${member} is present but did not resolve to a number (${JSON.stringify(explicit[member])?.slice(0, 80)}), so it was ignored. This is usually an unresolved intrinsic; resolve it to a literal.`
|
|
21015
|
+
message: `${context.blockName}.${member} is present but did not resolve to a number (${JSON.stringify(maskDeep(explicit[member], maskSecrets))?.slice(0, 80)}), so it was ignored. This is usually an unresolved intrinsic; resolve it to a literal.`
|
|
21127
21016
|
});
|
|
21128
21017
|
}
|
|
21129
21018
|
const derivedValue = derived?.[member];
|
|
@@ -21144,7 +21033,7 @@ function mergeExplicitThroughputBlock(explicit, derived, members, diagnostics, c
|
|
|
21144
21033
|
* gate short-circuits). The defect is identical in all three; only the
|
|
21145
21034
|
* diagnostic was conditional.
|
|
21146
21035
|
*/
|
|
21147
|
-
function reportUnresolvedRawMember(rawValue, diagnostics, context) {
|
|
21036
|
+
function reportUnresolvedRawMember(rawValue, diagnostics, context, maskSecrets = (text) => text) {
|
|
21148
21037
|
if (!diagnostics) return;
|
|
21149
21038
|
if (rawValue === void 0) return;
|
|
21150
21039
|
if (toFiniteNumber(rawValue) !== void 0) return;
|
|
@@ -21152,7 +21041,7 @@ function reportUnresolvedRawMember(rawValue, diagnostics, context) {
|
|
|
21152
21041
|
kind: "unresolved-member",
|
|
21153
21042
|
...context.indexName !== void 0 && { indexName: context.indexName },
|
|
21154
21043
|
member: context.member,
|
|
21155
|
-
message: `${context.blockName}.${context.member} is declared but did not resolve to a number (${JSON.stringify(rawValue)?.slice(0, 80)}), so no throughput value was sent for it and the live AWS setting was left unchanged. This is usually an unresolved intrinsic; resolve it to a literal to apply the limit, or remove the property entirely to clear it.`
|
|
21044
|
+
message: `${context.blockName}.${context.member} is declared but did not resolve to a number (${JSON.stringify(maskDeep(rawValue, maskSecrets))?.slice(0, 80)}), so no throughput value was sent for it and the live AWS setting was left unchanged. This is usually an unresolved intrinsic; resolve it to a literal to apply the limit, or remove the property entirely to clear it.`
|
|
21156
21045
|
});
|
|
21157
21046
|
}
|
|
21158
21047
|
/**
|
|
@@ -21230,7 +21119,7 @@ function blameUnresolvedProvisionedMember(rawSettings, side, source) {
|
|
|
21230
21119
|
* explicit SDK-shaped member is standing in for it, so the warning always
|
|
21231
21120
|
* describes what actually reached AWS.
|
|
21232
21121
|
*/
|
|
21233
|
-
function reportUnresolvedProvisionedCapacity(rawSettings, side, source, outcome, diagnostics, context) {
|
|
21122
|
+
function reportUnresolvedProvisionedCapacity(rawSettings, side, source, outcome, diagnostics, context, maskSecrets = (text) => text) {
|
|
21234
21123
|
if (!diagnostics) return;
|
|
21235
21124
|
const blame = blameUnresolvedProvisionedMember(rawSettings, side, source);
|
|
21236
21125
|
if (!blame) return;
|
|
@@ -21240,7 +21129,7 @@ function reportUnresolvedProvisionedCapacity(rawSettings, side, source, outcome,
|
|
|
21240
21129
|
kind: "unresolved-member",
|
|
21241
21130
|
...context.indexName !== void 0 && { indexName: context.indexName },
|
|
21242
21131
|
member: blame.relPath ? blame.relPath.slice(blame.relPath.lastIndexOf(".") + 1) : context.blockName.slice(context.blockName.lastIndexOf(".") + 1),
|
|
21243
|
-
message: `${path} is declared but did not resolve to a number (${JSON.stringify(blame.value)?.slice(0, 80)}), ${consequence}. This is usually an unresolved intrinsic; resolve it to a literal to apply the capacity you declared.`
|
|
21132
|
+
message: `${path} is declared but did not resolve to a number (${JSON.stringify(maskDeep(blame.value, maskSecrets))?.slice(0, 80)}), ${consequence}. This is usually an unresolved intrinsic; resolve it to a literal to apply the capacity you declared.`
|
|
21244
21133
|
});
|
|
21245
21134
|
}
|
|
21246
21135
|
/**
|
|
@@ -21332,10 +21221,10 @@ function pickAutoScalingCapacity(autoScaling, source) {
|
|
|
21332
21221
|
* written before this fix (and hand-authored templates) can carry them, and
|
|
21333
21222
|
* silently re-deriving over an explicit value would be a regression.
|
|
21334
21223
|
*/
|
|
21335
|
-
function toSdkGlobalSecondaryIndexes(properties, region, billingMode, source = "min", diagnostics, onUnusableIndexes) {
|
|
21224
|
+
function toSdkGlobalSecondaryIndexes(properties, region, billingMode, source = "min", diagnostics, onUnusableIndexes, maskSecrets = (text) => text) {
|
|
21336
21225
|
const rawIndexes = properties["GlobalSecondaryIndexes"];
|
|
21337
21226
|
if (rawIndexes !== void 0 && !Array.isArray(rawIndexes)) {
|
|
21338
|
-
const shapeDetail = `AWS::DynamoDB::GlobalTable GlobalSecondaryIndexes must be an array, got ${typeof rawIndexes} (${JSON.stringify(rawIndexes)?.slice(0, 200)}).`;
|
|
21227
|
+
const shapeDetail = `AWS::DynamoDB::GlobalTable GlobalSecondaryIndexes must be an array, got ${typeof rawIndexes} (${JSON.stringify(maskDeep(rawIndexes, maskSecrets))?.slice(0, 200)}).`;
|
|
21339
21228
|
if (onUnusableIndexes) {
|
|
21340
21229
|
onUnusableIndexes(shapeDetail);
|
|
21341
21230
|
return [];
|
|
@@ -21396,19 +21285,19 @@ function toSdkGlobalSecondaryIndexes(properties, region, billingMode, source = "
|
|
|
21396
21285
|
reportUnresolvedProvisionedCapacity(fromReplica ? rawLocalRead : rawGsiRead, "Read", source, { appliedUnits: DEFAULT_CAPACITY_UNITS }, diagnostics, {
|
|
21397
21286
|
...typeof indexName === "string" && { indexName },
|
|
21398
21287
|
blockName: fromReplica ? "Replicas[local].GlobalSecondaryIndexes[].ReadProvisionedThroughputSettings" : "ReadProvisionedThroughputSettings"
|
|
21399
|
-
});
|
|
21288
|
+
}, maskSecrets);
|
|
21400
21289
|
}
|
|
21401
21290
|
if (derivedWrite === void 0 && !explicitCovers("WriteCapacityUnits")) reportUnresolvedProvisionedCapacity(rawWrite, "Write", source, { appliedUnits: DEFAULT_CAPACITY_UNITS }, diagnostics, {
|
|
21402
21291
|
...typeof indexName === "string" && { indexName },
|
|
21403
21292
|
blockName: "WriteProvisionedThroughputSettings"
|
|
21404
|
-
});
|
|
21293
|
+
}, maskSecrets);
|
|
21405
21294
|
sdk.ProvisionedThroughput = mergeExplicitThroughputBlock(explicitProvisioned, {
|
|
21406
21295
|
ReadCapacityUnits: derivedRead ?? DEFAULT_CAPACITY_UNITS,
|
|
21407
21296
|
WriteCapacityUnits: derivedWrite ?? DEFAULT_CAPACITY_UNITS
|
|
21408
21297
|
}, ["ReadCapacityUnits", "WriteCapacityUnits"], diagnostics, {
|
|
21409
21298
|
...typeof indexName === "string" && { indexName },
|
|
21410
21299
|
blockName: "ProvisionedThroughput"
|
|
21411
|
-
});
|
|
21300
|
+
}, maskSecrets);
|
|
21412
21301
|
} else {
|
|
21413
21302
|
const rawWrite = asRecord$1(gsi["WriteOnDemandThroughputSettings"])?.["MaxWriteRequestUnits"];
|
|
21414
21303
|
const rawReadLocal = asRecord$1(localEntry?.["ReadOnDemandThroughputSettings"])?.["MaxReadRequestUnits"];
|
|
@@ -21417,12 +21306,12 @@ function toSdkGlobalSecondaryIndexes(properties, region, billingMode, source = "
|
|
|
21417
21306
|
...typeof indexName === "string" && { indexName },
|
|
21418
21307
|
blockName: "WriteOnDemandThroughputSettings",
|
|
21419
21308
|
member: "MaxWriteRequestUnits"
|
|
21420
|
-
});
|
|
21309
|
+
}, maskSecrets);
|
|
21421
21310
|
reportUnresolvedRawMember(rawReadLocal !== void 0 ? rawReadLocal : rawReadGsi, diagnostics, {
|
|
21422
21311
|
...typeof indexName === "string" && { indexName },
|
|
21423
21312
|
blockName: rawReadLocal !== void 0 ? "Replicas[local].GlobalSecondaryIndexes[].ReadOnDemandThroughputSettings" : "ReadOnDemandThroughputSettings",
|
|
21424
21313
|
member: "MaxReadRequestUnits"
|
|
21425
|
-
});
|
|
21314
|
+
}, maskSecrets);
|
|
21426
21315
|
const maxWrite = toFiniteNumber(rawWrite);
|
|
21427
21316
|
const maxRead = toFiniteNumber(rawReadLocal) ?? toFiniteNumber(rawReadGsi);
|
|
21428
21317
|
const merged = mergeExplicitThroughputBlock(explicitOnDemand, {
|
|
@@ -21431,7 +21320,7 @@ function toSdkGlobalSecondaryIndexes(properties, region, billingMode, source = "
|
|
|
21431
21320
|
}, ["MaxReadRequestUnits", "MaxWriteRequestUnits"], diagnostics, {
|
|
21432
21321
|
...typeof indexName === "string" && { indexName },
|
|
21433
21322
|
blockName: "OnDemandThroughput"
|
|
21434
|
-
});
|
|
21323
|
+
}, maskSecrets);
|
|
21435
21324
|
if (merged) sdk.OnDemandThroughput = merged;
|
|
21436
21325
|
}
|
|
21437
21326
|
result.push(sdk);
|
|
@@ -21943,14 +21832,14 @@ function buildLiveRecoveryGsiBaseline(desiredSdkIndexes, liveIndexes, options) {
|
|
|
21943
21832
|
* status back in `readCurrentState`). Recorded here rather than silently
|
|
21944
21833
|
* dropped; tracked with the other GlobalTable nested-key gaps.
|
|
21945
21834
|
*/
|
|
21946
|
-
function toSdkReplicaGlobalSecondaryIndexes(replicaIndexes, billingMode, diagnostics) {
|
|
21835
|
+
function toSdkReplicaGlobalSecondaryIndexes(replicaIndexes, billingMode, diagnostics, maskSecrets = (text) => text) {
|
|
21947
21836
|
if (!Array.isArray(replicaIndexes) || replicaIndexes.length === 0) return void 0;
|
|
21948
21837
|
return replicaIndexes.map((entry) => {
|
|
21949
21838
|
const cfn = asRecord$1(entry);
|
|
21950
21839
|
if (!cfn) return entry;
|
|
21951
21840
|
const indexName = cfn["IndexName"];
|
|
21952
21841
|
const sdk = { IndexName: indexName };
|
|
21953
|
-
const overrides = toSdkReplicaThroughputOverrides(cfn, billingMode, diagnostics, { ...typeof indexName === "string" && { indexName } });
|
|
21842
|
+
const overrides = toSdkReplicaThroughputOverrides(cfn, billingMode, diagnostics, { ...typeof indexName === "string" && { indexName } }, maskSecrets);
|
|
21954
21843
|
if (overrides.ProvisionedThroughputOverride) sdk.ProvisionedThroughputOverride = overrides.ProvisionedThroughputOverride;
|
|
21955
21844
|
if (overrides.OnDemandThroughputOverride) sdk.OnDemandThroughputOverride = overrides.OnDemandThroughputOverride;
|
|
21956
21845
|
return sdk;
|
|
@@ -21970,7 +21859,7 @@ function toSdkReplicaGlobalSecondaryIndexes(replicaIndexes, billingMode, diagnos
|
|
|
21970
21859
|
* mode. Both override members are READ-side only — a replica has no
|
|
21971
21860
|
* independent write capacity, since writes replicate from the source table.
|
|
21972
21861
|
*/
|
|
21973
|
-
function toSdkReplicaThroughputOverrides(cfn, billingMode, diagnostics, context) {
|
|
21862
|
+
function toSdkReplicaThroughputOverrides(cfn, billingMode, diagnostics, context, maskSecrets = (text) => text) {
|
|
21974
21863
|
const explicitProvisioned = asRecord$1(cfn["ProvisionedThroughputOverride"]);
|
|
21975
21864
|
const explicitOnDemand = asRecord$1(cfn["OnDemandThroughputOverride"]);
|
|
21976
21865
|
if (explicitProvisioned && billingMode !== "PROVISIONED") diagnostics?.push({
|
|
@@ -21991,11 +21880,11 @@ function toSdkReplicaThroughputOverrides(cfn, billingMode, diagnostics, context)
|
|
|
21991
21880
|
if (readCapacity === void 0 && toFiniteNumber(explicitProvisioned?.["ReadCapacityUnits"]) === void 0) reportUnresolvedProvisionedCapacity(rawRead, "Read", "min", { suppressed: "so no ProvisionedThroughputOverride was sent and the replica keeps the source table's read capacity" }, diagnostics, {
|
|
21992
21881
|
...context,
|
|
21993
21882
|
blockName: "ReadProvisionedThroughputSettings"
|
|
21994
|
-
});
|
|
21883
|
+
}, maskSecrets);
|
|
21995
21884
|
const merged = mergeExplicitThroughputBlock(explicitProvisioned, readCapacity !== void 0 ? { ReadCapacityUnits: readCapacity } : void 0, ["ReadCapacityUnits"], diagnostics, {
|
|
21996
21885
|
...context,
|
|
21997
21886
|
blockName: "ProvisionedThroughputOverride"
|
|
21998
|
-
});
|
|
21887
|
+
}, maskSecrets);
|
|
21999
21888
|
return merged ? { ProvisionedThroughputOverride: merged } : {};
|
|
22000
21889
|
}
|
|
22001
21890
|
const rawMaxRead = asRecord$1(cfn["ReadOnDemandThroughputSettings"])?.["MaxReadRequestUnits"];
|
|
@@ -22003,12 +21892,12 @@ function toSdkReplicaThroughputOverrides(cfn, billingMode, diagnostics, context)
|
|
|
22003
21892
|
...context,
|
|
22004
21893
|
blockName: "ReadOnDemandThroughputSettings",
|
|
22005
21894
|
member: "MaxReadRequestUnits"
|
|
22006
|
-
});
|
|
21895
|
+
}, maskSecrets);
|
|
22007
21896
|
const maxReadRequestUnits = toFiniteNumber(rawMaxRead);
|
|
22008
21897
|
const merged = mergeExplicitThroughputBlock(explicitOnDemand, maxReadRequestUnits !== void 0 ? { MaxReadRequestUnits: maxReadRequestUnits } : void 0, ["MaxReadRequestUnits"], diagnostics, {
|
|
22009
21898
|
...context,
|
|
22010
21899
|
blockName: "OnDemandThroughputOverride"
|
|
22011
|
-
});
|
|
21900
|
+
}, maskSecrets);
|
|
22012
21901
|
return merged ? { OnDemandThroughputOverride: merged } : {};
|
|
22013
21902
|
}
|
|
22014
21903
|
/**
|
|
@@ -22030,7 +21919,7 @@ function toSdkReplicaThroughputOverrides(cfn, billingMode, diagnostics, context)
|
|
|
22030
21919
|
* member on `ReplicaSpecification`:
|
|
22031
21920
|
* `ReadOnDemandThroughputSettings: { MaxReadRequestUnits: integer, minimum 1 }`.
|
|
22032
21921
|
*/
|
|
22033
|
-
function collectTableOnDemandCeilings(properties, region, diagnostics) {
|
|
21922
|
+
function collectTableOnDemandCeilings(properties, region, diagnostics, maskSecrets = (text) => text) {
|
|
22034
21923
|
const writeBlock = properties["WriteOnDemandThroughputSettings"];
|
|
22035
21924
|
const replicas = properties["Replicas"];
|
|
22036
21925
|
const readBlock = asRecord$1(Array.isArray(replicas) ? replicas.find((r) => asRecord$1(r)?.["Region"] === region) : void 0)?.["ReadOnDemandThroughputSettings"];
|
|
@@ -22039,11 +21928,11 @@ function collectTableOnDemandCeilings(properties, region, diagnostics) {
|
|
|
22039
21928
|
reportUnresolvedRawMember(rawRead, diagnostics, {
|
|
22040
21929
|
blockName: "Replicas[local].ReadOnDemandThroughputSettings",
|
|
22041
21930
|
member: "MaxReadRequestUnits"
|
|
22042
|
-
});
|
|
21931
|
+
}, maskSecrets);
|
|
22043
21932
|
reportUnresolvedRawMember(rawWrite, diagnostics, {
|
|
22044
21933
|
blockName: "WriteOnDemandThroughputSettings",
|
|
22045
21934
|
member: "MaxWriteRequestUnits"
|
|
22046
|
-
});
|
|
21935
|
+
}, maskSecrets);
|
|
22047
21936
|
return {
|
|
22048
21937
|
read: {
|
|
22049
21938
|
declared: rawRead !== void 0 || isUnresolvedIntrinsicBlock(readBlock),
|
|
@@ -22919,9 +22808,9 @@ var CloudWatchAnomalyDetectorProvider = class {
|
|
|
22919
22808
|
/**
|
|
22920
22809
|
* Create an anomaly detection model via `PutAnomalyDetector`.
|
|
22921
22810
|
*/
|
|
22922
|
-
async create(logicalId, resourceType, properties) {
|
|
22811
|
+
async create(logicalId, resourceType, properties, context) {
|
|
22923
22812
|
this.logger.debug(`Creating CloudWatch anomaly detector ${logicalId}`);
|
|
22924
|
-
const params = buildPutParams(properties);
|
|
22813
|
+
const params = buildPutParams(properties, maskerOrIdentity(context?.maskSecrets));
|
|
22925
22814
|
if (!hasDescriptor(params)) throw new ProvisioningError(`AnomalyDetector ${logicalId} needs a metric descriptor: either SingleMetricAnomalyDetector, MetricMathAnomalyDetector, or the top-level Namespace/MetricName/Stat fields`, resourceType, logicalId);
|
|
22926
22815
|
try {
|
|
22927
22816
|
await this.cloudWatchClient.send(new PutAnomalyDetectorCommand(params));
|
|
@@ -22953,10 +22842,10 @@ var CloudWatchAnomalyDetectorProvider = class {
|
|
|
22953
22842
|
* defaults), so re-putting the full desired properties matches CFn's
|
|
22954
22843
|
* "removed property resets to default" behavior with no extra clearing.
|
|
22955
22844
|
*/
|
|
22956
|
-
async update(logicalId, physicalId, resourceType, properties, _previousProperties) {
|
|
22845
|
+
async update(logicalId, physicalId, resourceType, properties, _previousProperties, context) {
|
|
22957
22846
|
this.logger.debug(`Updating CloudWatch anomaly detector ${logicalId}: ${physicalId}`);
|
|
22958
22847
|
try {
|
|
22959
|
-
await this.cloudWatchClient.send(new PutAnomalyDetectorCommand(buildPutParams(properties)));
|
|
22848
|
+
await this.cloudWatchClient.send(new PutAnomalyDetectorCommand(buildPutParams(properties, maskerOrIdentity(context?.maskSecrets))));
|
|
22960
22849
|
this.logger.debug(`Successfully updated CloudWatch anomaly detector ${logicalId}`);
|
|
22961
22850
|
return {
|
|
22962
22851
|
physicalId,
|
|
@@ -23023,7 +22912,7 @@ var CloudWatchAnomalyDetectorProvider = class {
|
|
|
23023
22912
|
* `Configuration.ExcludedTimeRanges[].StartTime/EndTime`, which CFn carries
|
|
23024
22913
|
* as ISO-8601 strings and the SDK models as `Date`.
|
|
23025
22914
|
*/
|
|
23026
|
-
function buildPutParams(properties) {
|
|
22915
|
+
function buildPutParams(properties, mask) {
|
|
23027
22916
|
const params = {};
|
|
23028
22917
|
const single = properties["SingleMetricAnomalyDetector"];
|
|
23029
22918
|
if (single !== void 0) params.SingleMetricAnomalyDetector = single;
|
|
@@ -23039,8 +22928,8 @@ function buildPutParams(properties) {
|
|
|
23039
22928
|
if (configuration["MetricTimeZone"] !== void 0) mapped.MetricTimezone = configuration["MetricTimeZone"];
|
|
23040
22929
|
const ranges = configuration["ExcludedTimeRanges"];
|
|
23041
22930
|
if (ranges !== void 0) mapped.ExcludedTimeRanges = ranges.map((r) => ({
|
|
23042
|
-
StartTime: toDate(r["StartTime"]),
|
|
23043
|
-
EndTime: toDate(r["EndTime"])
|
|
22931
|
+
StartTime: toDate(r["StartTime"], mask),
|
|
22932
|
+
EndTime: toDate(r["EndTime"], mask)
|
|
23044
22933
|
}));
|
|
23045
22934
|
params.Configuration = mapped;
|
|
23046
22935
|
}
|
|
@@ -23065,11 +22954,11 @@ function buildDeleteParams(properties) {
|
|
|
23065
22954
|
return params;
|
|
23066
22955
|
}
|
|
23067
22956
|
/** CFn carries Range times as ISO-8601 strings; the SDK models them as Date. */
|
|
23068
|
-
function toDate(value) {
|
|
22957
|
+
function toDate(value, mask) {
|
|
23069
22958
|
if (value === void 0) return void 0;
|
|
23070
22959
|
if (value instanceof Date) return value;
|
|
23071
22960
|
const parsed = typeof value === "string" || typeof value === "number" ? new Date(value) : /* @__PURE__ */ new Date(NaN);
|
|
23072
|
-
if (Number.isNaN(parsed.getTime())) throw new Error(`Configuration.ExcludedTimeRanges contains an unparsable time value: ${JSON.stringify(value)}`);
|
|
22961
|
+
if (Number.isNaN(parsed.getTime())) throw new Error(`Configuration.ExcludedTimeRanges contains an unparsable time value: ${JSON.stringify(maskDeep(value, mask))}`);
|
|
23073
22962
|
return parsed;
|
|
23074
22963
|
}
|
|
23075
22964
|
/**
|
|
@@ -44848,11 +44737,11 @@ var AppSyncProvider = class {
|
|
|
44848
44737
|
* engine's replacement-detection layer should normally route those
|
|
44849
44738
|
* through CREATE+DELETE.
|
|
44850
44739
|
*/
|
|
44851
|
-
async update(logicalId, physicalId, resourceType, properties, previousProperties) {
|
|
44740
|
+
async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
|
|
44852
44741
|
switch (resourceType) {
|
|
44853
44742
|
case "AWS::AppSync::GraphQLApi": return this.updateGraphQLApi(logicalId, physicalId, resourceType, properties, previousProperties);
|
|
44854
44743
|
case "AWS::AppSync::GraphQLSchema": return this.updateGraphQLSchema(logicalId, physicalId, resourceType, properties, previousProperties);
|
|
44855
|
-
case "AWS::AppSync::DataSource": return this.updateDataSource(logicalId, physicalId, resourceType, properties, previousProperties);
|
|
44744
|
+
case "AWS::AppSync::DataSource": return this.updateDataSource(logicalId, physicalId, resourceType, properties, previousProperties, maskerOrIdentity(context?.maskSecrets));
|
|
44856
44745
|
case "AWS::AppSync::Resolver": return this.updateResolver(logicalId, physicalId, resourceType, properties, previousProperties);
|
|
44857
44746
|
case "AWS::AppSync::ApiKey": return this.updateApiKey(logicalId, physicalId, resourceType, properties, previousProperties);
|
|
44858
44747
|
default: throw new ProvisioningError(`Unsupported resource type: ${resourceType}`, resourceType, logicalId, physicalId);
|
|
@@ -44959,7 +44848,7 @@ var AppSyncProvider = class {
|
|
|
44959
44848
|
wasReplaced: false
|
|
44960
44849
|
};
|
|
44961
44850
|
}
|
|
44962
|
-
async updateDataSource(logicalId, physicalId, resourceType, properties, previousProperties) {
|
|
44851
|
+
async updateDataSource(logicalId, physicalId, resourceType, properties, previousProperties, mask) {
|
|
44963
44852
|
for (const field of [
|
|
44964
44853
|
"ApiId",
|
|
44965
44854
|
"Name",
|
|
@@ -44989,7 +44878,7 @@ var AppSyncProvider = class {
|
|
|
44989
44878
|
name,
|
|
44990
44879
|
type
|
|
44991
44880
|
};
|
|
44992
|
-
this.applyDataSourceConfig(input, resourceType, logicalId, properties);
|
|
44881
|
+
this.applyDataSourceConfig(input, resourceType, logicalId, properties, mask);
|
|
44993
44882
|
try {
|
|
44994
44883
|
await this.getClient().send(new UpdateDataSourceCommand(input));
|
|
44995
44884
|
} catch (error) {
|
|
@@ -45189,10 +45078,10 @@ var AppSyncProvider = class {
|
|
|
45189
45078
|
* .claude/rules/providers.md. So the accepted shapes are enumerated instead:
|
|
45190
45079
|
* a finite NUMBER, or a NON-BLANK string that parses to one.
|
|
45191
45080
|
*/
|
|
45192
|
-
toDeltaSyncTtl(value, path, logicalId, resourceType) {
|
|
45081
|
+
toDeltaSyncTtl(value, path, logicalId, resourceType, mask) {
|
|
45193
45082
|
const numeric = typeof value === "number" ? value : typeof value === "string" ? value.trim() : void 0;
|
|
45194
45083
|
const parsed = numeric === void 0 || numeric === "" ? NaN : Number(numeric);
|
|
45195
|
-
if (!Number.isFinite(parsed)) throw new ProvisioningError(`${resourceType} ${path} must be a number of minutes (CFn types it as a string), got ${JSON.stringify(value)} — cdkd refuses to drop it silently`, resourceType, logicalId);
|
|
45084
|
+
if (!Number.isFinite(parsed)) throw new ProvisioningError(`${resourceType} ${path} must be a number of minutes (CFn types it as a string), got ${JSON.stringify(maskDeep(value, mask))} — cdkd refuses to drop it silently`, resourceType, logicalId);
|
|
45196
45085
|
return parsed;
|
|
45197
45086
|
}
|
|
45198
45087
|
/**
|
|
@@ -45536,7 +45425,7 @@ var AppSyncProvider = class {
|
|
|
45536
45425
|
* validation error. The read side (`readDataSource`) gates on the
|
|
45537
45426
|
* response's own discriminator instead.
|
|
45538
45427
|
*/
|
|
45539
|
-
applyDataSourceConfig(input, resourceType, logicalId, properties) {
|
|
45428
|
+
applyDataSourceConfig(input, resourceType, logicalId, properties, mask) {
|
|
45540
45429
|
if (properties["Description"] !== void 0) input.description = properties["Description"];
|
|
45541
45430
|
if (properties["ServiceRoleArn"] !== void 0) input.serviceRoleArn = properties["ServiceRoleArn"];
|
|
45542
45431
|
const dynamo = this.asObject(properties["DynamoDBConfig"], "DynamoDBConfig", { logicalId }, resourceType);
|
|
@@ -45550,9 +45439,9 @@ var AppSyncProvider = class {
|
|
|
45550
45439
|
const delta = this.asObject(dynamo["DeltaSyncConfig"], "DynamoDBConfig.DeltaSyncConfig", { logicalId }, resourceType);
|
|
45551
45440
|
if (delta) {
|
|
45552
45441
|
const deltaConfig = {};
|
|
45553
|
-
if (delta["BaseTableTTL"] !== void 0) deltaConfig.baseTableTTL = this.toDeltaSyncTtl(delta["BaseTableTTL"], "DynamoDBConfig.DeltaSyncConfig.BaseTableTTL", logicalId, resourceType);
|
|
45442
|
+
if (delta["BaseTableTTL"] !== void 0) deltaConfig.baseTableTTL = this.toDeltaSyncTtl(delta["BaseTableTTL"], "DynamoDBConfig.DeltaSyncConfig.BaseTableTTL", logicalId, resourceType, mask);
|
|
45554
45443
|
if (delta["DeltaSyncTableName"] !== void 0) deltaConfig.deltaSyncTableName = delta["DeltaSyncTableName"];
|
|
45555
|
-
if (delta["DeltaSyncTableTTL"] !== void 0) deltaConfig.deltaSyncTableTTL = this.toDeltaSyncTtl(delta["DeltaSyncTableTTL"], "DynamoDBConfig.DeltaSyncConfig.DeltaSyncTableTTL", logicalId, resourceType);
|
|
45444
|
+
if (delta["DeltaSyncTableTTL"] !== void 0) deltaConfig.deltaSyncTableTTL = this.toDeltaSyncTtl(delta["DeltaSyncTableTTL"], "DynamoDBConfig.DeltaSyncConfig.DeltaSyncTableTTL", logicalId, resourceType, mask);
|
|
45556
45445
|
ddbConfig.deltaSyncConfig = deltaConfig;
|
|
45557
45446
|
}
|
|
45558
45447
|
input.dynamodbConfig = ddbConfig;
|
|
@@ -45731,7 +45620,7 @@ var AppSyncProvider = class {
|
|
|
45731
45620
|
name,
|
|
45732
45621
|
type
|
|
45733
45622
|
};
|
|
45734
|
-
this.applyDataSourceConfig(input, resourceType, logicalId, properties);
|
|
45623
|
+
this.applyDataSourceConfig(input, resourceType, logicalId, properties, maskerOrIdentity(context?.maskSecrets));
|
|
45735
45624
|
reportedArn = (await this.getClient().send(new CreateDataSourceCommand(input))).dataSource?.dataSourceArn;
|
|
45736
45625
|
this.logger.debug(`Successfully created DataSource ${logicalId}: ${physicalId}`);
|
|
45737
45626
|
} catch (error) {
|
|
@@ -49365,15 +49254,15 @@ var BudgetsBudgetProvider = class {
|
|
|
49365
49254
|
* a UTC date string (`2026-07-01T00:00:00Z`) or an epoch timestamp in
|
|
49366
49255
|
* seconds (possibly as a numeric string).
|
|
49367
49256
|
*/
|
|
49368
|
-
toSdkDate(raw, field, logicalId, resourceType) {
|
|
49257
|
+
toSdkDate(raw, field, logicalId, resourceType, mask) {
|
|
49369
49258
|
let date;
|
|
49370
49259
|
if (typeof raw === "number") date = new Date(raw < 0xe8d4a51000 ? raw * 1e3 : raw);
|
|
49371
49260
|
else if (typeof raw === "string" && /^\d+$/.test(raw)) {
|
|
49372
49261
|
const num = Number(raw);
|
|
49373
49262
|
date = new Date(num < 0xe8d4a51000 ? num * 1e3 : num);
|
|
49374
49263
|
} else if (typeof raw === "string") date = new Date(raw);
|
|
49375
|
-
else throw new ProvisioningError(`Invalid TimePeriod.${field} for budget ${logicalId}: expected a date string or epoch timestamp, got ${JSON.stringify(raw)}`, resourceType, logicalId);
|
|
49376
|
-
if (Number.isNaN(date.getTime())) throw new ProvisioningError(`Invalid TimePeriod.${field} for budget ${logicalId}: ${JSON.stringify(raw)} is not a parseable date`, resourceType, logicalId);
|
|
49264
|
+
else throw new ProvisioningError(`Invalid TimePeriod.${field} for budget ${logicalId}: expected a date string or epoch timestamp, got ${JSON.stringify(maskDeep(raw, mask))}`, resourceType, logicalId);
|
|
49265
|
+
if (Number.isNaN(date.getTime())) throw new ProvisioningError(`Invalid TimePeriod.${field} for budget ${logicalId}: ${JSON.stringify(maskDeep(raw, mask))} is not a parseable date`, resourceType, logicalId);
|
|
49377
49266
|
return date;
|
|
49378
49267
|
}
|
|
49379
49268
|
/**
|
|
@@ -49383,7 +49272,7 @@ var BudgetsBudgetProvider = class {
|
|
|
49383
49272
|
* `TimePeriod.Start` / `.End` are `Date`s. `FilterExpression` / `Metrics` /
|
|
49384
49273
|
* `CostFilters` / `CostTypes` / `AutoAdjustData` pass through verbatim.
|
|
49385
49274
|
*/
|
|
49386
|
-
toSdkBudget(raw, budgetName, logicalId, resourceType) {
|
|
49275
|
+
toSdkBudget(raw, budgetName, logicalId, resourceType, mask) {
|
|
49387
49276
|
if (raw === void 0 || raw === null || typeof raw !== "object") throw new ProvisioningError(`The Budget property is required for ${logicalId}`, resourceType, logicalId);
|
|
49388
49277
|
const src = raw;
|
|
49389
49278
|
const budget = {
|
|
@@ -49399,8 +49288,8 @@ var BudgetsBudgetProvider = class {
|
|
|
49399
49288
|
if (src["TimePeriod"] !== void 0 && typeof src["TimePeriod"] === "object") {
|
|
49400
49289
|
const rawPeriod = src["TimePeriod"];
|
|
49401
49290
|
const period = {};
|
|
49402
|
-
if (rawPeriod["Start"] !== void 0) period.Start = this.toSdkDate(rawPeriod["Start"], "Start", logicalId, resourceType);
|
|
49403
|
-
if (rawPeriod["End"] !== void 0) period.End = this.toSdkDate(rawPeriod["End"], "End", logicalId, resourceType);
|
|
49291
|
+
if (rawPeriod["Start"] !== void 0) period.Start = this.toSdkDate(rawPeriod["Start"], "Start", logicalId, resourceType, mask);
|
|
49292
|
+
if (rawPeriod["End"] !== void 0) period.End = this.toSdkDate(rawPeriod["End"], "End", logicalId, resourceType, mask);
|
|
49404
49293
|
budget["TimePeriod"] = period;
|
|
49405
49294
|
}
|
|
49406
49295
|
return budget;
|
|
@@ -49480,7 +49369,8 @@ var BudgetsBudgetProvider = class {
|
|
|
49480
49369
|
* its notifications with subscribers, and resource tags — no post-create
|
|
49481
49370
|
* wiring to clean up on partial failure).
|
|
49482
49371
|
*/
|
|
49483
|
-
async create(logicalId, resourceType, properties) {
|
|
49372
|
+
async create(logicalId, resourceType, properties, context) {
|
|
49373
|
+
const mask = maskerOrIdentity(context?.maskSecrets);
|
|
49484
49374
|
this.logger.debug(`Creating budget ${logicalId}`);
|
|
49485
49375
|
const rawName = (properties["Budget"] ?? {})["BudgetName"];
|
|
49486
49376
|
const name = typeof rawName === "string" && rawName.length > 0 ? rawName : generateResourceName(logicalId, {
|
|
@@ -49493,7 +49383,7 @@ var BudgetsBudgetProvider = class {
|
|
|
49493
49383
|
const resourceTags = this.toSdkResourceTags(properties["ResourceTags"]);
|
|
49494
49384
|
await this.getClient().send(new CreateBudgetCommand({
|
|
49495
49385
|
AccountId: accountId,
|
|
49496
|
-
Budget: this.toSdkBudget(properties["Budget"], name, logicalId, resourceType),
|
|
49386
|
+
Budget: this.toSdkBudget(properties["Budget"], name, logicalId, resourceType, mask),
|
|
49497
49387
|
...notifications.length > 0 && { NotificationsWithSubscribers: notifications },
|
|
49498
49388
|
...resourceTags.length > 0 && { ResourceTags: resourceTags }
|
|
49499
49389
|
}));
|
|
@@ -49513,13 +49403,14 @@ var BudgetsBudgetProvider = class {
|
|
|
49513
49403
|
* reconcile `NotificationsWithSubscribers` in place (CloudFormation would
|
|
49514
49404
|
* replace the whole budget instead) and diff `ResourceTags`.
|
|
49515
49405
|
*/
|
|
49516
|
-
async update(logicalId, physicalId, resourceType, properties, previousProperties) {
|
|
49406
|
+
async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
|
|
49407
|
+
const mask = maskerOrIdentity(context?.maskSecrets);
|
|
49517
49408
|
this.logger.debug(`Updating budget ${logicalId}: ${physicalId}`);
|
|
49518
49409
|
try {
|
|
49519
49410
|
const accountId = await this.resolveAccountId();
|
|
49520
49411
|
await this.getClient().send(new UpdateBudgetCommand({
|
|
49521
49412
|
AccountId: accountId,
|
|
49522
|
-
NewBudget: this.toSdkBudget(properties["Budget"], physicalId, logicalId, resourceType)
|
|
49413
|
+
NewBudget: this.toSdkBudget(properties["Budget"], physicalId, logicalId, resourceType, mask)
|
|
49523
49414
|
}));
|
|
49524
49415
|
await this.reconcileNotifications(accountId, physicalId, this.toSdkNotificationsWithSubscribers(previousProperties["NotificationsWithSubscribers"]), this.toSdkNotificationsWithSubscribers(properties["NotificationsWithSubscribers"]));
|
|
49525
49416
|
await this.reconcileResourceTags(accountId, physicalId, this.toSdkResourceTags(previousProperties["ResourceTags"]), this.toSdkResourceTags(properties["ResourceTags"]));
|
|
@@ -49828,11 +49719,11 @@ function expandShardLevelMetrics(value) {
|
|
|
49828
49719
|
* previous side is never routed through the refusal at all — see
|
|
49829
49720
|
* {@link previousMetricNames}.
|
|
49830
49721
|
*/
|
|
49831
|
-
function readShardLevelMetrics(value) {
|
|
49722
|
+
function readShardLevelMetrics(value, mask) {
|
|
49832
49723
|
if (value == null) return { kind: "absent" };
|
|
49833
49724
|
if (!isUsableMetricsList(value)) return {
|
|
49834
49725
|
kind: "unusable",
|
|
49835
|
-
reason: `AWS::Kinesis::Stream DesiredShardLevelMetrics must be an array of metric-name strings, got ${JSON.stringify(value)}`
|
|
49726
|
+
reason: `AWS::Kinesis::Stream DesiredShardLevelMetrics must be an array of metric-name strings, got ${JSON.stringify(maskDeep(value, mask))}`
|
|
49836
49727
|
};
|
|
49837
49728
|
const expanded = expandShardLevelMetrics(value);
|
|
49838
49729
|
return {
|
|
@@ -49851,7 +49742,7 @@ function previousMetricNames(value) {
|
|
|
49851
49742
|
const expanded = expandShardLevelMetrics(value);
|
|
49852
49743
|
return isUsableMetricsList(expanded) ? expanded : [];
|
|
49853
49744
|
}
|
|
49854
|
-
function readMaxRecordSize(value) {
|
|
49745
|
+
function readMaxRecordSize(value, mask) {
|
|
49855
49746
|
if (value == null) return { kind: "absent" };
|
|
49856
49747
|
if (typeof value === "number" && Number.isFinite(value)) return {
|
|
49857
49748
|
kind: "usable",
|
|
@@ -49866,7 +49757,7 @@ function readMaxRecordSize(value) {
|
|
|
49866
49757
|
}
|
|
49867
49758
|
return {
|
|
49868
49759
|
kind: "unusable",
|
|
49869
|
-
reason: `AWS::Kinesis::Stream MaxRecordSizeInKiB must be a number, got ${JSON.stringify(value)}`
|
|
49760
|
+
reason: `AWS::Kinesis::Stream MaxRecordSizeInKiB must be a number, got ${JSON.stringify(maskDeep(value, mask))}`
|
|
49870
49761
|
};
|
|
49871
49762
|
}
|
|
49872
49763
|
/**
|
|
@@ -49876,8 +49767,8 @@ function readMaxRecordSize(value) {
|
|
|
49876
49767
|
* Unusable / absent both yield `undefined`, which the caller treats as "no
|
|
49877
49768
|
* declared size" rather than refusing — the previous side is state-borne.
|
|
49878
49769
|
*/
|
|
49879
|
-
function comparableRecordSize(value) {
|
|
49880
|
-
const read = readMaxRecordSize(value);
|
|
49770
|
+
function comparableRecordSize(value, mask) {
|
|
49771
|
+
const read = readMaxRecordSize(value, mask);
|
|
49881
49772
|
return read.kind === "usable" ? read.size : void 0;
|
|
49882
49773
|
}
|
|
49883
49774
|
/**
|
|
@@ -49910,13 +49801,15 @@ var KinesisStreamProvider = class {
|
|
|
49910
49801
|
* Create a Kinesis stream
|
|
49911
49802
|
*/
|
|
49912
49803
|
async create(logicalId, resourceType, properties, context) {
|
|
49804
|
+
const mask = maskerOrIdentity(context?.maskSecrets);
|
|
49805
|
+
const warn = (message) => this.logger.warn(mask(message));
|
|
49913
49806
|
this.logger.debug(`Creating Kinesis stream ${logicalId}`);
|
|
49914
49807
|
const streamName = properties["Name"] || generateResourceName(logicalId, { maxLength: 128 });
|
|
49915
|
-
const desiredRead = readShardLevelMetrics(properties["DesiredShardLevelMetrics"]);
|
|
49916
|
-
if (desiredRead.kind === "unusable") if (context?.replayingState === true)
|
|
49808
|
+
const desiredRead = readShardLevelMetrics(properties["DesiredShardLevelMetrics"], mask);
|
|
49809
|
+
if (desiredRead.kind === "unusable") if (context?.replayingState === true) warn(`${desiredRead.reason}. Replaying a state record, so the shard-level metrics are left unset on ${streamName} rather than refusing the restore`);
|
|
49917
49810
|
else throw new ProvisioningError(desiredRead.reason, resourceType, logicalId, streamName);
|
|
49918
|
-
const maxRecordRead = readMaxRecordSize(properties["MaxRecordSizeInKiB"]);
|
|
49919
|
-
if (maxRecordRead.kind === "unusable") if (context?.replayingState === true)
|
|
49811
|
+
const maxRecordRead = readMaxRecordSize(properties["MaxRecordSizeInKiB"], mask);
|
|
49812
|
+
if (maxRecordRead.kind === "unusable") if (context?.replayingState === true) warn(`${maxRecordRead.reason}. Replaying a state record, so ${streamName} is created with AWS's default maximum record size rather than refusing the restore`);
|
|
49920
49813
|
else throw new ProvisioningError(maxRecordRead.reason, resourceType, logicalId, streamName);
|
|
49921
49814
|
try {
|
|
49922
49815
|
const streamModeDetails = properties["StreamModeDetails"];
|
|
@@ -49994,7 +49887,9 @@ var KinesisStreamProvider = class {
|
|
|
49994
49887
|
* RetentionPeriodHours, StreamEncryption, and Tags. Name changes require
|
|
49995
49888
|
* replacement (handled by the deployment layer).
|
|
49996
49889
|
*/
|
|
49997
|
-
async update(logicalId, physicalId, resourceType, properties, previousProperties) {
|
|
49890
|
+
async update(logicalId, physicalId, resourceType, properties, previousProperties, context) {
|
|
49891
|
+
const mask = maskerOrIdentity(context?.maskSecrets);
|
|
49892
|
+
const warn = (message) => this.logger.warn(mask(message));
|
|
49998
49893
|
this.logger.debug(`Updating Kinesis stream ${logicalId}: ${physicalId}`);
|
|
49999
49894
|
try {
|
|
50000
49895
|
const streamModeDetails = properties["StreamModeDetails"];
|
|
@@ -50064,10 +49959,10 @@ var KinesisStreamProvider = class {
|
|
|
50064
49959
|
await this.waitForStreamActive(physicalId);
|
|
50065
49960
|
}
|
|
50066
49961
|
}
|
|
50067
|
-
const desiredSizeRead = readMaxRecordSize(properties["MaxRecordSizeInKiB"]);
|
|
50068
|
-
if (desiredSizeRead.kind === "unusable")
|
|
50069
|
-
const newMaxRecordSize = comparableRecordSize(properties["MaxRecordSizeInKiB"]);
|
|
50070
|
-
const oldMaxRecordSize = comparableRecordSize(previousProperties["MaxRecordSizeInKiB"]);
|
|
49962
|
+
const desiredSizeRead = readMaxRecordSize(properties["MaxRecordSizeInKiB"], mask);
|
|
49963
|
+
if (desiredSizeRead.kind === "unusable") warn(`${desiredSizeRead.reason}. Leaving the maximum record size on ${physicalId} unchanged; the same value is REFUSED on a template-path create`);
|
|
49964
|
+
const newMaxRecordSize = comparableRecordSize(properties["MaxRecordSizeInKiB"], mask);
|
|
49965
|
+
const oldMaxRecordSize = comparableRecordSize(previousProperties["MaxRecordSizeInKiB"], mask);
|
|
50071
49966
|
if (newMaxRecordSize !== void 0 && newMaxRecordSize !== oldMaxRecordSize) {
|
|
50072
49967
|
this.logger.debug(`Updating max record size for ${physicalId}: ${oldMaxRecordSize} -> ${newMaxRecordSize}`);
|
|
50073
49968
|
await this.getClient().send(new UpdateMaxRecordSizeCommand({
|
|
@@ -50076,9 +49971,9 @@ var KinesisStreamProvider = class {
|
|
|
50076
49971
|
}));
|
|
50077
49972
|
await this.waitForStreamActive(physicalId);
|
|
50078
49973
|
}
|
|
50079
|
-
const desiredRead = readShardLevelMetrics(properties["DesiredShardLevelMetrics"]);
|
|
49974
|
+
const desiredRead = readShardLevelMetrics(properties["DesiredShardLevelMetrics"], mask);
|
|
50080
49975
|
let desiredMetrics;
|
|
50081
|
-
if (desiredRead.kind === "unusable")
|
|
49976
|
+
if (desiredRead.kind === "unusable") warn(`${desiredRead.reason}. Leaving the shard-level metrics on ${physicalId} unchanged rather than disabling the live ones; the same value is REFUSED on a template-path create`);
|
|
50082
49977
|
else {
|
|
50083
49978
|
desiredMetrics = desiredRead.kind === "usable" ? desiredRead.expanded : void 0;
|
|
50084
49979
|
const desiredSet = desiredRead.kind === "usable" ? desiredRead.metrics : [];
|
|
@@ -88120,4 +88015,4 @@ function buildProgram() {
|
|
|
88120
88015
|
|
|
88121
88016
|
//#endregion
|
|
88122
88017
|
export { buildProgram };
|
|
88123
|
-
//# sourceMappingURL=program-
|
|
88018
|
+
//# sourceMappingURL=program-BfK9a98r.js.map
|