Skip to content

Commit

Permalink
Merge pull request #224 from Innablr/hotfix/reg-overwrite
Browse files Browse the repository at this point in the history
Fix an error where the region for an account was overwritten by the d…
abukharov authored Feb 29, 2024
2 parents d58a4b7 + 499efdb commit 0b6ed74
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/config.ts
Original file line number Diff line number Diff line change
@@ -86,7 +86,7 @@ export class RevolverConfig {
);
// build assumeRoleArn string, extract account_id and revolver_role_name
const updatedAccountsList = filteredAccountsList.map((xa: any) => {
const account: any = merge.withOptions({ mergeArrays: false }, xa, config.defaults);
const account: any = merge.withOptions({ mergeArrays: false }, config.defaults, xa);
account.settings.assumeRoleArn = `arn:aws:iam::${account.accountId}:role/${account.settings.revolverRoleName}`;
return account;
});
4 changes: 2 additions & 2 deletions revolver.ts
Original file line number Diff line number Diff line change
@@ -65,8 +65,8 @@ export const handler: ScheduledHandler = async (event: EventBridgeEvent<'Schedul
.connectTo(account.settings.assumeRoleArn)
.then((auth: any) => (auth ? account : undefined))
.catch((err) => {
logger.error(`Unable to assume role ${account.settings.assumeRoleArn} on ${account.account_id}: ${err}`);
logger.error(`Account ${account.account_id} will be skipped`);
logger.error(`Unable to assume role ${account.settings.assumeRoleArn} on ${account.accountId}: ${err}`);
logger.error(`Account ${account.accountId} will be skipped`);
return undefined;
}),
),

0 comments on commit 0b6ed74

Please sign in to comment.