cdk-real-drift 0.25.0 → 0.25.2

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
@@ -30,7 +30,7 @@ import { DescribeMountTargetsCommand, EFSClient } from "@aws-sdk/client-efs";
30
30
  import { DescribeApplicationVersionsCommand, DescribeApplicationsCommand, DescribeConfigurationSettingsCommand, ElasticBeanstalkClient, UpdateApplicationCommand, UpdateApplicationResourceLifecycleCommand, UpdateEnvironmentCommand } from "@aws-sdk/client-elastic-beanstalk";
31
31
  import { DescribeListenerCertificatesCommand, DescribeListenersCommand, DescribeRulesCommand, ElasticLoadBalancingV2Client, GetTrustStoreCaCertificatesBundleCommand, ModifyLoadBalancerAttributesCommand, ModifyTargetGroupAttributesCommand } from "@aws-sdk/client-elastic-load-balancing-v2";
32
32
  import { DescribeEventBusCommand, EventBridgeClient, ListRulesCommand, PutPermissionCommand } from "@aws-sdk/client-eventbridge";
33
- import { GetClassifierCommand, GetConnectionCommand, GetJobCommand, GetSecurityConfigurationCommand, GetTableCommand, GetTablesCommand, GetTagsCommand, GetWorkflowCommand, GlueClient, UpdateClassifierCommand, UpdateConnectionCommand, UpdateJobCommand, UpdateTableCommand, UpdateWorkflowCommand } from "@aws-sdk/client-glue";
33
+ import { DeleteTableCommand, GetClassifierCommand, GetConnectionCommand, GetJobCommand, GetSecurityConfigurationCommand, GetTableCommand, GetTablesCommand, GetTagsCommand, GetWorkflowCommand, GlueClient, UpdateClassifierCommand, UpdateConnectionCommand, UpdateJobCommand, UpdateTableCommand, UpdateWorkflowCommand } from "@aws-sdk/client-glue";
34
34
  import { GuardDutyClient, ListFiltersCommand, ListIPSetsCommand, ListPublishingDestinationsCommand, ListThreatEntitySetsCommand, ListThreatIntelSetsCommand, ListTrustedEntitySetsCommand } from "@aws-sdk/client-guardduty";
35
35
  import { AddPermissionCommand, GetFunctionCommand, GetPolicyCommand, LambdaClient, ListAliasesCommand as ListAliasesCommand$1, ListEventSourceMappingsCommand, ListFunctionUrlConfigsCommand, ListVersionsByFunctionCommand, RemovePermissionCommand } from "@aws-sdk/client-lambda";
36
36
  import { DescribeDomainConfigCommand, DescribeDomainsCommand, ListDomainNamesCommand, OpenSearchClient, UpdateDomainConfigCommand } from "@aws-sdk/client-opensearch";
@@ -2358,7 +2358,14 @@ const KNOWN_DEFAULTS = {
2358
2358
  ConnectivityType: "public",
2359
2359
  AvailabilityMode: "zonal"
2360
2360
  },
2361
- "AWS::CodeDeploy::DeploymentGroup": { OutdatedInstancesStrategy: "UPDATE" },
2361
+ "AWS::CodeDeploy::DeploymentGroup": {
2362
+ OutdatedInstancesStrategy: "UPDATE",
2363
+ DeploymentConfigName: "CodeDeployDefault.OneAtATime",
2364
+ DeploymentStyle: {
2365
+ DeploymentType: "IN_PLACE",
2366
+ DeploymentOption: "WITHOUT_TRAFFIC_CONTROL"
2367
+ }
2368
+ },
2362
2369
  "AWS::EFS::FileSystem": {
2363
2370
  ThroughputMode: "bursting",
2364
2371
  BackupPolicy: { Status: "DISABLED" },
@@ -4071,8 +4078,18 @@ const CASE_INSENSITIVE_PATHS = {
4071
4078
  "DBSubnetGroupName"
4072
4079
  ]),
4073
4080
  "AWS::ElastiCache::SubnetGroup": new Set(["CacheSubnetGroupName"]),
4074
- "AWS::ElastiCache::ReplicationGroup": new Set(["ReplicationGroupId", "CacheSubnetGroupName"]),
4075
- "AWS::ElastiCache::CacheCluster": new Set(["ClusterName", "CacheSubnetGroupName"]),
4081
+ "AWS::ElastiCache::ReplicationGroup": new Set([
4082
+ "ReplicationGroupId",
4083
+ "CacheSubnetGroupName",
4084
+ "CacheParameterGroupName"
4085
+ ]),
4086
+ "AWS::ElastiCache::CacheCluster": new Set([
4087
+ "ClusterName",
4088
+ "CacheSubnetGroupName",
4089
+ "CacheParameterGroupName"
4090
+ ]),
4091
+ "AWS::ElastiCache::ServerlessCache": new Set(["ServerlessCacheName", "UserGroupId"]),
4092
+ "AWS::Route53Resolver::ResolverRule": new Set(["DomainName"]),
4076
4093
  "AWS::DocDB::DBCluster": new Set([
4077
4094
  "DBClusterIdentifier",
4078
4095
  "DBSubnetGroupName",
@@ -4109,6 +4126,11 @@ const CASE_INSENSITIVE_PATHS = {
4109
4126
  "AWS::DMS::ReplicationSubnetGroup": new Set(["ReplicationSubnetGroupIdentifier"]),
4110
4127
  "AWS::DAX::ParameterGroup": new Set(["ParameterGroupName"]),
4111
4128
  "AWS::DAX::SubnetGroup": new Set(["SubnetGroupName"]),
4129
+ "AWS::DAX::Cluster": new Set([
4130
+ "ClusterName",
4131
+ "ParameterGroupName",
4132
+ "SubnetGroupName"
4133
+ ]),
4112
4134
  "AWS::CertificateManager::Certificate": new Set(["DomainName"]),
4113
4135
  "AWS::DMS::Endpoint": new Set(["EndpointType", "EndpointIdentifier"]),
4114
4136
  "AWS::WAFv2::LoggingConfiguration": new Set(["RedactedFields.*.SingleHeader.Name"]),
@@ -4311,7 +4333,9 @@ const CASE_INSENSITIVE_ARRAY_PATHS = {
4311
4333
  "AWS::ApiGatewayV2::Api": new Set(["CorsConfiguration.AllowHeaders", "CorsConfiguration.ExposeHeaders"]),
4312
4334
  "AWS::Lambda::Url": new Set(["Cors.AllowHeaders", "Cors.ExposeHeaders"]),
4313
4335
  "AWS::CertificateManager::Certificate": new Set(["SubjectAlternativeNames"]),
4314
- "AWS::SES::ConfigurationSetEventDestination": new Set(["EventDestination.MatchingEventTypes"])
4336
+ "AWS::SES::ConfigurationSetEventDestination": new Set(["EventDestination.MatchingEventTypes"]),
4337
+ "AWS::ElastiCache::UserGroup": new Set(["UserIds"]),
4338
+ "AWS::ElastiCache::ReplicationGroup": new Set(["UserGroupIds"])
4315
4339
  };
4316
4340
  function isCaseInsensitiveEqualScalarSet(a, b) {
4317
4341
  if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) return false;
@@ -5522,6 +5546,9 @@ function elbTargetGroupDerivedHealthCheckProtocol(protocol, targetType) {
5522
5546
  function elbTargetGroupDerivedHealthCheckPort(protocol) {
5523
5547
  return protocol === "GENEVE" ? "80" : void 0;
5524
5548
  }
5549
+ function logsDeliveryDerivedRetention(logGroupClass) {
5550
+ return logGroupClass === "DELIVERY" ? 2 : void 0;
5551
+ }
5525
5552
  function rdsReplicaDerivedBackupRetention(sourceDbInstanceIdentifier) {
5526
5553
  return sourceDbInstanceIdentifier !== void 0 ? 0 : void 0;
5527
5554
  }
@@ -7411,6 +7438,13 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
7411
7438
  "HealthCheckConfig.Port": defaultPort
7412
7439
  };
7413
7440
  }
7441
+ if (resourceType === "AWS::Logs::LogGroup") {
7442
+ const derivedRetention = logsDeliveryDerivedRetention(declared["LogGroupClass"]);
7443
+ if (derivedRetention !== void 0) knownDef = {
7444
+ ...knownDef,
7445
+ RetentionInDays: derivedRetention
7446
+ };
7447
+ }
7414
7448
  if (resourceType === "AWS::ApiGateway::RestApi") {
7415
7449
  const types = declared["EndpointConfiguration"]?.["Types"];
7416
7450
  if (Array.isArray(types) && types.includes("PRIVATE")) {
@@ -10246,6 +10280,16 @@ async function pageSubscriptionFilters(client, logGroupName) {
10246
10280
  } while (next);
10247
10281
  return out;
10248
10282
  }
10283
+ async function tolerateNonStandardLogClass(call) {
10284
+ try {
10285
+ return await call();
10286
+ } catch (e) {
10287
+ const err = e;
10288
+ const msg = typeof err.message === "string" ? err.message : "";
10289
+ if (err.name === "ValidationException" && msg.includes("Standard log class")) return [];
10290
+ throw e;
10291
+ }
10292
+ }
10249
10293
  async function enumerateLogGroupChildren(ctx) {
10250
10294
  const { parent, desired, region } = ctx;
10251
10295
  const logGroupName = parent.physicalId;
@@ -10266,8 +10310,8 @@ async function enumerateLogGroupChildren(ctx) {
10266
10310
  region,
10267
10311
  ...READ_RETRY
10268
10312
  });
10269
- const liveFilters = (await pageMetricFilters(client, logGroupName)).filter((f) => typeof f.filterName === "string").map((f) => ({ name: f.filterName }));
10270
- const liveSubs = (await pageSubscriptionFilters(client, logGroupName)).filter((f) => typeof f.filterName === "string").map((f) => ({ name: f.filterName }));
10313
+ const liveFilters = (await tolerateNonStandardLogClass(() => pageMetricFilters(client, logGroupName))).filter((f) => typeof f.filterName === "string").map((f) => ({ name: f.filterName }));
10314
+ const liveSubs = (await tolerateNonStandardLogClass(() => pageSubscriptionFilters(client, logGroupName))).filter((f) => typeof f.filterName === "string").map((f) => ({ name: f.filterName }));
10271
10315
  return [...diffLogGroupChildren({
10272
10316
  logGroupName,
10273
10317
  declaredFilterNames,
@@ -20120,13 +20164,25 @@ const deleteKmsGrant = async (ctx) => {
20120
20164
  GrantId: ctx.physicalId
20121
20165
  }));
20122
20166
  };
20167
+ const deleteGlueTable = async (ctx) => {
20168
+ const sep = ctx.physicalId.indexOf("|");
20169
+ if (sep <= 0) throw new Error(`cannot split the Glue table identifier '${ctx.physicalId}' into DatabaseName|TableName`);
20170
+ await new GlueClient({
20171
+ region: ctx.region,
20172
+ ...CLIENT_TIMEOUTS
20173
+ }).send(new DeleteTableCommand({
20174
+ DatabaseName: ctx.physicalId.slice(0, sep),
20175
+ Name: ctx.physicalId.slice(sep + 1)
20176
+ }));
20177
+ };
20123
20178
  const SDK_DELETERS = {
20124
20179
  "AWS::AppSync::ApiKey": deleteAppSyncApiKey,
20125
20180
  "AWS::Route53::RecordSet": deleteRoute53RecordSet,
20126
20181
  "AWS::SQS::QueuePolicy": deleteSqsQueuePolicy,
20127
20182
  "AWS::SecretsManager::ResourcePolicy": deleteSecretsManagerResourcePolicy,
20128
20183
  "AWS::SNS::TopicPolicy": deleteSnsTopicPolicy,
20129
- "AWS::KMS::Grant": deleteKmsGrant
20184
+ "AWS::KMS::Grant": deleteKmsGrant,
20185
+ "AWS::Glue::Table": deleteGlueTable
20130
20186
  };
20131
20187
 
20132
20188
  //#endregion
@@ -20146,6 +20202,7 @@ const CC_REVERTABLE_DESPITE_READ_OVERRIDE = new Set([
20146
20202
  const REVERT_SET_DEFAULT_PATHS = new Set([
20147
20203
  "AWS::EC2::CapacityReservation\0InstanceMatchCriteria",
20148
20204
  "AWS::EC2::CapacityReservation\0EndDateType",
20205
+ "AWS::CodeDeploy::DeploymentGroup\0DeploymentConfigName",
20149
20206
  "AWS::DLM::LifecyclePolicy\0RetainInterval",
20150
20207
  "AWS::DLM::LifecyclePolicy\0CreateInterval",
20151
20208
  "AWS::IAM::Role\0MaxSessionDuration",
@@ -20697,6 +20754,7 @@ function derivedRevertDefaultFor(resourceType, path, declared) {
20697
20754
  if (path === "HealthCheckPort") return elbTargetGroupDerivedHealthCheckPort(declared["Protocol"]);
20698
20755
  }
20699
20756
  if (resourceType === "AWS::RDS::DBInstance" && path === "BackupRetentionPeriod") return rdsReplicaDerivedBackupRetention(declared["SourceDBInstanceIdentifier"]);
20757
+ if (resourceType === "AWS::Logs::LogGroup" && path === "RetentionInDays") return logsDeliveryDerivedRetention(declared["LogGroupClass"]);
20700
20758
  }
20701
20759
  const REVERT_COMPANION_REMOVES = {
20702
20760
  "AWS::ElasticLoadBalancingV2::TargetGroup\0HealthCheckProtocol": (value) => value === "TCP" ? ["Matcher", "HealthCheckPath"] : [],