cdk-real-drift 0.1.6 → 0.1.8

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
@@ -49,6 +49,7 @@ import { S_BAR, S_BAR_END, S_BAR_START, S_CHECKBOX_INACTIVE, S_CHECKBOX_SELECTED
49
49
  import pc from "picocolors";
50
50
  import { MultiSelectPrompt, Prompt, isCancel as isCancel$1 } from "@clack/core";
51
51
  import { CloudFrontClient, GetDistributionConfigCommand, UpdateDistributionCommand } from "@aws-sdk/client-cloudfront";
52
+ import { ElasticBeanstalkClient, UpdateApplicationCommand, UpdateEnvironmentCommand } from "@aws-sdk/client-elastic-beanstalk";
52
53
  import { DescribeDomainConfigCommand, OpenSearchClient, UpdateDomainConfigCommand } from "@aws-sdk/client-opensearch";
53
54
  import { GetWebACLCommand, UpdateWebACLCommand, WAFV2Client } from "@aws-sdk/client-wafv2";
54
55
  import { ConfigServiceClient, DescribeConfigRulesCommand, PutConfigRuleCommand } from "@aws-sdk/client-config-service";
@@ -1085,6 +1086,23 @@ const KNOWN_DEFAULTS = {
1085
1086
  }
1086
1087
  },
1087
1088
  "AWS::KinesisAnalyticsV2::Application": { ApplicationMode: "STREAMING" },
1089
+ "AWS::ElasticBeanstalk::Application": { ResourceLifecycleConfig: { VersionLifecycleConfig: {
1090
+ MaxCountRule: {
1091
+ DeleteSourceFromS3: false,
1092
+ Enabled: false,
1093
+ MaxCount: 200
1094
+ },
1095
+ MaxAgeRule: {
1096
+ DeleteSourceFromS3: false,
1097
+ MaxAgeInDays: 180,
1098
+ Enabled: false
1099
+ }
1100
+ } } },
1101
+ "AWS::ElasticBeanstalk::Environment": { Tier: {
1102
+ Type: "Standard",
1103
+ Version: "1.0",
1104
+ Name: "WebServer"
1105
+ } },
1088
1106
  "AWS::S3::Bucket": {
1089
1107
  VersioningConfiguration: { Status: "Suspended" },
1090
1108
  AbacStatus: "Disabled",
@@ -1917,6 +1935,8 @@ const GENERATED_NESTED_PATHS = {
1917
1935
  const VALUE_INDEPENDENT_DEFAULT_TOPLEVEL_PATHS = {
1918
1936
  "AWS::ECS::Service": new Set(["AvailabilityZoneRebalancing", "PlatformVersion"]),
1919
1937
  "AWS::KinesisAnalyticsV2::Application": new Set(["ApplicationMaintenanceConfiguration"]),
1938
+ "AWS::ElasticBeanstalk::ConfigurationTemplate": new Set(["PlatformArn"]),
1939
+ "AWS::ElasticBeanstalk::Environment": new Set(["PlatformArn"]),
1920
1940
  "AWS::ApiGateway::Authorizer": new Set(["AuthType"]),
1921
1941
  "AWS::RDS::DBCluster": new Set([
1922
1942
  "KmsKeyId",
@@ -9672,7 +9692,41 @@ const writeLexBotLocales = async (ctx, ops) => {
9672
9692
  }
9673
9693
  }
9674
9694
  };
9695
+ const EB_APPLICATION_MODIFY_PARAMS = new Set(["Description"]);
9696
+ const writeElasticBeanstalkApplication = async (ctx, ops) => {
9697
+ const name = str(ctx.physicalId) ?? str(ctx.declared["ApplicationName"]);
9698
+ if (!name) throw new Error("cannot resolve Elastic Beanstalk ApplicationName for revert");
9699
+ const input = { ApplicationName: name };
9700
+ let any = false;
9701
+ for (const op of ops) {
9702
+ const top = op.path.replace(/^\//, "").split("/")[0];
9703
+ if (top && EB_APPLICATION_MODIFY_PARAMS.has(top)) {
9704
+ input[top] = op.op === "remove" ? "" : str(ctx.declared[top]) ?? "";
9705
+ any = true;
9706
+ }
9707
+ }
9708
+ if (!any) return;
9709
+ await new ElasticBeanstalkClient({ region: ctx.region }).send(new UpdateApplicationCommand(input));
9710
+ };
9711
+ const EB_ENVIRONMENT_MODIFY_PARAMS = new Set(["Description"]);
9712
+ const writeElasticBeanstalkEnvironment = async (ctx, ops) => {
9713
+ const name = str(ctx.physicalId) ?? str(ctx.declared["EnvironmentName"]);
9714
+ if (!name) throw new Error("cannot resolve Elastic Beanstalk EnvironmentName for revert");
9715
+ const input = { EnvironmentName: name };
9716
+ let any = false;
9717
+ for (const op of ops) {
9718
+ const top = op.path.replace(/^\//, "").split("/")[0];
9719
+ if (top && EB_ENVIRONMENT_MODIFY_PARAMS.has(top)) {
9720
+ input[top] = op.op === "remove" ? "" : str(ctx.declared[top]) ?? "";
9721
+ any = true;
9722
+ }
9723
+ }
9724
+ if (!any) return;
9725
+ await new ElasticBeanstalkClient({ region: ctx.region }).send(new UpdateEnvironmentCommand(input));
9726
+ };
9675
9727
  const SDK_WRITERS = {
9728
+ "AWS::ElasticBeanstalk::Application": writeElasticBeanstalkApplication,
9729
+ "AWS::ElasticBeanstalk::Environment": writeElasticBeanstalkEnvironment,
9676
9730
  "AWS::CodeBuild::ReportGroup": writeCodeBuildReportGroup,
9677
9731
  "AWS::DAX::Cluster": writeDaxCluster,
9678
9732
  "AWS::DAX::ParameterGroup": writeDaxParameterGroup,