class Construct (construct)
Language | Type name |
---|---|
![]() | Constructs.Construct |
![]() | software.constructs.Construct |
![]() | constructs.Construct |
![]() | constructs » Construct |
Implements
IConstruct
Represents the building block of the construct graph.
All constructs besides the root construct must be created within the scope of another construct.
Initializer
new Construct(scope: Construct, id: string, options?: ConstructOptions)
Parameters
- scope
Construct
— The scope in which to define this construct. - id
string
— The scoped construct ID. - options
Construct
— Options.Options
Creates a new construct node.
Construct Props
Name | Type | Description |
---|---|---|
node | INode | A factory for attaching Node s to the construct. |
nodeFactory?
Type:
INode
(optional, default: the default Node
is associated)
A factory for attaching Node
s to the construct.
Methods
Name | Description |
---|---|
to | Returns a string representation of this construct. |
protected on | Perform final modifications before synthesis. |
protected on | Allows this construct to emit artifacts into the cloud assembly during synthesis. |
protected on | Validate the current construct. |
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
protected onPrepare()
protected 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.
protected onSynthesize(session)
protected onSynthesize(session: ISynthesisSession): void
Parameters
- session
ISynthesis
— The synthesis session.Session
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.
protected onValidate()
protected onValidate(): string[]
⚠️ Deprecated: use Node.addValidation()
to subscribe validation functions on this construct
instead of overriding this method.
Returns
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.