Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Instrument

Bigband's basic building block. Usually corresponds to an AWS resources such as: a Lambda function, a DynamoDB table, a Kinesis stream, etc.

Naming. Inside every Section, Instruments are arranged in a tree-like hierarchy (similar to the way files are arranged in directories). This enables logical grouping of related instruments. The packageName (denoting a "path in the tree") is specified as an array of string: ["p1", "p2", "p3"] denotes a package nested inside the ["p1", "p2"] package. For brevity, a packageName can also be specified as a plain string: "p1" is equivalent to ["p1"]. The instrument's plain name is must be unique within its package. In other words: two instruments can have the same simple name if they belond to two different packages.

Hierarchy

Index

Constructors

constructor

  • new Instrument(packageName: string | string[], _name: string): Instrument
  • Initializes an Instrument.

    memberof

    Instrument

    Parameters

    • packageName: string | string[]

      the package name of the instrument. See "Naming" above.

    • _name: string

    Returns Instrument

Properties

Protected definition

definition: Definition = new Definition()

dependencies

dependencies: Dependency[] = []

Methods

arn

  • Computes the ARN of this instrument at the given section

    Parameters

    Returns string

Abstract arnService

  • arnService(): string
  • Returns the AWS service namespace to be used when constructing the ARN of this instrument. For instance, in a an ARN of a lambda function, "arn:aws:lambda:eu-west-2:111111111111:function:my-function", this is the "lamda" token.

    Returns string

Abstract arnType

  • arnType(): string
  • Returns the AWS resource name to be used when constructing the ARN of this instrument. For instance, in a an ARN of a lambda function, "arn:aws:lambda:eu-west-2:111111111111:function:my-function", this is the "function" token.

    Returns string

canDo

  • canDo(action: string, arn: string): this
  • Adds an IAM permission to this instrument

    memberof

    Instrument

    Parameters

    • action: string

      the action to be allowed

    • arn: string

      specifies the resource that this instrument is being granted permission to access

    Returns this

    this

Abstract contributeToConsumerDefinition

  • Called on supplier instruments (as per the uses method). This allows supplier instruments to affect the cloudformation template of their consumer insturments. A supplier would typically add an IAM permission to its consumer.

    Parameters

    Returns void

Abstract createFragment

fullyQualifiedName

  • fullyQualifiedName(style?: NameStyle): string
  • Computes the full name of this instrument. The full name is a composition of the "last name" (as specified by the package name) with the "first name" (this instrument's name)

    memberof

    Instrument

    Parameters

    • Default value style: NameStyle = NameStyle.DASH

    Returns string

    the full qualified name

getDefinition

Abstract getEntryPointFile

  • getEntryPointFile(): string
  • Returns the path to a file that needs to be compiled with this instrument. This is needed for instruments that need user-supplied code to be shipped, such as Lambda instruments. An empty string denotes that no node needs to be shipped.

    Returns string

getPhysicalDefinition

name

  • name(): string
  • Returns the plain name of this instrument.

    Returns string

Abstract nameProperty

  • nameProperty(): string

physicalName

  • physicalName(section: Section): string
  • Computes the physical name of the instrument at the given section. The physical name contains the names of the enclosing bigband and section as well as the fullyQualifiedName.

    Parameters

    Returns string

uses

  • Declares an inter-instrument dependency. It indicates that this instrument ("the consumer") will use the supplier instrument

    Parameters

    • supplier: Instrument

      the supplier instrument.

    • name: string

      the name of the dependency.

    Returns void

Generated using TypeDoc