cdk-real-drift 0.12.64 → 0.12.65

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/README.md CHANGED
@@ -1046,8 +1046,10 @@ place, since Cloud Control has no handler for the type),
1046
1046
  `ecs:UpdateService` (reverts an `AWS::ECS::Service` `ServiceConnectConfiguration` /
1047
1047
  `VolumeConfigurations` drift — the whole writeOnly prop is re-supplied, since Cloud
1048
1048
  Control cannot sub-path patch it),
1049
- `elasticbeanstalk:UpdateApplication` / `elasticbeanstalk:UpdateEnvironment`
1050
- (revert an `AWS::ElasticBeanstalk::Application` / `Environment`),
1049
+ `elasticbeanstalk:UpdateApplication` / `elasticbeanstalk:UpdateEnvironment` /
1050
+ `elasticbeanstalk:UpdateApplicationResourceLifecycle` (revert an
1051
+ `AWS::ElasticBeanstalk::Application` — including its `ResourceLifecycleConfig` — or
1052
+ `Environment`),
1051
1053
  `codebuild:UpdateReportGroup` (reverts an `AWS::CodeBuild::ReportGroup`),
1052
1054
  `dax:UpdateCluster` / `dax:UpdateParameterGroup` (revert an `AWS::DAX::Cluster` /
1053
1055
  `ParameterGroup`),
package/dist/cli.js CHANGED
@@ -31,7 +31,7 @@ import { ChangeResourceRecordSetsCommand, ListResourceRecordSetsCommand, Route53
31
31
  import { GetTopicAttributesCommand, ListSubscriptionsByTopicCommand, SNSClient, SetTopicAttributesCommand } from "@aws-sdk/client-sns";
32
32
  import { ACMClient, DescribeCertificateCommand, ListTagsForCertificateCommand } from "@aws-sdk/client-acm";
33
33
  import { BudgetsClient, DescribeBudgetCommand } from "@aws-sdk/client-budgets";
34
- import { DescribeConfigurationSettingsCommand, ElasticBeanstalkClient, UpdateApplicationCommand, UpdateEnvironmentCommand } from "@aws-sdk/client-elastic-beanstalk";
34
+ import { DescribeConfigurationSettingsCommand, ElasticBeanstalkClient, UpdateApplicationCommand, UpdateApplicationResourceLifecycleCommand, UpdateEnvironmentCommand } from "@aws-sdk/client-elastic-beanstalk";
35
35
  import { CognitoSyncClient, GetCognitoEventsCommand, SetCognitoEventsCommand } from "@aws-sdk/client-cognito-sync";
36
36
  import { BatchGetProjectsCommand, BatchGetReportGroupsCommand, CodeBuildClient, UpdateReportGroupCommand } from "@aws-sdk/client-codebuild";
37
37
  import { DescribeDBClustersCommand as DescribeDBClustersCommand$1, DescribeDBInstancesCommand as DescribeDBInstancesCommand$1, DocDBClient, ListTagsForResourceCommand, ModifyDBClusterCommand, ModifyDBInstanceCommand } from "@aws-sdk/client-docdb";
@@ -15984,23 +15984,42 @@ const writeLexBotLocales = async (ctx, ops) => {
15984
15984
  }
15985
15985
  };
15986
15986
  const EB_APPLICATION_MODIFY_PARAMS = new Set(["Description"]);
15987
+ const EB_APPLICATION_DEFAULT_RESOURCE_LIFECYCLE = { VersionLifecycleConfig: {
15988
+ MaxCountRule: {
15989
+ DeleteSourceFromS3: false,
15990
+ Enabled: false,
15991
+ MaxCount: 200
15992
+ },
15993
+ MaxAgeRule: {
15994
+ DeleteSourceFromS3: false,
15995
+ MaxAgeInDays: 180,
15996
+ Enabled: false
15997
+ }
15998
+ } };
15999
+ const asObject = (v) => v !== null && typeof v === "object" && !Array.isArray(v) ? v : void 0;
15987
16000
  const writeElasticBeanstalkApplication = async (ctx, ops) => {
15988
16001
  const name = str(ctx.physicalId) ?? str(ctx.declared["ApplicationName"]);
15989
16002
  if (!name) throw new Error("cannot resolve Elastic Beanstalk ApplicationName for revert");
16003
+ const client = new ElasticBeanstalkClient({
16004
+ region: ctx.region,
16005
+ ...CLIENT_TIMEOUTS
16006
+ });
15990
16007
  const input = { ApplicationName: name };
15991
16008
  let any = false;
16009
+ let lifecycle;
15992
16010
  for (const op of ops) {
15993
16011
  const top = op.path.replace(/^\//, "").split("/")[0];
15994
16012
  if (top && EB_APPLICATION_MODIFY_PARAMS.has(top)) {
15995
16013
  input[top] = op.op === "remove" ? "" : str(ctx.declared[top]) ?? "";
15996
16014
  any = true;
15997
- }
16015
+ } else if (top === "ResourceLifecycleConfig") lifecycle = op.op === "remove" ? EB_APPLICATION_DEFAULT_RESOURCE_LIFECYCLE : asObject(ctx.declared["ResourceLifecycleConfig"]) ?? asObject(op.value) ?? EB_APPLICATION_DEFAULT_RESOURCE_LIFECYCLE;
15998
16016
  }
15999
- if (any) await new ElasticBeanstalkClient({
16000
- region: ctx.region,
16001
- ...CLIENT_TIMEOUTS
16002
- }).send(new UpdateApplicationCommand(input));
16003
- assertOpsConsumed("ElasticBeanstalk Application", ops, EB_APPLICATION_MODIFY_PARAMS);
16017
+ if (any) await client.send(new UpdateApplicationCommand(input));
16018
+ if (lifecycle !== void 0) await client.send(new UpdateApplicationResourceLifecycleCommand({
16019
+ ApplicationName: name,
16020
+ ResourceLifecycleConfig: lifecycle
16021
+ }));
16022
+ assertOpsConsumed("ElasticBeanstalk Application", ops, new Set([...EB_APPLICATION_MODIFY_PARAMS, "ResourceLifecycleConfig"]));
16004
16023
  };
16005
16024
  const EB_ENVIRONMENT_MODIFY_PARAMS = new Set(["Description"]);
16006
16025
  const writeElasticBeanstalkEnvironment = async (ctx, ops) => {