Skip to main content

cdk-organizations-list-accounts is an AWS CDK building library that outputs a list of AWS organization accounts in CSV format.

Project description

NPM version PyPI version Release

cdk-organizations-list-accounts

Want to keep an up-to-date list of your AWS accounts?

cdk-organizations-list-accounts is an AWS CDK building library that outputs a list of AWS organization accounts in CSV format.

Overview

Amazon EventBridge detects the account creation event and starts a Lambda function. An accounts list, including the organization structure, will be output to S3 bucket in CSV format.

Output Example:

Id,Name,Email,Status,Joined Method,Joined Timestamp,OU Id,1st Level OU,2nd Level OU,3rd Level OU,4th Level OU,5th Level OU
000000000000,account-mgmt,account+mgmt@example.com,ACTIVE,INVITED,2022-01-31 07:19:57,r-xxxx
111111111111,account-0001,account+0001@example.com,ACTIVE,INVITED,2022-01-31 07:25:38,ou-xxxx-yyyyyyyy,Suspended
222222222222,account-0002,account+0002@example.com,ACTIVE,CREATED,2022-01-31 07:31:28,ou-xxxx-zzzzzzzz,Sample System,Additional,Workloads,Prod
333333333333,account-0003,account+0003@example.com,ACTIVE,CREATED,2022-01-31 08:15:49,ou-xxxx-zzzzzzzz,Sample System,Additional,Workloads,SDLC
444444444444,account-0004,account+0004@example.com,ACTIVE,CREATED,2022-01-31 09:18:50,ou-xxxx-zzzzzzzz,Sample System,Foundational,Security,Prod
555555555555,account-0005,account+0005@example.com,ACTIVE,CREATED,2022-01-31 10:21:30,ou-xxxx-zzzzzzzz,Sample System,Foundational,Infrastructure,Prod
666666666666,account-0006,account+0006@example.com,ACTIVE,CREATED,2022-01-31 11:21:05,ou-xxxx-zzzzzzzz,Sample System,Foundational,Infrastructure,SDLC

Limitations at present

  • Must deploy to AWS Organization's management account
  • Events other than CreateAccount are not supported

Getting Started

TypeScript

Installation

$ yarn add cdk-organizations-list-accounts

Usage

import * as cdk from 'aws-cdk-lib';
import { OrganizationsListAccounts } from 'cdk-organizations-list-accounts';

const App = new cdk.App();
const stack = new cdk.Stack(App, 'Stack', { env: { region: 'us-east-1' } });
new OrganizationsListAccounts(stack, 'Organizations-List-Accounts');

Deploy!

$ cdk deploy

Python

Installation

$ pip install cdk-organizations-list-accounts

Usage

import aws_cdk as cdk
from cdk_organizations_list_accounts import OrganizationsListAccounts

app = cdk.App()
stack = cdk.Stack(app, "Stack", env={"region": "us-east-1"})
OrganizationsListAccounts(stack, "Organizations-List-Accounts")
app.synth()

Deploy!

$ cdk deploy

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cdk-organizations-list-accounts-1.0.127.tar.gz (29.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file cdk-organizations-list-accounts-1.0.127.tar.gz.

File metadata

File hashes

Hashes for cdk-organizations-list-accounts-1.0.127.tar.gz
Algorithm Hash digest
SHA256 4526c1caf974b7a501f30df5b37a57c35afa7ca1d22d1999b3b61785086424dc
MD5 f3358d7f73fdd310d5c4c5b01323b491
BLAKE2b-256 0ff2dd282c19a78db4b72e9ed73f48153bc4f3a6cfa1a4be0a552a54795378a8

See more details on using hashes here.

File details

Details for the file cdk_organizations_list_accounts-1.0.127-py3-none-any.whl.

File metadata

File hashes

Hashes for cdk_organizations_list_accounts-1.0.127-py3-none-any.whl
Algorithm Hash digest
SHA256 fb130a4b6fde5b38aef7749bafa63f1477fd9b5a54ed613a08c24ae28f2da935
MD5 ca80889d30f1feb39455e63cce3598d0
BLAKE2b-256 e0497a6e458d0e8d3b2274a2090d8b124c83fdc31b79ad9ab6f23bc561c5018a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page