Options
All
  • Public
  • Public/Protected
  • All
Menu

Mira API Documentation

Here you will find the complete API documentation for Mira, as well as its helper Constructs and functions.

This documentation is automatically generated from code comments as well as the relevant TypeScript declarations. It will be improved and expanded over time and during the course of Mira's development.

If you find issues or have queries regarding the code base, feel free to open an issue on our Github Repo here.

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

EnvironmentVariable

EnvironmentVariable: { name: string; value: string }

Type declaration

  • name: string
  • value: string

MiraStackList

MiraStackList: Array<MiraValidStack>

MiraValidStack

ValidAwsContruct

ValidAwsContruct: CloudFormation

Variables

Let cdkFiles

cdkFiles: string[] = fs.existsSync('cdk.out') ? fs.readdirSync('cdk.out') : []

Let miraCfn

miraCfn: CloudFormation

Let miraS3

miraS3: S3

Const supportedCdkArgs

supportedCdkArgs: string[] = ['outputs-file', 'require-approval']

Functions

assumeRole

  • assumeRole(roleArn: string): Promise<Config>
  • Allow Mira to assume a role based on a given arn. This is used for deployment and allows Mira to use the account specified in the configuration file.

    internal
    throws

    Cannot assume role ${roleArn}: Invalid Role

    throws

    Cannot assume role ${roleArn}: <other reason>

    Parameters

    • roleArn: string

    Returns Promise<Config>

configWizard

  • configWizard(): Promise<void>

createDefaultJSON

  • createDefaultJSON(config: object): void

Const deleteBucket

  • deleteBucket(bucketName: string): Promise<void>

Const domainOnList

  • domainOnList(list: ResourceRecordSets, domain: string): boolean

Const getAssetFiles

  • getAssetFiles(id: string): Promise<Array<string>>

Const getAssetPrefix

  • getAssetPrefix(id: string): string

getBaseStackName

  • getBaseStackName(suffix?: undefined | string): string

getBaseStackNameFromParams

  • getBaseStackNameFromParams(prefix: string, name: string, suffix?: undefined | string): string

Const getBucketObjects

  • getBucketObjects(Bucket: string): Promise<PromiseResult<ListObjectsOutput, AWSError>>
  • Gets the objects from a bucket.

    Parameters

    • Bucket: string

    Returns Promise<PromiseResult<ListObjectsOutput, AWSError>>

Const getBucketRefs

Const getBucketResources

Const getCfn

  • getCfn(): Promise<CloudFormation>

getConfigSchema

  • getConfigSchema(): object
  • This function programmatically defines the default.json file

    internal

    Returns object

getDeployProjectRoleName

  • getDeployProjectRoleName(environment: string): string

Const getEnvironment

Const getFullStackName

  • getFullStackName(): string

Const getInstaceStacks

Const getInstanceResources

Const getInstanceResourcesByType

Const getRoleArn

  • getRoleArn(profile: string): string
  • Given a provided profile, reads the users local ~/.aws/config file and

    Parameters

    • profile: string

    Returns string

Const getS3

  • getS3(): Promise<S3>

Const getS3Buckets

  • getS3Buckets(prefix: string, siteName: string): Promise<Bucket[]>
  • Gets S3 buckets beginning with a prefix.

    Parameters

    • prefix: string
    • siteName: string

    Returns Promise<Bucket[]>

Const getSiteBuckets

Const getStackName

  • getStackName(): string

Const getStackResources

  • getStackResources(StackName: string): Promise<LooseObject>

Const getStacks

  • getStacks(filter?: undefined | string): Promise<LooseObject>

Const getTemplateFiles

getUrl

  • getUrl(envData: EnvData, isDeveloperMode: boolean, stackName: string): Domain
  • In developer mode build using a sub-domain of the base domain. Otherwise, parse the base domain from the web app URL.

    internal

    Parameters

    • envData: EnvData
    • isDeveloperMode: boolean
    • stackName: string

    Returns Domain

Const handler

isValidAwsAccountId

  • isValidAwsAccountId(input: string): boolean

isValidAwsAccountIdList

  • isValidAwsAccountIdList(input: string): boolean

isValidAwsCliProfile

  • isValidAwsCliProfile(input: string): Promise<unknown>

isValidAwsHostedZoneId

  • isValidAwsHostedZoneId(input: string): boolean

isValidAwsSecretsManagerArn

  • isValidAwsSecretsManagerArn(input: string): boolean

isValidBaseDomain

  • isValidBaseDomain(input: string): boolean

isValidDomain

  • isValidDomain(input: string): boolean

isValidEnvironmentNameList

  • isValidEnvironmentNameList(input: string): boolean

isValidGitBranchName

  • isValidGitBranchName(input: string): Promise<unknown>

isValidSshRsaPublicKey

  • isValidSshRsaPublicKey(input: string): boolean

loadAWSProfile

loadEnvironment

  • loadEnvironment(name: string): EnvData

nameResource

  • nameResource(namespace: string, ...subNames: string[]): string
  • It is important that we disallow undefined here, otherwise resource name collisions may occur

    internal

    Parameters

    • namespace: string
    • Rest ...subNames: string[]

    Returns string

overrideEnv

  • overrideEnv(key: string, value: string): Function

Const quickDeploy

  • quickDeploy(): Promise<void>
  • Quickly deploys an asset bundle generated by CDK to an intended S3 bucket as defined by a CDK generated Cfn template.

    Returns Promise<void>

readJsonFile

  • readJsonFile(filePath: string): string
  • Reads the defined file and returns it.

    internal

    Parameters

    • filePath: string

    Returns string

Const removeAssetDirectories

  • removeAssetDirectories(): void

send

  • send(event: LambdaEvent, context: Context, responseStatus: string, responseData: ResponseData, physicalResourceId?: undefined | string, noEcho?: undefined | false | true): Promise<string>

Const sendResponse

Const sleep

  • sleep(ms: number): Promise<unknown>

validateConfig

  • validateConfig(config: object): boolean
  • Uses a programmatically defined schema and validates a data input.

    internal

    Parameters

    • config: object

    Returns boolean

Legend

  • Constructor
  • Property
  • Method
  • Constructor
  • Property
  • Method
  • Inherited property
  • Inherited method
  • Private property
  • Private method
  • Static property
  • Static method

Generated using TypeDoc