in packages/@aws-cdk/cloudformation-diff/lib/iam/iam-changes.ts [151:185]
public summarizeSsoAssignments(): string[][] {
const ret: string[][] = [];
const header = ['', 'Resource', 'InstanceArn', 'PermissionSetArn', 'PrincipalId', 'PrincipalType', 'TargetId', 'TargetType'];
for (const att of this.ssoAssignments.additions) {
ret.push([
'+',
att.cfnLogicalId || '',
att.ssoInstanceArn || '',
att.permissionSetArn || '',
att.principalId || '',
att.principalType || '',
att.targetId || '',
att.targetType || '',
].map(s => chalk.green(s)));
}
for (const att of this.ssoAssignments.removals) {
ret.push([
'-',
att.cfnLogicalId || '',
att.ssoInstanceArn || '',
att.permissionSetArn || '',
att.principalId || '',
att.principalType || '',
att.targetId || '',
att.targetType || '',
].map(s => chalk.red(s)));
}
// Sort by resource name to ensure a unique value is used for sorting
ret.sort(makeComparator((row: string[]) => [row[1]]));
ret.splice(0, 0, header);
return ret;
}