@go-to-k/cdkd 0.50.6 → 0.50.7

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
@@ -8705,10 +8705,10 @@ var IAMRoleProvider = class {
8705
8705
  const updateParams = {
8706
8706
  RoleName: physicalId
8707
8707
  };
8708
- if (properties["Description"]) {
8708
+ if (properties["Description"] !== void 0) {
8709
8709
  updateParams.Description = properties["Description"];
8710
8710
  }
8711
- if (properties["MaxSessionDuration"]) {
8711
+ if (properties["MaxSessionDuration"] !== void 0) {
8712
8712
  updateParams.MaxSessionDuration = properties["MaxSessionDuration"];
8713
8713
  }
8714
8714
  await this.iamClient.send(new UpdateRoleCommand(updateParams));
@@ -12641,6 +12641,14 @@ import {
12641
12641
  } from "@aws-sdk/client-sqs";
12642
12642
  import { GetCallerIdentityCommand as GetCallerIdentityCommand4 } from "@aws-sdk/client-sts";
12643
12643
  init_aws_clients();
12644
+ function serializeRedrivePolicy(value) {
12645
+ if (value === null || value === void 0)
12646
+ return "";
12647
+ if (typeof value === "object" && Object.keys(value).length === 0) {
12648
+ return "";
12649
+ }
12650
+ return JSON.stringify(value);
12651
+ }
12644
12652
  var CDK_TO_SQS_ATTRIBUTES = {
12645
12653
  VisibilityTimeout: "VisibilityTimeout",
12646
12654
  MaximumMessageSize: "MaximumMessageSize",
@@ -12699,7 +12707,7 @@ var SQSQueueProvider = class {
12699
12707
  if (properties[cdkKey] !== void 0) {
12700
12708
  const value = properties[cdkKey];
12701
12709
  if (cdkKey === "RedrivePolicy" && typeof value === "object") {
12702
- attributes[sqsKey] = JSON.stringify(value);
12710
+ attributes[sqsKey] = serializeRedrivePolicy(value);
12703
12711
  } else {
12704
12712
  attributes[sqsKey] = String(value);
12705
12713
  }
@@ -12757,7 +12765,7 @@ var SQSQueueProvider = class {
12757
12765
  if (properties[cdkKey] !== void 0) {
12758
12766
  const value = properties[cdkKey];
12759
12767
  if (cdkKey === "RedrivePolicy" && typeof value === "object") {
12760
- attributes[sqsKey] = JSON.stringify(value);
12768
+ attributes[sqsKey] = serializeRedrivePolicy(value);
12761
12769
  } else {
12762
12770
  attributes[sqsKey] = String(value);
12763
12771
  }
@@ -39824,6 +39832,19 @@ async function runAccept(reports, stateBackend, stateConfig, awsClients, options
39824
39832
  }
39825
39833
  }
39826
39834
  }
39835
+ function buildRevertNewProperties(drifts, desiredProperties, awsProperties) {
39836
+ const result = { ...awsProperties };
39837
+ for (const d of drifts) {
39838
+ const topLevelKey = d.path.split(".", 1)[0];
39839
+ if (!topLevelKey)
39840
+ continue;
39841
+ if (topLevelKey in desiredProperties) {
39842
+ result[topLevelKey] = desiredProperties[topLevelKey];
39843
+ } else {
39844
+ }
39845
+ }
39846
+ return result;
39847
+ }
39827
39848
  async function runRevert(reports, providerRegistry, stateConfig, awsClients, options) {
39828
39849
  const logger = getLogger();
39829
39850
  printRevertPlan(reports);
@@ -39866,13 +39887,18 @@ async function runRevert(reports, providerRegistry, stateConfig, awsClients, opt
39866
39887
  }
39867
39888
  const provider = providerRegistry.getProvider(outcome.resourceType);
39868
39889
  const desiredProperties = stateResource.observedProperties ?? stateResource.properties ?? {};
39890
+ const newProperties = buildRevertNewProperties(
39891
+ outcome.changes,
39892
+ desiredProperties,
39893
+ outcome.awsProperties
39894
+ );
39869
39895
  try {
39870
39896
  await withRetry(
39871
39897
  () => provider.update(
39872
39898
  outcome.logicalId,
39873
39899
  stateResource.physicalId,
39874
39900
  outcome.resourceType,
39875
- desiredProperties,
39901
+ newProperties,
39876
39902
  outcome.awsProperties
39877
39903
  ),
39878
39904
  outcome.logicalId,
@@ -43505,7 +43531,7 @@ function reorderArgs(argv) {
43505
43531
  }
43506
43532
  async function main() {
43507
43533
  const program = new Command14();
43508
- program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.50.6");
43534
+ program.name("cdkd").description("CDK Direct - Deploy AWS CDK apps directly via SDK/Cloud Control API").version("0.50.7");
43509
43535
  program.addCommand(createBootstrapCommand());
43510
43536
  program.addCommand(createSynthCommand());
43511
43537
  program.addCommand(createListCommand());