cdk-real-drift 0.25.1 → 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 +58 -7
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
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";
|
|
@@ -4078,8 +4078,18 @@ const CASE_INSENSITIVE_PATHS = {
|
|
|
4078
4078
|
"DBSubnetGroupName"
|
|
4079
4079
|
]),
|
|
4080
4080
|
"AWS::ElastiCache::SubnetGroup": new Set(["CacheSubnetGroupName"]),
|
|
4081
|
-
"AWS::ElastiCache::ReplicationGroup": new Set([
|
|
4082
|
-
|
|
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"]),
|
|
4083
4093
|
"AWS::DocDB::DBCluster": new Set([
|
|
4084
4094
|
"DBClusterIdentifier",
|
|
4085
4095
|
"DBSubnetGroupName",
|
|
@@ -4116,6 +4126,11 @@ const CASE_INSENSITIVE_PATHS = {
|
|
|
4116
4126
|
"AWS::DMS::ReplicationSubnetGroup": new Set(["ReplicationSubnetGroupIdentifier"]),
|
|
4117
4127
|
"AWS::DAX::ParameterGroup": new Set(["ParameterGroupName"]),
|
|
4118
4128
|
"AWS::DAX::SubnetGroup": new Set(["SubnetGroupName"]),
|
|
4129
|
+
"AWS::DAX::Cluster": new Set([
|
|
4130
|
+
"ClusterName",
|
|
4131
|
+
"ParameterGroupName",
|
|
4132
|
+
"SubnetGroupName"
|
|
4133
|
+
]),
|
|
4119
4134
|
"AWS::CertificateManager::Certificate": new Set(["DomainName"]),
|
|
4120
4135
|
"AWS::DMS::Endpoint": new Set(["EndpointType", "EndpointIdentifier"]),
|
|
4121
4136
|
"AWS::WAFv2::LoggingConfiguration": new Set(["RedactedFields.*.SingleHeader.Name"]),
|
|
@@ -4318,7 +4333,9 @@ const CASE_INSENSITIVE_ARRAY_PATHS = {
|
|
|
4318
4333
|
"AWS::ApiGatewayV2::Api": new Set(["CorsConfiguration.AllowHeaders", "CorsConfiguration.ExposeHeaders"]),
|
|
4319
4334
|
"AWS::Lambda::Url": new Set(["Cors.AllowHeaders", "Cors.ExposeHeaders"]),
|
|
4320
4335
|
"AWS::CertificateManager::Certificate": new Set(["SubjectAlternativeNames"]),
|
|
4321
|
-
"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"])
|
|
4322
4339
|
};
|
|
4323
4340
|
function isCaseInsensitiveEqualScalarSet(a, b) {
|
|
4324
4341
|
if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) return false;
|
|
@@ -5529,6 +5546,9 @@ function elbTargetGroupDerivedHealthCheckProtocol(protocol, targetType) {
|
|
|
5529
5546
|
function elbTargetGroupDerivedHealthCheckPort(protocol) {
|
|
5530
5547
|
return protocol === "GENEVE" ? "80" : void 0;
|
|
5531
5548
|
}
|
|
5549
|
+
function logsDeliveryDerivedRetention(logGroupClass) {
|
|
5550
|
+
return logGroupClass === "DELIVERY" ? 2 : void 0;
|
|
5551
|
+
}
|
|
5532
5552
|
function rdsReplicaDerivedBackupRetention(sourceDbInstanceIdentifier) {
|
|
5533
5553
|
return sourceDbInstanceIdentifier !== void 0 ? 0 : void 0;
|
|
5534
5554
|
}
|
|
@@ -7418,6 +7438,13 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
|
|
|
7418
7438
|
"HealthCheckConfig.Port": defaultPort
|
|
7419
7439
|
};
|
|
7420
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
|
+
}
|
|
7421
7448
|
if (resourceType === "AWS::ApiGateway::RestApi") {
|
|
7422
7449
|
const types = declared["EndpointConfiguration"]?.["Types"];
|
|
7423
7450
|
if (Array.isArray(types) && types.includes("PRIVATE")) {
|
|
@@ -10253,6 +10280,16 @@ async function pageSubscriptionFilters(client, logGroupName) {
|
|
|
10253
10280
|
} while (next);
|
|
10254
10281
|
return out;
|
|
10255
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
|
+
}
|
|
10256
10293
|
async function enumerateLogGroupChildren(ctx) {
|
|
10257
10294
|
const { parent, desired, region } = ctx;
|
|
10258
10295
|
const logGroupName = parent.physicalId;
|
|
@@ -10273,8 +10310,8 @@ async function enumerateLogGroupChildren(ctx) {
|
|
|
10273
10310
|
region,
|
|
10274
10311
|
...READ_RETRY
|
|
10275
10312
|
});
|
|
10276
|
-
const liveFilters = (await pageMetricFilters(client, logGroupName)).filter((f) => typeof f.filterName === "string").map((f) => ({ name: f.filterName }));
|
|
10277
|
-
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 }));
|
|
10278
10315
|
return [...diffLogGroupChildren({
|
|
10279
10316
|
logGroupName,
|
|
10280
10317
|
declaredFilterNames,
|
|
@@ -20127,13 +20164,25 @@ const deleteKmsGrant = async (ctx) => {
|
|
|
20127
20164
|
GrantId: ctx.physicalId
|
|
20128
20165
|
}));
|
|
20129
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
|
+
};
|
|
20130
20178
|
const SDK_DELETERS = {
|
|
20131
20179
|
"AWS::AppSync::ApiKey": deleteAppSyncApiKey,
|
|
20132
20180
|
"AWS::Route53::RecordSet": deleteRoute53RecordSet,
|
|
20133
20181
|
"AWS::SQS::QueuePolicy": deleteSqsQueuePolicy,
|
|
20134
20182
|
"AWS::SecretsManager::ResourcePolicy": deleteSecretsManagerResourcePolicy,
|
|
20135
20183
|
"AWS::SNS::TopicPolicy": deleteSnsTopicPolicy,
|
|
20136
|
-
"AWS::KMS::Grant": deleteKmsGrant
|
|
20184
|
+
"AWS::KMS::Grant": deleteKmsGrant,
|
|
20185
|
+
"AWS::Glue::Table": deleteGlueTable
|
|
20137
20186
|
};
|
|
20138
20187
|
|
|
20139
20188
|
//#endregion
|
|
@@ -20153,6 +20202,7 @@ const CC_REVERTABLE_DESPITE_READ_OVERRIDE = new Set([
|
|
|
20153
20202
|
const REVERT_SET_DEFAULT_PATHS = new Set([
|
|
20154
20203
|
"AWS::EC2::CapacityReservation\0InstanceMatchCriteria",
|
|
20155
20204
|
"AWS::EC2::CapacityReservation\0EndDateType",
|
|
20205
|
+
"AWS::CodeDeploy::DeploymentGroup\0DeploymentConfigName",
|
|
20156
20206
|
"AWS::DLM::LifecyclePolicy\0RetainInterval",
|
|
20157
20207
|
"AWS::DLM::LifecyclePolicy\0CreateInterval",
|
|
20158
20208
|
"AWS::IAM::Role\0MaxSessionDuration",
|
|
@@ -20704,6 +20754,7 @@ function derivedRevertDefaultFor(resourceType, path, declared) {
|
|
|
20704
20754
|
if (path === "HealthCheckPort") return elbTargetGroupDerivedHealthCheckPort(declared["Protocol"]);
|
|
20705
20755
|
}
|
|
20706
20756
|
if (resourceType === "AWS::RDS::DBInstance" && path === "BackupRetentionPeriod") return rdsReplicaDerivedBackupRetention(declared["SourceDBInstanceIdentifier"]);
|
|
20757
|
+
if (resourceType === "AWS::Logs::LogGroup" && path === "RetentionInDays") return logsDeliveryDerivedRetention(declared["LogGroupClass"]);
|
|
20707
20758
|
}
|
|
20708
20759
|
const REVERT_COMPANION_REMOVES = {
|
|
20709
20760
|
"AWS::ElasticLoadBalancingV2::TargetGroup\0HealthCheckProtocol": (value) => value === "TCP" ? ["Matcher", "HealthCheckPath"] : [],
|