cdk-real-drift 0.1.10 → 0.2.0
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 +5 -0
- package/dist/cli.js +57 -12
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -599,6 +599,11 @@ covers them. **If you never run `revert`, cdkrd needs no write permissions at al
|
|
|
599
599
|
(supplement an `AWS::MSK::Configuration` with its writeOnly `ServerProperties`
|
|
600
600
|
Kafka blob — an out-of-band `update-configuration` revision is otherwise
|
|
601
601
|
invisible),
|
|
602
|
+
`elasticbeanstalk:DescribeConfigurationSettings` (supplements an
|
|
603
|
+
`AWS::ElasticBeanstalk::Environment` with its writeOnly `OptionSettings` — the
|
|
604
|
+
full resolved option set; an out-of-band console edit to any environment option
|
|
605
|
+
is otherwise invisible, and the service-filled default options fold to
|
|
606
|
+
`atDefault`),
|
|
602
607
|
`servicediscovery:GetNamespace` (reads a Cloud Map
|
|
603
608
|
`HttpNamespace` / `PrivateDnsNamespace` / `PublicDnsNamespace` — incl. the Arn an
|
|
604
609
|
ECS Service Connect namespace `Fn::GetAtt` resolves against)
|
package/dist/cli.js
CHANGED
|
@@ -22,6 +22,7 @@ import { GetPolicyCommand, LambdaClient, ListAliasesCommand as ListAliasesComman
|
|
|
22
22
|
import { 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
|
+
import { DescribeConfigurationSettingsCommand, ElasticBeanstalkClient, UpdateApplicationCommand, UpdateEnvironmentCommand } from "@aws-sdk/client-elastic-beanstalk";
|
|
25
26
|
import { CognitoSyncClient, GetCognitoEventsCommand, SetCognitoEventsCommand } from "@aws-sdk/client-cognito-sync";
|
|
26
27
|
import { BatchGetProjectsCommand, BatchGetReportGroupsCommand, CodeBuildClient, UpdateReportGroupCommand } from "@aws-sdk/client-codebuild";
|
|
27
28
|
import { DescribeDBClustersCommand, DescribeDBInstancesCommand as DescribeDBInstancesCommand$1, DocDBClient, ModifyDBClusterCommand, ModifyDBInstanceCommand } from "@aws-sdk/client-docdb";
|
|
@@ -49,7 +50,6 @@ import { S_BAR, S_BAR_END, S_BAR_START, S_CHECKBOX_INACTIVE, S_CHECKBOX_SELECTED
|
|
|
49
50
|
import pc from "picocolors";
|
|
50
51
|
import { MultiSelectPrompt, Prompt, isCancel as isCancel$1 } from "@clack/core";
|
|
51
52
|
import { CloudFrontClient, GetDistributionConfigCommand, UpdateDistributionCommand } from "@aws-sdk/client-cloudfront";
|
|
52
|
-
import { ElasticBeanstalkClient, UpdateApplicationCommand, UpdateEnvironmentCommand } from "@aws-sdk/client-elastic-beanstalk";
|
|
53
53
|
import { DescribeDomainConfigCommand, OpenSearchClient, UpdateDomainConfigCommand } from "@aws-sdk/client-opensearch";
|
|
54
54
|
import { GetWebACLCommand, UpdateWebACLCommand, WAFV2Client } from "@aws-sdk/client-wafv2";
|
|
55
55
|
import { ConfigServiceClient, DescribeConfigRulesCommand, PutConfigRuleCommand } from "@aws-sdk/client-config-service";
|
|
@@ -1103,6 +1103,13 @@ const KNOWN_DEFAULTS = {
|
|
|
1103
1103
|
Version: "1.0",
|
|
1104
1104
|
Name: "WebServer"
|
|
1105
1105
|
} },
|
|
1106
|
+
"AWS::ElasticLoadBalancing::LoadBalancer": {
|
|
1107
|
+
ConnectionSettings: { IdleTimeout: 60 },
|
|
1108
|
+
ConnectionDrainingPolicy: {
|
|
1109
|
+
Enabled: false,
|
|
1110
|
+
Timeout: 300
|
|
1111
|
+
}
|
|
1112
|
+
},
|
|
1106
1113
|
"AWS::S3::Bucket": {
|
|
1107
1114
|
VersioningConfiguration: { Status: "Suspended" },
|
|
1108
1115
|
AbacStatus: "Disabled",
|
|
@@ -1976,7 +1983,7 @@ const EB_OPTION_DEFAULTS = {
|
|
|
1976
1983
|
"aws:elasticbeanstalk:control|RollbackLaunchOnFailure": "false",
|
|
1977
1984
|
"aws:elasticbeanstalk:environment:proxy|ProxyServer": "nginx",
|
|
1978
1985
|
"aws:elasticbeanstalk:environment|LoadBalancerType": "classic",
|
|
1979
|
-
"aws:elasticbeanstalk:
|
|
1986
|
+
"aws:elasticbeanstalk:environment|ServiceRole": "AWSServiceRoleForElasticBeanstalk",
|
|
1980
1987
|
"aws:elasticbeanstalk:healthreporting:system|HealthCheckSuccessThreshold": "Ok",
|
|
1981
1988
|
"aws:elasticbeanstalk:healthreporting:system|SystemType": "enhanced",
|
|
1982
1989
|
"aws:elasticbeanstalk:hostmanager|LogPublicationControl": "false",
|
|
@@ -2002,7 +2009,18 @@ const EB_OPTION_DEFAULTS = {
|
|
|
2002
2009
|
"aws:elb:policies|ConnectionDrainingEnabled": "false",
|
|
2003
2010
|
"aws:elb:policies|ConnectionDrainingTimeout": "20",
|
|
2004
2011
|
"aws:elb:policies|ConnectionSettingIdleTimeout": "60",
|
|
2005
|
-
"aws:rds:dbinstance|HasCoupledDatabase": "false"
|
|
2012
|
+
"aws:rds:dbinstance|HasCoupledDatabase": "false",
|
|
2013
|
+
"aws:elasticbeanstalk:container:python|NumProcesses": "1",
|
|
2014
|
+
"aws:elasticbeanstalk:container:python|NumThreads": "15",
|
|
2015
|
+
"aws:elasticbeanstalk:container:python|WSGIPath": "application",
|
|
2016
|
+
"aws:elasticbeanstalk:application:environment|GRADLE_HOME": "/usr/local/gradle",
|
|
2017
|
+
"aws:elasticbeanstalk:application:environment|M2": "/usr/local/apache-maven/bin",
|
|
2018
|
+
"aws:elasticbeanstalk:application:environment|M2_HOME": "/usr/local/apache-maven",
|
|
2019
|
+
"aws:elasticbeanstalk:container:php:phpini|allow_url_fopen": "On",
|
|
2020
|
+
"aws:elasticbeanstalk:container:php:phpini|display_errors": "Off",
|
|
2021
|
+
"aws:elasticbeanstalk:container:php:phpini|max_execution_time": "60",
|
|
2022
|
+
"aws:elasticbeanstalk:container:php:phpini|memory_limit": "256M",
|
|
2023
|
+
"aws:elasticbeanstalk:container:php:phpini|zlib.output_compression": "Off"
|
|
2006
2024
|
};
|
|
2007
2025
|
const EB_OPTION_DERIVED = {
|
|
2008
2026
|
"aws:autoscaling:asg|MaxSize": {
|
|
@@ -2017,15 +2035,20 @@ const EB_OPTION_DERIVED = {
|
|
|
2017
2035
|
const EB_OPTION_VALUE_INDEPENDENT = new Set([
|
|
2018
2036
|
"aws:autoscaling:launchconfiguration|ImageId",
|
|
2019
2037
|
"aws:autoscaling:launchconfiguration|InstanceType",
|
|
2038
|
+
"aws:autoscaling:launchconfiguration|SecurityGroups",
|
|
2039
|
+
"aws:elb:loadbalancer|SecurityGroups",
|
|
2020
2040
|
"aws:cloudformation:template:parameter|AppSource",
|
|
2021
2041
|
"aws:cloudformation:template:parameter|HooksPkgUrl",
|
|
2022
2042
|
"aws:cloudformation:template:parameter|InstanceTypeFamily",
|
|
2043
|
+
"aws:cloudformation:template:parameter|EnvironmentVariables",
|
|
2023
2044
|
"aws:ec2:instances|InstanceTypes",
|
|
2024
2045
|
"aws:ec2:instances|SupportedArchitectures",
|
|
2046
|
+
"aws:elasticbeanstalk:application:environment|PYTHONPATH",
|
|
2025
2047
|
"aws:elasticbeanstalk:healthreporting:system|ConfigDocument",
|
|
2026
|
-
"aws:
|
|
2048
|
+
"aws:elasticbeanstalk:healthreporting:system|EnhancedHealthAuthEnabled"
|
|
2027
2049
|
]);
|
|
2028
2050
|
function ebOptionSettingTier(namespace, optionName, value, envType) {
|
|
2051
|
+
if (value == null || value === "") return "atDefault";
|
|
2029
2052
|
const key = `${String(namespace)}|${String(optionName)}`;
|
|
2030
2053
|
if (EB_OPTION_VALUE_INDEPENDENT.has(key)) return "atDefault";
|
|
2031
2054
|
const derived = EB_OPTION_DERIVED[key];
|
|
@@ -2038,6 +2061,7 @@ const VALUE_INDEPENDENT_DEFAULT_TOPLEVEL_PATHS = {
|
|
|
2038
2061
|
"AWS::KinesisAnalyticsV2::Application": new Set(["ApplicationMaintenanceConfiguration"]),
|
|
2039
2062
|
"AWS::ElasticBeanstalk::ConfigurationTemplate": new Set(["PlatformArn"]),
|
|
2040
2063
|
"AWS::ElasticBeanstalk::Environment": new Set(["PlatformArn"]),
|
|
2064
|
+
"AWS::ElasticLoadBalancing::LoadBalancer": new Set(["AvailabilityZones"]),
|
|
2041
2065
|
"AWS::ApiGateway::Authorizer": new Set(["AuthType"]),
|
|
2042
2066
|
"AWS::RDS::DBCluster": new Set([
|
|
2043
2067
|
"KmsKeyId",
|
|
@@ -2262,7 +2286,8 @@ const CASE_INSENSITIVE_PATHS = {
|
|
|
2262
2286
|
"AWS::RDS::DBInstance": new Set(["DBInstanceIdentifier"]),
|
|
2263
2287
|
"AWS::RDS::DBCluster": new Set(["DBClusterIdentifier"]),
|
|
2264
2288
|
"AWS::DMS::Endpoint": new Set(["EndpointType"]),
|
|
2265
|
-
"AWS::WAFv2::LoggingConfiguration": new Set(["RedactedFields.*.SingleHeader.Name"])
|
|
2289
|
+
"AWS::WAFv2::LoggingConfiguration": new Set(["RedactedFields.*.SingleHeader.Name"]),
|
|
2290
|
+
"AWS::ElasticLoadBalancing::LoadBalancer": new Set(["Listeners.*.Protocol", "Listeners.*.InstanceProtocol"])
|
|
2266
2291
|
};
|
|
2267
2292
|
function isCaseInsensitiveScalarEqual(a, b) {
|
|
2268
2293
|
return typeof a === "string" && typeof b === "string" && a.toLowerCase() === b.toLowerCase();
|
|
@@ -3515,16 +3540,21 @@ const IAM_ATTACHMENT_SUBSET = { "AWS::IAM::ManagedPolicy": new Set([
|
|
|
3515
3540
|
"Users",
|
|
3516
3541
|
"Groups"
|
|
3517
3542
|
]) };
|
|
3518
|
-
const
|
|
3543
|
+
const ebOptionSettingsEntryTier = (entry, liveArray) => {
|
|
3544
|
+
const envEntry = (Array.isArray(liveArray) ? liveArray : []).find((e) => e && e.OptionName === "EnvironmentType");
|
|
3545
|
+
const envType = typeof envEntry?.Value === "string" ? envEntry.Value : "LoadBalanced";
|
|
3546
|
+
return ebOptionSettingTier(entry.Namespace, entry.OptionName, entry.Value, envType);
|
|
3547
|
+
};
|
|
3548
|
+
const ebOptionSettingsSubsetSpec = {
|
|
3519
3549
|
re: /(^|\.)OptionSettings$/,
|
|
3520
3550
|
keyFields: ["Namespace", "OptionName"],
|
|
3521
3551
|
ignoreFields: new Set(["ResourceName"]),
|
|
3522
|
-
entryTier:
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
}
|
|
3552
|
+
entryTier: ebOptionSettingsEntryTier
|
|
3553
|
+
};
|
|
3554
|
+
const COMPOSITE_KEY_SUBSET_PATHS = {
|
|
3555
|
+
"AWS::ElasticBeanstalk::ConfigurationTemplate": ebOptionSettingsSubsetSpec,
|
|
3556
|
+
"AWS::ElasticBeanstalk::Environment": ebOptionSettingsSubsetSpec
|
|
3557
|
+
};
|
|
3528
3558
|
function alignCompositeKeySubset(declared, live, spec) {
|
|
3529
3559
|
if (!Array.isArray(declared) || !Array.isArray(live)) return null;
|
|
3530
3560
|
const keyOf = (e) => {
|
|
@@ -7404,7 +7434,21 @@ const supplementLexBot = async ({ physicalId, region }) => {
|
|
|
7404
7434
|
return;
|
|
7405
7435
|
}
|
|
7406
7436
|
};
|
|
7437
|
+
const supplementElasticBeanstalkEnvironment = async ({ physicalId, declared, region }) => {
|
|
7438
|
+
const envName = str$1(physicalId);
|
|
7439
|
+
const appName = str$1(declared.ApplicationName);
|
|
7440
|
+
if (!envName || !appName) return void 0;
|
|
7441
|
+
const opts = (await new ElasticBeanstalkClient({
|
|
7442
|
+
region,
|
|
7443
|
+
...READ_RETRY
|
|
7444
|
+
}).send(new DescribeConfigurationSettingsCommand({
|
|
7445
|
+
ApplicationName: appName,
|
|
7446
|
+
EnvironmentName: envName
|
|
7447
|
+
}))).ConfigurationSettings?.[0]?.OptionSettings;
|
|
7448
|
+
return Array.isArray(opts) && opts.length > 0 ? { OptionSettings: opts } : void 0;
|
|
7449
|
+
};
|
|
7407
7450
|
const SDK_SUPPLEMENTS = {
|
|
7451
|
+
"AWS::ElasticBeanstalk::Environment": supplementElasticBeanstalkEnvironment,
|
|
7408
7452
|
"AWS::Lex::Bot": supplementLexBot,
|
|
7409
7453
|
"AWS::MSK::Configuration": supplementMskConfiguration,
|
|
7410
7454
|
"AWS::ElasticLoadBalancingV2::TrustStore": supplementTrustStore,
|
|
@@ -7576,6 +7620,7 @@ async function getSchemaInfo(client, resourceType) {
|
|
|
7576
7620
|
}
|
|
7577
7621
|
const OVERRIDE_READABLE_WRITEONLY = {
|
|
7578
7622
|
"AWS::EC2::LaunchTemplate": ["LaunchTemplateData"],
|
|
7623
|
+
"AWS::ElasticBeanstalk::Environment": ["OptionSettings"],
|
|
7579
7624
|
"AWS::MSK::Configuration": ["ServerProperties"],
|
|
7580
7625
|
"AWS::Cognito::IdentityPool": ["CognitoEvents"],
|
|
7581
7626
|
"AWS::SSM::Parameter": [
|