Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AWSDeployer<T>

Abstract AWS Deployer

It includes some basic utilities methods to be used by final deployers

Type parameters

Hierarchy

Constructors

  • new AWSDeployer(manager: DeploymentManager, resources: any): AWSDeployer

Properties

AWS: any
_defaulted: boolean
app: Application
logger: Logger
manager: DeploymentManager
name: string
now: number
packageDescription: any
parameters: any
resources: T
type: string

Methods

  • _replaceForAWS(id: string): string
  • commonPrefix(str1: string, str2: string): string
  • Find the common prefix between two strings

    Example

    commonPrefix("/test/plop1", "/templates/") => "/te"

    Parameters

    • str1: string

      to compare

    • str2: string

      to compare

    Returns string

  • createBucket(Bucket: string): Promise<void>
  • createDNSEntry(domain: string, type: string, value: string, targetZone?: HostedZone): Promise<void>
  • Create DNS entry

    Parameters

    • domain: string

      to create

    • type: string

      of DNS

    • value: string

      the value of the record

    • Default value targetZone: HostedZone = undefined

    Returns Promise<void>

  • defaultResources(): Promise<void>
  • deploy(): Promise<any>
  • doCreateCertificate(domain: string, zone: HostedZone): Promise<CertificateDetail>
  • Create a certificate for a domain Will use Route 53 to do the validation

    Parameters

    • domain: string

      to create the certificate for

    • zone: HostedZone

    Returns Promise<CertificateDetail>

  • execute(command: string, stdin?: string, resolveOnError?: boolean, logLevel?: WorkerLogLevel): Promise<object>
  • getARNPolicy(accountId: any, region: any): object[]
  • getAWSIdentity(): Promise<GetCallerIdentityResponse>
  • getApplication(): Application
  • getCertificate(domain: string, region?: string): Promise<any>
  • getDefaultTags(key?: string | object[]): object[]
  • Take this.resources[key].Tags and add all remaining Tags from this.resources.Tags

    Parameters

    • Default value key: string | object[] = undefined

      of the resources to add

    Returns object[]

  • getDefaultTagsAsMap(key?: string | object[]): object
  • Take this.resources[key].Tags and add all remaining Tags from this.resources.Tags

    Parameters

    • Default value key: string | object[] = undefined

      of the resources to add

    Returns object

    • [key: string]: string
  • getDefaultTagsAsS3Tagging(key?: string | object[]): string
  • getDefaultVpc(): Promise<object>
  • getPolicyDocument(additionalStatements?: any[]): Promise<any>
  • Generate the PolicyDocument

    It will browse all services for a method getARNPolicy Allowing you to write some specific Service or Bean that requires specific AWS permissions

    Parameters

    • Default value additionalStatements: any[] = []

    Returns Promise<any>

  • getRegion(): string
  • getZoneForDomainName(domain: any): Promise<HostedZone>
  • hash(str: string, type?: string, format?: "hex" | "base64"): string
  • Hash the string

    Parameters

    • str: string

      to hash

    • Default value type: string = "md5"

      of hash

    • Default value format: "hex" | "base64" = "hex"

      hex or b64

    Returns string

  • loadDefaults(): Promise<void>
  • md5(str: string): string
  • putFilesOnBucket(bucket: string, files: object[]): Promise<void>
  • Add files to a bucket

    It uses hash and ETag to avoid uploading files already present

    The files src can be either:

    • a string representing the local path
    • a Buffer with the dynamic content

    Parameters

    • bucket: string

      to send bucket

    • files: object[]

      to send

    Returns Promise<void>

  • putFolderOnBucket(bucket: string, folder: string, prefix?: string): Promise<void>
  • Send a full folder (recursive) on bucket

    Parameters

    • bucket: string

      to send data to

    • folder: string

      path to local folder to send

    • Default value prefix: string = ""

      prefix on the bucket

    Returns Promise<void>

  • replaceResourcesVariables(): void
  • replaceVariables(obj: any): any
  • setName(name: string): void
  • setType(type: string): void
  • waitFor(callback: any, delay: number, retries: number, title: string): Promise<any>
  • Wait for an operation to end

    Some AWS Api require minutes and polling This method will call the callback function until it returns true, or the max retries has been reached. Between each call, it will wait the delay

    If it reaches the max retries without a good answer from callback, the Promise will be rejected

    todo

    move it to core library along with a exponential retry

    Parameters

    • callback: any

      to call between each call

    • delay: number

      between each call to callback

    • retries: number

      max number of retries

    • title: string

      to display

    Returns Promise<any>

Generated using TypeDoc