@go-to-k/cdkd 0.50.8 → 0.50.9

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/cli.js CHANGED
@@ -16755,23 +16755,28 @@ var DynamoDBTableProvider = class {
16755
16755
  WriteCapacityUnits: table.ProvisionedThroughput.WriteCapacityUnits
16756
16756
  };
16757
16757
  }
16758
- if (table.StreamSpecification) {
16758
+ if (table.StreamSpecification?.StreamEnabled && table.StreamSpecification.StreamViewType) {
16759
16759
  result["StreamSpecification"] = {
16760
- StreamEnabled: table.StreamSpecification.StreamEnabled,
16760
+ StreamEnabled: true,
16761
16761
  StreamViewType: table.StreamSpecification.StreamViewType
16762
16762
  };
16763
16763
  }
16764
- result["GlobalSecondaryIndexes"] = table.GlobalSecondaryIndexes ?? [];
16765
- result["LocalSecondaryIndexes"] = table.LocalSecondaryIndexes ?? [];
16766
- const sse = {
16767
- SSEEnabled: table.SSEDescription?.Status === "ENABLED"
16768
- };
16769
- if (table.SSEDescription?.KMSMasterKeyArn !== void 0) {
16770
- sse["KMSMasterKeyId"] = table.SSEDescription.KMSMasterKeyArn;
16764
+ if (table.GlobalSecondaryIndexes && table.GlobalSecondaryIndexes.length > 0) {
16765
+ result["GlobalSecondaryIndexes"] = table.GlobalSecondaryIndexes;
16766
+ }
16767
+ if (table.LocalSecondaryIndexes && table.LocalSecondaryIndexes.length > 0) {
16768
+ result["LocalSecondaryIndexes"] = table.LocalSecondaryIndexes;
16769
+ }
16770
+ if (table.SSEDescription?.Status === "ENABLED") {
16771
+ const sse = { SSEEnabled: true };
16772
+ if (table.SSEDescription.KMSMasterKeyArn !== void 0) {
16773
+ sse["KMSMasterKeyId"] = table.SSEDescription.KMSMasterKeyArn;
16774
+ }
16775
+ if (table.SSEDescription.SSEType !== void 0) {
16776
+ sse["SSEType"] = table.SSEDescription.SSEType;
16777
+ }
16778
+ result["SSESpecification"] = sse;
16771
16779
  }
16772
- if (table.SSEDescription?.SSEType !== void 0)
16773
- sse["SSEType"] = table.SSEDescription.SSEType;
16774
- result["SSESpecification"] = sse;
16775
16780
  if (table.DeletionProtectionEnabled !== void 0) {
16776
16781
  result["DeletionProtectionEnabled"] = table.DeletionProtectionEnabled;
16777
16782
  }
@@ -17724,9 +17729,9 @@ var SecretsManagerSecretProvider = class {
17724
17729
  };
17725
17730
  if (secretString)
17726
17731
  updateParams.SecretString = secretString;
17727
- if (properties["Description"])
17732
+ if (properties["Description"] !== void 0)
17728
17733
  updateParams.Description = properties["Description"];
17729
- if (properties["KmsKeyId"])
17734
+ if (properties["KmsKeyId"] !== void 0 && properties["KmsKeyId"] !== "")
17730
17735
  updateParams.KmsKeyId = properties["KmsKeyId"];
17731
17736
  await this.smClient.send(new UpdateSecretCommand(updateParams));
17732
17737
  const newTags = properties["Tags"];
@@ -27250,13 +27255,14 @@ var RDSProvider = class {
27250
27255
  async updateDBSubnetGroup(logicalId, physicalId, resourceType, properties, previousProperties) {
27251
27256
  this.logger.debug(`Updating DBSubnetGroup ${logicalId}: ${physicalId}`);
27252
27257
  try {
27253
- await this.getClient().send(
27254
- new ModifyDBSubnetGroupCommand({
27255
- DBSubnetGroupName: physicalId,
27256
- DBSubnetGroupDescription: properties["DBSubnetGroupDescription"],
27257
- SubnetIds: properties["SubnetIds"]
27258
- })
27259
- );
27258
+ const subnetIds = properties["SubnetIds"];
27259
+ const sendSubnetIds = subnetIds !== void 0 && subnetIds.length > 0;
27260
+ const modifyInput = {
27261
+ DBSubnetGroupName: physicalId,
27262
+ DBSubnetGroupDescription: properties["DBSubnetGroupDescription"],
27263
+ ...sendSubnetIds && { SubnetIds: subnetIds }
27264
+ };
27265
+ await this.getClient().send(new ModifyDBSubnetGroupCommand(modifyInput));
27260
27266
  const desc = await this.getClient().send(
27261
27267
  new DescribeDBSubnetGroupsCommand({ DBSubnetGroupName: physicalId })
27262
27268
  );
@@ -27386,16 +27392,19 @@ var RDSProvider = class {
27386
27392
  this.logger.debug(`Updating DBCluster ${logicalId}: ${physicalId}`);
27387
27393
  try {
27388
27394
  const serverlessV2Config = properties["ServerlessV2ScalingConfiguration"];
27395
+ const hasServerlessV2 = serverlessV2Config !== void 0 && (serverlessV2Config.MinCapacity !== void 0 || serverlessV2Config.MaxCapacity !== void 0);
27396
+ const vpcSgIds = properties["VpcSecurityGroupIds"];
27397
+ const sendVpcSgIds = vpcSgIds !== void 0 && vpcSgIds.length > 0;
27389
27398
  await this.getClient().send(
27390
27399
  new ModifyDBClusterCommand({
27391
27400
  DBClusterIdentifier: physicalId,
27392
27401
  EngineVersion: properties["EngineVersion"],
27393
27402
  DeletionProtection: properties["DeletionProtection"],
27394
27403
  BackupRetentionPeriod: properties["BackupRetentionPeriod"] != null ? Number(properties["BackupRetentionPeriod"]) : void 0,
27395
- VpcSecurityGroupIds: properties["VpcSecurityGroupIds"],
27404
+ ...sendVpcSgIds && { VpcSecurityGroupIds: vpcSgIds },
27396
27405
  MasterUserPassword: properties["MasterUserPassword"],
27397
27406
  Port: properties["Port"] != null ? Number(properties["Port"]) : void 0,
27398
- ...serverlessV2Config && {
27407
+ ...hasServerlessV2 && {
27399
27408
  ServerlessV2ScalingConfiguration: {
27400
27409
  MinCapacity: serverlessV2Config.MinCapacity,
27401
27410
  MaxCapacity: serverlessV2Config.MaxCapacity
@@ -27894,7 +27903,7 @@ var RDSProvider = class {
27894
27903
  if (cluster.DeletionProtection !== void 0) {
27895
27904
  result["DeletionProtection"] = cluster.DeletionProtection;
27896
27905
  }
27897
- {
27906
+ if (cluster.ServerlessV2ScalingConfiguration?.MinCapacity !== void 0 || cluster.ServerlessV2ScalingConfiguration?.MaxCapacity !== void 0) {
27898
27907
  const sc = {};
27899
27908
  if (cluster.ServerlessV2ScalingConfiguration?.MinCapacity !== void 0) {
27900
27909
  sc["MinCapacity"] = cluster.ServerlessV2ScalingConfiguration.MinCapacity;
@@ -30084,11 +30093,13 @@ var ElastiCacheProvider = class {
30084
30093
  async updateCacheCluster(logicalId, physicalId, resourceType, properties, previousProperties) {
30085
30094
  this.logger.debug(`Updating CacheCluster ${logicalId}: ${physicalId}`);
30086
30095
  try {
30096
+ const rawSgIds = properties["VpcSecurityGroupIds"];
30097
+ const sgIds = rawSgIds && rawSgIds.length > 0 ? rawSgIds : void 0;
30087
30098
  await this.getClient().send(
30088
30099
  new ModifyCacheClusterCommand({
30089
30100
  CacheClusterId: physicalId,
30090
30101
  NumCacheNodes: properties["NumCacheNodes"] != null ? Number(properties["NumCacheNodes"]) : void 0,
30091
- SecurityGroupIds: properties["VpcSecurityGroupIds"],
30102
+ SecurityGroupIds: sgIds,
30092
30103
  CacheParameterGroupName: properties["CacheParameterGroupName"],
30093
30104
  EngineVersion: properties["EngineVersion"],
30094
30105
  PreferredMaintenanceWindow: properties["PreferredMaintenanceWindow"],
@@ -30366,7 +30377,7 @@ var ElastiCacheProvider = class {
30366
30377
  result["IpDiscovery"] = cluster.IpDiscovery;
30367
30378
  if (cluster.NetworkType !== void 0)
30368
30379
  result["NetworkType"] = cluster.NetworkType;
30369
- if (cluster.TransitEncryptionEnabled !== void 0) {
30380
+ if (cluster.Engine === "redis" && cluster.TransitEncryptionEnabled !== void 0) {
30370
30381
  result["TransitEncryptionEnabled"] = cluster.TransitEncryptionEnabled;
30371
30382
  }
30372
30383
  if (cluster.CacheNodes?.[0]?.Endpoint?.Port !== void 0) {
@@ -33008,6 +33019,36 @@ var KMSProvider = class {
33008
33019
  }
33009
33020
  return result;
33010
33021
  }
33022
+ /**
33023
+ * Declare state property paths cdkd cannot round-trip from AWS, so the
33024
+ * drift comparator skips them instead of firing guaranteed false-
33025
+ * positive drift on every clean run.
33026
+ *
33027
+ * - `KeyPolicy`: cdkd does NOT call `GetKeyPolicy` in `readCurrentState`.
33028
+ * The policy body needs JSON parsing for comparison and a separate
33029
+ * SDK call; deferred to a follow-up. Until then, any user who
33030
+ * templates `KeyPolicy` would see guaranteed drift.
33031
+ * - `EnableKeyRotation` / `RotationPeriodInDays`: cdkd does NOT call
33032
+ * `GetKeyRotationStatus`. Same reason — deferred to a follow-up.
33033
+ * `EnableKeyRotation` is also a Class 1 candidate (only valid for
33034
+ * `KeySpec=SYMMETRIC_DEFAULT`); when we lift this gap the read side
33035
+ * must gate the emit on the discriminator.
33036
+ * - `BypassPolicyLockoutSafetyCheck` / `PendingWindowInDays`: not part
33037
+ * of the persisted AWS state visible via `DescribeKey` — both are
33038
+ * create / delete-time-only inputs.
33039
+ */
33040
+ getDriftUnknownPaths(resourceType) {
33041
+ if (resourceType === "AWS::KMS::Key") {
33042
+ return [
33043
+ "KeyPolicy",
33044
+ "EnableKeyRotation",
33045
+ "RotationPeriodInDays",
33046
+ "BypassPolicyLockoutSafetyCheck",
33047
+ "PendingWindowInDays"
33048
+ ];
33049
+ }
33050
+ return [];
33051
+ }
33011
33052
  async readCurrentStateAlias(physicalId) {
33012
33053
  let marker;
33013
33054
  do {
@@ -43628,7 +43669,7 @@ function reorderArgs(argv) {
43628
43669
  }
43629
43670
  async function main() {
43630
43671
  const program = new Command14();
43631
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.50.8");
43672
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.50.9");
43632
43673
  program.addCommand(createBootstrapCommand());
43633
43674
  program.addCommand(createSynthCommand());
43634
43675
  program.addCommand(createListCommand());