Construct

class constructs.Construct(scope, id, *, node_factory=None)

Bases: object

Represents the building block of the construct graph.

All constructs besides the root construct must be created within the scope of another construct.

Creates a new construct node.

Parameters
  • scope (Construct) – The scope in which to define this construct.

  • id (str) – The scoped construct ID. Must be unique amongst siblings. If the ID includes a path separator (/), then it will be replaced by double dash --.

  • node_factory (Optional[INodeFactory]) – A factory for attaching Node``s to the construct. Default: - the default ``Node is associated

Methods

to_string()

Returns a string representation of this construct.

Return type

str