AcceleratorTool Class

Hierarchy

  • AcceleratorTool

Constructors

Properties

Methods

Constructors

Properties

acceleratorCloudFormationStacks: pipelineStackType[] = []

acceleratorCloudFormationStacks

acceleratorCodeBuildProjects: string[] = []
acceleratorToolProps: AcceleratorToolProps

acceleratorToolProps

backupVaults: {
    backup: string;
    client: BackupClient;
    stackName: string;
}[] = []

List of backup vaults will be used to delete post stack deletion

bootstrapBuildEnvironmentVariables: undefined | {
    name: string;
    value: string;
}[]

bootstrapBuildEnvironmentVariables

buckets: {
    bucket: string;
    client: S3Client;
    stackName: string;
}[] = []

List of buckets will be used to delete post stack deletion

deleteStackLists: deleteStacksType[] = []
executingAccountId: undefined | string

Executing Account ID

externalPipelineAccount: {
    accountId: undefined | string;
    isUsed: boolean;
} = ...

externalPipelineAccount object

Type declaration

  • accountId: undefined | string
  • isUsed: boolean
globalConfig: undefined | GlobalConfig

Pipeline Global Config

globalRegion: string = 'us-east-1'

globalRegion

iamPolicies: {
    client: IAMClient;
    policyName: string;
    stackName: string;
}[] = []

List of IAM policies to be detached prior to stack deletion

iamRoles: {
    client: IAMClient;
    roleName: string;
    stackName: string;
}[] = []

List of IAM roles to have policies detached prior to stack deletion

kmsKeys: {
    client: KMSClient;
    key: string;
    stackName: string;
}[] = []

List of Kms key will be used to delete post stack deletion

logGroups: {
    client: CloudWatchLogsClient;
    logGroup: string;
    stackName: string;
}[] = []

List of log groups will be used to delete post stack deletion

logger: Logger
organizationAccounts: {
    accountId: string;
    accountName: string;
}[] = []

organizationAccounts - for list of accounts in organization

pipelineActionNames: string[] = []

List of pipeline action names

pipelineConfigSourceRepo: undefined | {
    branch: string;
    provider: string;
    repositoryName: string;
}

Pipeline Source Config repository details

pipelineManagementAccount: ManagementAccountType = undefined

pipelineManagementAccount

pipelineStageActions: {
    actions: stageActionType[];
    order: number;
    stage: string;
}[] = ...

pipelineStageActions List Accelerator stacks in delete order Any changes in stacks creation in accelerator needs will need changes of this field

pipelineStageNames: string[] = []

List of pipeline stage names

Methods

  • Returns

    Parameters

    • stsClient: STSClient

      Function to assume role

    • roleArn: string

    Returns Promise<AssumeRoleCommandOutput>

  • Function to clean stack and it's resources

    Parameters

    • cloudFormationClient: CloudFormationClient
    • stackName: string

    Returns Promise<void>

  • Parameters

    • cloudFormationClient: CloudFormationClient
    • stackName: string

    Returns Promise<void>

  • Parameters

    • acceleratorPrefix: string

    Returns Promise<void>

  • Parameters

    • message: string
    • messageType: string

    Returns void

  • Parameters

    • ms: number

    Returns Promise<unknown>

  • Private

    Delete installer stack and resources like installer stack, installer pipeline code build projects etc.

    Parameters

    • installerStackName: string

    Returns Promise<void>

  • Private

    Function to delete accelerator pipeline stack and it's resources

    Parameters

    • acceleratorPipelineStackNamePrefix: string

    Returns Promise<void>

  • Returns Promise<void>

  • Parameters

    • acceleratorPrefix: string
    • acceleratorQualifier: string

    Returns Promise<void>

  • Private

    Function to delete Cloudwatch log group

    Parameters

    • backupClient: BackupClient
    • stackName: string
    • backupVaultName: string

    Returns Promise<boolean>

  • Function to delete backup vaults

    Returns Promise<void>

  • Private

    Function to delete bucket once all objects are deleted

    Parameters

    • s3Client: S3Client
    • stackName: string
    • bucketName: string

    Returns Promise<boolean>

  • Function to delete buckets post stack deletion, if buckets deleted before stack replication custom resource will fail

    Returns Promise<void>

  • Private

    Function to delete Cloudwatch log group

    Parameters

    • cloudWatchLogsClient: CloudWatchLogsClient
    • stackName: string
    • logGroupName: string

    Returns Promise<boolean>

  • Private

    Function to delete build ids for code build project

    Parameters

    • codeBuildClient: CodeBuildClient
    • buildProjectName: string

    Returns Promise<void>

  • Private

    Function to delete code commit repository

    Parameters

    • codeCommitClient: CodeCommitClient
    • repositoryName: string

    Returns Promise<void>

  • Function to schedule deletion of ksm keys post stack deletion

    Returns Promise<void>

  • Function to delete log groups

    Returns Promise<void>

  • Private

    Function to delete stacks in pipeline account accelerator tester stack

    Parameters

    • stackNamePrefix: string

    Returns Promise<void>

  • Private

    Function to delete cloudformation stacks created by accelerator pipeline

    Parameters

    • acceleratorPrefix: string
    • pipelineName: string

    Returns Promise<void>

  • Function to delete resources after stack deletion

    Returns Promise<void>

  • Function to delete resources before stack deletion

    Returns Promise<void>

  • Private

    Function to delete cloudformation stack

    Parameters

    • cloudFormationClient: CloudFormationClient
    • stackName: string

    Returns Promise<void>

  • Private

    Function to delete cloudformation stack

    Parameters

    • acceleratorPrefix: string
    • stackName: string

    Returns Promise<void>

  • Private

    Function to delete accelerator tester pipeline stack

    Parameters

    • testerPipelineStackNamePrefix: string
    • testerPipelineConfigRepositoryName: string

    Returns Promise<void>

  • Returns Promise<void>

  • Private

    Function to see is cloudformation stack is deletable If stack termination protection is ON and uninstaller flag to ignore termination protection is on then it is considered to be deletable

    Parameters

    • cloudFormationClient: CloudFormationClient
    • stackName: string
    • Optional accountId: string
    • Optional region: string

    Returns Promise<boolean>

  • Returns

    Function to filter stages to be deleted based on input stage name

    Returns void

  • Parameters

    • acceleratorPrefix: string
    • acceleratorQualifier: string

    Returns Promise<void>

  • Function to get pipeline bootstrap stage environment variables

    Parameters

    • stage: StageDeclaration

    Returns Promise<void>

  • Private

    Function to get code build environment variables

    Parameters

    • buildProjectName: string

    Returns Promise<undefined | {
        name: string;
        value: string;
    }[]>

  • Function to get pipeline build projects

    Parameters

    • stage: StageDeclaration

    Returns void

  • Private

    Function to get GlobalConfig object from the repo content

    Returns Promise<GlobalConfig>

  • Parameters

    • s3Client: S3Client
    • bucketName: string

    Returns Promise<ListObjectVersionsCommandOutput>

  • Private

    Function to get management account credentials

    Parameters

    • managementAccountId: string
    • managementAccountRoleName: undefined | string

    Returns Promise<undefined | Credentials>

  • Private

    Function to get account list from organization

    Returns Promise<{
        accountId: string;
        accountName: string;
    }[]>

  • Function to get pipeline action names

    Parameters

    • stage: StageDeclaration

    Returns void

  • Private

    Function to get cloudformation stacks created by pipeline stage actions

    Parameters

    • acceleratorPrefix: string

    Returns pipelineStackType[]

  • Private

    Get pipeline management account details

    Returns Promise<ManagementAccountType>

  • Function to get pipeline repository names

    Parameters

    • stage: StageDeclaration

    Returns void

  • Function to get list of managed policies which are assigned to IAM roles by SSM automation accelerator-ec2-instance-profile-permission

    Returns

    Returns Promise<string[]>

  • Private

    Private async function to initialize required properties to perform accelerator cleanup

    Parameters

    • acceleratorPrefix: string
    • pipelineName: string

    Returns Promise<void>

  • Private

    Function to check if given stack deletion completed.

    Parameters

    • cloudFormationClient: CloudFormationClient
    • stackName: string
    • retryAttempt: number
    • maxRetry: number

    Returns Promise<"FAILED" | "IN_PROGRESS" | "COMPLETE">

  • Private

    Function to delete stack's resources like S3/Cloudwatch logs, KMS key

    Parameters

    • stackName: string
    • cloudFormationClient: CloudFormationClient
    • cloudWatchLogsClient: CloudWatchLogsClient
    • s3Client: S3Client
    • backupClient: BackupClient
    • kMSClient: KMSClient
    • iamClient: IAMClient

    Returns Promise<void>

  • Returns Promise<void>

  • Private

    Function to schedule Key deletion

    Parameters

    • kMSClient: KMSClient
    • stackName: string
    • kmsKeyId: string

    Returns Promise<boolean>

  • Function to uninstall accelerator. It is expected to completely rollback installer. Uninstaller can rollback following resources created by accelerator.

    • CloudFormation Stacks
    • S3 Buckets
    • Cloudwatch Log Groups
    • Codebuild Projects
    • CodeCommit Repository
    • CodePipeline

    Parameters

    • installerStackName: string

      The name of the installer cloudformation stack

    Returns Promise<boolean>

  • Function to check if stack exists

    Returns

    Parameters

    • cloudFormationClient: CloudFormationClient
    • stackName: string
    • accountId: string
    • region: string

    Returns Promise<undefined | Stack>

  • Private

    Function to get pipeline name from given cloudformation stack

    Parameters

    • stackName: string

    Returns Promise<{
        pipelineName: string;
        status: boolean;
    }>

  • Private

    Function to check weather accelerator pipeline created code commit repository

    Parameters

    • stackName: string

    Returns Promise<boolean>

  • Private

    Clears credential environment variables

    Returns void

Generated using TypeDoc