Skip to content

Commit 23192ef

Browse files
authored
fix(convert-config): Remove warning for ssm-remediation with nested ous in convert-config (#1249)
1 parent 5dd1c64 commit 23192ef

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

reference-artifacts/Custom-Scripts/lza-upgrade/src/convert-config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2567,14 +2567,15 @@ export class ConvertAseaConfig {
25672567
}
25682568
//validation to ensure rules with remediation via ssm have document to deployed to matching ou's
25692569
for (const rule of rulesWithTarget) {
2570+
const deploymentOuListWithNestedOus = this.getNestedOusForDeploymentTargets(rule.deployTo ?? []);
25702571
if (rule.remediation && rule.remediation.targetId) {
25712572
for (const documentSet of this.documentSets) {
25722573
for (const document of documentSet.documents) {
25732574
if (document.name === rule.remediation.targetId) {
25742575
for (const target of documentSet.shareTargets.organizationalUnits ?? []) {
2575-
if (!rule.deployTo?.includes(target)) {
2576+
if (!deploymentOuListWithNestedOus.includes(target)) {
25762577
this.configCheck.addWarning(
2577-
`SSM Remediation document ${document.name} is not deployed to the same OU ${target} as the config rule ${rule.name}.`,
2578+
`SSM Remediation document ${document.name} is not deployed to the same OU ${target} as the config rule ${rule.name} in ${deploymentOuListWithNestedOus}.`,
25782579
);
25792580
}
25802581
}

0 commit comments

Comments
 (0)