Added IAM support

This commit is contained in:
2023-04-03 16:00:14 -04:00
parent 2c78be1b3f
commit 29d36a57d6
22 changed files with 1167 additions and 52 deletions

21
src/util/breakdown-arn.ts Normal file
View File

@@ -0,0 +1,21 @@
export type ArnParts = {
service: string;
region: string;
accountId: string;
identifier: string;
}
export const breakdownArn = (arn: string): ArnParts => {
if (!arn.startsWith('arn')) {
throw new Error('Invalid arn');
}
const [_arn, _aws, service, region, accountId, ...identifierData] = arn.split(':');
return {
service,
region,
accountId,
identifier: identifierData.join(':'),
}
}