@cdkd/cli 0.347.0 → 0.349.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.
Files changed (58) hide show
  1. package/dist/{ambient-client-defaults-BV_xDm4m.js → ambient-client-defaults-7acjxfyN.js} +3 -3
  2. package/dist/{ambient-client-defaults-BV_xDm4m.js.map → ambient-client-defaults-7acjxfyN.js.map} +1 -1
  3. package/dist/{asg-provider-fpr4ZEfp.js → asg-provider-Dvy_jqxt.js} +5 -5
  4. package/dist/{asg-provider-fpr4ZEfp.js.map → asg-provider-Dvy_jqxt.js.map} +1 -1
  5. package/dist/aws-partition-DA0r2sr-.js +58 -0
  6. package/dist/aws-partition-DA0r2sr-.js.map +1 -0
  7. package/dist/cli.js +2 -2
  8. package/dist/custom-resource-runtime-Dwnnj7bg.js +1104 -0
  9. package/dist/custom-resource-runtime-Dwnnj7bg.js.map +1 -0
  10. package/dist/{db-instance-modify-retry-BbBT68Qa.js → db-instance-modify-retry-pFWx2ED5.js} +4 -4
  11. package/dist/{db-instance-modify-retry-BbBT68Qa.js.map → db-instance-modify-retry-pFWx2ED5.js.map} +1 -1
  12. package/dist/delete-started-Co5Gt1jH.js +169 -0
  13. package/dist/delete-started-Co5Gt1jH.js.map +1 -0
  14. package/dist/{deploy-engine-DMWjQ_C2.js → deploy-engine-DeYSJno7.js} +720 -11916
  15. package/dist/deploy-engine-DeYSJno7.js.map +1 -0
  16. package/dist/diff-calculator-CRkRB1Dg.js +4959 -0
  17. package/dist/diff-calculator-CRkRB1Dg.js.map +1 -0
  18. package/dist/ec2-termination-protection-BM1Zt3Fn.js +1277 -0
  19. package/dist/ec2-termination-protection-BM1Zt3Fn.js.map +1 -0
  20. package/dist/{ecr-uri-C2FWGsrX.js → ecr-uri-C3_6QVgR.js} +3 -3
  21. package/dist/{ecr-uri-C2FWGsrX.js.map → ecr-uri-C3_6QVgR.js.map} +1 -1
  22. package/dist/expected-bucket-owner-CGoY_YS8.js +88 -0
  23. package/dist/expected-bucket-owner-CGoY_YS8.js.map +1 -0
  24. package/dist/{iam-role-provider-70-NzlFV.js → iam-role-provider-BaN9MMWs.js} +6 -5
  25. package/dist/iam-role-provider-BaN9MMWs.js.map +1 -0
  26. package/dist/image-plan-D4I8-FhR.js +1940 -0
  27. package/dist/image-plan-D4I8-FhR.js.map +1 -0
  28. package/dist/index.d.ts +3 -1
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +5 -4
  31. package/dist/{aws-failure-text-jomzO3aT.js → logger-DmQRya0S.js} +148 -59
  32. package/dist/logger-DmQRya0S.js.map +1 -0
  33. package/dist/{neptune-provider-CX4BHKjZ.js → neptune-provider-BYgFNrtZ.js} +6 -6
  34. package/dist/{neptune-provider-CX4BHKjZ.js.map → neptune-provider-BYgFNrtZ.js.map} +1 -1
  35. package/dist/{program-BU5T28eB.js → program-BBGm88gl.js} +1031 -2003
  36. package/dist/program-BBGm88gl.js.map +1 -0
  37. package/dist/{provider-classes-cw32hLq9.js → provider-classes-CRCHL04N.js} +44 -28
  38. package/dist/provider-classes-CRCHL04N.js.map +1 -0
  39. package/dist/{rds-provider-CxSVX1d7.js → rds-provider-DKZjtd50.js} +110 -70
  40. package/dist/rds-provider-DKZjtd50.js.map +1 -0
  41. package/dist/{read-replica-DtD9IDko.js → read-replica-C5e4xpYi.js} +78 -24
  42. package/dist/read-replica-C5e4xpYi.js.map +1 -0
  43. package/dist/replacement-rules-01_01yDU.js +4937 -0
  44. package/dist/replacement-rules-01_01yDU.js.map +1 -0
  45. package/dist/resource-deadline-TfDpwRQ_.js +423 -0
  46. package/dist/resource-deadline-TfDpwRQ_.js.map +1 -0
  47. package/dist/{update-removal-CpGaCv-d.js → update-removal-D-FspP88.js} +3 -3
  48. package/dist/{update-removal-CpGaCv-d.js.map → update-removal-D-FspP88.js.map} +1 -1
  49. package/dist/{version-Bx-Ox9xU.js → version-DamSnfI_.js} +2 -2
  50. package/dist/{version-Bx-Ox9xU.js.map → version-DamSnfI_.js.map} +1 -1
  51. package/package.json +4 -2
  52. package/dist/aws-failure-text-jomzO3aT.js.map +0 -1
  53. package/dist/deploy-engine-DMWjQ_C2.js.map +0 -1
  54. package/dist/iam-role-provider-70-NzlFV.js.map +0 -1
  55. package/dist/program-BU5T28eB.js.map +0 -1
  56. package/dist/provider-classes-cw32hLq9.js.map +0 -1
  57. package/dist/rds-provider-CxSVX1d7.js.map +0 -1
  58. package/dist/read-replica-DtD9IDko.js.map +0 -1
@@ -1,10 +1,12 @@
1
- import { S as coerceCfnBoolean, b as generatedNameFor, n as describeAwsFailure, s as getLogger, ut as safeMsg } from "./aws-failure-text-jomzO3aT.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-BV_xDm4m.js";
3
- 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-CpGaCv-d.js";
1
+ import { E as coerceCfnBoolean, mt as safeMsg, n as getLogger, u as describeAwsFailure, w as generatedNameFor } from "./logger-DmQRya0S.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-7acjxfyN.js";
3
+ 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-D-FspP88.js";
4
4
  import { f as ambientRegion } from "./aws-client-defaults-DAebi99J.js";
5
- import { El as dynamicReferenceTokens, Ic as dbInstanceEngineChangeIsInPlace, Na as slowCcOperationTimeoutMs, Ql as acceptedCreateOnlyDropsOf, _i as pointInTimeTemplateRefusal, aa as stringifyIfAssigned, ca as planTagDiff, fa as tagPlanWarning, gi as declaresInstancePointInTime, hi as POINT_IN_TIME_NO_SOURCE_REASON, ia as definedAttributes, jt as enclosingDeadlineRemainingMs, ma as markDeleteStarted, ua as refuseMalformedDesiredTags, vi as refuseRestoreFromItself, yi as parseZonedTimestamp } from "./deploy-engine-DMWjQ_C2.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-BbBT68Qa.js";
7
- import { a as positive, c as refuseUnknownSourceRegion, d as replicaModifyAfterCreateInput, f as replicaNeedsModifyAfterCreate, g as withPreviousReplicaSource, h as sameReplicaSource, i as ownScopeOf, l as replicaCreateInput, m as replicaSourceOf, n as describeReplicaSource, p as replicaSourceChange, r as isLiveReadReplica, s as refuseMalformedReplicaSource, t as declared, u as replicaEngine } from "./read-replica-DtD9IDko.js";
5
+ import { a as acceptedCreateOnlyDropsOf, i as slowCcOperationTimeoutMs, r as markDeleteStarted } from "./delete-started-Co5Gt1jH.js";
6
+ import { a as POINT_IN_TIME_NO_SOURCE_REASON, c as refuseRestoreFromItself, d as stringifyIfAssigned, g as refuseMalformedDesiredTags, l as parseZonedTimestamp, m as planTagDiff, n as enclosingDeadlineRemainingMs, o as declaresInstancePointInTime, s as pointInTimeTemplateRefusal, u as definedAttributes, v as tagPlanWarning } from "./resource-deadline-TfDpwRQ_.js";
7
+ 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-pFWx2ED5.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-C5e4xpYi.js";
9
+ import { Nt as dynamicReferenceTokens, r as dbInstanceEngineChangeIsInPlace } from "./replacement-rules-01_01yDU.js";
8
10
  import { DescribeSecurityGroupsCommand, EC2Client } from "@aws-sdk/client-ec2";
9
11
  import { isDeepStrictEqual } from "node:util";
10
12
  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";
@@ -2772,7 +2774,8 @@ function unusedPointInTimeRestoreKeys(properties) {
2772
2774
  "AdditionalStorageVolumes",
2773
2775
  "DBClusterIdentifier",
2774
2776
  "PromotionTier",
2775
- "MasterUserAuthenticationType"
2777
+ "MasterUserAuthenticationType",
2778
+ "SourceDBClusterIdentifier"
2776
2779
  ].filter((key) => {
2777
2780
  const value = properties[key];
2778
2781
  if (value == null || value === "") return false;
@@ -2811,9 +2814,10 @@ async function createDBInstance(logicalId, resourceType, properties, mask, repla
2811
2814
  refuseMalformedReplicaSource(properties, resourceType, logicalId);
2812
2815
  refuseUnknownSourceRegion(properties, resourceType, logicalId, replaying, (message) => this.logger.warn(message));
2813
2816
  const pointInTime = readInstancePointInTimeRestore(properties, resourceType, logicalId);
2814
- const replicaSource = pointInTime === void 0 ? replicaSourceOf(properties) : void 0;
2817
+ if (pointInTime === void 0) refuseBothReplicaSources(properties, resourceType, logicalId);
2818
+ const replicaSource = pointInTime === void 0 ? declaredReplicaSource(properties) : void 0;
2815
2819
  const snapshotRestore = pointInTime === void 0 && replicaSource === void 0 ? readInstanceSnapshotRestore(properties, resourceType, logicalId) : void 0;
2816
- if (snapshotRestore === void 0 && declaredSnapshotKeys(properties).length > 0) this.logger.warn(pointInTime !== void 0 ? safeMsg`DBInstance ${logicalId}: ${declaredSnapshotKeys(properties).join(", ")} not applied: a point-in-time key makes the create a restore to a point in time, which reads no snapshot, as in CloudFormation.` : safeMsg`DBInstance ${logicalId}: ${declaredSnapshotKeys(properties).join(", ")} not applied: SourceDBInstanceIdentifier makes the instance a read replica, which restores no snapshot, as in CloudFormation.`);
2820
+ if (snapshotRestore === void 0 && declaredSnapshotKeys(properties).length > 0) this.logger.warn(pointInTime !== void 0 ? safeMsg`DBInstance ${logicalId}: ${declaredSnapshotKeys(properties).join(", ")} not applied: a point-in-time key makes the create a restore to a point in time, which reads no snapshot, as in CloudFormation.` : safeMsg`DBInstance ${logicalId}: ${declaredSnapshotKeys(properties).join(", ")} not applied: ${replicaSource?.key ?? "SourceDBInstanceIdentifier"} makes the instance a read replica, which restores no snapshot, as in CloudFormation.`);
2817
2821
  const dbInstanceIdentifier = properties["DBInstanceIdentifier"] || generatedNameFor("AWS::RDS::DBInstance", logicalId);
2818
2822
  if (snapshotRestore !== void 0 || pointInTime !== void 0) refuseRestoreFromItself(resourceType, properties, dbInstanceIdentifier, logicalId, {});
2819
2823
  let instanceCreated = false;
@@ -2970,14 +2974,14 @@ async function createReadReplicaWhenSourceAvailable(logicalId, source, command)
2970
2974
  send: async () => {
2971
2975
  response = await this.getCreateClient().send(command);
2972
2976
  },
2973
- readStatus: async () => (await describeReplicaSource.call(this, source))?.DBInstanceStatus,
2977
+ readStatus: () => replicaSourceStatus.call(this, source),
2974
2978
  sleep: (ms) => this.sleep(ms),
2975
2979
  logger: this.logger,
2976
2980
  label: "RDS DBInstance",
2977
2981
  logicalId,
2978
2982
  remainingMs: enclosingDeadlineRemainingMs(),
2979
2983
  action: "create of the read replica",
2980
- nounText: "source instance"
2984
+ nounText: source.key === "SourceDBClusterIdentifier" ? "source DB cluster" : "source instance"
2981
2985
  });
2982
2986
  return response;
2983
2987
  }
@@ -3002,14 +3006,19 @@ async function updateDBInstance(logicalId, physicalId, resourceType, properties,
3002
3006
  }
3003
3007
  if (passwordCompanion?.kind === "missing") throw markNonRetryable(new ProvisioningError(passwordAuthenticationMissingText(resourceType, logicalId), resourceType, logicalId, physicalId));
3004
3008
  refuseMalformedReplicaSource(properties, resourceType, logicalId, physicalId);
3005
- const sourceChange = declaresPointInTimeRestore(previousProperties) || declaresPointInTimeRestore(properties) ? "unchanged" : replicaSourceChange(properties, previousProperties);
3009
+ const sourceChange = declaresPointInTimeRestore(previousProperties) || declaresPointInTimeRestore(properties) ? {
3010
+ kind: "unchanged",
3011
+ keys: [],
3012
+ removed: []
3013
+ } : replicaSourceChange(properties, previousProperties);
3006
3014
  const restoreKeys = [
3007
3015
  ...SNAPSHOT_RESTORE_KEYS,
3008
3016
  ...POINT_IN_TIME_KEYS,
3009
- ...declaresPointInTimeRestore(previousProperties) ? ["SourceDBInstanceIdentifier"] : []
3017
+ ...declaresPointInTimeRestore(previousProperties) ? ["SourceDBInstanceIdentifier", "SourceDBClusterIdentifier"] : []
3010
3018
  ];
3011
3019
  const changedRestoreKeys = changedCreateTimeKeys(restoreKeys, properties, previousProperties, context?.changedProperties, context?.noEchoOnlyChangedProperties);
3012
3020
  const unconfirmedRestoreKeys = unconfirmedCreateTimeKeys(restoreKeys, properties, previousProperties, context?.noEchoOnlyChangedProperties);
3021
+ for (const key of unconfirmedRestoreKeys) context?.keptNoEchoOnlyProperty?.(key);
3013
3022
  if (unconfirmedRestoreKeys.length > 0) this.logger.warn(safeMsg`DBInstance ${logicalId}: ${unconfirmedRestoreKeys.join(", ")} may have changed (a NoEcho value cdkd cannot compare with its record); not applied: an instance is restored only when it is created.`);
3014
3023
  if (changedRestoreKeys.length > 0 && context?.replayingState !== true && context?.desiredFromAwsReadback !== true) {
3015
3024
  const { mask: restoreMask } = withDerivedNameMasks(this.logger, createMaskedLogSinks(this.logger, context?.maskSecrets), [[previousProperties["DBInstanceIdentifier"], physicalId]]);
@@ -3033,7 +3042,7 @@ async function updateDBInstance(logicalId, physicalId, resourceType, properties,
3033
3042
  fromReadback: context?.desiredFromAwsReadback === true
3034
3043
  }, resourceType, logicalId, physicalId, (message) => this.logger.warn(message));
3035
3044
  const { mask: sourceMask } = withDerivedNameMasks(this.logger, createMaskedLogSinks(this.logger, context?.maskSecrets), [[previousProperties["DBInstanceIdentifier"], physicalId]]);
3036
- let sourceKept = sourceChange !== "immutable";
3045
+ let sourceKept = sourceChange.kind !== "immutable";
3037
3046
  let liveSourceRead = "read";
3038
3047
  if (!sourceKept) {
3039
3048
  const live = await this.describeDBInstance(physicalId).then((instance) => {
@@ -3043,12 +3052,15 @@ async function updateDBInstance(logicalId, physicalId, resourceType, properties,
3043
3052
  liveSourceRead = err?.name === "DBInstanceNotFoundFault" ? "not-found" : "unreadable";
3044
3053
  this.logger.debug(sourceMask(safeMsg`DBInstance ${logicalId}: could not read the live replica source: ${describeAwsFailure(err).summary}`));
3045
3054
  });
3046
- const liveSource = live?.ReadReplicaSourceDBInstanceIdentifier;
3047
- const desiredSource = replicaSourceOf(properties);
3048
- sourceKept = liveSource !== void 0 && liveSource !== "" && desiredSource !== void 0 && sameReplicaSource(liveSource, desiredSource, ownScopeOf(live?.DBInstanceArn));
3055
+ sourceKept = sourceChange.keys.every((key) => {
3056
+ const liveSource = liveReplicaSource(live, key);
3057
+ const desiredSource = properties[key];
3058
+ return liveSource !== void 0 && typeof desiredSource === "string" && desiredSource !== "" && sameReplicaSource(liveSource, desiredSource, ownScopeOf(live?.DBInstanceArn));
3059
+ });
3049
3060
  }
3061
+ const sourceKeys = sourceChange.keys.join(" and ");
3050
3062
  const stateBorne = context?.replayingState === true || context?.desiredFromAwsReadback === true;
3051
- if (!sourceKept && !stateBorne) throw new ResourceUpdateNotSupportedError(resourceType, logicalId, sourceMask(`SourceDBInstanceIdentifier cannot be added or changed on an existing DB instance — an instance becomes a read replica only when it is created, and CloudFormation refuses the same update ("Resource is immutable"). Removing it promotes the replica instead. Nothing was applied to DB instance ${physicalId}. ` + (liveSourceRead === "not-found" ? "RDS reports no such DB instance: it was deleted outside cdkd, so the state record no longer matches AWS. " : liveSourceRead === "unreadable" ? "cdkd could not read the instance's live replica source (an AWS read failed), so it could not tell whether the instance already replicates the declared source; a re-run may succeed. " : "") + "To keep the instance as it is, declare the source the previous deploy declared (or none, if it declared none). To replace it with a new read replica, " + (String(previousProperties["DeletionProtection"]) === "true" ? protectedReplacementAdvice({
3063
+ if (!sourceKept && !stateBorne) throw new ResourceUpdateNotSupportedError(resourceType, logicalId, sourceMask(`${sourceKeys} cannot be added or changed on an existing DB instance — an instance becomes a read replica only when it is created, and CloudFormation refuses the same update ("Resource is immutable"). Removing it promotes the replica instead` + (sourceChange.removed.length > 0 ? ` (here it replaces ${sourceChange.removed.join(" and ")}, so nothing is promoted)` : "") + `. Nothing was applied to DB instance ${physicalId}. ` + (liveSourceRead === "not-found" ? "RDS reports no such DB instance: it was deleted outside cdkd, so the state record no longer matches AWS. " : liveSourceRead === "unreadable" ? "cdkd could not read the instance's live replica source (an AWS read failed), so it could not tell whether the instance already replicates the declared source; a re-run may succeed. " : "") + "To keep the instance as it is, declare the source the previous deploy declared (or none, if it declared none). To replace it with a new read replica, " + (String(previousProperties["DeletionProtection"]) === "true" ? protectedReplacementAdvice({
3052
3064
  evidence: "cdkd's properties for this DB instance carry DeletionProtection: true",
3053
3065
  replaceFlags: "cdkd deploy --replace --force-stateful-recreation",
3054
3066
  disable: {
@@ -3058,7 +3070,7 @@ async function updateDBInstance(logicalId, physicalId, resourceType, properties,
3058
3070
  maskSecrets: sourceMask
3059
3071
  }
3060
3072
  }) : "note AWS::RDS::DBInstance is a stateful type: re-run with cdkd deploy --replace --force-stateful-recreation (this deletes the instance and its data). The replace flags apply to the WHOLE deploy, so run them with nothing else pending")));
3061
- if (!sourceKept) this.logger.warn(sourceMask(safeMsg`DBInstance ${logicalId} (${physicalId}): SourceDBInstanceIdentifier cannot be ` + safeMsg`added or changed in place (an instance becomes a read replica only when it is ` + safeMsg`created), so the instance keeps its current replication and cdkd records that.`));
3073
+ if (!sourceKept) this.logger.warn(sourceMask(safeMsg`DBInstance ${logicalId} (${physicalId}): ${sourceKeys} cannot be ` + safeMsg`added or changed in place (an instance becomes a read replica only when it is ` + safeMsg`created), so the instance keeps its current replication and cdkd records that.`));
3062
3074
  const { mask: zoneMask } = withDerivedNameMasks(this.logger, createMaskedLogSinks(this.logger, context?.maskSecrets), [[previousProperties["DBInstanceIdentifier"], physicalId]]);
3063
3075
  const desiredZone = properties["AvailabilityZone"];
3064
3076
  let zoneKept = context?.desiredFromAwsReadback === true || context?.replayingState === true && (desiredZone == null || desiredZone === "") || instanceAvailabilityZoneKept(properties, previousProperties);
@@ -3082,13 +3094,13 @@ async function updateDBInstance(logicalId, physicalId, resourceType, properties,
3082
3094
  }) : "note AWS::RDS::DBInstance is a stateful type: re-run with cdkd deploy --replace --force-stateful-recreation to recreate it in the new zone (this deletes the instance and its data)")));
3083
3095
  if (!zoneKept) this.logger.warn(zoneMask(safeMsg`DBInstance ${logicalId} (${physicalId}): AvailabilityZone cannot change in place ` + safeMsg`(ModifyDBInstance has no such member), so the instance keeps its current zone ` + safeMsg`and cdkd records that zone.`));
3084
3096
  let promotionSkipped = false;
3085
- if (sourceChange === "promote") {
3097
+ if (sourceChange.kind === "promote") {
3086
3098
  const live = await this.describeDBInstance(physicalId);
3087
3099
  if (isLiveReadReplica(live) && context?.replayingState === true) {
3088
3100
  promotionSkipped = true;
3089
3101
  this.logger.warn(sourceMask(safeMsg`DBInstance ${logicalId} (${physicalId}): the rollback does not promote the read replica (a promotion cannot be undone, and the instance was a replica before this deploy), so cdkd records its source.`));
3090
3102
  } else if (isLiveReadReplica(live)) {
3091
- this.logger.info(safeMsg`Promoting DBInstance ${logicalId} to a standalone instance (SourceDBInstanceIdentifier was removed), as CloudFormation does`);
3103
+ this.logger.info(safeMsg`Promoting DBInstance ${logicalId} to a standalone instance (${sourceKeys} was removed), as CloudFormation does`);
3092
3104
  await this.getClient().send(new PromoteReadReplicaCommand({
3093
3105
  DBInstanceIdentifier: physicalId,
3094
3106
  ...properties["BackupRetentionPeriod"] != null && { BackupRetentionPeriod: Number(properties["BackupRetentionPeriod"]) },
@@ -3242,7 +3254,7 @@ async function deleteDBInstanceOnce(logicalId, physicalId, resourceType, propert
3242
3254
  if (!this.isNotFoundError(disableError, "DBInstanceNotFoundFault")) this.logger.debug(maskerOrIdentity(context?.maskSecrets)(`Could not disable deletion protection for DBInstance ${logicalId}: ${describeAwsFailure(disableError).detail}`));
3243
3255
  }
3244
3256
  let finalSnapshotId = properties?.["DBClusterIdentifier"] === void 0 ? context?.finalSnapshotIdentifier : void 0;
3245
- if (finalSnapshotId && replicaSourceOf(properties) !== void 0) {
3257
+ if (finalSnapshotId && declaredReplicaSource(properties) !== void 0) {
3246
3258
  const live = await this.describeDBInstance(physicalId).catch((err) => {
3247
3259
  this.logger.debug(maskerOrIdentity(context?.maskSecrets)(safeMsg`Could not read whether DBInstance ${logicalId} is a read replica: ${describeAwsFailure(err).detail}`));
3248
3260
  });
@@ -3448,6 +3460,43 @@ async function waitForInstanceDeleted(logicalId, dbInstanceIdentifier, maxWaitMs
3448
3460
  throw new Error(`Timed out waiting for DBInstance ${logicalId} to be deleted`);
3449
3461
  }
3450
3462
 
3463
+ // src/provisioning/providers/rds/provider-base.ts
3464
+ var RDSProviderBase = class {
3465
+ waitForMemberAfterClusterChange(dbInstanceIdentifier, clusterLogicalId, transitional, change, maxWaitMs = 18e5) {
3466
+ return waitForMemberAfterClusterChange.call(this, dbInstanceIdentifier, clusterLogicalId, transitional, change, maxWaitMs);
3467
+ }
3468
+ requireClusterWhileWaiting(cluster, logicalId, change) {
3469
+ return requireClusterWhileWaiting.call(this, cluster, logicalId, change);
3470
+ }
3471
+ waitForClusterPortApplied(dbClusterIdentifier, logicalId, port, maxWaitMs = 18e5) {
3472
+ return waitForClusterPortApplied.call(this, dbClusterIdentifier, logicalId, port, maxWaitMs);
3473
+ }
3474
+ waitForSecurityGroupsApplied(dbClusterIdentifier, logicalId, expected, maxWaitMs = 18e5) {
3475
+ return waitForSecurityGroupsApplied.call(this, dbClusterIdentifier, logicalId, expected, maxWaitMs);
3476
+ }
3477
+ waitForClusterState(logicalId, dbClusterIdentifier, done, change, unboundedMaxWaitMs = 18e5) {
3478
+ return waitForClusterState.call(this, logicalId, dbClusterIdentifier, done, change, unboundedMaxWaitMs);
3479
+ }
3480
+ waitForClusterAvailable(logicalId, dbClusterIdentifier, maxWaitMs = 18e5, doing = "being created") {
3481
+ return waitForClusterAvailable.call(this, logicalId, dbClusterIdentifier, maxWaitMs, doing);
3482
+ }
3483
+ waitForClusterDeleted(logicalId, dbClusterIdentifier, maxWaitMs = 18e5) {
3484
+ return waitForClusterDeleted.call(this, logicalId, dbClusterIdentifier, maxWaitMs);
3485
+ }
3486
+ rebootForPendingParameterGroup(logicalId, physicalId, sentGroup, caRotationRestarts) {
3487
+ return rebootForPendingParameterGroup.call(this, logicalId, physicalId, sentGroup, caRotationRestarts);
3488
+ }
3489
+ waitForInstanceState(logicalId, dbInstanceIdentifier, done, change) {
3490
+ return waitForInstanceState.call(this, logicalId, dbInstanceIdentifier, done, change);
3491
+ }
3492
+ waitForInstanceAvailable(logicalId, dbInstanceIdentifier, maxWaitMs = 18e5, doing = "being created") {
3493
+ return waitForInstanceAvailable.call(this, logicalId, dbInstanceIdentifier, maxWaitMs, doing);
3494
+ }
3495
+ waitForInstanceDeleted(logicalId, dbInstanceIdentifier, maxWaitMs = 18e5) {
3496
+ return waitForInstanceDeleted.call(this, logicalId, dbInstanceIdentifier, maxWaitMs);
3497
+ }
3498
+ };
3499
+
3451
3500
  // src/provisioning/providers/rds/associated-roles.ts
3452
3501
  function desiredAssociatedRoles(properties, resourceType, logicalId, physicalId, replayingCreate) {
3453
3502
  const instance = resourceType === "AWS::RDS::DBInstance";
@@ -3538,7 +3587,7 @@ function getDriftUnknownPaths(resourceType, properties) {
3538
3587
  "DBSnapshotIdentifier",
3539
3588
  "DBClusterSnapshotIdentifier",
3540
3589
  ...POINT_IN_TIME_KEYS,
3541
- ...declaresPointInTimeRestore(properties) ? ["SourceDBInstanceIdentifier"] : []
3590
+ ...declaresPointInTimeRestore(properties) ? ["SourceDBInstanceIdentifier", "SourceDBClusterIdentifier"] : []
3542
3591
  ];
3543
3592
  const retention = properties?.["AutomaticBackupReplicationRetentionPeriod"];
3544
3593
  const declared = properties?.["ProcessorFeatures"];
@@ -3604,20 +3653,22 @@ function canonicalizeDriftProperties(resourceType, properties) {
3604
3653
  }
3605
3654
  async function canonicalizeDriftPair(resourceType, baseline, aws) {
3606
3655
  if (resourceType === "AWS::RDS::DBInstance") aws = withDeclaredVolumeMembers(baseline, withDeclaredProcessorFeatures(baseline, aws));
3607
- const recorded = baseline["SourceDBInstanceIdentifier"];
3608
- const live = aws["SourceDBInstanceIdentifier"];
3609
- if (resourceType !== "AWS::RDS::DBInstance" || typeof recorded !== "string" || typeof live !== "string" || recorded === live) return {
3656
+ if (resourceType !== "AWS::RDS::DBInstance") return {
3610
3657
  baseline,
3611
3658
  aws
3612
3659
  };
3613
- const region = await this.getClient().config.region();
3614
- return sameReplicaSource(recorded, live, { region }) ? {
3615
- baseline,
3616
- aws: {
3660
+ let region;
3661
+ for (const key of REPLICA_SOURCE_KEYS) {
3662
+ const recorded = baseline[key];
3663
+ const live = aws[key];
3664
+ if (typeof recorded !== "string" || typeof live !== "string" || recorded === live) continue;
3665
+ region ??= await this.getClient().config.region();
3666
+ if (sameReplicaSource(recorded, live, { region })) aws = {
3617
3667
  ...aws,
3618
- SourceDBInstanceIdentifier: recorded
3619
- }
3620
- } : {
3668
+ [key]: recorded
3669
+ };
3670
+ }
3671
+ return {
3621
3672
  baseline,
3622
3673
  aws
3623
3674
  };
@@ -3792,6 +3843,12 @@ async function readCurrentStateDBInstance(physicalId) {
3792
3843
  const ownArn = inst.DBInstanceArn;
3793
3844
  result["SourceDBInstanceIdentifier"] = liveSource.startsWith("arn:") || ownArn === void 0 || !ownArn.startsWith("arn:") ? liveSource : `${ownArn.slice(0, ownArn.lastIndexOf(":") + 1)}${liveSource}`;
3794
3845
  }
3846
+ const liveClusterSource = inst.ReadReplicaSourceDBClusterIdentifier;
3847
+ if (liveClusterSource !== void 0 && liveClusterSource !== "" && inst.DBClusterIdentifier === void 0) {
3848
+ const ownArn = inst.DBInstanceArn;
3849
+ const prefix = ownArn?.startsWith("arn:") === true ? ownArn.split(":").slice(0, 5) : void 0;
3850
+ result["SourceDBClusterIdentifier"] = liveClusterSource.startsWith("arn:") || prefix === void 0 || prefix.length < 5 ? liveClusterSource : `${prefix.join(":")}:cluster:${liveClusterSource}`;
3851
+ }
3795
3852
  result["AssociatedRoles"] = associatedRolesReadback(inst.AssociatedRoles);
3796
3853
  if (inst.DBInstanceArn) await this.attachTags(result, inst.DBInstanceArn);
3797
3854
  return result;
@@ -3900,7 +3957,7 @@ async function importDBCluster(input) {
3900
3957
  }
3901
3958
 
3902
3959
  // src/provisioning/providers/rds-provider.ts
3903
- var RDSProvider = class {
3960
+ var RDSProvider = class extends RDSProviderBase {
3904
3961
  rdsClient;
3905
3962
  createClient;
3906
3963
  ec2Client;
@@ -4026,6 +4083,7 @@ var RDSProvider = class {
4026
4083
  "MasterUserAuthenticationType",
4027
4084
  "AssociatedRoles",
4028
4085
  "SourceDBInstanceIdentifier",
4086
+ "SourceDBClusterIdentifier",
4029
4087
  "SourceRegion",
4030
4088
  "DBSnapshotIdentifier",
4031
4089
  "DBClusterSnapshotIdentifier",
@@ -4047,13 +4105,28 @@ var RDSProvider = class {
4047
4105
  unhandledByDesign = /* @__PURE__ */ new Map([["AWS::RDS::DBCluster", /* @__PURE__ */ new Map([
4048
4106
  ["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"],
4049
4107
  ["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"],
4050
- ["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"]
4108
+ ["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"],
4109
+ ["Domain", "joins the cluster to an AWS Directory Service for Microsoft Active Directory domain (Kerberos authentication); verifying it needs a provisioned directory, dedicated infrastructure the backfill campaign leaves out of scope by maintainer decision (go-to-k/cdkd#5639). Kept unhandled so a template declaring it keeps its Cloud Control route"],
4110
+ ["DomainIAMRoleName", "the IAM role RDS uses to call AWS Directory Service for the Domain join; verifying it needs a provisioned directory, dedicated infrastructure the backfill campaign leaves out of scope by maintainer decision (go-to-k/cdkd#5639). Kept unhandled so a template declaring it keeps its Cloud Control route"]
4051
4111
  ])], ["AWS::RDS::DBInstance", /* @__PURE__ */ new Map([
4052
4112
  ["DBSecurityGroups", "EC2-Classic-only feature retired by AWS (2022-08-15); new accounts cannot use this — use VPCSecurityGroups instead"],
4053
4113
  ["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"],
4054
- ["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"]
4114
+ ["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"],
4115
+ ["Domain", "joins the instance to an AWS Directory Service for Microsoft Active Directory domain (Kerberos authentication); verifying it needs a provisioned directory, dedicated infrastructure the backfill campaign leaves out of scope by maintainer decision (go-to-k/cdkd#5640). Kept unhandled so a template declaring it keeps its Cloud Control route"],
4116
+ ["DomainIAMRoleName", "the IAM role RDS uses to call AWS Directory Service for the Domain join; verifying it needs a provisioned directory, dedicated infrastructure the backfill campaign leaves out of scope by maintainer decision (go-to-k/cdkd#5640). Kept unhandled so a template declaring it keeps its Cloud Control route"],
4117
+ ["DomainAuthSecretArn", "the Secrets Manager secret holding the credentials that join the instance to a self-managed Active Directory domain; verifying it needs a reachable self-managed domain, dedicated infrastructure the backfill campaign leaves out of scope by maintainer decision (go-to-k/cdkd#5640). Kept unhandled so a template declaring it keeps its Cloud Control route"],
4118
+ ["DomainDnsIps", "the DNS servers of the self-managed Active Directory domain the instance joins; verifying it needs a reachable self-managed domain, dedicated infrastructure the backfill campaign leaves out of scope by maintainer decision (go-to-k/cdkd#5640). Kept unhandled so a template declaring it keeps its Cloud Control route"],
4119
+ ["DomainFqdn", "the fully qualified name of the self-managed Active Directory domain the instance joins; verifying it needs a reachable self-managed domain, dedicated infrastructure the backfill campaign leaves out of scope by maintainer decision (go-to-k/cdkd#5640). Kept unhandled so a template declaring it keeps its Cloud Control route"],
4120
+ ["DomainOu", "the organizational unit the instance joins in a self-managed Active Directory domain; verifying it needs a reachable self-managed domain, dedicated infrastructure the backfill campaign leaves out of scope by maintainer decision (go-to-k/cdkd#5640). Kept unhandled so a template declaring it keeps its Cloud Control route"],
4121
+ ["TdeCredentialArn", "the key store an Oracle instance uses for Transparent Data Encryption; verifying it needs an Oracle instance with an HSM key store, dedicated infrastructure the backfill campaign leaves out of scope by maintainer decision (go-to-k/cdkd#5640). Kept unhandled so a template declaring it keeps its Cloud Control route"],
4122
+ ["TdeCredentialPassword", "the password of the TdeCredentialArn key store; verifying it needs an Oracle instance with an HSM key store, dedicated infrastructure the backfill campaign leaves out of scope by maintainer decision (go-to-k/cdkd#5640). Kept unhandled so a template declaring it keeps its Cloud Control route"],
4123
+ ["ReplicaMode", "the mounted or open-read-only mode of an Oracle read replica; verifying it needs an Oracle Enterprise Edition (BYOL) source instance, dedicated infrastructure the backfill campaign leaves out of scope by maintainer decision (go-to-k/cdkd#5640). Kept unhandled so a template declaring it keeps its Cloud Control route"],
4124
+ ["CustomIAMInstanceProfile", "the instance profile of an RDS Custom instance; verifying it needs an RDS Custom setup (a custom engine version and its IAM and network prerequisites), dedicated infrastructure the backfill campaign leaves out of scope by maintainer decision (go-to-k/cdkd#5640). Kept unhandled so a template declaring it keeps its Cloud Control route"],
4125
+ ["DBSystemId", "the Oracle system identifier of an RDS Custom for Oracle instance; verifying it needs an RDS Custom setup, dedicated infrastructure the backfill campaign leaves out of scope by maintainer decision (go-to-k/cdkd#5640). Kept unhandled so a template declaring it keeps its Cloud Control route"],
4126
+ ["BackupTarget", "where automated backups and manual snapshots are stored (the Region, an AWS Outposts rack, or a Dedicated Local Zone); verifying it needs RDS on Outposts or a Dedicated Local Zone, dedicated infrastructure the backfill campaign leaves out of scope by maintainer decision (go-to-k/cdkd#5640). Kept unhandled so a template declaring it keeps its Cloud Control route"]
4055
4127
  ])]]);
4056
4128
  constructor(options) {
4129
+ super();
4057
4130
  this.providerRegion = options?.region ?? ambientRegion();
4058
4131
  }
4059
4132
  getClient() {
@@ -4155,21 +4228,6 @@ var RDSProvider = class {
4155
4228
  describeDBInstance(dbInstanceIdentifier) {
4156
4229
  return describeDBInstance.call(this, dbInstanceIdentifier);
4157
4230
  }
4158
- waitForMemberAfterClusterChange(dbInstanceIdentifier, clusterLogicalId, transitional, change, maxWaitMs = 18e5) {
4159
- return waitForMemberAfterClusterChange.call(this, dbInstanceIdentifier, clusterLogicalId, transitional, change, maxWaitMs);
4160
- }
4161
- requireClusterWhileWaiting(cluster, logicalId, change) {
4162
- return requireClusterWhileWaiting.call(this, cluster, logicalId, change);
4163
- }
4164
- waitForClusterPortApplied(dbClusterIdentifier, logicalId, port, maxWaitMs = 18e5) {
4165
- return waitForClusterPortApplied.call(this, dbClusterIdentifier, logicalId, port, maxWaitMs);
4166
- }
4167
- waitForSecurityGroupsApplied(dbClusterIdentifier, logicalId, expected, maxWaitMs = 18e5) {
4168
- return waitForSecurityGroupsApplied.call(this, dbClusterIdentifier, logicalId, expected, maxWaitMs);
4169
- }
4170
- waitForClusterState(logicalId, dbClusterIdentifier, done, change, unboundedMaxWaitMs = 18e5) {
4171
- return waitForClusterState.call(this, logicalId, dbClusterIdentifier, done, change, unboundedMaxWaitMs);
4172
- }
4173
4231
  sendHttpEndpointChange(logicalId, physicalId, arn, enable) {
4174
4232
  return sendHttpEndpointChange.call(this, logicalId, physicalId, arn, enable);
4175
4233
  }
@@ -4185,24 +4243,6 @@ var RDSProvider = class {
4185
4243
  applyAssociatedRoles(target, logicalId, physicalId, desired, previous, mask, marks) {
4186
4244
  return applyAssociatedRoles.call(this, target, logicalId, physicalId, desired, previous, mask, marks);
4187
4245
  }
4188
- waitForClusterAvailable(logicalId, dbClusterIdentifier, maxWaitMs = 18e5, doing = "being created") {
4189
- return waitForClusterAvailable.call(this, logicalId, dbClusterIdentifier, maxWaitMs, doing);
4190
- }
4191
- waitForClusterDeleted(logicalId, dbClusterIdentifier, maxWaitMs = 18e5) {
4192
- return waitForClusterDeleted.call(this, logicalId, dbClusterIdentifier, maxWaitMs);
4193
- }
4194
- rebootForPendingParameterGroup(logicalId, physicalId, sentGroup, caRotationRestarts) {
4195
- return rebootForPendingParameterGroup.call(this, logicalId, physicalId, sentGroup, caRotationRestarts);
4196
- }
4197
- waitForInstanceState(logicalId, dbInstanceIdentifier, done, change) {
4198
- return waitForInstanceState.call(this, logicalId, dbInstanceIdentifier, done, change);
4199
- }
4200
- waitForInstanceAvailable(logicalId, dbInstanceIdentifier, maxWaitMs = 18e5, doing = "being created") {
4201
- return waitForInstanceAvailable.call(this, logicalId, dbInstanceIdentifier, maxWaitMs, doing);
4202
- }
4203
- waitForInstanceDeleted(logicalId, dbInstanceIdentifier, maxWaitMs = 18e5) {
4204
- return waitForInstanceDeleted.call(this, logicalId, dbInstanceIdentifier, maxWaitMs);
4205
- }
4206
4246
  sleep(ms) {
4207
4247
  return new Promise((resolve) => setTimeout(resolve, ms));
4208
4248
  }
@@ -4264,4 +4304,4 @@ var RDSProvider = class {
4264
4304
  };
4265
4305
 
4266
4306
  export { RDSProvider };
4267
- //# sourceMappingURL=rds-provider-CxSVX1d7.js.map
4307
+ //# sourceMappingURL=rds-provider-DKZjtd50.js.map