Class Construct
Represents the building block of the construct graph.
Inheritance
Namespace: Amazon.CDK
Assembly: Amazon.CDK.dll
Syntax (csharp)
public class Construct : Construct, IConstruct, IDependable
Syntax (vb)
Public Class Construct
Inherits Construct
Implements IConstruct, IDependable
Remarks
All constructs besides the root construct must be created within the scope of another construct.
ExampleMetadata: infused
Examples
var entry = "/path/to/function";
var image = DockerImage.FromBuild(entry);
new PythonFunction(this, "function", new PythonFunctionProps {
Entry = entry,
Runtime = Runtime.PYTHON_3_8,
Bundling = new BundlingOptions {
BuildArgs = new Dictionary<string, string> { { "PIP_INDEX_URL", "https://your.index.url/simple/" }, { "PIP_EXTRA_INDEX_URL", "https://your.extra-index.url/simple/" } }
}
});
Synopsis
Constructors
Construct(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Construct(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Construct(Construct, String) |
Properties
Node | The construct tree node associated with this construct. |
Methods
IsConstruct(Object) | Return whether the given object is a Construct. |
OnPrepare() | Perform final modifications before synthesis. |
OnSynthesize(ISynthesisSession) | Allows this construct to emit artifacts into the cloud assembly during synthesis. |
OnValidate() | Validate the current construct. |
Prepare() | Perform final modifications before synthesis. |
Synthesize(ISynthesisSession) | Allows this construct to emit artifacts into the cloud assembly during synthesis. |
Validate() | Validate the current construct. |
Constructors
Construct(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected Construct(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
Construct(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected Construct(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Construct(Construct, String)
public Construct(Construct scope, string id)
Parameters
- scope Constructs.Construct
- id System.String
Properties
Node
The construct tree node associated with this construct.
public virtual ConstructNode Node { get; }
Property Value
Methods
IsConstruct(Object)
Return whether the given object is a Construct.
public static bool IsConstruct(object x)
Parameters
- x System.Object
Returns
System.Boolean
OnPrepare()
Perform final modifications before synthesis.
protected override void OnPrepare()
Remarks
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.
OnSynthesize(ISynthesisSession)
Allows this construct to emit artifacts into the cloud assembly during synthesis.
protected override void OnSynthesize(ISynthesisSession session)
Parameters
- session Constructs.ISynthesisSession
The synthesis session.
Remarks
This method is usually implemented by framework-level constructs such as Stack
and Asset
as they participate in synthesizing the cloud assembly.
OnValidate()
Validate the current construct.
protected override string[] OnValidate()
Returns
System.String[]
An array of validation error messages, or an empty array if the construct is valid.
Remarks
This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.
Prepare()
Perform final modifications before synthesis.
protected virtual void Prepare()
Remarks
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.
Synthesize(ISynthesisSession)
Allows this construct to emit artifacts into the cloud assembly during synthesis.
protected virtual void Synthesize(ISynthesisSession session)
Parameters
- session ISynthesisSession
The synthesis session.
Remarks
This method is usually implemented by framework-level constructs such as Stack
and Asset
as they participate in synthesizing the cloud assembly.
Validate()
Validate the current construct.
protected virtual string[] Validate()
Returns
System.String[]
An array of validation error messages, or an empty array if the construct is valid.
Remarks
This method can be implemented by derived constructs in order to perform validation logic. It is called on all constructs before synthesis.