@cdkd/cli 0.336.0 → 0.338.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ambient-client-defaults-B9bnuob2.js → ambient-client-defaults-Bz2AYX3k.js} +3 -2
- package/dist/ambient-client-defaults-Bz2AYX3k.js.map +1 -0
- package/dist/{asg-provider-Kmj1OMXP.js → asg-provider-CWmAKpgF.js} +5 -5
- package/dist/{asg-provider-Kmj1OMXP.js.map → asg-provider-CWmAKpgF.js.map} +1 -1
- package/dist/{aws-failure-text-CoS1huLy.js → aws-failure-text-FKztQiaJ.js} +13 -4
- package/dist/aws-failure-text-FKztQiaJ.js.map +1 -0
- package/dist/cli.js +2 -2
- package/dist/{db-instance-modify-retry-CQLlNArd.js → db-instance-modify-retry-Dks4BxMq.js} +4 -4
- package/dist/{db-instance-modify-retry-CQLlNArd.js.map → db-instance-modify-retry-Dks4BxMq.js.map} +1 -1
- package/dist/{deploy-engine-C1sQP24T.js → deploy-engine-BnsHKIjc.js} +58 -22
- package/dist/deploy-engine-BnsHKIjc.js.map +1 -0
- package/dist/{ecr-uri-EPT8p1G0.js → ecr-uri-Bekubfie.js} +3 -3
- package/dist/{ecr-uri-EPT8p1G0.js.map → ecr-uri-Bekubfie.js.map} +1 -1
- package/dist/{iam-role-provider-DF2RT3QW.js → iam-role-provider-c85y_vuT.js} +5 -5
- package/dist/{iam-role-provider-DF2RT3QW.js.map → iam-role-provider-c85y_vuT.js.map} +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/{neptune-provider-DYvMIjKO.js → neptune-provider-CLuvQucV.js} +6 -6
- package/dist/{neptune-provider-DYvMIjKO.js.map → neptune-provider-CLuvQucV.js.map} +1 -1
- package/dist/{program-B8rxD6E3.js → program-CF2fN6wd.js} +10 -9
- package/dist/program-CF2fN6wd.js.map +1 -0
- package/dist/{provider-classes-BxlB3pLK.js → provider-classes-Ch72oCC3.js} +230 -58
- package/dist/provider-classes-Ch72oCC3.js.map +1 -0
- package/dist/{rds-provider-DuzqwKfc.js → rds-provider-DDK78o9z.js} +296 -51
- package/dist/rds-provider-DDK78o9z.js.map +1 -0
- package/dist/{read-replica-BHKXELki.js → read-replica-C7nFHyNr.js} +3 -3
- package/dist/{read-replica-BHKXELki.js.map → read-replica-C7nFHyNr.js.map} +1 -1
- package/dist/{update-removal-Dh6W86TO.js → update-removal--qeWEXhm.js} +3 -3
- package/dist/{update-removal-Dh6W86TO.js.map → update-removal--qeWEXhm.js.map} +1 -1
- package/dist/{version-hOdgRlOf.js → version-bUHr9iDr.js} +2 -2
- package/dist/{version-hOdgRlOf.js.map → version-bUHr9iDr.js.map} +1 -1
- package/package.json +2 -1
- package/dist/ambient-client-defaults-B9bnuob2.js.map +0 -1
- package/dist/aws-failure-text-CoS1huLy.js.map +0 -1
- package/dist/deploy-engine-C1sQP24T.js.map +0 -1
- package/dist/program-B8rxD6E3.js.map +0 -1
- package/dist/provider-classes-BxlB3pLK.js.map +0 -1
- package/dist/rds-provider-DuzqwKfc.js.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { $ as safeMsg, n as describeAwsFailure, s as getLogger, y as generatedNameFor } from "./aws-failure-text-
|
|
2
|
-
import { E as relayedNameCollision, H as markNonRetryable, U as markRedactedCause, W as wrapMaskedAwsError, Z as CdkdError, h as ResourceUpdateNotSupportedError, nt as ProvisioningError, t as ambientClientDefaults } from "./ambient-client-defaults-
|
|
1
|
+
import { $ as safeMsg, n as describeAwsFailure, s as getLogger, y as generatedNameFor } from "./aws-failure-text-FKztQiaJ.js";
|
|
2
|
+
import { E as relayedNameCollision, H as markNonRetryable, U as markRedactedCause, W as wrapMaskedAwsError, Z as CdkdError, h as ResourceUpdateNotSupportedError, nt as ProvisioningError, t as ambientClientDefaults } from "./ambient-client-defaults-Bz2AYX3k.js";
|
|
3
3
|
import { c as ambientRegion } from "./aws-client-defaults-BLXFsfMa.js";
|
|
4
|
-
import { $i as tagPlanWarning, Gi as definedAttributes, Ki as stringifyIfAssigned, Nt as enclosingDeadlineRemainingMs, Sl as dynamicReferenceTokens, Yi as planTagDiff, Zi as refuseMalformedDesiredTags, ba as slowCcOperationTimeoutMs, jc as dbInstanceEngineChangeIsInPlace, ta as markDeleteStarted } from "./deploy-engine-
|
|
5
|
-
import { $ as deleteAfterProtectionFlipWithFinalSnapshot, B as resolveExplicitPhysicalId, H as assertRegionMatch, I as normalizeAwsTagsToCfn, It as maskerOrIdentity, J as observeThenDisableProtection, K as deleteWithProtectionCompensation, Kt as markAuxiliaryFailure, Lt as withDerivedNameMasks, Mt as createMaskedLogSinks, Q as PROTECTION_FLIP_RETRY_WAIT_MS, V as RESOURCE_NOT_FOUND, W as markNotGone, Y as rdsFamilyProtectionSite, a as withRemovalDefaults, f as retractCreatedResource, gt as protectedReplacementAdvice, ht as pasteableAwsCommand, it as ProtectionFlipRegistry, j as withoutServerErrorRetries, nt as isTerminalDbWaitStatus, ot as protectionFlipKey, qt as markCreatedBeforeFailure, t as clearOnUpdateRemoval, u as reportCreatedResource } from "./update-removal
|
|
6
|
-
import { a as associatedRoleList, c as canonicalAssociatedRoles, i as associatedRoleKey, l as isRoleCallNotAvailableRefusal, n as modifyDbInstanceWhenAvailable, o as associatedRolesNamed, r as associatedRoleArns, s as associatedRolesReadback, t as isModifyNotAvailableRefusal, u as planAssociatedRoleChanges } from "./db-instance-modify-retry-
|
|
7
|
-
import { a as refuseMalformedReplicaSource, c as replicaEngine, d as replicaSourceChange, f as replicaSourceOf, l as replicaModifyAfterCreateInput, m as withPreviousReplicaSource, n as isLiveReadReplica, o as refuseUnknownSourceRegion, p as sameReplicaSource, r as ownScopeOf, s as replicaCreateInput, t as describeReplicaSource, u as replicaNeedsModifyAfterCreate } from "./read-replica-
|
|
4
|
+
import { $i as tagPlanWarning, Gi as definedAttributes, Ki as stringifyIfAssigned, Nt as enclosingDeadlineRemainingMs, Sl as dynamicReferenceTokens, Yi as planTagDiff, Zi as refuseMalformedDesiredTags, ba as slowCcOperationTimeoutMs, jc as dbInstanceEngineChangeIsInPlace, ta as markDeleteStarted } from "./deploy-engine-BnsHKIjc.js";
|
|
5
|
+
import { $ as deleteAfterProtectionFlipWithFinalSnapshot, B as resolveExplicitPhysicalId, H as assertRegionMatch, I as normalizeAwsTagsToCfn, It as maskerOrIdentity, J as observeThenDisableProtection, K as deleteWithProtectionCompensation, Kt as markAuxiliaryFailure, Lt as withDerivedNameMasks, Mt as createMaskedLogSinks, Q as PROTECTION_FLIP_RETRY_WAIT_MS, V as RESOURCE_NOT_FOUND, W as markNotGone, Y as rdsFamilyProtectionSite, a as withRemovalDefaults, f as retractCreatedResource, gt as protectedReplacementAdvice, ht as pasteableAwsCommand, it as ProtectionFlipRegistry, j as withoutServerErrorRetries, nt as isTerminalDbWaitStatus, ot as protectionFlipKey, qt as markCreatedBeforeFailure, t as clearOnUpdateRemoval, u as reportCreatedResource } from "./update-removal--qeWEXhm.js";
|
|
6
|
+
import { a as associatedRoleList, c as canonicalAssociatedRoles, i as associatedRoleKey, l as isRoleCallNotAvailableRefusal, n as modifyDbInstanceWhenAvailable, o as associatedRolesNamed, r as associatedRoleArns, s as associatedRolesReadback, t as isModifyNotAvailableRefusal, u as planAssociatedRoleChanges } from "./db-instance-modify-retry-Dks4BxMq.js";
|
|
7
|
+
import { a as refuseMalformedReplicaSource, c as replicaEngine, d as replicaSourceChange, f as replicaSourceOf, l as replicaModifyAfterCreateInput, m as withPreviousReplicaSource, n as isLiveReadReplica, o as refuseUnknownSourceRegion, p as sameReplicaSource, r as ownScopeOf, s as replicaCreateInput, t as describeReplicaSource, u as replicaNeedsModifyAfterCreate } from "./read-replica-C7nFHyNr.js";
|
|
8
8
|
import { DescribeSecurityGroupsCommand, EC2Client } from "@aws-sdk/client-ec2";
|
|
9
9
|
import { isDeepStrictEqual } from "node:util";
|
|
10
10
|
import { AddRoleToDBClusterCommand, AddRoleToDBInstanceCommand, AddTagsToResourceCommand, CreateDBClusterCommand, CreateDBInstanceCommand, CreateDBInstanceReadReplicaCommand, CreateDBSubnetGroupCommand, DeleteDBClusterCommand, DeleteDBInstanceCommand, DeleteDBSubnetGroupCommand, DescribeDBClustersCommand, DescribeDBInstancesCommand, DescribeDBSubnetGroupsCommand, DescribeGlobalClustersCommand, DisableHttpEndpointCommand, EnableHttpEndpointCommand, ListTagsForResourceCommand, ModifyDBClusterCommand, ModifyDBInstanceCommand, ModifyDBSubnetGroupCommand, PromoteReadReplicaCommand, RDSClient, RebootDBInstanceCommand, RemoveFromGlobalClusterCommand, RemoveRoleFromDBClusterCommand, RemoveRoleFromDBInstanceCommand, RemoveTagsFromResourceCommand } from "@aws-sdk/client-rds";
|
|
@@ -352,6 +352,89 @@ function withPreviousAvailabilityZone(properties, previousProperties) {
|
|
|
352
352
|
AvailabilityZone: previous
|
|
353
353
|
};
|
|
354
354
|
}
|
|
355
|
+
function processorFeatureList(value) {
|
|
356
|
+
if (value == null) return void 0;
|
|
357
|
+
if (!Array.isArray(value)) return "malformed";
|
|
358
|
+
const out = [];
|
|
359
|
+
for (const item of value) {
|
|
360
|
+
if (item === null || typeof item !== "object" || Array.isArray(item)) return "malformed";
|
|
361
|
+
const feature = {};
|
|
362
|
+
for (const key of ["Name", "Value"]) {
|
|
363
|
+
const member = item[key];
|
|
364
|
+
if (member == null) continue;
|
|
365
|
+
if (typeof member !== "string" && typeof member !== "number") return "malformed";
|
|
366
|
+
feature[key] = String(member);
|
|
367
|
+
}
|
|
368
|
+
out.push(feature);
|
|
369
|
+
}
|
|
370
|
+
return out;
|
|
371
|
+
}
|
|
372
|
+
function useDefaultProcessorFeaturesOf(value) {
|
|
373
|
+
if (value == null) return void 0;
|
|
374
|
+
if (typeof value === "boolean") return value;
|
|
375
|
+
if (typeof value === "string" && ["true", "false"].includes(value.toLowerCase())) return value.toLowerCase() === "true";
|
|
376
|
+
return "malformed";
|
|
377
|
+
}
|
|
378
|
+
function processorFeaturesRefusalText(features, resourceType, logicalId) {
|
|
379
|
+
return features === "malformed" ? `${resourceType} ${logicalId}: ProcessorFeatures must be a list of { Name, Value } objects` : `${resourceType} ${logicalId}: UseDefaultProcessorFeatures must be true or false`;
|
|
380
|
+
}
|
|
381
|
+
function desiredProcessorFeatures(properties, resourceType, logicalId) {
|
|
382
|
+
const features = processorFeatureList(properties["ProcessorFeatures"]);
|
|
383
|
+
const useDefault = useDefaultProcessorFeaturesOf(properties["UseDefaultProcessorFeatures"]);
|
|
384
|
+
if (features !== "malformed" && useDefault !== "malformed") return {
|
|
385
|
+
features,
|
|
386
|
+
useDefault
|
|
387
|
+
};
|
|
388
|
+
throw markNonRetryable(new ProvisioningError(processorFeaturesRefusalText(features, resourceType, logicalId), resourceType, logicalId));
|
|
389
|
+
}
|
|
390
|
+
function sameProcessorValue(read, desired, previous) {
|
|
391
|
+
const a = read(desired);
|
|
392
|
+
const b = read(previous);
|
|
393
|
+
return a === "malformed" && b === "malformed" ? isDeepStrictEqual(desired, previous) : isDeepStrictEqual(a, b);
|
|
394
|
+
}
|
|
395
|
+
function instanceProcessorFeatureMembers(properties, previousProperties, resourceType, logicalId, physicalId) {
|
|
396
|
+
if (sameProcessorValue(processorFeatureList, properties["ProcessorFeatures"], previousProperties["ProcessorFeatures"]) && sameProcessorValue(useDefaultProcessorFeaturesOf, properties["UseDefaultProcessorFeatures"], previousProperties["UseDefaultProcessorFeatures"])) return {};
|
|
397
|
+
const features = processorFeatureList(properties["ProcessorFeatures"]);
|
|
398
|
+
const useDefault = useDefaultProcessorFeaturesOf(properties["UseDefaultProcessorFeatures"]);
|
|
399
|
+
if (features === "malformed" || useDefault === "malformed") throw markNonRetryable(new ProvisioningError(processorFeaturesRefusalText(features, resourceType, logicalId), resourceType, logicalId, physicalId));
|
|
400
|
+
return {
|
|
401
|
+
...features !== void 0 && { ProcessorFeatures: features },
|
|
402
|
+
...useDefault !== void 0 && { UseDefaultProcessorFeatures: useDefault }
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
function sameFeatureValue(a, b) {
|
|
406
|
+
if (a === b) return true;
|
|
407
|
+
return a !== void 0 && b !== void 0 && a.trim() !== "" && b.trim() !== "" && Number(a) === Number(b);
|
|
408
|
+
}
|
|
409
|
+
const FLAG_ONLY_QUIET_READS = 3;
|
|
410
|
+
const PROCESSOR_SETTLED_STATUSES = /* @__PURE__ */ new Set(["available", "storage-optimization"]);
|
|
411
|
+
function processorChangeUnderWay(instance) {
|
|
412
|
+
return !PROCESSOR_SETTLED_STATUSES.has(instance.DBInstanceStatus ?? "") || (instance.PendingModifiedValues?.ProcessorFeatures ?? []).length > 0;
|
|
413
|
+
}
|
|
414
|
+
function processorFeaturesSettled(sent, modified) {
|
|
415
|
+
let changeSeen = modified !== void 0 && processorChangeUnderWay(modified);
|
|
416
|
+
let quietReads = 0;
|
|
417
|
+
return (instance) => {
|
|
418
|
+
if (processorChangeUnderWay(instance)) {
|
|
419
|
+
changeSeen = true;
|
|
420
|
+
return false;
|
|
421
|
+
}
|
|
422
|
+
if (sent !== void 0) {
|
|
423
|
+
const live = instance.ProcessorFeatures ?? [];
|
|
424
|
+
return sent.every((feature) => live.some((item) => item.Name === feature.Name && sameFeatureValue(item.Value, feature.Value)));
|
|
425
|
+
}
|
|
426
|
+
if (changeSeen) return true;
|
|
427
|
+
quietReads += 1;
|
|
428
|
+
return quietReads >= FLAG_ONLY_QUIET_READS;
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
function liveProcessorFeatures(instance) {
|
|
432
|
+
const pending = instance.PendingModifiedValues?.ProcessorFeatures ?? [];
|
|
433
|
+
if (pending.length === 0) return instance.ProcessorFeatures;
|
|
434
|
+
const out = (instance.ProcessorFeatures ?? []).map((feature) => pending.find((item) => item.Name === feature.Name) ?? feature);
|
|
435
|
+
for (const item of pending) if (!out.some((feature) => feature.Name === item.Name)) out.push(item);
|
|
436
|
+
return out;
|
|
437
|
+
}
|
|
355
438
|
function engineLifecycleSupportOf(bag) {
|
|
356
439
|
const value = bag["EngineLifecycleSupport"];
|
|
357
440
|
return value == null || value === "" ? void 0 : String(value);
|
|
@@ -593,6 +676,87 @@ function clusterPortToSend(properties, previousProperties) {
|
|
|
593
676
|
return reset === Number(previousProperties["Port"]) ? void 0 : reset;
|
|
594
677
|
}
|
|
595
678
|
|
|
679
|
+
// src/provisioning/providers/rds/express-writer.ts
|
|
680
|
+
const EXPRESS_WRITER_RESOURCE_ID_KEY = "cdkd:ExpressWriterResourceId";
|
|
681
|
+
var ExpressWriterRefusal = class extends Error {
|
|
682
|
+
constructor(message) {
|
|
683
|
+
super(message);
|
|
684
|
+
this.name = "ExpressWriterRefusal";
|
|
685
|
+
}
|
|
686
|
+
};
|
|
687
|
+
function sameDbIdentifier(a, b) {
|
|
688
|
+
return a !== void 0 && a.toLowerCase() === b.toLowerCase();
|
|
689
|
+
}
|
|
690
|
+
function expressWriterIdentifier(dbClusterIdentifier) {
|
|
691
|
+
return `${dbClusterIdentifier}-instance-1`;
|
|
692
|
+
}
|
|
693
|
+
function expressConfigurationFlag(value) {
|
|
694
|
+
return httpEndpointFlag(value);
|
|
695
|
+
}
|
|
696
|
+
function recordedExpressWriterId(attributes) {
|
|
697
|
+
const value = attributes?.[EXPRESS_WRITER_RESOURCE_ID_KEY];
|
|
698
|
+
return typeof value === "string" && value !== "" ? value : void 0;
|
|
699
|
+
}
|
|
700
|
+
async function readExpressWriterId(dbClusterIdentifier, mask) {
|
|
701
|
+
try {
|
|
702
|
+
const writer = await this.describeDBInstance(expressWriterIdentifier(dbClusterIdentifier));
|
|
703
|
+
return sameDbIdentifier(writer?.DBClusterIdentifier, dbClusterIdentifier) ? writer?.DbiResourceId : void 0;
|
|
704
|
+
} catch (error) {
|
|
705
|
+
this.logger.debug(mask(safeMsg`Could not read the express writer of DBCluster ${dbClusterIdentifier}: ${error instanceof Error ? error.name : "unknown error"}`));
|
|
706
|
+
return;
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
async function isOwnExpressWriter(dbClusterIdentifier) {
|
|
710
|
+
try {
|
|
711
|
+
return sameDbIdentifier((await this.describeDBInstance(expressWriterIdentifier(dbClusterIdentifier)))?.DBClusterIdentifier, dbClusterIdentifier);
|
|
712
|
+
} catch {
|
|
713
|
+
return false;
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
async function deleteExpressWriter(logicalId, physicalId, cluster, recordedWriterId, protectionFlippedOff, mask) {
|
|
717
|
+
if (cluster === void 0) return false;
|
|
718
|
+
if (cluster.DeletionProtection === true && !protectionFlippedOff) return false;
|
|
719
|
+
const writerName = expressWriterIdentifier(physicalId);
|
|
720
|
+
const members = cluster.DBClusterMembers ?? [];
|
|
721
|
+
if (!members.some((member) => sameDbIdentifier(member.DBInstanceIdentifier, writerName))) return false;
|
|
722
|
+
const refuse = (detail) => {
|
|
723
|
+
throw new ExpressWriterRefusal(detail);
|
|
724
|
+
};
|
|
725
|
+
const others = [];
|
|
726
|
+
for (const member of members) {
|
|
727
|
+
const name = member.DBInstanceIdentifier;
|
|
728
|
+
if (name === void 0 || sameDbIdentifier(name, writerName)) continue;
|
|
729
|
+
const instance = await this.describeDBInstance(name).catch((error) => {
|
|
730
|
+
if (this.isNotFoundError(error, "DBInstanceNotFoundFault")) return void 0;
|
|
731
|
+
throw error;
|
|
732
|
+
});
|
|
733
|
+
if (instance !== void 0 && instance.DBInstanceStatus !== "deleting") others.push(name);
|
|
734
|
+
}
|
|
735
|
+
if (others.length > 0) refuse(safeMsg`it still has DB instance(s) ${others.join(", ")} besides the writer express configuration created; delete them first, then re-run`);
|
|
736
|
+
if (recordedWriterId !== void 0) {
|
|
737
|
+
const writer = await this.describeDBInstance(writerName).catch((error) => {
|
|
738
|
+
if (this.isNotFoundError(error, "DBInstanceNotFoundFault")) return void 0;
|
|
739
|
+
throw error;
|
|
740
|
+
});
|
|
741
|
+
if (writer === void 0) return false;
|
|
742
|
+
if (writer.DbiResourceId !== recordedWriterId) refuse(safeMsg`DB instance ${writerName} is not the writer express configuration created for it, so cdkd did not delete it; delete it yourself, then re-run`);
|
|
743
|
+
}
|
|
744
|
+
try {
|
|
745
|
+
await this.getClient().send(new DeleteDBInstanceCommand({
|
|
746
|
+
DBInstanceIdentifier: writerName,
|
|
747
|
+
SkipFinalSnapshot: true
|
|
748
|
+
}));
|
|
749
|
+
} catch (error) {
|
|
750
|
+
if (this.isNotFoundError(error, "DBInstanceNotFoundFault")) return false;
|
|
751
|
+
if (error instanceof Error && error.name === "InvalidDBInstanceStateFault") {
|
|
752
|
+
if ((await this.describeDBInstance(writerName).catch(() => void 0))?.DBInstanceStatus === "deleting") return true;
|
|
753
|
+
}
|
|
754
|
+
throw error;
|
|
755
|
+
}
|
|
756
|
+
this.logger.debug(mask(safeMsg`Deleted the express writer ${writerName} of DBCluster ${logicalId}`));
|
|
757
|
+
return true;
|
|
758
|
+
}
|
|
759
|
+
|
|
596
760
|
// src/provisioning/providers/rds/cluster-create.ts
|
|
597
761
|
async function createDBCluster(logicalId, resourceType, properties, mask, replaying = false) {
|
|
598
762
|
this.logger.debug(`Creating DBCluster ${logicalId}`);
|
|
@@ -615,6 +779,9 @@ async function createDBCluster(logicalId, resourceType, properties, mask, replay
|
|
|
615
779
|
const availabilityZones = rawAvailabilityZones != null && !availabilityZonesSkipped ? rawAvailabilityZones : void 0;
|
|
616
780
|
const globalClusterSkipped = !readableGlobalClusterId(properties["GlobalClusterIdentifier"]);
|
|
617
781
|
const globalClusterId = globalClusterSkipped ? void 0 : recordedGlobalClusterIdentifier(properties);
|
|
782
|
+
const expressFlag = expressConfigurationFlag(properties["WithExpressConfiguration"]);
|
|
783
|
+
const expressSkipped = expressFlag === "malformed";
|
|
784
|
+
const express = expressFlag === true;
|
|
618
785
|
const classSkipped = malformedInstanceClass(properties["DBClusterInstanceClass"]);
|
|
619
786
|
const allocatedSkipped = clusterSizeValue(properties["AllocatedStorage"]) === "malformed";
|
|
620
787
|
const iopsSkipped = clusterSizeValue(properties["Iops"]) === "malformed";
|
|
@@ -638,6 +805,12 @@ async function createDBCluster(logicalId, resourceType, properties, mask, replay
|
|
|
638
805
|
"a string",
|
|
639
806
|
"no global cluster"
|
|
640
807
|
],
|
|
808
|
+
[
|
|
809
|
+
expressSkipped,
|
|
810
|
+
"WithExpressConfiguration",
|
|
811
|
+
"true or false",
|
|
812
|
+
"no express configuration"
|
|
813
|
+
],
|
|
641
814
|
[
|
|
642
815
|
classSkipped,
|
|
643
816
|
"DBClusterInstanceClass",
|
|
@@ -682,6 +855,7 @@ async function createDBCluster(logicalId, resourceType, properties, mask, replay
|
|
|
682
855
|
...forwardingSkipped ? ["EnableLocalWriteForwarding"] : [],
|
|
683
856
|
...availabilityZonesSkipped ? ["AvailabilityZones"] : [],
|
|
684
857
|
...globalClusterSkipped ? ["GlobalClusterIdentifier"] : [],
|
|
858
|
+
...expressSkipped ? ["WithExpressConfiguration"] : [],
|
|
685
859
|
...classSkipped ? ["DBClusterInstanceClass"] : [],
|
|
686
860
|
...allocatedSkipped ? ["AllocatedStorage"] : [],
|
|
687
861
|
...iopsSkipped ? ["Iops"] : [],
|
|
@@ -689,7 +863,7 @@ async function createDBCluster(logicalId, resourceType, properties, mask, replay
|
|
|
689
863
|
];
|
|
690
864
|
const effectiveProperties = skippedKeys.length > 0 ? Object.fromEntries(Object.entries(properties).filter(([key]) => !skippedKeys.includes(key))) : void 0;
|
|
691
865
|
const logExports = desiredLogExports(properties, resourceType, logicalId);
|
|
692
|
-
const dbClusterIdentifier = properties["DBClusterIdentifier"] || generatedNameFor("AWS::RDS::DBCluster", logicalId);
|
|
866
|
+
const dbClusterIdentifier = properties["DBClusterIdentifier"] || generatedNameFor("AWS::RDS::DBCluster", logicalId, { properties });
|
|
693
867
|
let clusterLeftBehind = false;
|
|
694
868
|
let createdResourceId;
|
|
695
869
|
try {
|
|
@@ -725,6 +899,7 @@ async function createDBCluster(logicalId, resourceType, properties, mask, replay
|
|
|
725
899
|
...properties["EngineMode"] != null && { EngineMode: properties["EngineMode"] },
|
|
726
900
|
...availabilityZones !== void 0 && availabilityZones.length > 0 && { AvailabilityZones: availabilityZones },
|
|
727
901
|
...globalClusterId !== void 0 && { GlobalClusterIdentifier: globalClusterId },
|
|
902
|
+
...expressFlag !== void 0 && !expressSkipped && { WithExpressConfiguration: express },
|
|
728
903
|
...tags.length > 0 && { Tags: tags }
|
|
729
904
|
}));
|
|
730
905
|
clusterLeftBehind = true;
|
|
@@ -737,6 +912,7 @@ async function createDBCluster(logicalId, resourceType, properties, mask, replay
|
|
|
737
912
|
if (process.env["CDKD_NO_WAIT"] !== "true") {
|
|
738
913
|
await this.waitForClusterAvailable(logicalId, dbClusterIdentifier);
|
|
739
914
|
if (localWriteForwardingFlag(properties["EnableLocalWriteForwarding"]) === true) await this.waitForClusterState(logicalId, dbClusterIdentifier, (cluster) => localWriteForwardingApplied(cluster, true), "local write forwarding setting");
|
|
915
|
+
if (express) await this.waitForInstanceAvailable(logicalId, expressWriterIdentifier(dbClusterIdentifier));
|
|
740
916
|
}
|
|
741
917
|
if (roles !== "skipped") try {
|
|
742
918
|
await this.applyAssociatedRoles("cluster", logicalId, dbClusterIdentifier, roles, [], mask, void 0);
|
|
@@ -745,6 +921,7 @@ async function createDBCluster(logicalId, resourceType, properties, mask, replay
|
|
|
745
921
|
throw roleError;
|
|
746
922
|
}
|
|
747
923
|
const described = await this.describeDBCluster(dbClusterIdentifier);
|
|
924
|
+
const expressWriterId = express ? await readExpressWriterId.call(this, dbClusterIdentifier, maskerOrIdentity(mask)) : void 0;
|
|
748
925
|
return {
|
|
749
926
|
physicalId: dbClusterIdentifier,
|
|
750
927
|
attributes: definedAttributes({
|
|
@@ -752,11 +929,13 @@ async function createDBCluster(logicalId, resourceType, properties, mask, replay
|
|
|
752
929
|
"Endpoint.Port": stringifyIfAssigned(described?.Port),
|
|
753
930
|
"ReadEndpoint.Address": described?.ReaderEndpoint,
|
|
754
931
|
Arn: described?.DBClusterArn,
|
|
755
|
-
DBClusterResourceId: described?.DbClusterResourceId
|
|
932
|
+
DBClusterResourceId: described?.DbClusterResourceId,
|
|
933
|
+
[EXPRESS_WRITER_RESOURCE_ID_KEY]: expressWriterId
|
|
756
934
|
}),
|
|
757
935
|
...effectiveProperties !== void 0 && { effectiveProperties }
|
|
758
936
|
};
|
|
759
937
|
} catch (innerError) {
|
|
938
|
+
let ownWriter = false;
|
|
760
939
|
try {
|
|
761
940
|
if (wantsDeletionProtection) try {
|
|
762
941
|
await this.getClient().send(new ModifyDBClusterCommand({
|
|
@@ -767,6 +946,15 @@ async function createDBCluster(logicalId, resourceType, properties, mask, replay
|
|
|
767
946
|
} catch (disableError) {
|
|
768
947
|
this.logger.debug(maskerOrIdentity(mask)(`Could not disable DeletionProtection on partially-created DBCluster ${dbClusterIdentifier}: ${describeAwsFailure(disableError).detail} (proceeding with DeleteDBCluster anyway)`));
|
|
769
948
|
}
|
|
949
|
+
ownWriter = express && await isOwnExpressWriter.call(this, dbClusterIdentifier);
|
|
950
|
+
if (ownWriter) try {
|
|
951
|
+
await this.getClient().send(new DeleteDBInstanceCommand({
|
|
952
|
+
DBInstanceIdentifier: expressWriterIdentifier(dbClusterIdentifier),
|
|
953
|
+
SkipFinalSnapshot: true
|
|
954
|
+
}));
|
|
955
|
+
} catch (writerError) {
|
|
956
|
+
if (!this.isNotFoundError(writerError, "DBInstanceNotFoundFault")) throw writerError;
|
|
957
|
+
}
|
|
770
958
|
await this.getClient().send(new DeleteDBClusterCommand({
|
|
771
959
|
DBClusterIdentifier: dbClusterIdentifier,
|
|
772
960
|
SkipFinalSnapshot: true
|
|
@@ -783,11 +971,12 @@ async function createDBCluster(logicalId, resourceType, properties, mask, replay
|
|
|
783
971
|
}
|
|
784
972
|
const aws = pasteableAwsCommand();
|
|
785
973
|
const unprotect = wantsDeletionProtection ? aws`aws rds modify-db-cluster --db-cluster-identifier ${dbClusterIdentifier} --no-deletion-protection --apply-immediately; ` : aws``;
|
|
974
|
+
const writer = ownWriter ? aws`aws rds delete-db-instance --db-instance-identifier ${expressWriterIdentifier(dbClusterIdentifier)} --skip-final-snapshot; ` : aws``;
|
|
786
975
|
const m = maskerOrIdentity(mask);
|
|
787
976
|
const cleanupFailure = describeAwsFailure(cleanupError);
|
|
788
977
|
const cleanupHead = `Failed to delete partially-created DBCluster ${logicalId} (${dbClusterIdentifier}): `;
|
|
789
978
|
if (cleanupFailure.redacted) this.logger.debug(m(`${cleanupHead}${m(cleanupFailure.detail)}`));
|
|
790
|
-
this.logger.warn(`${cleanupHead}${cleanupFailure.redacted ? `${m(cleanupFailure.summary)} ` : `${m(cleanupFailure.detail)}. `}THE CLUSTER IS STILL RUNNING AND BILLING. Outside a rollback's re-create, the failed deploy's rollback journal records it for \`cdkd rollback --revert-failed\`${wantsDeletionProtection ? ", which cannot delete it while its DeletionProtection is on" : ""}; otherwise delete it yourself: ${aws`${unprotect}aws rds delete-db-cluster --db-cluster-identifier ${dbClusterIdentifier} --skip-final-snapshot`.render()}`);
|
|
979
|
+
this.logger.warn(`${cleanupHead}${cleanupFailure.redacted ? `${m(cleanupFailure.summary)} ` : `${m(cleanupFailure.detail)}. `}THE CLUSTER IS STILL RUNNING AND BILLING. Outside a rollback's re-create, the failed deploy's rollback journal records it for \`cdkd rollback --revert-failed\`${wantsDeletionProtection ? ", which cannot delete it while its DeletionProtection is on" : ""}; otherwise delete it yourself: ${aws`${unprotect}${writer}aws rds delete-db-cluster --db-cluster-identifier ${dbClusterIdentifier} --skip-final-snapshot`.render()}`);
|
|
791
980
|
}
|
|
792
981
|
throw innerError;
|
|
793
982
|
}
|
|
@@ -1019,7 +1208,8 @@ async function updateDBCluster(logicalId, physicalId, resourceType, properties,
|
|
|
1019
1208
|
"Endpoint.Port": stringifyIfAssigned(noWait && portChanged && described !== void 0 ? portToSend : described?.Port),
|
|
1020
1209
|
"ReadEndpoint.Address": described?.ReaderEndpoint,
|
|
1021
1210
|
Arn: described?.DBClusterArn,
|
|
1022
|
-
DBClusterResourceId: described?.DbClusterResourceId
|
|
1211
|
+
DBClusterResourceId: described?.DbClusterResourceId,
|
|
1212
|
+
[EXPRESS_WRITER_RESOURCE_ID_KEY]: recordedExpressWriterId(context?.recordedAttributes)
|
|
1023
1213
|
}),
|
|
1024
1214
|
...skippedKeys.length > 0 && { effectiveProperties: withPreviousValues(properties, previousProperties, skippedKeys) }
|
|
1025
1215
|
};
|
|
@@ -1180,6 +1370,9 @@ async function deleteDBClusterOnce(logicalId, physicalId, resourceType, properti
|
|
|
1180
1370
|
beforeDelete: true,
|
|
1181
1371
|
removeProtection: context?.removeProtection === true
|
|
1182
1372
|
}, progress, maskerOrIdentity(context?.maskSecrets)) ? globalClusterId : void 0;
|
|
1373
|
+
if (expressConfigurationFlag(properties?.["WithExpressConfiguration"]) === true) {
|
|
1374
|
+
if (await deleteExpressWriter.call(this, logicalId, physicalId, await this.describeDBCluster(physicalId), recordedExpressWriterId(context?.recordedAttributes), flip.flippedOffByThisRun, maskerOrIdentity(context?.maskSecrets))) progress.stripped = true;
|
|
1375
|
+
}
|
|
1183
1376
|
const finalSnapshotId = context?.finalSnapshotIdentifier;
|
|
1184
1377
|
const sendDelete = () => this.getClient().send(new DeleteDBClusterCommand({
|
|
1185
1378
|
DBClusterIdentifier: physicalId,
|
|
@@ -1196,6 +1389,10 @@ async function deleteDBClusterOnce(logicalId, physicalId, resourceType, properti
|
|
|
1196
1389
|
this.logger.debug(`Successfully initiated deletion of DBCluster ${logicalId}`);
|
|
1197
1390
|
await this.waitForClusterDeleted(logicalId, physicalId, RDS_DELETE_WAIT_MS);
|
|
1198
1391
|
} catch (error) {
|
|
1392
|
+
if (error instanceof ExpressWriterRefusal) {
|
|
1393
|
+
const refusal = markNotGone(markNonRetryable(new ProvisioningError(`Failed to delete DBCluster ${logicalId}: ${maskerOrIdentity(context?.maskSecrets)(error.message)}`, resourceType, logicalId, physicalId, error)));
|
|
1394
|
+
throw progress.stripped ? markDeleteStarted(refusal) : refusal;
|
|
1395
|
+
}
|
|
1199
1396
|
if (error instanceof GlobalClusterDetachError) {
|
|
1200
1397
|
const detachFailure = markNotGone(markNonRetryable(new ProvisioningError(`Failed to delete DBCluster ${logicalId}: ${error.message}`, resourceType, logicalId, physicalId, error)));
|
|
1201
1398
|
throw progress.stripped ? markDeleteStarted(detachFailure) : detachFailure;
|
|
@@ -1319,6 +1516,7 @@ async function createDBInstance(logicalId, resourceType, properties, mask, repla
|
|
|
1319
1516
|
const tags = refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId);
|
|
1320
1517
|
const roles = this.desiredAssociatedRoles(properties, resourceType, logicalId, void 0, replaying);
|
|
1321
1518
|
const logExports = desiredLogExports(properties, resourceType, logicalId);
|
|
1519
|
+
const processor = desiredProcessorFeatures(properties, resourceType, logicalId);
|
|
1322
1520
|
refuseMalformedReplicaSource(properties, resourceType, logicalId);
|
|
1323
1521
|
refuseUnknownSourceRegion(properties, resourceType, logicalId, replaying, (message) => this.logger.warn(message));
|
|
1324
1522
|
const replicaSource = replicaSourceOf(properties);
|
|
@@ -1376,17 +1574,22 @@ async function createDBInstance(logicalId, resourceType, properties, mask, repla
|
|
|
1376
1574
|
...logExports !== void 0 && logExports.length > 0 && { EnableCloudwatchLogsExports: logExports },
|
|
1377
1575
|
...properties["DBName"] != null && { DBName: properties["DBName"] },
|
|
1378
1576
|
...properties["AvailabilityZone"] != null && { AvailabilityZone: properties["AvailabilityZone"] },
|
|
1577
|
+
...processor.features !== void 0 && { ProcessorFeatures: processor.features },
|
|
1379
1578
|
...tags.length > 0 && { Tags: tags }
|
|
1380
1579
|
});
|
|
1381
1580
|
const replicaEngineName = replicaSource === void 0 ? void 0 : await replicaEngine.call(this, properties, replicaSource);
|
|
1382
|
-
const response = replicaSource === void 0 ? await this.getCreateClient().send(standaloneCreate()) : await createReadReplicaWhenSourceAvailable.call(this, logicalId, replicaSource, new CreateDBInstanceReadReplicaCommand(
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1581
|
+
const response = replicaSource === void 0 ? await this.getCreateClient().send(standaloneCreate()) : await createReadReplicaWhenSourceAvailable.call(this, logicalId, replicaSource, new CreateDBInstanceReadReplicaCommand({
|
|
1582
|
+
...replicaCreateInput(properties, {
|
|
1583
|
+
identifier: dbInstanceIdentifier,
|
|
1584
|
+
source: replicaSource,
|
|
1585
|
+
engine: replicaEngineName,
|
|
1586
|
+
currentRegion: await this.getClient().config.region(),
|
|
1587
|
+
tags,
|
|
1588
|
+
logExports
|
|
1589
|
+
}),
|
|
1590
|
+
...processor.features !== void 0 && { ProcessorFeatures: processor.features },
|
|
1591
|
+
...processor.useDefault !== void 0 && { UseDefaultProcessorFeatures: processor.useDefault }
|
|
1592
|
+
}));
|
|
1390
1593
|
instanceCreated = true;
|
|
1391
1594
|
createdResourceId = response.DBInstance?.DbiResourceId;
|
|
1392
1595
|
reportCreatedResource(logicalId, resourceType, dbInstanceIdentifier, createdResourceId);
|
|
@@ -1456,6 +1659,7 @@ async function updateDBInstance(logicalId, physicalId, resourceType, properties,
|
|
|
1456
1659
|
refuseMalformedDesiredTags(properties["Tags"], resourceType, logicalId, physicalId);
|
|
1457
1660
|
const roles = this.desiredAssociatedRoles(properties, resourceType, logicalId, physicalId, false);
|
|
1458
1661
|
const logExportConfig = logExportsDelta(desiredLogExports(properties, resourceType, logicalId, physicalId), previousProperties["EnableCloudwatchLogsExports"]);
|
|
1662
|
+
const processorMembers = instanceProcessorFeatureMembers(properties, previousProperties, resourceType, logicalId, physicalId);
|
|
1459
1663
|
const vpcSgIds = await this.securityGroupsToSend("DBInstance", logicalId, physicalId, resourceType, properties, previousProperties, context);
|
|
1460
1664
|
const engineLifecycleSupport = await this.engineLifecycleSupportToSend("DB instance", logicalId, physicalId, resourceType, properties, previousProperties, context);
|
|
1461
1665
|
let authenticationType = masterUserAuthenticationTypeToSend(properties, previousProperties, context);
|
|
@@ -1543,28 +1747,34 @@ async function updateDBInstance(logicalId, physicalId, resourceType, properties,
|
|
|
1543
1747
|
const manageMasterUserPasswordOff = managedPasswordOnRemoval(properties, previousProperties);
|
|
1544
1748
|
let liveInstance;
|
|
1545
1749
|
const backfillMembers = await instanceModifyBackfillMembers(properties, previousProperties, () => liveInstance ??= this.describeDBInstance(physicalId).then((instance) => instance?.AllocatedStorage), logicalId, context);
|
|
1750
|
+
let modified;
|
|
1546
1751
|
await modifyDbInstanceWhenAvailable({
|
|
1547
|
-
send: () =>
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1752
|
+
send: async () => {
|
|
1753
|
+
const response = await this.getClient().send(new ModifyDBInstanceCommand({
|
|
1754
|
+
DBInstanceIdentifier: physicalId,
|
|
1755
|
+
DBInstanceClass: properties["DBInstanceClass"],
|
|
1756
|
+
PubliclyAccessible: properties["PubliclyAccessible"],
|
|
1757
|
+
ApplyImmediately: true,
|
|
1758
|
+
...backfillMembers,
|
|
1759
|
+
DeletionProtection: properties["DeletionProtection"],
|
|
1760
|
+
...previousProperties["Engine"] !== properties["Engine"] && dbInstanceEngineChangeIsInPlace(previousProperties["Engine"], properties["Engine"]) && { Engine: properties["Engine"] },
|
|
1761
|
+
...properties["Port"] !== void 0 && { DBPortNumber: Number(properties["Port"]) },
|
|
1762
|
+
...instancePassword !== void 0 && { MasterUserPassword: instancePassword },
|
|
1763
|
+
...vpcSgIds !== void 0 && { VpcSecurityGroupIds: vpcSgIds },
|
|
1764
|
+
...(sendCredentialSettings || passwordCompanion?.kind === "managed") && masterUserSecret?.KmsKeyId !== void 0 && { MasterUserSecretKmsKeyId: masterUserSecret.KmsKeyId },
|
|
1765
|
+
...sendManagedPasswordSetting && properties["ManageMasterUserPassword"] !== void 0 && { ManageMasterUserPassword: properties["ManageMasterUserPassword"] },
|
|
1766
|
+
...manageMasterUserPasswordOff && { ManageMasterUserPassword: false },
|
|
1767
|
+
...properties["MonitoringRoleArn"] !== void 0 && { MonitoringRoleArn: properties["MonitoringRoleArn"] },
|
|
1768
|
+
...properties["MonitoringInterval"] != null && { MonitoringInterval: Number(properties["MonitoringInterval"]) },
|
|
1769
|
+
EnableIAMDatabaseAuthentication: properties["EnableIAMDatabaseAuthentication"],
|
|
1770
|
+
...logExportConfig !== void 0 && { CloudwatchLogsExportConfiguration: logExportConfig },
|
|
1771
|
+
...processorMembers,
|
|
1772
|
+
...engineLifecycleSupport !== void 0 && { EngineLifecycleSupport: engineLifecycleSupport },
|
|
1773
|
+
...authenticationType !== void 0 && { MasterUserAuthenticationType: authenticationType }
|
|
1774
|
+
}));
|
|
1775
|
+
modified = response.DBInstance;
|
|
1776
|
+
return response;
|
|
1777
|
+
},
|
|
1568
1778
|
readStatus: async () => (await this.describeDBInstance(physicalId))?.DBInstanceStatus,
|
|
1569
1779
|
sleep: (ms) => this.sleep(ms),
|
|
1570
1780
|
logger: this.logger,
|
|
@@ -1574,6 +1784,7 @@ async function updateDBInstance(logicalId, physicalId, resourceType, properties,
|
|
|
1574
1784
|
});
|
|
1575
1785
|
this.logger.debug(`Successfully updated DBInstance ${logicalId}`);
|
|
1576
1786
|
if (process.env["CDKD_NO_WAIT"] !== "true" && logExportConfig !== void 0) await this.waitForInstanceState(logicalId, physicalId, (instance) => logExportsApplied(logExportConfig, instance.EnabledCloudwatchLogsExports, instance.PendingModifiedValues?.PendingCloudwatchLogsExports), "CloudWatch Logs exports change");
|
|
1787
|
+
if (process.env["CDKD_NO_WAIT"] !== "true" && (processorMembers.ProcessorFeatures !== void 0 || processorMembers.UseDefaultProcessorFeatures !== void 0)) await this.waitForInstanceState(logicalId, physicalId, processorFeaturesSettled(processorMembers.ProcessorFeatures, modified), "processor features change");
|
|
1577
1788
|
let described = await this.describeDBInstance(physicalId);
|
|
1578
1789
|
const sentGroup = backfillMembers.DBParameterGroupName;
|
|
1579
1790
|
if (sentGroup !== void 0 || instanceParameterGroupPendingReboot(described) || instanceParameterGroupApplying(described)) described = await this.rebootForPendingParameterGroup(logicalId, physicalId, sentGroup, String(properties["CertificateRotationRestart"]) === "true");
|
|
@@ -2090,14 +2301,24 @@ async function applyAssociatedRoles(target, logicalId, physicalId, desired, prev
|
|
|
2090
2301
|
|
|
2091
2302
|
// src/provisioning/providers/rds/drift.ts
|
|
2092
2303
|
function getDriftUnorderedPaths(resourceType) {
|
|
2093
|
-
return resourceType === "AWS::RDS::DBCluster" || resourceType === "AWS::RDS::DBInstance" ? ["EnableCloudwatchLogsExports", "AssociatedRoles"] : [];
|
|
2094
|
-
}
|
|
2095
|
-
function getDriftUnknownPaths(resourceType, properties) {
|
|
2096
2304
|
if (resourceType === "AWS::RDS::DBInstance") return [
|
|
2097
|
-
"
|
|
2098
|
-
"
|
|
2099
|
-
"
|
|
2305
|
+
"EnableCloudwatchLogsExports",
|
|
2306
|
+
"AssociatedRoles",
|
|
2307
|
+
"ProcessorFeatures"
|
|
2100
2308
|
];
|
|
2309
|
+
return resourceType === "AWS::RDS::DBCluster" ? ["EnableCloudwatchLogsExports", "AssociatedRoles"] : [];
|
|
2310
|
+
}
|
|
2311
|
+
function getDriftUnknownPaths(resourceType, properties) {
|
|
2312
|
+
if (resourceType === "AWS::RDS::DBInstance") {
|
|
2313
|
+
const instanceUnknown = [
|
|
2314
|
+
"AllowMajorVersionUpgrade",
|
|
2315
|
+
"CertificateRotationRestart",
|
|
2316
|
+
"SourceRegion",
|
|
2317
|
+
"UseDefaultProcessorFeatures"
|
|
2318
|
+
];
|
|
2319
|
+
const declared = properties?.["ProcessorFeatures"];
|
|
2320
|
+
return declared == null || Array.isArray(declared) && declared.length === 0 ? [...instanceUnknown, "ProcessorFeatures"] : instanceUnknown;
|
|
2321
|
+
}
|
|
2101
2322
|
if (resourceType !== "AWS::RDS::DBCluster") return [];
|
|
2102
2323
|
const neverRead = [
|
|
2103
2324
|
"EngineMode",
|
|
@@ -2105,7 +2326,8 @@ function getDriftUnknownPaths(resourceType, properties) {
|
|
|
2105
2326
|
"ClusterScalabilityType",
|
|
2106
2327
|
"MasterUserAuthenticationType",
|
|
2107
2328
|
"GlobalClusterIdentifier",
|
|
2108
|
-
"DBInstanceParameterGroupName"
|
|
2329
|
+
"DBInstanceParameterGroupName",
|
|
2330
|
+
"WithExpressConfiguration"
|
|
2109
2331
|
];
|
|
2110
2332
|
if (properties === void 0 || Object.keys(properties).length === 0) return neverRead;
|
|
2111
2333
|
return (properties?.["ServerlessV2ScalingConfiguration"])?.SecondsUntilAutoPause === void 0 ? [...neverRead, "ServerlessV2ScalingConfiguration.SecondsUntilAutoPause"] : neverRead;
|
|
@@ -2138,6 +2360,7 @@ function canonicalizeDriftProperties(resourceType, properties) {
|
|
|
2138
2360
|
return out ?? properties;
|
|
2139
2361
|
}
|
|
2140
2362
|
async function canonicalizeDriftPair(resourceType, baseline, aws) {
|
|
2363
|
+
if (resourceType === "AWS::RDS::DBInstance") aws = withDeclaredProcessorFeatures(baseline, aws);
|
|
2141
2364
|
const recorded = baseline["SourceDBInstanceIdentifier"];
|
|
2142
2365
|
const live = aws["SourceDBInstanceIdentifier"];
|
|
2143
2366
|
if (resourceType !== "AWS::RDS::DBInstance" || typeof recorded !== "string" || typeof live !== "string" || recorded === live) return {
|
|
@@ -2156,6 +2379,21 @@ async function canonicalizeDriftPair(resourceType, baseline, aws) {
|
|
|
2156
2379
|
aws
|
|
2157
2380
|
};
|
|
2158
2381
|
}
|
|
2382
|
+
function withDeclaredProcessorFeatures(baseline, aws) {
|
|
2383
|
+
const declared = baseline["ProcessorFeatures"];
|
|
2384
|
+
const live = aws["ProcessorFeatures"];
|
|
2385
|
+
if (!Array.isArray(declared) || !Array.isArray(live)) return aws;
|
|
2386
|
+
const names = /* @__PURE__ */ new Set();
|
|
2387
|
+
for (const item of declared) {
|
|
2388
|
+
if (item === null || typeof item !== "object") return aws;
|
|
2389
|
+
names.add(item["Name"]);
|
|
2390
|
+
}
|
|
2391
|
+
const kept = live.filter((item) => item !== null && typeof item === "object" && names.has(item["Name"]));
|
|
2392
|
+
return kept.length === live.length ? aws : {
|
|
2393
|
+
...aws,
|
|
2394
|
+
ProcessorFeatures: kept
|
|
2395
|
+
};
|
|
2396
|
+
}
|
|
2159
2397
|
function canonicalizeUnsettledProperties(resourceType, properties) {
|
|
2160
2398
|
return this.canonicalizeDriftProperties(resourceType, properties);
|
|
2161
2399
|
}
|
|
@@ -2284,6 +2522,11 @@ async function readCurrentStateDBInstance(physicalId) {
|
|
|
2284
2522
|
const instanceLogs = liveLogExports(inst.EnabledCloudwatchLogsExports, inst.PendingModifiedValues?.PendingCloudwatchLogsExports);
|
|
2285
2523
|
if (instanceLogs.length > 0) result["EnableCloudwatchLogsExports"] = instanceLogs;
|
|
2286
2524
|
}
|
|
2525
|
+
const processorFeatures = liveProcessorFeatures(inst);
|
|
2526
|
+
if (processorFeatures !== void 0 && processorFeatures.length > 0) result["ProcessorFeatures"] = processorFeatures.map((feature) => ({
|
|
2527
|
+
Name: feature.Name,
|
|
2528
|
+
Value: feature.Value
|
|
2529
|
+
}));
|
|
2287
2530
|
if (inst.DBName !== void 0) result["DBName"] = inst.DBName;
|
|
2288
2531
|
if (inst.AvailabilityZone !== void 0 && inst.MultiAZ !== true) result["AvailabilityZone"] = inst.AvailabilityZone;
|
|
2289
2532
|
if (inst.EngineLifecycleSupport !== void 0 && inst.DBClusterIdentifier === void 0) result["EngineLifecycleSupport"] = inst.EngineLifecycleSupport;
|
|
@@ -2462,7 +2705,8 @@ var RDSProvider = class {
|
|
|
2462
2705
|
"DBClusterInstanceClass",
|
|
2463
2706
|
"AllocatedStorage",
|
|
2464
2707
|
"Iops",
|
|
2465
|
-
"DBInstanceParameterGroupName"
|
|
2708
|
+
"DBInstanceParameterGroupName",
|
|
2709
|
+
"WithExpressConfiguration"
|
|
2466
2710
|
])],
|
|
2467
2711
|
["AWS::RDS::DBInstance", /* @__PURE__ */ new Set([
|
|
2468
2712
|
"DBInstanceIdentifier",
|
|
@@ -2516,14 +2760,15 @@ var RDSProvider = class {
|
|
|
2516
2760
|
"MasterUserAuthenticationType",
|
|
2517
2761
|
"AssociatedRoles",
|
|
2518
2762
|
"SourceDBInstanceIdentifier",
|
|
2519
|
-
"SourceRegion"
|
|
2763
|
+
"SourceRegion",
|
|
2764
|
+
"ProcessorFeatures",
|
|
2765
|
+
"UseDefaultProcessorFeatures"
|
|
2520
2766
|
])]
|
|
2521
2767
|
]);
|
|
2522
2768
|
unhandledByDesign = /* @__PURE__ */ new Map([["AWS::RDS::DBCluster", /* @__PURE__ */ new Map([
|
|
2523
2769
|
["DeleteAutomatedBackups", "delete-time flag, sent on the delete when the record carries it; kept unhandled so a template declaring it keeps its Cloud Control route. Final snapshots are governed by DeletionPolicy: Snapshot, which this flag does not control"],
|
|
2524
2770
|
["ScalingConfiguration", "Aurora Serverless v1 only (EngineMode serverless), retired by AWS: no aurora-mysql or aurora-postgresql engine version supports the serverless engine mode (DescribeDBEngineVersions, us-east-1, 2026-11-06). Aurora Serverless v2 uses ServerlessV2ScalingConfiguration"],
|
|
2525
|
-
["DBSystemId", "reserved for future use, per the CloudFormation schema (cloudformation:DescribeType, us-east-1, 2026-11-07); no observable behaviour to wire. Kept unhandled so a template declaring it keeps its Cloud Control route"]
|
|
2526
|
-
["WithExpressConfiguration", "CloudFormation's RDS handler fails to create it (an RDS 500, CREATE_FAILED on 3 stacks, us-east-1, 2026-11-07), Cloud Control calls the same RDS handler, so it is expected to fail the same way (inferred, not measured), and there is no parity oracle for what cdkd should do with the writer instance RDS auto-creates; re-measure tracked in go-to-k/cdkd#5984. Kept unhandled so a template declaring it keeps its Cloud Control route"]
|
|
2771
|
+
["DBSystemId", "reserved for future use, per the CloudFormation schema (cloudformation:DescribeType, us-east-1, 2026-11-07); no observable behaviour to wire. Kept unhandled so a template declaring it keeps its Cloud Control route"]
|
|
2527
2772
|
])], ["AWS::RDS::DBInstance", /* @__PURE__ */ new Map([
|
|
2528
2773
|
["DBSecurityGroups", "EC2-Classic-only feature retired by AWS (2022-08-15); new accounts cannot use this — use VPCSecurityGroups instead"],
|
|
2529
2774
|
["ApplyImmediately", "cdkd always applies modifications immediately (rds:ModifyDBInstance.ApplyImmediately=true is hardcoded); users wanting maintenance-window deferral should run aws rds modify-db-instance directly"],
|
|
@@ -2739,4 +2984,4 @@ var RDSProvider = class {
|
|
|
2739
2984
|
};
|
|
2740
2985
|
|
|
2741
2986
|
export { RDSProvider };
|
|
2742
|
-
//# sourceMappingURL=rds-provider-
|
|
2987
|
+
//# sourceMappingURL=rds-provider-DDK78o9z.js.map
|