Skip to content

org-formation/org-formation-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published