import { importPeer } from "../util/peer.ts"; export type AccountId = string & { readonly __brand: "AccountId"; }; /** * Helper to get the current AWS account ID */ export async function AccountId(): Promise { const { GetCallerIdentityCommand, STSClient } = await importPeer( import("@aws-sdk/client-sts"), "aws::AccountId", ); const sts = new STSClient({}); const identity = await sts.send(new GetCallerIdentityCommand({})); return identity.Account! as AccountId; }