UNPKG

@cloud-copilot/iam-collect

Version:

Collect IAM information from AWS Accounts

17 lines 819 B
import { GetPublicAccessBlockCommand, S3ControlClient } from '@aws-sdk/client-s3-control'; import { runAndCatch404 } from '../../utils/client-tools.js'; import {} from '../sync.js'; export const AccountS3BpaSync = { awsService: 's3', name: 'accountBpa', global: true, execute: async (accountId, region, credentials, storage, endpoint, syncOptions) => { const client = syncOptions.clientPool.client(S3ControlClient, credentials, region, endpoint); const bpa = await runAndCatch404(async () => { const result = client.send(new GetPublicAccessBlockCommand({ AccountId: accountId })); return (await result).PublicAccessBlockConfiguration; }); await storage.saveAccountMetadata(accountId, 's3-bpa', bpa); } }; //# sourceMappingURL=accountBpa.js.map