Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ResourceGeneratorConstruct

Given a list of application resources with metadata attached, generate appropriate CDK resources.

This construct ingests a list of API classes and their methods and generates API routes and lambda function handlers.

Hierarchy

  • Construct
    • ResourceGeneratorConstruct

Index

Constructors

constructor

Properties

Optional databaseCluster

databaseCluster?: SlsPgDb

Optional functionOptions

functionOptions?: FunctionOptions

Default options for Lambda functions. Can be overridden.

Optional functionPrefix

functionPrefix?: string

generatedLambdas

generatedLambdas: JetKitLambdaFunction[]

Lambda functions that were generated.

Optional httpApi

httpApi?: HttpApi

Private layerCounter

layerCounter: number = 1

Readonly node

node: ConstructNode

The construct tree node associated with this construct.

stability

stable

Private ruleCounter

ruleCounter: number = 1

Private seenFunctionNames

seenFunctionNames: Record<string, number>

Methods

Protected configureAutoScaling

Protected configureVpc

Protected createLambdaFunction

generateConstructsForClass

generateConstructsForFunction

generateConstructsForResource

  • generateConstructsForResource(resource: MetadataTarget): void

Protected generateFunctionName

  • generateFunctionName(name: string, functionOptions: FunctionOptions): undefined | string

getFunction

Protected grantFunctionAccess

mergeFunctionDefaults

Protected onPrepare

  • onPrepare(): void
  • Perform final modifications before synthesis.

    This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

    This is an advanced framework feature. Only use this if you understand the implications.

    stability

    stable

    Returns void

Protected onSynthesize

  • onSynthesize(session: ISynthesisSession): void
  • Allows this construct to emit artifacts into the cloud assembly during synthesis.

    This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

    stability

    stable

    Parameters

    • session: ISynthesisSession

      The synthesis session.

    Returns void

Protected onValidate

  • onValidate(): string[]
  • Validate the current construct.

    This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

    stability

    stable

    Returns string[]

    An array of validation error messages, or an empty array if the construct is valid.

Protected prepare

  • prepare(): void
  • Perform final modifications before synthesis.

    This method can be implemented by derived constructs in order to perform final changes before synthesis. prepare() will be called after child constructs have been prepared.

    This is an advanced framework feature. Only use this if you understand the implications.

    stability

    stable

    Returns void

Protected resolveLayerReferences

Protected synthesize

  • synthesize(session: ISynthesisSession): void
  • Allows this construct to emit artifacts into the cloud assembly during synthesis.

    This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

    stability

    stable

    Parameters

    • session: ISynthesisSession

      The synthesis session.

    Returns void

toString

  • toString(): string
  • Returns a string representation of this construct.

    stability

    stable

    Returns string

Protected validate

  • validate(): string[]
  • Validate the current construct.

    This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.

    stability

    stable

    Returns string[]

    An array of validation error messages, or an empty array if the construct is valid.

Static isConstruct

  • isConstruct(x: any): x is Construct
  • Return whether the given object is a Construct.

    stability

    stable

    Parameters

    • x: any

    Returns x is Construct

Generated using TypeDoc