0.2.2 • Published 8 months ago

aws-organization-formation-client v0.2.2

Weekly downloads
473
License
ISC
Repository
-
Last release
8 months ago

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
0.2.1

10 months ago

0.2.2

8 months ago

0.1.1

3 years ago

0.1.0

3 years ago