@cdkd/cli 0.350.4 → 0.351.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-CepgBr_y.js → ambient-client-defaults-BdOY70NL.js} +3 -3
- package/dist/{ambient-client-defaults-CepgBr_y.js.map → ambient-client-defaults-BdOY70NL.js.map} +1 -1
- package/dist/{asg-provider-26AfIhcd.js → asg-provider-BhktjcGM.js} +6 -6
- package/dist/{asg-provider-26AfIhcd.js.map → asg-provider-BhktjcGM.js.map} +1 -1
- package/dist/cli.js +3 -3
- package/dist/{custom-resource-runtime-2Kfh-v8P.js → custom-resource-runtime-BkEa9HAa.js} +6 -6
- package/dist/{custom-resource-runtime-2Kfh-v8P.js.map → custom-resource-runtime-BkEa9HAa.js.map} +1 -1
- package/dist/db-associated-roles-DZ1mRuUA.js +74 -0
- package/dist/db-associated-roles-DZ1mRuUA.js.map +1 -0
- package/dist/delete-started-ByP_GmQ7.js +887 -0
- package/dist/delete-started-ByP_GmQ7.js.map +1 -0
- package/dist/{deploy-engine-DLmPF7r5.js → deploy-engine-BZNCiQ-B.js} +289 -91
- package/dist/deploy-engine-BZNCiQ-B.js.map +1 -0
- package/dist/{diff-calculator-DYUmMeew.js → diff-calculator-vaWjL6sQ.js} +12 -12
- package/dist/{diff-calculator-DYUmMeew.js.map → diff-calculator-vaWjL6sQ.js.map} +1 -1
- package/dist/{ec2-termination-protection-Di3eM8PN.js → ec2-termination-protection-DpNlPDar.js} +6 -6
- package/dist/{ec2-termination-protection-Di3eM8PN.js.map → ec2-termination-protection-DpNlPDar.js.map} +1 -1
- package/dist/{ecr-uri-6HdJfJPR.js → ecr-uri-Cd_x_ldh.js} +2 -2
- package/dist/{ecr-uri-6HdJfJPR.js.map → ecr-uri-Cd_x_ldh.js.map} +1 -1
- package/dist/{expected-bucket-owner-Drp-CSQY.js → expected-bucket-owner-Ba9LshiP.js} +2 -2
- package/dist/{expected-bucket-owner-Drp-CSQY.js.map → expected-bucket-owner-Ba9LshiP.js.map} +1 -1
- package/dist/{iam-role-provider-B5c4V2kT.js → iam-role-provider-CL-dMrn4.js} +7 -7
- package/dist/{iam-role-provider-B5c4V2kT.js.map → iam-role-provider-CL-dMrn4.js.map} +1 -1
- package/dist/{image-plan-CYouJkYM.js → image-plan-C0B05bHS.js} +8 -8
- package/dist/{image-plan-CYouJkYM.js.map → image-plan-C0B05bHS.js.map} +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/{logger-6lyGJVGE.js → logger-DpAGzSvV.js} +2 -2
- package/dist/{logger-6lyGJVGE.js.map → logger-DpAGzSvV.js.map} +1 -1
- package/dist/{neptune-provider-Dhody0jz.js → neptune-provider-CJuYc8IB.js} +7 -7
- package/dist/{neptune-provider-Dhody0jz.js.map → neptune-provider-CJuYc8IB.js.map} +1 -1
- package/dist/{program-BMBei2v9.js → program-CUCE3lAz.js} +121 -22
- package/dist/program-CUCE3lAz.js.map +1 -0
- package/dist/{provider-classes-B3qqzXp-.js → provider-classes-YUbciPtV.js} +199 -63
- package/dist/provider-classes-YUbciPtV.js.map +1 -0
- package/dist/{rds-provider-CXjWWFKT.js → rds-provider-CbmVLapS.js} +20 -691
- package/dist/rds-provider-CbmVLapS.js.map +1 -0
- package/dist/{read-replica-iA8yd-HO.js → read-replica-BQ5dRRmm.js} +3 -3
- package/dist/{read-replica-iA8yd-HO.js.map → read-replica-BQ5dRRmm.js.map} +1 -1
- package/dist/{replacement-rules-B4fLD_Ru.js → replacement-rules-DZphESoc.js} +60 -7
- package/dist/replacement-rules-DZphESoc.js.map +1 -0
- package/dist/{resource-deadline-BcEyGRdL.js → resource-deadline-_gEj2hxY.js} +45 -5
- package/dist/resource-deadline-_gEj2hxY.js.map +1 -0
- package/dist/{run-cli-Dp938GHN.js → run-cli-bzXhjxpe.js} +2 -2
- package/dist/{run-cli-Dp938GHN.js.map → run-cli-bzXhjxpe.js.map} +1 -1
- package/dist/{update-removal-1ZPAMzvz.js → update-removal-DOUUID3B.js} +4 -4
- package/dist/{update-removal-1ZPAMzvz.js.map → update-removal-DOUUID3B.js.map} +1 -1
- package/dist/{version-D_7vFUjp.js → version-DTKcNNDa.js} +2 -2
- package/dist/{version-D_7vFUjp.js.map → version-DTKcNNDa.js.map} +1 -1
- package/package.json +2 -2
- package/dist/db-instance-modify-retry-BoKzNMfz.js +0 -116
- package/dist/db-instance-modify-retry-BoKzNMfz.js.map +0 -1
- package/dist/delete-started-Bq_G9e4j.js +0 -192
- package/dist/delete-started-Bq_G9e4j.js.map +0 -1
- package/dist/deploy-engine-DLmPF7r5.js.map +0 -1
- package/dist/program-BMBei2v9.js.map +0 -1
- package/dist/provider-classes-B3qqzXp-.js.map +0 -1
- package/dist/rds-provider-CXjWWFKT.js.map +0 -1
- package/dist/replacement-rules-B4fLD_Ru.js.map +0 -1
- package/dist/resource-deadline-BcEyGRdL.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { E as coerceCfnBoolean, n as getLogger, u as describeAwsFailure, w as generatedNameFor } from "./logger-
|
|
2
|
-
import { G as markRedactedCause, K as wrapMaskedAwsError, O as relayedNameCollision, W as markNonRetryable, _ as ResourceUpdateNotSupportedError, at as ProvisioningError, et as CdkdError, t as ambientClientDefaults } from "./ambient-client-defaults-
|
|
3
|
-
import { H as resolveExplicitPhysicalId, J as deleteWithProtectionCompensation, Jt as markAuxiliaryFailure, K as markNotGone, M as withoutServerErrorRetries, Pt as createMaskedLogSinks, R as normalizeAwsTagsToCfn, Rt as maskerOrIdentity, U as RESOURCE_NOT_FOUND, W as assertRegionMatch, X as observeThenDisableProtection, Yt as markCreatedBeforeFailure, Z as rdsFamilyProtectionSite, _t as pasteableAwsCommand, a as withRemovalDefaults, ct as protectionFlipKey, et as PROTECTION_FLIP_RETRY_WAIT_MS, f as retractCreatedResource, it as isTerminalDbWaitStatus, ot as ProtectionFlipRegistry, t as clearOnUpdateRemoval, tt as deleteAfterProtectionFlipWithFinalSnapshot, u as reportCreatedResource, vt as protectedReplacementAdvice, zt as withDerivedNameMasks } from "./update-removal-
|
|
1
|
+
import { E as coerceCfnBoolean, n as getLogger, u as describeAwsFailure, w as generatedNameFor } from "./logger-DpAGzSvV.js";
|
|
2
|
+
import { G as markRedactedCause, K as wrapMaskedAwsError, O as relayedNameCollision, W as markNonRetryable, _ as ResourceUpdateNotSupportedError, at as ProvisioningError, et as CdkdError, t as ambientClientDefaults } from "./ambient-client-defaults-BdOY70NL.js";
|
|
3
|
+
import { H as resolveExplicitPhysicalId, J as deleteWithProtectionCompensation, Jt as markAuxiliaryFailure, K as markNotGone, M as withoutServerErrorRetries, Pt as createMaskedLogSinks, R as normalizeAwsTagsToCfn, Rt as maskerOrIdentity, U as RESOURCE_NOT_FOUND, W as assertRegionMatch, X as observeThenDisableProtection, Yt as markCreatedBeforeFailure, Z as rdsFamilyProtectionSite, _t as pasteableAwsCommand, a as withRemovalDefaults, ct as protectionFlipKey, et as PROTECTION_FLIP_RETRY_WAIT_MS, f as retractCreatedResource, it as isTerminalDbWaitStatus, ot as ProtectionFlipRegistry, t as clearOnUpdateRemoval, tt as deleteAfterProtectionFlipWithFinalSnapshot, u as reportCreatedResource, vt as protectedReplacementAdvice, zt as withDerivedNameMasks } from "./update-removal-DOUUID3B.js";
|
|
4
4
|
import { f as ambientRegion } from "./aws-client-defaults-DAebi99J.js";
|
|
5
|
-
import { a as slowCcOperationTimeoutMs,
|
|
6
|
-
import { _ as
|
|
7
|
-
import { P as safeMsg, c as deployReplaceCommand, m as proseQuoted, o as cdkdRemedy } from "./version-
|
|
8
|
-
import { a as
|
|
9
|
-
import {
|
|
10
|
-
import { Nt as dynamicReferenceTokens, r as dbInstanceEngineChangeIsInPlace } from "./replacement-rules-
|
|
5
|
+
import { $ as instanceAvailabilityZoneKept, A as isClusterBusyRefusal, B as usableClusterSize, C as clusterModifyMultiAzMembers, D as globalWriteForwardingApplied, E as clusterSizeValue, F as multiAzAppliedProbe, G as usableRetentionPeriod, H as usableHttpEndpoint, I as retentionPeriodValue, J as desiredLogExports, K as withPreviousValues, L as serverlessV2ScalingToSend, M as localWriteForwardingFlag, N as localWriteForwardingToSend, O as globalWriteForwardingFlag, P as malformedInstanceClass, Q as engineLifecycleSupportRefusalText, R as usableAvailabilityZones, S as clusterModifyBackfillMembers, T as clusterPortToSend, U as usableInstanceClass, V as usableGlobalWriteForwarding, W as usableLocalWriteForwarding, X as engineLifecycleSupportAction, Y as desiredProcessorFeatures, Z as engineLifecycleSupportOf, _ as clusterCreateMultiAzMembers, _t as acceptedCreateOnlyDropsOf, a as ExpressWriterRefusal, at as instanceRebootApplied, b as clusterHttpEndpointAction, c as expressWriterIdentifier, ct as liveLogExports, d as recordedExpressWriterId, dt as logExportsDelta, et as instanceModifyBackfillMembers, f as CLUSTER_BOOLEAN_SCALARS, ft as numberOrUndefined, g as clusterCreateBackfillMembers, gt as slowCcOperationTimeoutMs, h as backtrackWindowValue, ht as dbInstanceAttributes, i as dbClusterAttributes, it as instanceProcessorFeatureMembers, j as localWriteForwardingApplied, k as httpEndpointFlag, l as isOwnExpressWriter, lt as liveProcessorFeatures, m as SECURITY_GROUP_CHANGE_MEMBER_STATUSES, mt as withPreviousAvailabilityZone, nt as instanceParameterGroupPendingReboot, o as deleteExpressWriter, ot as instanceValueChanged, p as PORT_CHANGE_MEMBER_STATUSES, pt as processorFeaturesSettled, q as backupReplicationPlan, r as markDeleteStarted, rt as instanceParameterGroupSettled, s as expressConfigurationFlag, st as liveBackupReplicationRegions, tt as instanceParameterGroupApplying, u as readExpressWriterId, ut as logExportsApplied, v as clusterCreateScalarMembers, w as clusterModifyScalarMembers, x as clusterInstanceParameterGroupToSend, y as clusterEngineVersionChanged, z as usableBacktrackWindow } from "./delete-started-ByP_GmQ7.js";
|
|
6
|
+
import { _ as isModifyNotAvailableRefusal, a as POINT_IN_TIME_NO_SOURCE_REASON, c as refuseRestoreFromItself, f as planTagDiff, g as tagPlanWarning, l as parseZonedTimestamp, m as refuseMalformedDesiredTags, n as enclosingDeadlineRemainingMs, o as declaresInstancePointInTime, s as pointInTimeTemplateRefusal, v as modifyDbInstanceWhenAvailable } from "./resource-deadline-_gEj2hxY.js";
|
|
7
|
+
import { P as safeMsg, c as deployReplaceCommand, m as proseQuoted, o as cdkdRemedy } from "./version-DTKcNNDa.js";
|
|
8
|
+
import { _ as replicaSourceChange, a as isLiveReadReplica, b as withPreviousReplicaSource, c as positive, d as refuseMalformedReplicaSource, f as refuseUnknownSourceRegion, g as replicaNeedsModifyAfterCreate, h as replicaModifyAfterCreateInput, i as describeReplicaSource, m as replicaEngine, n as declared, o as liveReplicaSource, p as replicaCreateInput, r as declaredReplicaSource, s as ownScopeOf, t as REPLICA_SOURCE_KEYS, u as refuseBothReplicaSources, v as replicaSourceStatus, y as sameReplicaSource } from "./read-replica-BQ5dRRmm.js";
|
|
9
|
+
import { a as associatedRolesReadback, c as planAssociatedRoleChanges, i as associatedRolesNamed, n as associatedRoleKey, o as canonicalAssociatedRoles, r as associatedRoleList, s as isRoleCallNotAvailableRefusal, t as associatedRoleArns } from "./db-associated-roles-DZ1mRuUA.js";
|
|
10
|
+
import { Nt as dynamicReferenceTokens, r as dbInstanceEngineChangeIsInPlace } from "./replacement-rules-DZphESoc.js";
|
|
11
11
|
import { DescribeSecurityGroupsCommand, EC2Client } from "@aws-sdk/client-ec2";
|
|
12
12
|
import { isDeepStrictEqual } from "node:util";
|
|
13
13
|
import { AddRoleToDBClusterCommand, AddRoleToDBInstanceCommand, AddTagsToResourceCommand, CreateDBClusterCommand, CreateDBInstanceCommand, CreateDBInstanceReadReplicaCommand, CreateDBSubnetGroupCommand, DeleteDBClusterCommand, DeleteDBInstanceCommand, DeleteDBSubnetGroupCommand, DescribeDBClusterAutomatedBackupsCommand, DescribeDBClusterSnapshotsCommand, DescribeDBClustersCommand, DescribeDBInstanceAutomatedBackupsCommand, DescribeDBInstancesCommand, DescribeDBSnapshotsCommand, DescribeDBSubnetGroupsCommand, DescribeGlobalClustersCommand, DisableHttpEndpointCommand, EnableHttpEndpointCommand, ListTagsForResourceCommand, ModifyDBClusterCommand, ModifyDBInstanceCommand, ModifyDBSubnetGroupCommand, PromoteReadReplicaCommand, RDSClient, RebootDBInstanceCommand, RemoveFromGlobalClusterCommand, RemoveRoleFromDBClusterCommand, RemoveRoleFromDBInstanceCommand, RemoveTagsFromResourceCommand, RestoreDBClusterFromSnapshotCommand, RestoreDBClusterToPointInTimeCommand, RestoreDBInstanceFromDBSnapshotCommand, RestoreDBInstanceToPointInTimeCommand, StartDBInstanceAutomatedBackupsReplicationCommand, StopDBInstanceAutomatedBackupsReplicationCommand } from "@aws-sdk/client-rds";
|
|
@@ -198,661 +198,6 @@ async function importDBSubnetGroup(input) {
|
|
|
198
198
|
return null;
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
// src/provisioning/providers/rds/instance-members.ts
|
|
202
|
-
function numberOrUndefined(value) {
|
|
203
|
-
return value == null ? void 0 : Number(value);
|
|
204
|
-
}
|
|
205
|
-
const STORAGE_MEMBERS = /* @__PURE__ */ new Set([
|
|
206
|
-
"AllocatedStorage",
|
|
207
|
-
"Iops",
|
|
208
|
-
"StorageType",
|
|
209
|
-
"StorageThroughput"
|
|
210
|
-
]);
|
|
211
|
-
function instanceValueChanged(properties, previousProperties, key, context) {
|
|
212
|
-
const desired = properties[key];
|
|
213
|
-
if (desired == null) return false;
|
|
214
|
-
const previous = previousProperties[key];
|
|
215
|
-
if (previous == null) return true;
|
|
216
|
-
const differs = typeof desired === "object" || typeof previous === "object" ? !isDeepStrictEqual(desired, previous) : String(desired) !== String(previous);
|
|
217
|
-
if (STORAGE_MEMBERS.has(key) && !differs) return false;
|
|
218
|
-
if (context?.changedProperties !== void 0) return context.changedProperties.has(key);
|
|
219
|
-
return differs;
|
|
220
|
-
}
|
|
221
|
-
function sizeOrZero(value) {
|
|
222
|
-
const size = Number(value);
|
|
223
|
-
return value != null && Number.isFinite(size) ? size : 0;
|
|
224
|
-
}
|
|
225
|
-
function isProvisionedIoStorage(properties) {
|
|
226
|
-
const storageType = properties["StorageType"];
|
|
227
|
-
if (typeof storageType === "string" && storageType !== "") return [
|
|
228
|
-
"io1",
|
|
229
|
-
"io2",
|
|
230
|
-
"gp3"
|
|
231
|
-
].includes(storageType.toLowerCase());
|
|
232
|
-
return properties["Iops"] != null;
|
|
233
|
-
}
|
|
234
|
-
async function instanceModifyBackfillMembers(properties, previousProperties, liveAllocatedStorage, logicalId, context) {
|
|
235
|
-
const changed = (key) => instanceValueChanged(properties, previousProperties, key, context);
|
|
236
|
-
const desiredAllocated = numberOrUndefined(properties["AllocatedStorage"]);
|
|
237
|
-
const members = {};
|
|
238
|
-
if (changed("BackupRetentionPeriod")) members.BackupRetentionPeriod = Number(properties["BackupRetentionPeriod"]);
|
|
239
|
-
for (const key of [
|
|
240
|
-
"PreferredBackupWindow",
|
|
241
|
-
"PreferredMaintenanceWindow",
|
|
242
|
-
"StorageType",
|
|
243
|
-
"OptionGroupName",
|
|
244
|
-
"CACertificateIdentifier"
|
|
245
|
-
]) if (changed(key)) members[key] = properties[key];
|
|
246
|
-
for (const key of ["NetworkType", "LicenseModel"]) if (changed(key)) members[key] = properties[key];
|
|
247
|
-
if (changed("DatabaseInsightsMode")) members.DatabaseInsightsMode = properties["DatabaseInsightsMode"];
|
|
248
|
-
for (const key of [
|
|
249
|
-
"MultiAZ",
|
|
250
|
-
"AutoMinorVersionUpgrade",
|
|
251
|
-
"CopyTagsToSnapshot",
|
|
252
|
-
"DedicatedLogVolume"
|
|
253
|
-
]) if (changed(key)) members[key] = properties[key];
|
|
254
|
-
if (changed("StorageThroughput")) members.StorageThroughput = Number(properties["StorageThroughput"]);
|
|
255
|
-
if (changed("PromotionTier")) members.PromotionTier = Number(properties["PromotionTier"]);
|
|
256
|
-
if (changed("CACertificateIdentifier") && properties["CertificateRotationRestart"] != null) members.CertificateRotationRestart = properties["CertificateRotationRestart"];
|
|
257
|
-
if (changed("MaxAllocatedStorage")) members.MaxAllocatedStorage = Number(properties["MaxAllocatedStorage"]);
|
|
258
|
-
else if (properties["MaxAllocatedStorage"] == null && previousProperties["MaxAllocatedStorage"] != null) {
|
|
259
|
-
const live = await liveAllocatedStorage();
|
|
260
|
-
if (live === void 0) throw new Error(safeMsg`DBInstance ${logicalId}: MaxAllocatedStorage was removed from the template, which turns storage autoscaling off by setting it to the allocated storage, but DescribeDBInstances did not report the allocated storage`);
|
|
261
|
-
members.MaxAllocatedStorage = Math.max(live, sizeOrZero(desiredAllocated));
|
|
262
|
-
}
|
|
263
|
-
const rollback = context?.replayingState === true;
|
|
264
|
-
if (changed("EngineVersion") && !rollback) members.EngineVersion = String(properties["EngineVersion"]);
|
|
265
|
-
if (changed("DBParameterGroupName") && !(rollback && changed("EngineVersion"))) members.DBParameterGroupName = properties["DBParameterGroupName"];
|
|
266
|
-
if (changed("AllowMajorVersionUpgrade") || members.EngineVersion !== void 0 && properties["AllowMajorVersionUpgrade"] != null) members.AllowMajorVersionUpgrade = properties["AllowMajorVersionUpgrade"];
|
|
267
|
-
if (changed("AllocatedStorage") && !rollback) members.AllocatedStorage = desiredAllocated;
|
|
268
|
-
if (isProvisionedIoStorage(properties)) {
|
|
269
|
-
if (changed("AllocatedStorage") || changed("Iops") || changed("StorageThroughput") || changed("StorageType")) {
|
|
270
|
-
if (members.AllocatedStorage === void 0) {
|
|
271
|
-
const live = await liveAllocatedStorage();
|
|
272
|
-
const larger = Math.max(sizeOrZero(live), sizeOrZero(desiredAllocated), rollback ? sizeOrZero(previousProperties["AllocatedStorage"]) : 0);
|
|
273
|
-
if (larger > 0) members.AllocatedStorage = larger;
|
|
274
|
-
}
|
|
275
|
-
if (properties["Iops"] != null) members.Iops = Number(properties["Iops"]);
|
|
276
|
-
}
|
|
277
|
-
} else if (changed("Iops") && !rollback) members.Iops = Number(properties["Iops"]);
|
|
278
|
-
const enableChanged = changed("EnablePerformanceInsights");
|
|
279
|
-
const keyChanged = changed("PerformanceInsightsKMSKeyId");
|
|
280
|
-
const enableDesired = properties["EnablePerformanceInsights"];
|
|
281
|
-
const keyDesired = properties["PerformanceInsightsKMSKeyId"];
|
|
282
|
-
if (enableChanged || keyChanged) {
|
|
283
|
-
members.EnablePerformanceInsights = enableDesired;
|
|
284
|
-
if (keyChanged || String(enableDesired) === "true") members.PerformanceInsightsKMSKeyId = keyDesired;
|
|
285
|
-
}
|
|
286
|
-
if (changed("PerformanceInsightsRetentionPeriod")) {
|
|
287
|
-
members.PerformanceInsightsRetentionPeriod = Number(properties["PerformanceInsightsRetentionPeriod"]);
|
|
288
|
-
members.EnablePerformanceInsights = enableDesired;
|
|
289
|
-
members.PerformanceInsightsKMSKeyId = keyDesired;
|
|
290
|
-
}
|
|
291
|
-
return Object.fromEntries(Object.entries(members).filter(([, value]) => value !== void 0));
|
|
292
|
-
}
|
|
293
|
-
function instanceParameterGroupPendingReboot(instance) {
|
|
294
|
-
return (instance?.DBParameterGroups ?? []).some((group) => group.ParameterApplyStatus === "pending-reboot");
|
|
295
|
-
}
|
|
296
|
-
function instanceParameterGroupApplying(instance) {
|
|
297
|
-
return (instance?.DBParameterGroups ?? []).some((group) => group.ParameterApplyStatus === "applying");
|
|
298
|
-
}
|
|
299
|
-
function instanceHasPendingChanges(instance, caRotationRestarts) {
|
|
300
|
-
const pending = instance.PendingModifiedValues;
|
|
301
|
-
if (pending === void 0) return false;
|
|
302
|
-
return pending.DBInstanceClass !== void 0 || pending.AllocatedStorage !== void 0 || pending.AutomationMode !== void 0 || pending.BackupRetentionPeriod !== void 0 || pending.DBInstanceIdentifier !== void 0 || pending.DBSubnetGroupName !== void 0 || pending.Engine !== void 0 || pending.EngineVersion !== void 0 || pending.IAMDatabaseAuthenticationEnabled !== void 0 || pending.Iops !== void 0 || pending.LicenseModel !== void 0 || pending.MasterUserPassword !== void 0 || pending.MultiAZ !== void 0 || pending.PendingCloudwatchLogsExports !== void 0 || pending.Port !== void 0 || (pending.ProcessorFeatures ?? []).length > 0 || pending.ResumeFullAutomationModeTime !== void 0 || pending.StorageThroughput !== void 0 || pending.StorageType !== void 0 || caRotationRestarts && pending.CACertificateIdentifier !== void 0;
|
|
303
|
-
}
|
|
304
|
-
function instanceParameterGroupSettled(instance, sentGroup, caRotationRestarts) {
|
|
305
|
-
if (instance.DBInstanceStatus !== "available") return false;
|
|
306
|
-
if (instanceHasPendingChanges(instance, caRotationRestarts)) return false;
|
|
307
|
-
const groups = instance.DBParameterGroups ?? [];
|
|
308
|
-
if (groups.some((group) => group.ParameterApplyStatus === "applying")) return false;
|
|
309
|
-
if (sentGroup === void 0 || groups.length === 0) return true;
|
|
310
|
-
return groups.some((group) => group.DBParameterGroupName?.toLowerCase() === sentGroup.toLowerCase());
|
|
311
|
-
}
|
|
312
|
-
function instanceRebootApplied(instance) {
|
|
313
|
-
return instance.DBInstanceStatus === "available" && (instance.DBParameterGroups ?? []).every((group) => group.ParameterApplyStatus === "in-sync") && (instance.OptionGroupMemberships ?? []).every((group) => group.Status === "in-sync");
|
|
314
|
-
}
|
|
315
|
-
function logExportsList(value) {
|
|
316
|
-
if (value == null) return void 0;
|
|
317
|
-
if (!Array.isArray(value) || !value.every((type) => typeof type === "string")) return "malformed";
|
|
318
|
-
return [...new Set(value)];
|
|
319
|
-
}
|
|
320
|
-
function desiredLogExports(properties, resourceType, logicalId, physicalId) {
|
|
321
|
-
const desired = logExportsList(properties["EnableCloudwatchLogsExports"]);
|
|
322
|
-
if (desired !== "malformed") return desired;
|
|
323
|
-
throw markNonRetryable(new ProvisioningError(`${resourceType} ${logicalId}: EnableCloudwatchLogsExports must be a list of log type names`, resourceType, logicalId, physicalId));
|
|
324
|
-
}
|
|
325
|
-
function logExportsDelta(desired, previousValue) {
|
|
326
|
-
const previous = logExportsList(previousValue);
|
|
327
|
-
const had = previous === void 0 || previous === "malformed" ? [] : previous;
|
|
328
|
-
const want = desired ?? [];
|
|
329
|
-
const enable = want.filter((type) => !had.includes(type));
|
|
330
|
-
const disable = had.filter((type) => !want.includes(type));
|
|
331
|
-
if (enable.length === 0 && disable.length === 0) return void 0;
|
|
332
|
-
return {
|
|
333
|
-
...enable.length > 0 && { EnableLogTypes: enable },
|
|
334
|
-
...disable.length > 0 && { DisableLogTypes: disable }
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
function liveLogExports(enabled, pending) {
|
|
338
|
-
const disabled = pending?.LogTypesToDisable ?? [];
|
|
339
|
-
const out = (enabled ?? []).filter((type) => !disabled.includes(type));
|
|
340
|
-
for (const type of pending?.LogTypesToEnable ?? []) if (!out.includes(type)) out.push(type);
|
|
341
|
-
return out;
|
|
342
|
-
}
|
|
343
|
-
function logExportsApplied(config, enabled, pending) {
|
|
344
|
-
if ((pending?.LogTypesToEnable?.length ?? 0) > 0) return false;
|
|
345
|
-
if ((pending?.LogTypesToDisable?.length ?? 0) > 0) return false;
|
|
346
|
-
const live = enabled ?? [];
|
|
347
|
-
return (config.EnableLogTypes ?? []).every((type) => live.includes(type)) && !(config.DisableLogTypes ?? []).some((type) => live.includes(type));
|
|
348
|
-
}
|
|
349
|
-
function instanceAvailabilityZoneKept(properties, previousProperties) {
|
|
350
|
-
const desired = properties["AvailabilityZone"];
|
|
351
|
-
if (desired === previousProperties["AvailabilityZone"]) return true;
|
|
352
|
-
return (desired == null || desired === "") && String(properties["MultiAZ"]) === "true";
|
|
353
|
-
}
|
|
354
|
-
function withPreviousAvailabilityZone(properties, previousProperties) {
|
|
355
|
-
const { AvailabilityZone: _desired, ...rest } = properties;
|
|
356
|
-
const previous = previousProperties["AvailabilityZone"];
|
|
357
|
-
return previous === void 0 ? rest : {
|
|
358
|
-
...rest,
|
|
359
|
-
AvailabilityZone: previous
|
|
360
|
-
};
|
|
361
|
-
}
|
|
362
|
-
function processorFeatureList(value) {
|
|
363
|
-
if (value == null) return void 0;
|
|
364
|
-
if (!Array.isArray(value)) return "malformed";
|
|
365
|
-
const out = [];
|
|
366
|
-
for (const item of value) {
|
|
367
|
-
if (item === null || typeof item !== "object" || Array.isArray(item)) return "malformed";
|
|
368
|
-
const feature = {};
|
|
369
|
-
for (const key of ["Name", "Value"]) {
|
|
370
|
-
const member = item[key];
|
|
371
|
-
if (member == null) continue;
|
|
372
|
-
if (typeof member !== "string" && typeof member !== "number") return "malformed";
|
|
373
|
-
feature[key] = String(member);
|
|
374
|
-
}
|
|
375
|
-
out.push(feature);
|
|
376
|
-
}
|
|
377
|
-
return out;
|
|
378
|
-
}
|
|
379
|
-
function useDefaultProcessorFeaturesOf(value) {
|
|
380
|
-
if (value == null) return void 0;
|
|
381
|
-
if (typeof value === "boolean") return value;
|
|
382
|
-
if (typeof value === "string" && ["true", "false"].includes(value.toLowerCase())) return value.toLowerCase() === "true";
|
|
383
|
-
return "malformed";
|
|
384
|
-
}
|
|
385
|
-
function processorFeaturesRefusalText(features, resourceType, logicalId) {
|
|
386
|
-
return features === "malformed" ? `${resourceType} ${logicalId}: ProcessorFeatures must be a list of { Name, Value } objects` : `${resourceType} ${logicalId}: UseDefaultProcessorFeatures must be true or false`;
|
|
387
|
-
}
|
|
388
|
-
function desiredProcessorFeatures(properties, resourceType, logicalId) {
|
|
389
|
-
const features = processorFeatureList(properties["ProcessorFeatures"]);
|
|
390
|
-
const useDefault = useDefaultProcessorFeaturesOf(properties["UseDefaultProcessorFeatures"]);
|
|
391
|
-
if (features !== "malformed" && useDefault !== "malformed") return {
|
|
392
|
-
features,
|
|
393
|
-
useDefault
|
|
394
|
-
};
|
|
395
|
-
throw markNonRetryable(new ProvisioningError(processorFeaturesRefusalText(features, resourceType, logicalId), resourceType, logicalId));
|
|
396
|
-
}
|
|
397
|
-
function sameProcessorValue(read, desired, previous) {
|
|
398
|
-
const a = read(desired);
|
|
399
|
-
const b = read(previous);
|
|
400
|
-
return a === "malformed" && b === "malformed" ? isDeepStrictEqual(desired, previous) : isDeepStrictEqual(a, b);
|
|
401
|
-
}
|
|
402
|
-
function instanceProcessorFeatureMembers(properties, previousProperties, resourceType, logicalId, physicalId) {
|
|
403
|
-
if (sameProcessorValue(processorFeatureList, properties["ProcessorFeatures"], previousProperties["ProcessorFeatures"]) && sameProcessorValue(useDefaultProcessorFeaturesOf, properties["UseDefaultProcessorFeatures"], previousProperties["UseDefaultProcessorFeatures"])) return {};
|
|
404
|
-
const features = processorFeatureList(properties["ProcessorFeatures"]);
|
|
405
|
-
const useDefault = useDefaultProcessorFeaturesOf(properties["UseDefaultProcessorFeatures"]);
|
|
406
|
-
if (features === "malformed" || useDefault === "malformed") throw markNonRetryable(new ProvisioningError(processorFeaturesRefusalText(features, resourceType, logicalId), resourceType, logicalId, physicalId));
|
|
407
|
-
return {
|
|
408
|
-
...features !== void 0 && { ProcessorFeatures: features },
|
|
409
|
-
...useDefault !== void 0 && { UseDefaultProcessorFeatures: useDefault }
|
|
410
|
-
};
|
|
411
|
-
}
|
|
412
|
-
function sameFeatureValue(a, b) {
|
|
413
|
-
if (a === b) return true;
|
|
414
|
-
return a !== void 0 && b !== void 0 && a.trim() !== "" && b.trim() !== "" && Number(a) === Number(b);
|
|
415
|
-
}
|
|
416
|
-
const FLAG_ONLY_QUIET_READS = 3;
|
|
417
|
-
const PROCESSOR_SETTLED_STATUSES = /* @__PURE__ */ new Set(["available", "storage-optimization"]);
|
|
418
|
-
function processorChangeUnderWay(instance) {
|
|
419
|
-
return !PROCESSOR_SETTLED_STATUSES.has(instance.DBInstanceStatus ?? "") || (instance.PendingModifiedValues?.ProcessorFeatures ?? []).length > 0;
|
|
420
|
-
}
|
|
421
|
-
function processorFeaturesSettled(sent, modified) {
|
|
422
|
-
let changeSeen = modified !== void 0 && processorChangeUnderWay(modified);
|
|
423
|
-
let quietReads = 0;
|
|
424
|
-
return (instance) => {
|
|
425
|
-
if (processorChangeUnderWay(instance)) {
|
|
426
|
-
changeSeen = true;
|
|
427
|
-
return false;
|
|
428
|
-
}
|
|
429
|
-
if (sent !== void 0) {
|
|
430
|
-
const live = instance.ProcessorFeatures ?? [];
|
|
431
|
-
return sent.every((feature) => live.some((item) => item.Name === feature.Name && sameFeatureValue(item.Value, feature.Value)));
|
|
432
|
-
}
|
|
433
|
-
if (changeSeen) return true;
|
|
434
|
-
quietReads += 1;
|
|
435
|
-
return quietReads >= FLAG_ONLY_QUIET_READS;
|
|
436
|
-
};
|
|
437
|
-
}
|
|
438
|
-
function liveProcessorFeatures(instance) {
|
|
439
|
-
const pending = instance.PendingModifiedValues?.ProcessorFeatures ?? [];
|
|
440
|
-
if (pending.length === 0) return instance.ProcessorFeatures;
|
|
441
|
-
const out = (instance.ProcessorFeatures ?? []).map((feature) => pending.find((item) => item.Name === feature.Name) ?? feature);
|
|
442
|
-
for (const item of pending) if (!out.some((feature) => feature.Name === item.Name)) out.push(item);
|
|
443
|
-
return out;
|
|
444
|
-
}
|
|
445
|
-
function engineLifecycleSupportOf(bag) {
|
|
446
|
-
const value = bag["EngineLifecycleSupport"];
|
|
447
|
-
return value == null || value === "" ? void 0 : String(value);
|
|
448
|
-
}
|
|
449
|
-
function engineLifecycleSupportAction(properties, previousProperties, context) {
|
|
450
|
-
const desired = engineLifecycleSupportOf(properties);
|
|
451
|
-
if (desired === engineLifecycleSupportOf(previousProperties)) return "unchanged";
|
|
452
|
-
if (context?.replayingState === true) return "unchanged";
|
|
453
|
-
if (context?.desiredFromAwsReadback === true) return desired === void 0 ? "unchanged" : "send";
|
|
454
|
-
return desired === void 0 ? "refuse" : "check-live";
|
|
455
|
-
}
|
|
456
|
-
function engineLifecycleSupportRefusalText(resourceType, logicalId, physicalId, kind, liveRead) {
|
|
457
|
-
const cli = kind === "DB cluster" ? "aws rds modify-db-cluster" : "aws rds modify-db-instance";
|
|
458
|
-
return `${resourceType} ${logicalId}: EngineLifecycleSupport cannot change on an existing ${kind}. CloudFormation refuses the same update ("EngineLifecycleSupport cannot be modified."), whether the value changes, is added or is removed. Nothing was applied to ${kind} ${physicalId}. ` + (liveRead === "unreadable" ? `cdkd could not read the live setting (an AWS read failed), so it could not tell whether the ${kind} already holds the declared value; a re-run may succeed. ` : liveRead === "not-found" ? `RDS reports no such ${kind}: it was deleted outside cdkd, so the state record no longer matches AWS. ` : "") + `Declare the value the previous deploy declared (or none, if it declared none). To change the live setting, run ${cli} with --engine-lifecycle-support and --apply-immediately, then declare that value: a declared value the ${kind} already holds is no change.`;
|
|
459
|
-
}
|
|
460
|
-
const BACKUP_REPLICATION_KEYS = [
|
|
461
|
-
"AutomaticBackupReplicationRegion",
|
|
462
|
-
"AutomaticBackupReplicationKmsKeyId",
|
|
463
|
-
"AutomaticBackupReplicationRetentionPeriod"
|
|
464
|
-
];
|
|
465
|
-
const MALFORMED = Symbol("malformed");
|
|
466
|
-
function optionalString(value) {
|
|
467
|
-
if (value == null || value === "") return void 0;
|
|
468
|
-
return typeof value === "string" ? value : MALFORMED;
|
|
469
|
-
}
|
|
470
|
-
function optionalWholeNumber(value) {
|
|
471
|
-
if (value == null || value === "") return void 0;
|
|
472
|
-
const parsed = typeof value === "number" ? value : typeof value === "string" ? Number(value) : NaN;
|
|
473
|
-
return Number.isInteger(parsed) ? parsed : MALFORMED;
|
|
474
|
-
}
|
|
475
|
-
function backupReplicationOf(bag) {
|
|
476
|
-
const region = optionalString(bag["AutomaticBackupReplicationRegion"]);
|
|
477
|
-
const kmsKeyId = optionalString(bag["AutomaticBackupReplicationKmsKeyId"]);
|
|
478
|
-
const retention = optionalWholeNumber(bag["AutomaticBackupReplicationRetentionPeriod"]);
|
|
479
|
-
if (region === MALFORMED || kmsKeyId === MALFORMED || retention === MALFORMED) return "malformed";
|
|
480
|
-
return {
|
|
481
|
-
region,
|
|
482
|
-
kmsKeyId,
|
|
483
|
-
retention
|
|
484
|
-
};
|
|
485
|
-
}
|
|
486
|
-
function backupRetentionPeriodOf(bag) {
|
|
487
|
-
const value = optionalWholeNumber(bag["BackupRetentionPeriod"]);
|
|
488
|
-
return value === MALFORMED ? void 0 : value;
|
|
489
|
-
}
|
|
490
|
-
function backupReplicationPlan(properties, previousProperties, resourceType, logicalId, physicalId, stateBorne, warn) {
|
|
491
|
-
const none = {
|
|
492
|
-
stop: false,
|
|
493
|
-
start: void 0
|
|
494
|
-
};
|
|
495
|
-
const keys = [...BACKUP_REPLICATION_KEYS, "BackupRetentionPeriod"];
|
|
496
|
-
const desired = backupReplicationOf(properties);
|
|
497
|
-
const previous = backupReplicationOf(previousProperties);
|
|
498
|
-
if (desired === "malformed") {
|
|
499
|
-
if (keys.every((key) => isDeepStrictEqual(properties[key], previousProperties[key]))) return none;
|
|
500
|
-
throw markNonRetryable(new ProvisioningError(`${resourceType} ${logicalId}: AutomaticBackupReplicationRegion and AutomaticBackupReplicationKmsKeyId must be strings, and AutomaticBackupReplicationRetentionPeriod a whole number`, resourceType, logicalId, physicalId));
|
|
501
|
-
}
|
|
502
|
-
const misuse = desired.region === void 0 ? desired.kmsKeyId !== void 0 ? "You must specify the AutomaticBackupReplicationRegion parameter when setting the AutomaticBackupReplicationKmsKeyId parameter" : desired.retention !== void 0 ? "You must specify the AutomaticBackupReplicationRegion parameter when setting the AutomaticBackupReplicationRetentionPeriod parameter" : void 0 : backupRetentionPeriodOf(properties) === 0 ? "AutomaticBackupReplicationRegion cannot be specified when BackupRetentionPeriod is 0" : void 0;
|
|
503
|
-
if (misuse !== void 0) {
|
|
504
|
-
const message = `${resourceType} ${logicalId}: ${misuse} (as CloudFormation refuses it)`;
|
|
505
|
-
if (!stateBorne) throw markNonRetryable(new ProvisioningError(message, resourceType, logicalId, physicalId));
|
|
506
|
-
warn(`${message}; the restored properties declare it, so it is applied as declared`);
|
|
507
|
-
}
|
|
508
|
-
const start = desired.region === void 0 ? void 0 : {
|
|
509
|
-
...desired,
|
|
510
|
-
region: desired.region
|
|
511
|
-
};
|
|
512
|
-
if (previous === "malformed") return {
|
|
513
|
-
stop: true,
|
|
514
|
-
start
|
|
515
|
-
};
|
|
516
|
-
if (previous.region === void 0) return {
|
|
517
|
-
stop: false,
|
|
518
|
-
start
|
|
519
|
-
};
|
|
520
|
-
if (desired.region === void 0) return {
|
|
521
|
-
stop: true,
|
|
522
|
-
start: void 0
|
|
523
|
-
};
|
|
524
|
-
return desired.retention === void 0 && backupRetentionPeriodOf(properties) !== void 0 && backupRetentionPeriodOf(properties) !== backupRetentionPeriodOf(previousProperties) || desired.region !== previous.region || desired.kmsKeyId !== previous.kmsKeyId || desired.retention !== previous.retention ? {
|
|
525
|
-
stop: true,
|
|
526
|
-
start
|
|
527
|
-
} : none;
|
|
528
|
-
}
|
|
529
|
-
function liveBackupReplicationRegions(instance) {
|
|
530
|
-
const regions = [];
|
|
531
|
-
for (const replication of instance.DBInstanceAutomatedBackupsReplications ?? []) {
|
|
532
|
-
const region = replication.DBInstanceAutomatedBackupsArn?.split(":")[3];
|
|
533
|
-
if (region !== void 0 && region !== "" && !regions.includes(region)) regions.push(region);
|
|
534
|
-
}
|
|
535
|
-
return regions;
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
// src/provisioning/providers/rds/cluster-members.ts
|
|
539
|
-
const CLUSTER_REMOVED_PORT = /* @__PURE__ */ new Map([
|
|
540
|
-
["aurora-postgresql", 5432],
|
|
541
|
-
["aurora-mysql", 3306],
|
|
542
|
-
["mysql", 3306],
|
|
543
|
-
["postgres", 3306]
|
|
544
|
-
]);
|
|
545
|
-
function isClusterBusyRefusal(error) {
|
|
546
|
-
if (isModifyNotAvailableRefusal(error)) return true;
|
|
547
|
-
return error instanceof Error && error.name === "InvalidDBClusterStateFault" && /could not be modified\. Please try again/i.test(error.message);
|
|
548
|
-
}
|
|
549
|
-
function serverlessV2ScalingToSend(config) {
|
|
550
|
-
const seconds = numberOrUndefined(config.SecondsUntilAutoPause);
|
|
551
|
-
return {
|
|
552
|
-
MinCapacity: config.MinCapacity,
|
|
553
|
-
MaxCapacity: config.MaxCapacity,
|
|
554
|
-
...seconds !== void 0 && { SecondsUntilAutoPause: seconds }
|
|
555
|
-
};
|
|
556
|
-
}
|
|
557
|
-
const CLUSTER_BACKFILL_STRING_MEMBERS = [
|
|
558
|
-
"DBClusterParameterGroupName",
|
|
559
|
-
"PreferredBackupWindow",
|
|
560
|
-
"PreferredMaintenanceWindow",
|
|
561
|
-
"StorageType"
|
|
562
|
-
];
|
|
563
|
-
function clusterCreateBackfillMembers(properties) {
|
|
564
|
-
const members = {};
|
|
565
|
-
for (const key of CLUSTER_BACKFILL_STRING_MEMBERS) if (properties[key] != null) members[key] = properties[key];
|
|
566
|
-
if (properties["CopyTagsToSnapshot"] != null) members.CopyTagsToSnapshot = properties["CopyTagsToSnapshot"];
|
|
567
|
-
return members;
|
|
568
|
-
}
|
|
569
|
-
function clusterModifyBackfillMembers(properties, previousProperties, context) {
|
|
570
|
-
const changed = (key) => instanceValueChanged(properties, previousProperties, key, context);
|
|
571
|
-
const members = {};
|
|
572
|
-
for (const key of CLUSTER_BACKFILL_STRING_MEMBERS) if (changed(key)) members[key] = properties[key];
|
|
573
|
-
if (changed("CopyTagsToSnapshot")) members.CopyTagsToSnapshot = properties["CopyTagsToSnapshot"];
|
|
574
|
-
return members;
|
|
575
|
-
}
|
|
576
|
-
function clusterSizeValue(value) {
|
|
577
|
-
return retentionPeriodValue(value);
|
|
578
|
-
}
|
|
579
|
-
function malformedInstanceClass(value) {
|
|
580
|
-
return value != null && typeof value !== "string";
|
|
581
|
-
}
|
|
582
|
-
const usableInstanceClass = (value) => typeof value === "string";
|
|
583
|
-
const usableClusterSize = (value) => typeof clusterSizeValue(value) === "number";
|
|
584
|
-
function clusterCreateMultiAzMembers(properties) {
|
|
585
|
-
const members = {};
|
|
586
|
-
const instanceClass = properties["DBClusterInstanceClass"];
|
|
587
|
-
if (typeof instanceClass === "string") members.DBClusterInstanceClass = instanceClass;
|
|
588
|
-
const allocated = clusterSizeValue(properties["AllocatedStorage"]);
|
|
589
|
-
if (typeof allocated === "number") members.AllocatedStorage = allocated;
|
|
590
|
-
const iops = clusterSizeValue(properties["Iops"]);
|
|
591
|
-
if (typeof iops === "number") members.Iops = iops;
|
|
592
|
-
return members;
|
|
593
|
-
}
|
|
594
|
-
function clusterModifyMultiAzMembers(properties, previousProperties, context, onShrinkSkipped = () => {}) {
|
|
595
|
-
const changed = (key) => instanceValueChanged(properties, previousProperties, key, context);
|
|
596
|
-
const members = {};
|
|
597
|
-
const instanceClass = properties["DBClusterInstanceClass"];
|
|
598
|
-
if (typeof instanceClass === "string" && changed("DBClusterInstanceClass")) members.DBClusterInstanceClass = instanceClass;
|
|
599
|
-
const allocated = clusterSizeValue(properties["AllocatedStorage"]);
|
|
600
|
-
const previousAllocated = clusterSizeValue(previousProperties["AllocatedStorage"]);
|
|
601
|
-
const shrinkSkipped = (context?.replayingState === true || context?.desiredFromAwsReadback === true) && changed("AllocatedStorage") && typeof allocated === "number" && typeof previousAllocated === "number" && allocated < previousAllocated;
|
|
602
|
-
if (shrinkSkipped) onShrinkSkipped(allocated, previousAllocated);
|
|
603
|
-
if (changed("AllocatedStorage") && !shrinkSkipped || changed("Iops") || changed("StorageType")) {
|
|
604
|
-
if (shrinkSkipped) members.AllocatedStorage = previousAllocated;
|
|
605
|
-
else if (typeof allocated === "number") members.AllocatedStorage = allocated;
|
|
606
|
-
const iops = clusterSizeValue(properties["Iops"]);
|
|
607
|
-
if (typeof iops === "number") members.Iops = iops;
|
|
608
|
-
}
|
|
609
|
-
return members;
|
|
610
|
-
}
|
|
611
|
-
function multiAzSettledStatuses(fullWait) {
|
|
612
|
-
return new Set(fullWait ? ["available"] : ["available", "storage-optimization"]);
|
|
613
|
-
}
|
|
614
|
-
function multiAzReadState(cluster, sent, fullWait) {
|
|
615
|
-
if (sent.DBClusterInstanceClass === void 0 && sent.AllocatedStorage === void 0 && sent.Iops === void 0) return "applied";
|
|
616
|
-
if (!multiAzSettledStatuses(fullWait).has(cluster.Status ?? "")) return "pending";
|
|
617
|
-
if (sent.DBClusterInstanceClass !== void 0 && cluster.DBClusterInstanceClass !== sent.DBClusterInstanceClass) return "pending";
|
|
618
|
-
if (sent.AllocatedStorage === void 0 && sent.Iops === void 0) return "applied";
|
|
619
|
-
if (sent.AllocatedStorage !== void 0 && cluster.AllocatedStorage !== sent.AllocatedStorage) return "pending";
|
|
620
|
-
const pending = cluster.PendingModifiedValues;
|
|
621
|
-
if (pending?.AllocatedStorage !== void 0 || pending?.Iops !== void 0 || pending?.StorageType !== void 0) return "pending";
|
|
622
|
-
if (sent.Iops === void 0 || cluster.Iops === sent.Iops) return "applied";
|
|
623
|
-
return ["io1", "io2"].includes(cluster.StorageType?.toLowerCase() ?? "") ? "pending" : "iops-unconfirmed";
|
|
624
|
-
}
|
|
625
|
-
const MULTI_AZ_IOPS_CONFIRM_READS = 3;
|
|
626
|
-
function multiAzAppliedProbe(sent, fullWait) {
|
|
627
|
-
let unconfirmedReads = 0;
|
|
628
|
-
return (cluster) => {
|
|
629
|
-
const state = multiAzReadState(cluster, sent, fullWait);
|
|
630
|
-
if (state !== "iops-unconfirmed") {
|
|
631
|
-
unconfirmedReads = 0;
|
|
632
|
-
return state === "applied";
|
|
633
|
-
}
|
|
634
|
-
unconfirmedReads += 1;
|
|
635
|
-
return unconfirmedReads >= 3;
|
|
636
|
-
};
|
|
637
|
-
}
|
|
638
|
-
const CLUSTER_PERFORMANCE_INSIGHTS_MEMBERS = [
|
|
639
|
-
["PerformanceInsightsEnabled", "EnablePerformanceInsights"],
|
|
640
|
-
["PerformanceInsightsKmsKeyId", "PerformanceInsightsKMSKeyId"],
|
|
641
|
-
["PerformanceInsightsRetentionPeriod", "PerformanceInsightsRetentionPeriod"]
|
|
642
|
-
];
|
|
643
|
-
function clusterPerformanceInsightsMembers(properties) {
|
|
644
|
-
const members = {};
|
|
645
|
-
if (properties["PerformanceInsightsEnabled"] != null) members.EnablePerformanceInsights = properties["PerformanceInsightsEnabled"];
|
|
646
|
-
if (properties["PerformanceInsightsKmsKeyId"] != null) members.PerformanceInsightsKMSKeyId = properties["PerformanceInsightsKmsKeyId"];
|
|
647
|
-
const retention = retentionPeriodValue(properties["PerformanceInsightsRetentionPeriod"]);
|
|
648
|
-
if (typeof retention === "number") members.PerformanceInsightsRetentionPeriod = retention;
|
|
649
|
-
return members;
|
|
650
|
-
}
|
|
651
|
-
function clusterCreateScalarMembers(properties) {
|
|
652
|
-
return {
|
|
653
|
-
...properties["AutoMinorVersionUpgrade"] != null && { AutoMinorVersionUpgrade: properties["AutoMinorVersionUpgrade"] },
|
|
654
|
-
...properties["NetworkType"] != null && { NetworkType: properties["NetworkType"] },
|
|
655
|
-
...clusterPerformanceInsightsMembers(properties),
|
|
656
|
-
...properties["DatabaseInsightsMode"] != null && { DatabaseInsightsMode: properties["DatabaseInsightsMode"] },
|
|
657
|
-
...engineLifecycleSupportOf(properties) !== void 0 && { EngineLifecycleSupport: engineLifecycleSupportOf(properties) },
|
|
658
|
-
...properties["MasterUserAuthenticationType"] != null && { MasterUserAuthenticationType: properties["MasterUserAuthenticationType"] },
|
|
659
|
-
...typeof backtrackWindowValue(properties["BacktrackWindow"]) === "number" && { BacktrackWindow: backtrackWindowValue(properties["BacktrackWindow"]) },
|
|
660
|
-
...typeof localWriteForwardingFlag(properties["EnableLocalWriteForwarding"]) === "boolean" && { EnableLocalWriteForwarding: localWriteForwardingFlag(properties["EnableLocalWriteForwarding"]) },
|
|
661
|
-
...typeof globalWriteForwardingFlag(properties["EnableGlobalWriteForwarding"]) === "boolean" && { EnableGlobalWriteForwarding: globalWriteForwardingFlag(properties["EnableGlobalWriteForwarding"]) }
|
|
662
|
-
};
|
|
663
|
-
}
|
|
664
|
-
function clusterModifyScalarMembers(properties, previousProperties, context) {
|
|
665
|
-
const changed = (key) => instanceValueChanged(properties, previousProperties, key, context);
|
|
666
|
-
const members = {};
|
|
667
|
-
if (changed("AutoMinorVersionUpgrade")) members.AutoMinorVersionUpgrade = properties["AutoMinorVersionUpgrade"];
|
|
668
|
-
if (changed("NetworkType")) members.NetworkType = properties["NetworkType"];
|
|
669
|
-
const insightsModeChanged = changed("DatabaseInsightsMode");
|
|
670
|
-
if (insightsModeChanged || CLUSTER_PERFORMANCE_INSIGHTS_MEMBERS.some(([key]) => changed(key))) Object.assign(members, clusterPerformanceInsightsMembers(properties));
|
|
671
|
-
if (insightsModeChanged) members.DatabaseInsightsMode = properties["DatabaseInsightsMode"];
|
|
672
|
-
const backtrackWindow = backtrackWindowValue(properties["BacktrackWindow"]);
|
|
673
|
-
if (typeof backtrackWindow === "number" && changed("BacktrackWindow")) members.BacktrackWindow = backtrackWindow;
|
|
674
|
-
const localWriteForwarding = localWriteForwardingToSend(properties, previousProperties, context);
|
|
675
|
-
if (typeof localWriteForwarding === "boolean") members.EnableLocalWriteForwarding = localWriteForwarding;
|
|
676
|
-
const globalWriteForwarding = globalWriteForwardingFlag(properties["EnableGlobalWriteForwarding"]);
|
|
677
|
-
if (typeof globalWriteForwarding === "boolean" && changed("EnableGlobalWriteForwarding")) members.EnableGlobalWriteForwarding = globalWriteForwarding;
|
|
678
|
-
return members;
|
|
679
|
-
}
|
|
680
|
-
function backtrackWindowValue(value) {
|
|
681
|
-
return retentionPeriodValue(value);
|
|
682
|
-
}
|
|
683
|
-
function localWriteForwardingFlag(value) {
|
|
684
|
-
return httpEndpointFlag(value);
|
|
685
|
-
}
|
|
686
|
-
function localWriteForwardingToSend(properties, previousProperties, context) {
|
|
687
|
-
const desired = localWriteForwardingFlag(properties["EnableLocalWriteForwarding"]);
|
|
688
|
-
const previousFlag = localWriteForwardingFlag(previousProperties["EnableLocalWriteForwarding"]);
|
|
689
|
-
const previous = typeof previousFlag === "boolean" ? previousFlag : void 0;
|
|
690
|
-
if (desired === void 0) return previous === true ? false : void 0;
|
|
691
|
-
if (desired === "malformed") return void 0;
|
|
692
|
-
if (previous === void 0 && desired === false) return void 0;
|
|
693
|
-
if (!instanceValueChanged(properties, previousProperties, "EnableLocalWriteForwarding", context)) return;
|
|
694
|
-
return desired && context?.desiredFromAwsReadback === true && context.declaredTrueProperties?.has("EnableLocalWriteForwarding") !== true ? "withheld" : desired;
|
|
695
|
-
}
|
|
696
|
-
function localWriteForwardingApplied(cluster, enabled) {
|
|
697
|
-
const status = cluster.LocalWriteForwardingStatus;
|
|
698
|
-
if (status === void 0) return true;
|
|
699
|
-
if (status === "enabling" || status === "disabling") return false;
|
|
700
|
-
return (status === "requested" || status === "enabled") === enabled;
|
|
701
|
-
}
|
|
702
|
-
function globalWriteForwardingFlag(value) {
|
|
703
|
-
return httpEndpointFlag(value);
|
|
704
|
-
}
|
|
705
|
-
function globalWriteForwardingApplied(cluster) {
|
|
706
|
-
if (cluster.GlobalWriteForwardingRequested !== true) return true;
|
|
707
|
-
const status = cluster.GlobalWriteForwardingStatus;
|
|
708
|
-
return status !== "enabling" && status !== "disabling";
|
|
709
|
-
}
|
|
710
|
-
function httpEndpointFlag(value) {
|
|
711
|
-
if (value == null) return void 0;
|
|
712
|
-
if (value === true || value === "true") return true;
|
|
713
|
-
if (value === false || value === "false") return false;
|
|
714
|
-
return "malformed";
|
|
715
|
-
}
|
|
716
|
-
const CLUSTER_BOOLEAN_SCALARS = [
|
|
717
|
-
"AutoMinorVersionUpgrade",
|
|
718
|
-
"PerformanceInsightsEnabled",
|
|
719
|
-
"EnableHttpEndpoint",
|
|
720
|
-
"EnableLocalWriteForwarding"
|
|
721
|
-
];
|
|
722
|
-
function retentionPeriodValue(value) {
|
|
723
|
-
if (value == null) return void 0;
|
|
724
|
-
const parsed = typeof value === "number" ? value : typeof value === "string" && /^\d+$/.test(value.trim()) ? Number(value) : NaN;
|
|
725
|
-
return Number.isInteger(parsed) && parsed >= 0 ? parsed : "malformed";
|
|
726
|
-
}
|
|
727
|
-
function clusterHttpEndpointAction(properties, previousProperties, resourceType, logicalId, physicalId, context) {
|
|
728
|
-
const desired = httpEndpointFlag(properties["EnableHttpEndpoint"]);
|
|
729
|
-
if (desired === "malformed") {
|
|
730
|
-
if (context?.replayingState === true || context?.desiredFromAwsReadback === true) return "skip";
|
|
731
|
-
throw markNonRetryable(new ProvisioningError(`${resourceType} ${logicalId}: EnableHttpEndpoint must be true or false`, resourceType, logicalId, physicalId));
|
|
732
|
-
}
|
|
733
|
-
const engine = properties["Engine"];
|
|
734
|
-
if (typeof engine !== "string") return void 0;
|
|
735
|
-
if (!["aurora-mysql", "aurora-postgresql"].includes(engine.toLowerCase())) return void 0;
|
|
736
|
-
const recorded = httpEndpointFlag(previousProperties["EnableHttpEndpoint"]);
|
|
737
|
-
if (desired === (recorded === "malformed" ? void 0 : recorded)) return void 0;
|
|
738
|
-
if (desired !== true) return "disable";
|
|
739
|
-
return context?.desiredFromAwsReadback === true && context.declaredTrueProperties?.has("EnableHttpEndpoint") !== true ? "withheld" : "enable";
|
|
740
|
-
}
|
|
741
|
-
function withPreviousValues(properties, previousProperties, skipped) {
|
|
742
|
-
const out = { ...properties };
|
|
743
|
-
for (const [key, usable] of skipped) {
|
|
744
|
-
delete out[key];
|
|
745
|
-
const previous = previousProperties[key];
|
|
746
|
-
if (previous != null && usable(previous)) out[key] = previous;
|
|
747
|
-
}
|
|
748
|
-
return out;
|
|
749
|
-
}
|
|
750
|
-
const usableHttpEndpoint = (value) => typeof httpEndpointFlag(value) === "boolean";
|
|
751
|
-
const usableRetentionPeriod = (value) => typeof retentionPeriodValue(value) === "number";
|
|
752
|
-
const usableBacktrackWindow = (value) => typeof backtrackWindowValue(value) === "number";
|
|
753
|
-
const usableLocalWriteForwarding = (value) => typeof localWriteForwardingFlag(value) === "boolean";
|
|
754
|
-
const usableGlobalWriteForwarding = (value) => typeof globalWriteForwardingFlag(value) === "boolean";
|
|
755
|
-
const usableAvailabilityZones = (value) => value == null || Array.isArray(value) && value.every((zone) => typeof zone === "string" && zone.trim() !== "");
|
|
756
|
-
function clusterEngineVersionChanged(properties, previousProperties, context) {
|
|
757
|
-
if (context?.replayingState === true) return false;
|
|
758
|
-
return instanceValueChanged(properties, previousProperties, "EngineVersion", context);
|
|
759
|
-
}
|
|
760
|
-
function clusterInstanceParameterGroupToSend(properties, previousProperties, engineVersionChanged, context) {
|
|
761
|
-
const desired = properties["DBInstanceParameterGroupName"];
|
|
762
|
-
if (!engineVersionChanged || typeof desired !== "string") return void 0;
|
|
763
|
-
return instanceValueChanged(properties, previousProperties, "DBInstanceParameterGroupName", context) ? desired : void 0;
|
|
764
|
-
}
|
|
765
|
-
const SECURITY_GROUP_CHANGE_MEMBER_STATUSES = /* @__PURE__ */ new Set(["modifying"]);
|
|
766
|
-
const PORT_CHANGE_MEMBER_STATUSES = /* @__PURE__ */ new Set(["modifying", "rebooting"]);
|
|
767
|
-
function clusterPortToSend(properties, previousProperties) {
|
|
768
|
-
if (properties["Port"] != null) return Number(properties["Port"]);
|
|
769
|
-
if (previousProperties["Port"] == null) return void 0;
|
|
770
|
-
const engine = properties["Engine"] ?? previousProperties["Engine"];
|
|
771
|
-
const reset = typeof engine === "string" ? CLUSTER_REMOVED_PORT.get(engine.toLowerCase()) : void 0;
|
|
772
|
-
return reset === Number(previousProperties["Port"]) ? void 0 : reset;
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
// src/provisioning/providers/rds/express-writer.ts
|
|
776
|
-
const EXPRESS_WRITER_RESOURCE_ID_KEY = "cdkd:ExpressWriterResourceId";
|
|
777
|
-
var ExpressWriterRefusal = class extends Error {
|
|
778
|
-
constructor(message) {
|
|
779
|
-
super(message);
|
|
780
|
-
this.name = "ExpressWriterRefusal";
|
|
781
|
-
}
|
|
782
|
-
};
|
|
783
|
-
function sameDbIdentifier(a, b) {
|
|
784
|
-
return a !== void 0 && a.toLowerCase() === b.toLowerCase();
|
|
785
|
-
}
|
|
786
|
-
function expressWriterIdentifier(dbClusterIdentifier) {
|
|
787
|
-
return `${dbClusterIdentifier}-instance-1`;
|
|
788
|
-
}
|
|
789
|
-
function expressConfigurationFlag(value) {
|
|
790
|
-
return httpEndpointFlag(value);
|
|
791
|
-
}
|
|
792
|
-
function recordedExpressWriterId(attributes) {
|
|
793
|
-
const value = attributes?.[EXPRESS_WRITER_RESOURCE_ID_KEY];
|
|
794
|
-
return typeof value === "string" && value !== "" ? value : void 0;
|
|
795
|
-
}
|
|
796
|
-
async function readExpressWriterId(dbClusterIdentifier, mask) {
|
|
797
|
-
try {
|
|
798
|
-
const writer = await this.describeDBInstance(expressWriterIdentifier(dbClusterIdentifier));
|
|
799
|
-
return sameDbIdentifier(writer?.DBClusterIdentifier, dbClusterIdentifier) ? writer?.DbiResourceId : void 0;
|
|
800
|
-
} catch (error) {
|
|
801
|
-
this.logger.debug(mask(safeMsg`Could not read the express writer of DBCluster ${dbClusterIdentifier}: ${error instanceof Error ? error.name : "unknown error"}`));
|
|
802
|
-
return;
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
async function isOwnExpressWriter(dbClusterIdentifier) {
|
|
806
|
-
try {
|
|
807
|
-
return sameDbIdentifier((await this.describeDBInstance(expressWriterIdentifier(dbClusterIdentifier)))?.DBClusterIdentifier, dbClusterIdentifier);
|
|
808
|
-
} catch {
|
|
809
|
-
return false;
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
async function deleteExpressWriter(logicalId, physicalId, cluster, recordedWriterId, protectionFlippedOff, mask) {
|
|
813
|
-
if (cluster === void 0) return false;
|
|
814
|
-
if (cluster.DeletionProtection === true && !protectionFlippedOff) return false;
|
|
815
|
-
const writerName = expressWriterIdentifier(physicalId);
|
|
816
|
-
const members = cluster.DBClusterMembers ?? [];
|
|
817
|
-
if (!members.some((member) => sameDbIdentifier(member.DBInstanceIdentifier, writerName))) return false;
|
|
818
|
-
const refuse = (detail) => {
|
|
819
|
-
throw new ExpressWriterRefusal(detail);
|
|
820
|
-
};
|
|
821
|
-
const others = [];
|
|
822
|
-
for (const member of members) {
|
|
823
|
-
const name = member.DBInstanceIdentifier;
|
|
824
|
-
if (name === void 0 || sameDbIdentifier(name, writerName)) continue;
|
|
825
|
-
const instance = await this.describeDBInstance(name).catch((error) => {
|
|
826
|
-
if (this.isNotFoundError(error, "DBInstanceNotFoundFault")) return void 0;
|
|
827
|
-
throw error;
|
|
828
|
-
});
|
|
829
|
-
if (instance !== void 0 && instance.DBInstanceStatus !== "deleting") others.push(name);
|
|
830
|
-
}
|
|
831
|
-
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`);
|
|
832
|
-
if (recordedWriterId !== void 0) {
|
|
833
|
-
const writer = await this.describeDBInstance(writerName).catch((error) => {
|
|
834
|
-
if (this.isNotFoundError(error, "DBInstanceNotFoundFault")) return void 0;
|
|
835
|
-
throw error;
|
|
836
|
-
});
|
|
837
|
-
if (writer === void 0) return false;
|
|
838
|
-
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`);
|
|
839
|
-
}
|
|
840
|
-
try {
|
|
841
|
-
await this.getClient().send(new DeleteDBInstanceCommand({
|
|
842
|
-
DBInstanceIdentifier: writerName,
|
|
843
|
-
SkipFinalSnapshot: true
|
|
844
|
-
}));
|
|
845
|
-
} catch (error) {
|
|
846
|
-
if (this.isNotFoundError(error, "DBInstanceNotFoundFault")) return false;
|
|
847
|
-
if (error instanceof Error && error.name === "InvalidDBInstanceStateFault") {
|
|
848
|
-
if ((await this.describeDBInstance(writerName).catch(() => void 0))?.DBInstanceStatus === "deleting") return true;
|
|
849
|
-
}
|
|
850
|
-
throw error;
|
|
851
|
-
}
|
|
852
|
-
this.logger.debug(mask(safeMsg`Deleted the express writer ${writerName} of DBCluster ${logicalId}`));
|
|
853
|
-
return true;
|
|
854
|
-
}
|
|
855
|
-
|
|
856
201
|
// src/provisioning/providers/rds/cluster-restore.ts
|
|
857
202
|
function restoreCallName(restore) {
|
|
858
203
|
if (restore === void 0) return "CreateDBCluster";
|
|
@@ -1413,14 +758,7 @@ async function createDBCluster(logicalId, resourceType, properties, mask, replay
|
|
|
1413
758
|
const expressWriterId = express ? await readExpressWriterId.call(this, dbClusterIdentifier, maskerOrIdentity(mask)) : void 0;
|
|
1414
759
|
return {
|
|
1415
760
|
physicalId: dbClusterIdentifier,
|
|
1416
|
-
attributes:
|
|
1417
|
-
"Endpoint.Address": described?.Endpoint,
|
|
1418
|
-
"Endpoint.Port": stringifyIfAssigned(described?.Port),
|
|
1419
|
-
"ReadEndpoint.Address": described?.ReaderEndpoint,
|
|
1420
|
-
Arn: described?.DBClusterArn,
|
|
1421
|
-
DBClusterResourceId: described?.DbClusterResourceId,
|
|
1422
|
-
[EXPRESS_WRITER_RESOURCE_ID_KEY]: expressWriterId
|
|
1423
|
-
}),
|
|
761
|
+
attributes: dbClusterAttributes(described, { expressWriterId }),
|
|
1424
762
|
...effectiveProperties !== void 0 && { effectiveProperties }
|
|
1425
763
|
};
|
|
1426
764
|
} catch (innerError) {
|
|
@@ -1701,13 +1039,9 @@ async function updateDBCluster(logicalId, physicalId, resourceType, properties,
|
|
|
1701
1039
|
return {
|
|
1702
1040
|
physicalId,
|
|
1703
1041
|
wasReplaced: false,
|
|
1704
|
-
attributes:
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
"ReadEndpoint.Address": described?.ReaderEndpoint,
|
|
1708
|
-
Arn: described?.DBClusterArn,
|
|
1709
|
-
DBClusterResourceId: described?.DbClusterResourceId,
|
|
1710
|
-
[EXPRESS_WRITER_RESOURCE_ID_KEY]: recordedExpressWriterId(context?.recordedAttributes)
|
|
1042
|
+
attributes: dbClusterAttributes(described, {
|
|
1043
|
+
port: noWait && portChanged ? portToSend : void 0,
|
|
1044
|
+
expressWriterId: recordedExpressWriterId(context?.recordedAttributes)
|
|
1711
1045
|
}),
|
|
1712
1046
|
...skippedKeys.length > 0 && { effectiveProperties: withPreviousValues(properties, previousProperties, skippedKeys) }
|
|
1713
1047
|
};
|
|
@@ -2930,7 +2264,8 @@ async function createDBInstance(logicalId, resourceType, properties, mask, repla
|
|
|
2930
2264
|
const modifyAfterCreate = (replicaSource !== void 0 || restored) && replicaNeedsModifyAfterCreate(properties, followUpEngine, instance.Engine);
|
|
2931
2265
|
const unappliedFollowUp = modifyAfterCreate || replicaSource === void 0 && !restored ? [] : followUpOnlyKeys(properties, pointInTime !== void 0 ? "pitr" : snapshotRestore !== void 0 ? "restore" : "replica");
|
|
2932
2266
|
if (unappliedFollowUp.length > 0) this.logger.warn(safeMsg`DBInstance ${logicalId}: ${unappliedFollowUp.join(", ")} not applied: only CloudFormation's after-create ModifyDBInstance carries them, and nothing else declared calls for it, as in CloudFormation.`);
|
|
2933
|
-
|
|
2267
|
+
const waited = process.env["CDKD_NO_WAIT"] !== "true" || modifyAfterCreate || restored;
|
|
2268
|
+
if (waited) await this.waitForInstanceAvailable(logicalId, dbInstanceIdentifier, restored ? restoreWaitMs() : void 0, restored ? "being restored" : void 0);
|
|
2934
2269
|
if (modifyAfterCreate) await modifyReplicaAfterCreate.call(this, logicalId, dbInstanceIdentifier, properties, followUpEngine);
|
|
2935
2270
|
try {
|
|
2936
2271
|
if (roles !== "skipped") await this.applyAssociatedRoles("instance", logicalId, dbInstanceIdentifier, roles, [], mask, void 0);
|
|
@@ -2942,7 +2277,7 @@ async function createDBInstance(logicalId, resourceType, properties, mask, repla
|
|
|
2942
2277
|
const described = await this.describeDBInstance(dbInstanceIdentifier);
|
|
2943
2278
|
return {
|
|
2944
2279
|
physicalId: dbInstanceIdentifier,
|
|
2945
|
-
attributes: dbInstanceAttributes(described),
|
|
2280
|
+
attributes: dbInstanceAttributes(described, { settled: waited }),
|
|
2946
2281
|
...roles === "skipped" && { effectiveProperties: Object.fromEntries(Object.entries(properties).filter(([key]) => key !== "AssociatedRoles")) }
|
|
2947
2282
|
};
|
|
2948
2283
|
} catch (error) {
|
|
@@ -3164,7 +2499,7 @@ async function updateDBInstance(logicalId, physicalId, resourceType, properties,
|
|
|
3164
2499
|
return {
|
|
3165
2500
|
physicalId,
|
|
3166
2501
|
wasReplaced: false,
|
|
3167
|
-
attributes: dbInstanceAttributes(described),
|
|
2502
|
+
attributes: dbInstanceAttributes(described, { settled: process.env["CDKD_NO_WAIT"] !== "true" }),
|
|
3168
2503
|
...effectiveProperties !== void 0 && { effectiveProperties }
|
|
3169
2504
|
};
|
|
3170
2505
|
} catch (error) {
|
|
@@ -3916,7 +3251,7 @@ async function importDBInstance(input) {
|
|
|
3916
3251
|
const described = (await this.getClient().send(new DescribeDBInstancesCommand({ DBInstanceIdentifier: explicit }))).DBInstances?.[0];
|
|
3917
3252
|
return {
|
|
3918
3253
|
physicalId: explicit,
|
|
3919
|
-
attributes: dbInstanceAttributes(described)
|
|
3254
|
+
attributes: dbInstanceAttributes(described, { settled: true })
|
|
3920
3255
|
};
|
|
3921
3256
|
} catch (err) {
|
|
3922
3257
|
if (err.name === "DBInstanceNotFoundFault") return null;
|
|
@@ -3930,13 +3265,7 @@ async function importDBCluster(input) {
|
|
|
3930
3265
|
const described = (await this.getClient().send(new DescribeDBClustersCommand({ DBClusterIdentifier: explicit }))).DBClusters?.[0];
|
|
3931
3266
|
return {
|
|
3932
3267
|
physicalId: explicit,
|
|
3933
|
-
attributes:
|
|
3934
|
-
"Endpoint.Address": described?.Endpoint,
|
|
3935
|
-
"Endpoint.Port": stringifyIfAssigned(described?.Port),
|
|
3936
|
-
"ReadEndpoint.Address": described?.ReaderEndpoint,
|
|
3937
|
-
Arn: described?.DBClusterArn,
|
|
3938
|
-
DBClusterResourceId: described?.DbClusterResourceId
|
|
3939
|
-
})
|
|
3268
|
+
attributes: dbClusterAttributes(described)
|
|
3940
3269
|
};
|
|
3941
3270
|
} catch (err) {
|
|
3942
3271
|
if (err.name === "DBClusterNotFoundFault") return null;
|
|
@@ -4293,4 +3622,4 @@ var RDSProvider = class extends RDSProviderBase {
|
|
|
4293
3622
|
};
|
|
4294
3623
|
|
|
4295
3624
|
export { RDSProvider };
|
|
4296
|
-
//# sourceMappingURL=rds-provider-
|
|
3625
|
+
//# sourceMappingURL=rds-provider-CbmVLapS.js.map
|