aws-organization-formation-client
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

AWS Organization Formation Client

A typescript client library for AWS Organization Formation.

Installation

> npm i aws-organization-formation-client

Usage

const orgClient = new OrgFormationClient( {
    credentials : myCrendialsProvider.resolve(), // works just like any other aws service
    stateBucketName: 'my-state-bucket-name', // default will be organization-formation-${MasterAccountId}
    stateObjectKey: 'state.json', // this is the default
    organizationObjectKey: 'organization.yml', // this is the default
})

how to enumerate account ids

const developmentOUBinding: IOrganizationBinding = { OrganizationalUnit: { Ref: 'DevelopmentOU' } };
const developmentOUAccountIds: string[] = await orgClient.enumerateAccountIds(developmentOUBinding);

const moreComplexBinding: IOrganizationBinding = { IncludeMasterAccount: true, Account: '*', ExcludeAccount: [ { Ref: 'AccountB' } ] };
const moreComplexAccountIds: string[] = await orgClient.enumerateAccountIds(moreComplexBinding);

how to retrieve metadata related to an account:

const account = await orgClient.getAccount('1223123123123');
console.log(account.logicalId);
console.log(account.accountName);
console.log(account.alias);
console.log(account.rootEmail);
console.log(account.tags);
//etc

Readme

Keywords

none

Package Sidebar

Install

npm i aws-organization-formation-client

Weekly Downloads

3

Version

0.2.2

License

ISC

Unpacked Size

89.4 kB

Total Files

45

Last publish

Collaborators

  • olafconijn