Skip to content

Commit e7c7112

Browse files
authored
fix ctbaseline scp (#998)
1 parent 76f88c2 commit e7c7112

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/deployments/runtime/src/ou-validation-events/policy-changes.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,12 +197,13 @@ export const handler = async (input: ScheduledEvent) => {
197197
const acceleratorAccountIds = accounts.map(a => a.accountId!);
198198
const acceleratorTargetIds = [...rootIds, ...acceleratorOuIds, ...acceleratorAccountIds];
199199
const acceleratorTargetOuIds = [...rootIds, ...acceleratorOuIds];
200+
const baseline = globalOptionsConfig['ct-baseline'] ? 'CONTROL_TOWER' : 'ORGANIZATIONS';
200201

201202
// Detach non-Accelerator policies from Accelerator accounts
202203
await scps.detachPoliciesFromTargets({
203204
policyNamesToKeep: acceleratorPolicyNames,
204205
policyTargetIdsToInclude: acceleratorTargetOuIds,
205-
baseline: globalOptionsConfig['ct-baseline'] ? 'CONTROL_TOWER' : 'ORGANIZATIONS',
206+
baseline,
206207
});
207208

208209
await scps.attachFullAwsAccessPolicyToTargets({
@@ -215,6 +216,7 @@ export const handler = async (input: ScheduledEvent) => {
215216
configurationOus: organizationalUnits,
216217
acceleratorOus: config.getOrganizationalUnits(),
217218
acceleratorPrefix,
219+
baseline,
218220
});
219221

220222
await scps.attachOrDetachPoliciesToAccounts({

0 commit comments

Comments
 (0)