Skip to content

Commit

Permalink
fix(asea): iam role with principalarn property
Browse files Browse the repository at this point in the history
  • Loading branch information
crissupb authored and rycerrat committed Nov 19, 2024
1 parent da90d68 commit 65cf183
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import * as cdk from 'aws-cdk-lib';

import {
AccountPrincipal,
ArnPrincipal,
CfnInstanceProfile,
CfnManagedPolicy,
Effect,
Expand Down Expand Up @@ -92,6 +93,15 @@ export class Roles extends AseaResource {
}),
);
}
if (assumedByItem.type === 'principalArn') {
statements.push(
new PolicyStatement({
actions: ['sts:AssumeRole'],
effect: Effect.ALLOW,
principals: [new ArnPrincipal(assumedByItem.principal)],
}),
);
}
if (assumedByItem.type === 'account' && assumedByItem.principal) {
const partition = this.props.partition;
const accountIdRegex = /^\d{12}$/;
Expand Down

0 comments on commit 65cf183

Please sign in to comment.