cdk-real-drift 0.11.1 → 0.11.2
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 +26 -1
- package/dist/cli.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1643,6 +1643,8 @@ function buildCorpusCase(resource, liveRaw, schema, opts, findings) {
|
|
|
1643
1643
|
const bucketNotif = resource.physicalId && opts.bucketNotificationManaged?.has(resource.physicalId) ? [resource.physicalId] : void 0;
|
|
1644
1644
|
const echoModel = resource.physicalId && opts.clusterEchoModel?.[resource.physicalId] ? opts.clusterEchoModel[resource.physicalId] : void 0;
|
|
1645
1645
|
const rdsOptCatalog = resource.physicalId && opts.rdsOptionSettingDefaults?.[resource.physicalId] ? opts.rdsOptionSettingDefaults[resource.physicalId] : void 0;
|
|
1646
|
+
const listenerArn = resource.resourceType === "AWS::GlobalAccelerator::EndpointGroup" ? resource.declared?.ListenerArn : void 0;
|
|
1647
|
+
const gaListenerPort = typeof listenerArn === "string" && opts.siblingListenerPorts?.[listenerArn] !== void 0 ? { [listenerArn]: opts.siblingListenerPorts[listenerArn] } : void 0;
|
|
1646
1648
|
return sanitizeAccountId({
|
|
1647
1649
|
corpusVersion: 1,
|
|
1648
1650
|
resource: {
|
|
@@ -1675,7 +1677,8 @@ function buildCorpusCase(resource, liveRaw, schema, opts, findings) {
|
|
|
1675
1677
|
...sgSibling && resource.physicalId ? { siblingSgRules: { [resource.physicalId]: sgSibling } } : {},
|
|
1676
1678
|
...bucketNotif ? { bucketNotificationManaged: bucketNotif } : {},
|
|
1677
1679
|
...echoModel && resource.physicalId ? { clusterEchoModel: { [resource.physicalId]: echoModel } } : {},
|
|
1678
|
-
...rdsOptCatalog && resource.physicalId ? { rdsOptionSettingDefaults: { [resource.physicalId]: rdsOptCatalog } } : {}
|
|
1680
|
+
...rdsOptCatalog && resource.physicalId ? { rdsOptionSettingDefaults: { [resource.physicalId]: rdsOptCatalog } } : {},
|
|
1681
|
+
...gaListenerPort ? { siblingListenerPorts: gaListenerPort } : {}
|
|
1679
1682
|
},
|
|
1680
1683
|
expected: findings
|
|
1681
1684
|
}, opts.accountId);
|
|
@@ -5781,6 +5784,14 @@ function classifyResource(resource, liveRaw, schema, opts = {}) {
|
|
|
5781
5784
|
Id: `${attach}_${rtb}`
|
|
5782
5785
|
};
|
|
5783
5786
|
}
|
|
5787
|
+
if (resourceType === "AWS::GlobalAccelerator::EndpointGroup") {
|
|
5788
|
+
const listenerArn = declared["ListenerArn"];
|
|
5789
|
+
const port = typeof listenerArn === "string" ? opts.siblingListenerPorts?.[listenerArn] : void 0;
|
|
5790
|
+
if (typeof port === "number") knownDef = {
|
|
5791
|
+
...knownDef,
|
|
5792
|
+
HealthCheckPort: port
|
|
5793
|
+
};
|
|
5794
|
+
}
|
|
5784
5795
|
if (resourceType === "AWS::Lambda::EventSourceMapping") {
|
|
5785
5796
|
const arn = declared["EventSourceArn"];
|
|
5786
5797
|
const service = typeof arn === "string" ? arn.split(":")[2] : void 0;
|
|
@@ -11173,6 +11184,18 @@ function buildSiblingLifecycleHooks(desired) {
|
|
|
11173
11184
|
}
|
|
11174
11185
|
return map;
|
|
11175
11186
|
}
|
|
11187
|
+
const GA_LISTENER_TYPE = "AWS::GlobalAccelerator::Listener";
|
|
11188
|
+
function buildSiblingListenerPorts(desired) {
|
|
11189
|
+
const map = {};
|
|
11190
|
+
for (const r of desired.resources) {
|
|
11191
|
+
if (r.resourceType !== GA_LISTENER_TYPE || !r.physicalId) continue;
|
|
11192
|
+
const ranges = r.declared?.PortRanges;
|
|
11193
|
+
const first = Array.isArray(ranges) ? ranges[0] : void 0;
|
|
11194
|
+
const from = first && typeof first === "object" ? first.FromPort : void 0;
|
|
11195
|
+
if (typeof from === "number") map[r.physicalId] = from;
|
|
11196
|
+
}
|
|
11197
|
+
return map;
|
|
11198
|
+
}
|
|
11176
11199
|
function resolvePrincipalKey(ref, byLogicalId) {
|
|
11177
11200
|
if (typeof ref === "string" && ref) return ref;
|
|
11178
11201
|
if (ref && typeof ref === "object" && "Ref" in ref) {
|
|
@@ -11386,6 +11409,7 @@ async function gatherFindings(stackName, region, templateOverride, recoveryTempl
|
|
|
11386
11409
|
siblingManagedPolicyAttachments: buildSiblingManagedPolicyAttachments(desired),
|
|
11387
11410
|
siblingUserGroups: buildSiblingUserGroups(desired),
|
|
11388
11411
|
siblingLifecycleHooks: buildSiblingLifecycleHooks(desired),
|
|
11412
|
+
siblingListenerPorts: buildSiblingListenerPorts(desired),
|
|
11389
11413
|
bucketNotificationManaged: buildBucketNotificationManaged(desired),
|
|
11390
11414
|
clusterEchoModel: buildClusterEchoModels(desired),
|
|
11391
11415
|
rdsOptionSettingDefaults: await buildRdsOptionSettingDefaults(desired, region)
|
|
@@ -11449,6 +11473,7 @@ async function regatherTouched(gathered, touched, region) {
|
|
|
11449
11473
|
siblingManagedPolicyAttachments: buildSiblingManagedPolicyAttachments(desired),
|
|
11450
11474
|
siblingUserGroups: buildSiblingUserGroups(desired),
|
|
11451
11475
|
siblingLifecycleHooks: buildSiblingLifecycleHooks(desired),
|
|
11476
|
+
siblingListenerPorts: buildSiblingListenerPorts(desired),
|
|
11452
11477
|
bucketNotificationManaged: buildBucketNotificationManaged(desired),
|
|
11453
11478
|
clusterEchoModel: buildClusterEchoModels(desired),
|
|
11454
11479
|
rdsOptionSettingDefaults: await buildRdsOptionSettingDefaults(desired, region)
|