@cloud-copilot/iam-collect
Version:
Collect IAM information from AWS Accounts
27 lines • 945 B
JavaScript
import { IAMClient, ListInstanceProfilesCommand } from '@aws-sdk/client-iam';
import { createResourceSyncType, createTypedSyncOperation } from '../typedSync.js';
export const InstanceProfilesSync = createTypedSyncOperation('iam', 'instanceprofiles', createResourceSyncType({
client: IAMClient,
command: ListInstanceProfilesCommand,
key: 'InstanceProfiles',
paginationConfig: {
inputKey: 'Marker',
outputKey: 'Marker'
},
arn: (profile) => profile.Arn,
tags: (profile) => profile.Tags,
resourceTypeParts: (account, region) => ({
service: 'iam',
account,
resourceType: 'instance-profile'
}),
results: (profile) => ({
metadata: {
name: profile.Path,
roles: profile.Roles?.map((role) => role.Arn),
id: profile.InstanceProfileId,
path: profile.Path
}
})
}));
//# sourceMappingURL=instanceProfiles.js.map