cdk-real-drift 0.24.0 → 0.25.1
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 +132 -3
- package/dist/cli.js.map +1 -1
- package/package.json +2 -1
package/dist/cli.js
CHANGED
|
@@ -23,9 +23,11 @@ import { ApplicationAutoScalingClient, DescribeScalingPoliciesCommand } from "@a
|
|
|
23
23
|
import { AppSyncClient, DeleteApiKeyCommand, ListApiKeysCommand, ListDataSourcesCommand, ListFunctionsCommand, ListResolversCommand, ListTypesCommand } from "@aws-sdk/client-appsync";
|
|
24
24
|
import { ApiGatewayV2Client, DeleteAccessLogSettingsCommand, DeleteRouteSettingsCommand, GetAuthorizersCommand as GetAuthorizersCommand$1, GetIntegrationsCommand, GetRoutesCommand, GetStagesCommand as GetStagesCommand$1, UpdateStageCommand } from "@aws-sdk/client-apigatewayv2";
|
|
25
25
|
import { AutoScalingClient, DescribeLifecycleHooksCommand, DescribeScheduledActionsCommand } from "@aws-sdk/client-auto-scaling";
|
|
26
|
+
import { CodeDeployClient, ListDeploymentGroupsCommand } from "@aws-sdk/client-codedeploy";
|
|
26
27
|
import { CloudWatchLogsClient, DescribeMetricFiltersCommand, DescribeSubscriptionFiltersCommand, PutBearerTokenAuthenticationCommand, PutMetricFilterCommand } from "@aws-sdk/client-cloudwatch-logs";
|
|
27
28
|
import { CognitoIdentityProviderClient, DescribeUserPoolCommand, ListGroupsCommand, ListIdentityProvidersCommand, ListResourceServersCommand, ListUserPoolClientsCommand } from "@aws-sdk/client-cognito-identity-provider";
|
|
28
29
|
import { DescribeMountTargetsCommand, EFSClient } from "@aws-sdk/client-efs";
|
|
30
|
+
import { DescribeApplicationVersionsCommand, DescribeApplicationsCommand, DescribeConfigurationSettingsCommand, ElasticBeanstalkClient, UpdateApplicationCommand, UpdateApplicationResourceLifecycleCommand, UpdateEnvironmentCommand } from "@aws-sdk/client-elastic-beanstalk";
|
|
29
31
|
import { DescribeListenerCertificatesCommand, DescribeListenersCommand, DescribeRulesCommand, ElasticLoadBalancingV2Client, GetTrustStoreCaCertificatesBundleCommand, ModifyLoadBalancerAttributesCommand, ModifyTargetGroupAttributesCommand } from "@aws-sdk/client-elastic-load-balancing-v2";
|
|
30
32
|
import { DescribeEventBusCommand, EventBridgeClient, ListRulesCommand, PutPermissionCommand } from "@aws-sdk/client-eventbridge";
|
|
31
33
|
import { GetClassifierCommand, GetConnectionCommand, GetJobCommand, GetSecurityConfigurationCommand, GetTableCommand, GetTablesCommand, GetTagsCommand, GetWorkflowCommand, GlueClient, UpdateClassifierCommand, UpdateConnectionCommand, UpdateJobCommand, UpdateTableCommand, UpdateWorkflowCommand } from "@aws-sdk/client-glue";
|
|
@@ -39,7 +41,6 @@ import { GetTopicAttributesCommand, ListSubscriptionsByTopicCommand, SNSClient,
|
|
|
39
41
|
import { GetQueueAttributesCommand, SQSClient, SetQueueAttributesCommand } from "@aws-sdk/client-sqs";
|
|
40
42
|
import { ACMClient, DescribeCertificateCommand, ListTagsForCertificateCommand } from "@aws-sdk/client-acm";
|
|
41
43
|
import { BudgetsClient, DescribeBudgetCommand, UpdateBudgetCommand } from "@aws-sdk/client-budgets";
|
|
42
|
-
import { DescribeConfigurationSettingsCommand, ElasticBeanstalkClient, UpdateApplicationCommand, UpdateApplicationResourceLifecycleCommand, UpdateEnvironmentCommand } from "@aws-sdk/client-elastic-beanstalk";
|
|
43
44
|
import { CognitoSyncClient, GetCognitoEventsCommand, SetCognitoEventsCommand } from "@aws-sdk/client-cognito-sync";
|
|
44
45
|
import { BatchGetProjectsCommand, BatchGetReportGroupsCommand, CodeBuildClient, UpdateProjectCommand, UpdateReportGroupCommand } from "@aws-sdk/client-codebuild";
|
|
45
46
|
import { DescribeDBClustersCommand as DescribeDBClustersCommand$1, DescribeDBInstancesCommand as DescribeDBInstancesCommand$1, DocDBClient, ListTagsForResourceCommand as ListTagsForResourceCommand$1, ModifyDBClusterCommand, ModifyDBInstanceCommand } from "@aws-sdk/client-docdb";
|
|
@@ -2357,7 +2358,14 @@ const KNOWN_DEFAULTS = {
|
|
|
2357
2358
|
ConnectivityType: "public",
|
|
2358
2359
|
AvailabilityMode: "zonal"
|
|
2359
2360
|
},
|
|
2360
|
-
"AWS::CodeDeploy::DeploymentGroup": {
|
|
2361
|
+
"AWS::CodeDeploy::DeploymentGroup": {
|
|
2362
|
+
OutdatedInstancesStrategy: "UPDATE",
|
|
2363
|
+
DeploymentConfigName: "CodeDeployDefault.OneAtATime",
|
|
2364
|
+
DeploymentStyle: {
|
|
2365
|
+
DeploymentType: "IN_PLACE",
|
|
2366
|
+
DeploymentOption: "WITHOUT_TRAFFIC_CONTROL"
|
|
2367
|
+
}
|
|
2368
|
+
},
|
|
2361
2369
|
"AWS::EFS::FileSystem": {
|
|
2362
2370
|
ThroughputMode: "bursting",
|
|
2363
2371
|
BackupPolicy: { Status: "DISABLED" },
|
|
@@ -8447,7 +8455,9 @@ const CHILD_ENUMERATORS = {
|
|
|
8447
8455
|
"AWS::EC2::TransitGateway": enumerateTransitGatewayChildren,
|
|
8448
8456
|
"AWS::GuardDuty::Detector": enumerateGuardDutyDetectorChildren,
|
|
8449
8457
|
"AWS::SSM::MaintenanceWindow": enumerateMaintenanceWindowChildren,
|
|
8450
|
-
"AWS::ApplicationAutoScaling::ScalableTarget": enumerateScalableTargetChildren
|
|
8458
|
+
"AWS::ApplicationAutoScaling::ScalableTarget": enumerateScalableTargetChildren,
|
|
8459
|
+
"AWS::CodeDeploy::Application": enumerateCodeDeployApplicationChildren,
|
|
8460
|
+
"AWS::ElasticBeanstalk::Application": enumerateElasticBeanstalkApplicationChildren
|
|
8451
8461
|
};
|
|
8452
8462
|
function normalizeApiPath(p) {
|
|
8453
8463
|
let out = p.startsWith("/") ? p : `/${p}`;
|
|
@@ -11907,6 +11917,125 @@ async function enumerateScalableTargetChildren(ctx) {
|
|
|
11907
11917
|
}))
|
|
11908
11918
|
});
|
|
11909
11919
|
}
|
|
11920
|
+
function diffCodeDeployApplicationChildren(input) {
|
|
11921
|
+
const app = input.applicationName;
|
|
11922
|
+
const declared = new Set(input.declaredGroupNames);
|
|
11923
|
+
const added = [];
|
|
11924
|
+
for (const name of input.liveGroupNames) {
|
|
11925
|
+
if (declared.has(name)) continue;
|
|
11926
|
+
added.push({
|
|
11927
|
+
resourceType: "AWS::CodeDeploy::DeploymentGroup",
|
|
11928
|
+
identifier: `${app}|${name}`,
|
|
11929
|
+
label: name,
|
|
11930
|
+
live: {
|
|
11931
|
+
ApplicationName: app,
|
|
11932
|
+
DeploymentGroupName: name
|
|
11933
|
+
},
|
|
11934
|
+
siblingLookupId: name
|
|
11935
|
+
});
|
|
11936
|
+
}
|
|
11937
|
+
return added;
|
|
11938
|
+
}
|
|
11939
|
+
async function enumerateCodeDeployApplicationChildren(ctx) {
|
|
11940
|
+
const { parent, desired, region } = ctx;
|
|
11941
|
+
const applicationName = parent.physicalId;
|
|
11942
|
+
if (!applicationName) return [];
|
|
11943
|
+
const declaredGroupNames = [];
|
|
11944
|
+
for (const r of desired.resources) {
|
|
11945
|
+
if (r.resourceType !== "AWS::CodeDeploy::DeploymentGroup") continue;
|
|
11946
|
+
if (!parentRefMatches(r.declared.ApplicationName, applicationName)) continue;
|
|
11947
|
+
if (r.physicalId) declaredGroupNames.push(r.physicalId);
|
|
11948
|
+
if (typeof r.declared.DeploymentGroupName === "string") declaredGroupNames.push(r.declared.DeploymentGroupName);
|
|
11949
|
+
}
|
|
11950
|
+
const client = new CodeDeployClient({
|
|
11951
|
+
region,
|
|
11952
|
+
...READ_RETRY
|
|
11953
|
+
});
|
|
11954
|
+
const liveGroupNames = [];
|
|
11955
|
+
let token;
|
|
11956
|
+
do {
|
|
11957
|
+
const r = await client.send(new ListDeploymentGroupsCommand({
|
|
11958
|
+
applicationName,
|
|
11959
|
+
nextToken: token
|
|
11960
|
+
}));
|
|
11961
|
+
liveGroupNames.push(...r.deploymentGroups ?? []);
|
|
11962
|
+
token = r.nextToken;
|
|
11963
|
+
} while (token);
|
|
11964
|
+
return diffCodeDeployApplicationChildren({
|
|
11965
|
+
applicationName,
|
|
11966
|
+
declaredGroupNames,
|
|
11967
|
+
liveGroupNames
|
|
11968
|
+
});
|
|
11969
|
+
}
|
|
11970
|
+
function diffElasticBeanstalkApplicationChildren(input) {
|
|
11971
|
+
const app = input.applicationName;
|
|
11972
|
+
const added = [];
|
|
11973
|
+
const declaredVersions = new Set(input.declaredVersionLabels);
|
|
11974
|
+
for (const label of input.liveVersionLabels) {
|
|
11975
|
+
if (declaredVersions.has(label)) continue;
|
|
11976
|
+
added.push({
|
|
11977
|
+
resourceType: "AWS::ElasticBeanstalk::ApplicationVersion",
|
|
11978
|
+
identifier: `${app}|${label}`,
|
|
11979
|
+
label,
|
|
11980
|
+
live: {
|
|
11981
|
+
ApplicationName: app,
|
|
11982
|
+
Id: label
|
|
11983
|
+
},
|
|
11984
|
+
siblingLookupId: label
|
|
11985
|
+
});
|
|
11986
|
+
}
|
|
11987
|
+
const declaredTemplates = new Set(input.declaredTemplateNames);
|
|
11988
|
+
for (const name of input.liveTemplateNames) {
|
|
11989
|
+
if (declaredTemplates.has(name)) continue;
|
|
11990
|
+
added.push({
|
|
11991
|
+
resourceType: "AWS::ElasticBeanstalk::ConfigurationTemplate",
|
|
11992
|
+
identifier: `${app}|${name}`,
|
|
11993
|
+
label: name,
|
|
11994
|
+
live: {
|
|
11995
|
+
ApplicationName: app,
|
|
11996
|
+
TemplateName: name
|
|
11997
|
+
},
|
|
11998
|
+
siblingLookupId: name
|
|
11999
|
+
});
|
|
12000
|
+
}
|
|
12001
|
+
return added;
|
|
12002
|
+
}
|
|
12003
|
+
async function enumerateElasticBeanstalkApplicationChildren(ctx) {
|
|
12004
|
+
const { parent, desired, region } = ctx;
|
|
12005
|
+
const applicationName = parent.physicalId;
|
|
12006
|
+
if (!applicationName) return [];
|
|
12007
|
+
const declaredIdsOf = (type) => {
|
|
12008
|
+
const out = [];
|
|
12009
|
+
for (const r of desired.resources) {
|
|
12010
|
+
if (r.resourceType !== type) continue;
|
|
12011
|
+
if (!parentRefMatches(r.declared.ApplicationName, applicationName)) continue;
|
|
12012
|
+
if (r.physicalId) out.push(r.physicalId);
|
|
12013
|
+
}
|
|
12014
|
+
return out;
|
|
12015
|
+
};
|
|
12016
|
+
const client = new ElasticBeanstalkClient({
|
|
12017
|
+
region,
|
|
12018
|
+
...READ_RETRY
|
|
12019
|
+
});
|
|
12020
|
+
const liveVersions = [];
|
|
12021
|
+
let token;
|
|
12022
|
+
do {
|
|
12023
|
+
const r = await client.send(new DescribeApplicationVersionsCommand({
|
|
12024
|
+
ApplicationName: applicationName,
|
|
12025
|
+
NextToken: token
|
|
12026
|
+
}));
|
|
12027
|
+
liveVersions.push(...r.ApplicationVersions ?? []);
|
|
12028
|
+
token = r.NextToken;
|
|
12029
|
+
} while (token);
|
|
12030
|
+
const liveTemplateNames = (await client.send(new DescribeApplicationsCommand({ ApplicationNames: [applicationName] }))).Applications?.[0]?.ConfigurationTemplates ?? [];
|
|
12031
|
+
return diffElasticBeanstalkApplicationChildren({
|
|
12032
|
+
applicationName,
|
|
12033
|
+
declaredVersionLabels: declaredIdsOf("AWS::ElasticBeanstalk::ApplicationVersion"),
|
|
12034
|
+
declaredTemplateNames: declaredIdsOf("AWS::ElasticBeanstalk::ConfigurationTemplate"),
|
|
12035
|
+
liveVersionLabels: liveVersions.map((v) => v.VersionLabel).filter((l) => typeof l === "string"),
|
|
12036
|
+
liveTemplateNames
|
|
12037
|
+
});
|
|
12038
|
+
}
|
|
11910
12039
|
|
|
11911
12040
|
//#endregion
|
|
11912
12041
|
//#region src/read/pem.ts
|