Options
All
  • Public
  • Public/Protected
  • All
Menu

Module orgtomate

A library providing the means to execute blocks of javascript code across multiple AWS Accounts in an AWS Organization in parallel

Index

Type aliases

AssumeRoleConfig

AssumeRoleConfig: { DurationSeconds?: number; ExternalId?: string; RoleArn: string; RoleSessionName: string }

A Config object type compatible with an AWS STS Service assumeRole operation defining the exact parameters of the role to be assumed

Type declaration

  • Optional DurationSeconds?: number

    The optional length of the role assumption session

  • Optional ExternalId?: string
  • RoleArn: string

    The ARN of the Role to assume

  • RoleSessionName: string

    The session name of the role assumption session

AsyncCallbackFunction

AsyncCallbackFunction: (credentials: RoleCredentials, awsAccount: ProcessableAccount) => Promise<any>

Type declaration

    • An async function type that takes credentials and a ProcessableAccount, and returns results for processAccount to amalgamate into an Array

      Parameters

      • credentials: RoleCredentials

        A RoleCredentials object containing the credentials to use in an AWS Service constructor

      • awsAccount: ProcessableAccount

        A ProcessableAccount object containing the details of the account to work in

      Returns Promise<any>

      A promise to return the results of the work done in the ProcessableAccount

RoleCredentials

RoleCredentials: { accessKeyId: string; secretAccessKey: string; sessionToken: string }

The RoleCredentials object type that represents the result of an STS AssumeRole API call in a form usable in AWS Service constructor

Type declaration

  • accessKeyId: string

    An AWS Access Key ID

  • secretAccessKey: string

    An AWS Secret Access Key

  • sessionToken: string

    An AWS Session Token

RoleInfo

RoleInfo: { durationSeconds?: number; externalId?: string; name: string; sessionName?: string }

The RoleInfo object type that defines the information that represents the role information object we need to be provided with in order to assume appropriate Organizations Cross-Account Rols

remarks

The sessionName, externalId and durationSeconds parameters are optional as they can all be safely defaulted, but in most instances should be provided and defaulted as necessary in the caller.

Type declaration

  • Optional durationSeconds?: number

    The Role Duration Seconds for how long the assumed role session will be valid

  • Optional externalId?: string

    The optional External ID to use when assuming the role

  • name: string

    The name of the Cross Account Role in each account

  • Optional sessionName?: string

    The Role Session Name to assume when assuming the role

Functions

Const orgtomate

  • orgtomate(asyncCallback: AsyncCallbackFunction, roleInfo: RoleInfo, targetId?: null | string, recursive?: boolean, orgMgmtAccountId?: null | string): Promise<any[]>
  • Orgtomate!

    Take a function, an Organization cross-account role configuration and a target node in the Organization and run an asyncCallback against every account under that node using the cross-account role

    privateremarks

    TODO: Make the target optionally the name of a target, not just an ID, without making the processing too messy

    Parameters

    • asyncCallback: AsyncCallbackFunction

      The async callback function to run

    • roleInfo: RoleInfo

      The information about the role we need to assume in each account

    • targetId: null | string = null

      An optional ID of a target Node in the Organization parenting all of the accounts to operate in

    • recursive: boolean = false

      Whether to target all accounts below the target, or only immediate children of it

    • orgMgmtAccountId: null | string = null

      An optional ID of the account that is the management account for the Organization, to use for listAccounts

    Returns Promise<any[]>

    A promise to return an Array containing the result of processAccount for each account targeted

Generated using TypeDoc