cdk-real-drift 0.2.75 → 0.2.76
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 +16 -9
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -19,13 +19,13 @@ import { DescribeMountTargetsCommand, EFSClient } from "@aws-sdk/client-efs";
|
|
|
19
19
|
import { DescribeListenersCommand, DescribeRulesCommand, ElasticLoadBalancingV2Client, GetTrustStoreCaCertificatesBundleCommand, ModifyLoadBalancerAttributesCommand, ModifyTargetGroupAttributesCommand } from "@aws-sdk/client-elastic-load-balancing-v2";
|
|
20
20
|
import { DescribeEventBusCommand, EventBridgeClient, ListRulesCommand, PutPermissionCommand } from "@aws-sdk/client-eventbridge";
|
|
21
21
|
import { GetPolicyCommand, LambdaClient, ListAliasesCommand as ListAliasesCommand$1, ListEventSourceMappingsCommand, ListFunctionUrlConfigsCommand, ListVersionsByFunctionCommand } from "@aws-sdk/client-lambda";
|
|
22
|
-
import { DescribeDBInstancesCommand, RDSClient } from "@aws-sdk/client-rds";
|
|
22
|
+
import { DescribeDBClustersCommand, DescribeDBInstancesCommand, RDSClient } from "@aws-sdk/client-rds";
|
|
23
23
|
import { GetTopicAttributesCommand, ListSubscriptionsByTopicCommand, SNSClient, SetTopicAttributesCommand } from "@aws-sdk/client-sns";
|
|
24
24
|
import { BudgetsClient, DescribeBudgetCommand } from "@aws-sdk/client-budgets";
|
|
25
25
|
import { DescribeConfigurationSettingsCommand, ElasticBeanstalkClient, UpdateApplicationCommand, UpdateEnvironmentCommand } from "@aws-sdk/client-elastic-beanstalk";
|
|
26
26
|
import { CognitoSyncClient, GetCognitoEventsCommand, SetCognitoEventsCommand } from "@aws-sdk/client-cognito-sync";
|
|
27
27
|
import { BatchGetProjectsCommand, BatchGetReportGroupsCommand, CodeBuildClient, UpdateReportGroupCommand } from "@aws-sdk/client-codebuild";
|
|
28
|
-
import { DescribeDBClustersCommand, DescribeDBInstancesCommand as DescribeDBInstancesCommand$1, DocDBClient, ModifyDBClusterCommand, ModifyDBInstanceCommand } from "@aws-sdk/client-docdb";
|
|
28
|
+
import { DescribeDBClustersCommand as DescribeDBClustersCommand$1, DescribeDBInstancesCommand as DescribeDBInstancesCommand$1, DocDBClient, ModifyDBClusterCommand, ModifyDBInstanceCommand } from "@aws-sdk/client-docdb";
|
|
29
29
|
import { DAXClient, DescribeClustersCommand, DescribeParameterGroupsCommand, DescribeParametersCommand, DescribeSubnetGroupsCommand, UpdateClusterCommand, UpdateParameterGroupCommand } from "@aws-sdk/client-dax";
|
|
30
30
|
import { GetClassifierCommand, GetConnectionCommand, GetJobCommand, GetTableCommand, GetWorkflowCommand, GlueClient, UpdateClassifierCommand, UpdateConnectionCommand, UpdateJobCommand, UpdateTableCommand, UpdateWorkflowCommand } from "@aws-sdk/client-glue";
|
|
31
31
|
import { ChangeResourceRecordSetsCommand, ListResourceRecordSetsCommand, Route53Client } from "@aws-sdk/client-route-53";
|
|
@@ -6820,9 +6820,10 @@ async function enumerateEfsFileSystemChildren(ctx) {
|
|
|
6820
6820
|
}
|
|
6821
6821
|
function diffRdsClusterChildren(input) {
|
|
6822
6822
|
const declared = new Set(input.declaredInstanceIds);
|
|
6823
|
+
const clusterMembers = new Set(input.clusterMemberIds);
|
|
6823
6824
|
const added = [];
|
|
6824
6825
|
for (const i of input.liveInstances) {
|
|
6825
|
-
if (declared.has(i.id)) continue;
|
|
6826
|
+
if (declared.has(i.id) || clusterMembers.has(i.id)) continue;
|
|
6826
6827
|
added.push({
|
|
6827
6828
|
resourceType: "AWS::RDS::DBInstance",
|
|
6828
6829
|
identifier: i.id,
|
|
@@ -6848,21 +6849,27 @@ async function pageDbInstances(client, clusterId) {
|
|
|
6848
6849
|
} while (marker);
|
|
6849
6850
|
return out;
|
|
6850
6851
|
}
|
|
6852
|
+
async function describeClusterMemberIds(client, clusterId) {
|
|
6853
|
+
return (((await client.send(new DescribeDBClustersCommand({ DBClusterIdentifier: clusterId }))).DBClusters?.[0])?.DBClusterMembers ?? []).map((m) => m.DBInstanceIdentifier).filter((id) => typeof id === "string");
|
|
6854
|
+
}
|
|
6851
6855
|
async function enumerateRdsClusterChildren(ctx) {
|
|
6852
6856
|
const { parent, desired, region } = ctx;
|
|
6853
6857
|
const clusterId = parent.physicalId;
|
|
6854
6858
|
if (!clusterId) return [];
|
|
6855
6859
|
const declaredInstanceIds = [];
|
|
6856
6860
|
for (const r of desired.resources) if (r.resourceType === "AWS::RDS::DBInstance" && r.declared.DBClusterIdentifier === clusterId && r.physicalId) declaredInstanceIds.push(r.physicalId);
|
|
6861
|
+
const client = new RDSClient({
|
|
6862
|
+
region,
|
|
6863
|
+
...READ_RETRY
|
|
6864
|
+
});
|
|
6865
|
+
const [instances, clusterMemberIds] = await Promise.all([pageDbInstances(client, clusterId), describeClusterMemberIds(client, clusterId)]);
|
|
6857
6866
|
return diffRdsClusterChildren({
|
|
6858
6867
|
declaredInstanceIds,
|
|
6859
|
-
liveInstances: (
|
|
6860
|
-
region,
|
|
6861
|
-
...READ_RETRY
|
|
6862
|
-
}), clusterId)).filter((i) => typeof i.DBInstanceIdentifier === "string").map((i) => ({
|
|
6868
|
+
liveInstances: instances.filter((i) => typeof i.DBInstanceIdentifier === "string").map((i) => ({
|
|
6863
6869
|
id: i.DBInstanceIdentifier,
|
|
6864
6870
|
label: i.DBInstanceIdentifier
|
|
6865
|
-
}))
|
|
6871
|
+
})),
|
|
6872
|
+
clusterMemberIds
|
|
6866
6873
|
});
|
|
6867
6874
|
}
|
|
6868
6875
|
|
|
@@ -7944,7 +7951,7 @@ const readDocDbCluster = async ({ physicalId, declared, region }) => {
|
|
|
7944
7951
|
const cl = (await new DocDBClient({
|
|
7945
7952
|
region,
|
|
7946
7953
|
...READ_RETRY
|
|
7947
|
-
}).send(new DescribeDBClustersCommand({ DBClusterIdentifier: id }))).DBClusters?.[0];
|
|
7954
|
+
}).send(new DescribeDBClustersCommand$1({ DBClusterIdentifier: id }))).DBClusters?.[0];
|
|
7948
7955
|
if (!cl) return void 0;
|
|
7949
7956
|
const model = {};
|
|
7950
7957
|
if (cl.DBClusterIdentifier !== void 0) model.DBClusterIdentifier = cl.DBClusterIdentifier;
|