cdk-real-drift 0.12.105 → 0.12.107
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 +48 -2
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1910,6 +1910,7 @@ function buildCorpusCase(resource, liveRaw, schema, opts, findings) {
|
|
|
1910
1910
|
const bucketNotif = resource.physicalId && opts.bucketNotificationManaged?.has(resource.physicalId) ? [resource.physicalId] : void 0;
|
|
1911
1911
|
const eipSiblingId = resource.physicalId && opts.siblingEipAssociations?.has(resource.physicalId) ? resource.physicalId : opts.siblingEipAssociations?.has(resource.logicalId) ? resource.logicalId : void 0;
|
|
1912
1912
|
const tgRegistrarId = resource.physicalId && opts.siblingTargetGroupRegistrars?.has(resource.physicalId) ? resource.physicalId : opts.siblingTargetGroupRegistrars?.has(resource.logicalId) ? resource.logicalId : void 0;
|
|
1913
|
+
const subnetSiblingId = resource.physicalId && opts.siblingSubnetCidrBlocks?.has(resource.physicalId) ? resource.physicalId : opts.siblingSubnetCidrBlocks?.has(resource.logicalId) ? resource.logicalId : void 0;
|
|
1913
1914
|
const echoModel = resource.physicalId && opts.clusterEchoModel?.[resource.physicalId] ? opts.clusterEchoModel[resource.physicalId] : void 0;
|
|
1914
1915
|
const rdsOptCatalog = resource.physicalId && opts.rdsOptionSettingDefaults?.[resource.physicalId] ? opts.rdsOptionSettingDefaults[resource.physicalId] : void 0;
|
|
1915
1916
|
const listenerArn = resource.resourceType === "AWS::GlobalAccelerator::EndpointGroup" ? resource.declared?.ListenerArn : void 0;
|
|
@@ -1946,6 +1947,7 @@ function buildCorpusCase(resource, liveRaw, schema, opts, findings) {
|
|
|
1946
1947
|
...sgSibling && resource.physicalId ? { siblingSgRules: { [resource.physicalId]: sgSibling } } : {},
|
|
1947
1948
|
...bucketNotif ? { bucketNotificationManaged: bucketNotif } : {},
|
|
1948
1949
|
...eipSiblingId ? { siblingEipAssociations: [eipSiblingId] } : {},
|
|
1950
|
+
...subnetSiblingId ? { siblingSubnetCidrBlocks: [subnetSiblingId] } : {},
|
|
1949
1951
|
...tgRegistrarId ? { siblingTargetGroupRegistrars: [tgRegistrarId] } : {},
|
|
1950
1952
|
...echoModel && resource.physicalId ? { clusterEchoModel: { [resource.physicalId]: echoModel } } : {},
|
|
1951
1953
|
...rdsOptCatalog && resource.physicalId ? { rdsOptionSettingDefaults: { [resource.physicalId]: rdsOptCatalog } } : {},
|
|
@@ -2569,6 +2571,7 @@ const KNOWN_DEFAULTS = {
|
|
|
2569
2571
|
KmsKeyId: "AWS_OWNED_KMS_KEY",
|
|
2570
2572
|
NumberOfNodes: 1
|
|
2571
2573
|
},
|
|
2574
|
+
"AWS::Redshift::ScheduledAction": { Enable: true },
|
|
2572
2575
|
"AWS::EC2::VPCEndpoint": {
|
|
2573
2576
|
IpAddressType: "ipv4",
|
|
2574
2577
|
VpcEndpointType: "Gateway",
|
|
@@ -5578,7 +5581,8 @@ const MEANINGFUL_WHEN_OFF = {
|
|
|
5578
5581
|
"AWS::GuardDuty::Detector": { DataSources: () => true },
|
|
5579
5582
|
"AWS::Lambda::EventSourceMapping": { Enabled: () => true },
|
|
5580
5583
|
"AWS::ElasticLoadBalancingV2::TargetGroup": { HealthCheckEnabled: ({ declared }) => declared["TargetType"] !== "lambda" },
|
|
5581
|
-
"AWS::MemoryDB::Cluster": { TLSEnabled: () => true }
|
|
5584
|
+
"AWS::MemoryDB::Cluster": { TLSEnabled: () => true },
|
|
5585
|
+
"AWS::Redshift::ScheduledAction": { Enable: () => true }
|
|
5582
5586
|
};
|
|
5583
5587
|
const MEANINGFUL_WHEN_OFF_NESTED = { "AWS::CloudFront::Distribution": { "DistributionConfig.IPV6Enabled": () => true } };
|
|
5584
5588
|
const GUARDDUTY_FEATURE_CREATION_STATUS = {
|
|
@@ -5611,6 +5615,7 @@ const DEFAULT_SG_LIST_PATHS = {
|
|
|
5611
5615
|
"AWS::RDS::DBCluster": "VpcSecurityGroupIds",
|
|
5612
5616
|
"AWS::RDS::DBInstance": "VPCSecurityGroups",
|
|
5613
5617
|
"AWS::DocDB::DBCluster": "VpcSecurityGroupIds",
|
|
5618
|
+
"AWS::Redshift::Cluster": "VpcSecurityGroupIds",
|
|
5614
5619
|
"AWS::AmazonMQ::Broker": "SecurityGroups",
|
|
5615
5620
|
"AWS::RedshiftServerless::Workgroup": "SecurityGroupIds",
|
|
5616
5621
|
"AWS::EC2::Instance": "SecurityGroupIds"
|
|
@@ -6470,6 +6475,12 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
|
|
|
6470
6475
|
const selfDeclared = declaresTarget(declared.InstanceId) || declaresTarget(declared.NetworkInterfaceId);
|
|
6471
6476
|
if (explained || selfDeclared) delete live.NetworkInterfaceId;
|
|
6472
6477
|
}
|
|
6478
|
+
if (resourceType === "AWS::EC2::Subnet") {
|
|
6479
|
+
if (physicalId !== void 0 && opts.siblingSubnetCidrBlocks?.has(physicalId) || opts.siblingSubnetCidrBlocks?.has(logicalId)) {
|
|
6480
|
+
if (!("Ipv6CidrBlock" in declared)) delete live.Ipv6CidrBlock;
|
|
6481
|
+
if (!("Ipv6CidrBlocks" in declared)) delete live.Ipv6CidrBlocks;
|
|
6482
|
+
}
|
|
6483
|
+
}
|
|
6473
6484
|
if (resourceType === "AWS::S3::Bucket" && physicalId && opts.bucketNotificationManaged?.has(physicalId) && !("NotificationConfiguration" in declared)) {
|
|
6474
6485
|
if (deepEqual(canonicalizeForCompare(canonS3NotifBucketConfig(translateDeclaredBucketNotification(opts.bucketNotificationConfigs?.[physicalId] ?? {})), resourceType), canonicalizeForCompare(canonS3NotifBucketConfig(live.NotificationConfiguration), resourceType))) delete live.NotificationConfiguration;
|
|
6475
6486
|
}
|
|
@@ -13108,7 +13119,8 @@ const DEFAULT_SG_LIST_TYPES = new Set([
|
|
|
13108
13119
|
"AWS::EC2::NetworkInterface",
|
|
13109
13120
|
"AWS::Neptune::DBCluster",
|
|
13110
13121
|
"AWS::AmazonMQ::Broker",
|
|
13111
|
-
"AWS::RedshiftServerless::Workgroup"
|
|
13122
|
+
"AWS::RedshiftServerless::Workgroup",
|
|
13123
|
+
"AWS::Redshift::Cluster"
|
|
13112
13124
|
]);
|
|
13113
13125
|
const DEFAULT_SUBNET_LIST_TYPES = new Set(["AWS::RedshiftServerless::Workgroup"]);
|
|
13114
13126
|
const defaultSgIdsCache = /* @__PURE__ */ new Map();
|
|
@@ -13591,6 +13603,38 @@ function buildSiblingEipAssociations(desired) {
|
|
|
13591
13603
|
}
|
|
13592
13604
|
return associated;
|
|
13593
13605
|
}
|
|
13606
|
+
function buildSiblingSubnetCidrBlocks(desired) {
|
|
13607
|
+
const subnetIdentities = /* @__PURE__ */ new Map();
|
|
13608
|
+
for (const r of desired.resources) {
|
|
13609
|
+
if (r.resourceType !== "AWS::EC2::Subnet") continue;
|
|
13610
|
+
const ids = [r.logicalId];
|
|
13611
|
+
if (r.physicalId) ids.push(r.physicalId);
|
|
13612
|
+
subnetIdentities.set(r.logicalId, ids);
|
|
13613
|
+
}
|
|
13614
|
+
const withSibling = /* @__PURE__ */ new Set();
|
|
13615
|
+
const markSubnet = (ref) => {
|
|
13616
|
+
let subnetLogicalId;
|
|
13617
|
+
if (ref && typeof ref === "object") {
|
|
13618
|
+
if ("Ref" in ref && typeof ref.Ref === "string") subnetLogicalId = ref.Ref;
|
|
13619
|
+
else if ("Fn::GetAtt" in ref) {
|
|
13620
|
+
const g = ref["Fn::GetAtt"];
|
|
13621
|
+
if (Array.isArray(g) && typeof g[0] === "string") subnetLogicalId = g[0];
|
|
13622
|
+
}
|
|
13623
|
+
}
|
|
13624
|
+
if (subnetLogicalId !== void 0) {
|
|
13625
|
+
const ids = subnetIdentities.get(subnetLogicalId);
|
|
13626
|
+
if (ids) for (const id of ids) withSibling.add(id);
|
|
13627
|
+
return;
|
|
13628
|
+
}
|
|
13629
|
+
if (typeof ref === "string" && ref) withSibling.add(ref);
|
|
13630
|
+
};
|
|
13631
|
+
for (const r of desired.resources) {
|
|
13632
|
+
if (r.resourceType !== "AWS::EC2::SubnetCidrBlock") continue;
|
|
13633
|
+
const decl = r.declared;
|
|
13634
|
+
if (decl && typeof decl === "object") markSubnet(decl.SubnetId);
|
|
13635
|
+
}
|
|
13636
|
+
return withSibling;
|
|
13637
|
+
}
|
|
13594
13638
|
const ECS_SERVICE_TYPE = "AWS::ECS::Service";
|
|
13595
13639
|
const AUTO_SCALING_GROUP_TYPE = "AWS::AutoScaling::AutoScalingGroup";
|
|
13596
13640
|
const TARGET_GROUP_TYPE = "AWS::ElasticLoadBalancingV2::TargetGroup";
|
|
@@ -13975,6 +14019,7 @@ async function gatherFindings(stackName, region, templateOverride, recoveryTempl
|
|
|
13975
14019
|
siblingLifecycleHooks: buildSiblingLifecycleHooks(desired),
|
|
13976
14020
|
siblingListenerPorts: buildSiblingListenerPorts(desired),
|
|
13977
14021
|
siblingEipAssociations: buildSiblingEipAssociations(desired),
|
|
14022
|
+
siblingSubnetCidrBlocks: buildSiblingSubnetCidrBlocks(desired),
|
|
13978
14023
|
siblingTargetGroupRegistrars: buildSiblingTargetGroupRegistrars(desired),
|
|
13979
14024
|
bucketNotificationManaged: buildBucketNotificationManaged(desired),
|
|
13980
14025
|
bucketNotificationConfigs: buildBucketNotificationConfigs(desired),
|
|
@@ -14050,6 +14095,7 @@ async function regatherTouched(gathered, touched, region) {
|
|
|
14050
14095
|
siblingLifecycleHooks: buildSiblingLifecycleHooks(desired),
|
|
14051
14096
|
siblingListenerPorts: buildSiblingListenerPorts(desired),
|
|
14052
14097
|
siblingEipAssociations: buildSiblingEipAssociations(desired),
|
|
14098
|
+
siblingSubnetCidrBlocks: buildSiblingSubnetCidrBlocks(desired),
|
|
14053
14099
|
siblingTargetGroupRegistrars: buildSiblingTargetGroupRegistrars(desired),
|
|
14054
14100
|
bucketNotificationManaged: buildBucketNotificationManaged(desired),
|
|
14055
14101
|
bucketNotificationConfigs: buildBucketNotificationConfigs(desired),
|