cdk-real-drift 0.12.106 → 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 +42 -0
- 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 } } : {},
|
|
@@ -6473,6 +6475,12 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
|
|
|
6473
6475
|
const selfDeclared = declaresTarget(declared.InstanceId) || declaresTarget(declared.NetworkInterfaceId);
|
|
6474
6476
|
if (explained || selfDeclared) delete live.NetworkInterfaceId;
|
|
6475
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
|
+
}
|
|
6476
6484
|
if (resourceType === "AWS::S3::Bucket" && physicalId && opts.bucketNotificationManaged?.has(physicalId) && !("NotificationConfiguration" in declared)) {
|
|
6477
6485
|
if (deepEqual(canonicalizeForCompare(canonS3NotifBucketConfig(translateDeclaredBucketNotification(opts.bucketNotificationConfigs?.[physicalId] ?? {})), resourceType), canonicalizeForCompare(canonS3NotifBucketConfig(live.NotificationConfiguration), resourceType))) delete live.NotificationConfiguration;
|
|
6478
6486
|
}
|
|
@@ -13595,6 +13603,38 @@ function buildSiblingEipAssociations(desired) {
|
|
|
13595
13603
|
}
|
|
13596
13604
|
return associated;
|
|
13597
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
|
+
}
|
|
13598
13638
|
const ECS_SERVICE_TYPE = "AWS::ECS::Service";
|
|
13599
13639
|
const AUTO_SCALING_GROUP_TYPE = "AWS::AutoScaling::AutoScalingGroup";
|
|
13600
13640
|
const TARGET_GROUP_TYPE = "AWS::ElasticLoadBalancingV2::TargetGroup";
|
|
@@ -13979,6 +14019,7 @@ async function gatherFindings(stackName, region, templateOverride, recoveryTempl
|
|
|
13979
14019
|
siblingLifecycleHooks: buildSiblingLifecycleHooks(desired),
|
|
13980
14020
|
siblingListenerPorts: buildSiblingListenerPorts(desired),
|
|
13981
14021
|
siblingEipAssociations: buildSiblingEipAssociations(desired),
|
|
14022
|
+
siblingSubnetCidrBlocks: buildSiblingSubnetCidrBlocks(desired),
|
|
13982
14023
|
siblingTargetGroupRegistrars: buildSiblingTargetGroupRegistrars(desired),
|
|
13983
14024
|
bucketNotificationManaged: buildBucketNotificationManaged(desired),
|
|
13984
14025
|
bucketNotificationConfigs: buildBucketNotificationConfigs(desired),
|
|
@@ -14054,6 +14095,7 @@ async function regatherTouched(gathered, touched, region) {
|
|
|
14054
14095
|
siblingLifecycleHooks: buildSiblingLifecycleHooks(desired),
|
|
14055
14096
|
siblingListenerPorts: buildSiblingListenerPorts(desired),
|
|
14056
14097
|
siblingEipAssociations: buildSiblingEipAssociations(desired),
|
|
14098
|
+
siblingSubnetCidrBlocks: buildSiblingSubnetCidrBlocks(desired),
|
|
14057
14099
|
siblingTargetGroupRegistrars: buildSiblingTargetGroupRegistrars(desired),
|
|
14058
14100
|
bucketNotificationManaged: buildBucketNotificationManaged(desired),
|
|
14059
14101
|
bucketNotificationConfigs: buildBucketNotificationConfigs(desired),
|