Skip to content
v2.273.0

EcsRunTask ​

Run a Task on ECS or Fargate.

Example ​

ts
const vpc = ec2.Vpc.fromLookup(this, 'Vpc', {
  isDefault: true,
});

const cluster = new ecs.Cluster(this, 'FargateCluster', { vpc });

const taskDefinition = new ecs.TaskDefinition(this, 'TD', {
  memoryMiB: '512',
  cpu: '256',
  compatibility: ecs.Compatibility.FARGATE,
});

const containerDefinition = taskDefinition.addContainer('TheContainer', {
  image: ecs.ContainerImage.fromRegistry('foo/bar'),
  memoryLimitMiB: 256,
});

const runTask = new tasks.EcsRunTask(this, 'RunFargate', {
  integrationPattern: sfn.IntegrationPattern.RUN_JOB,
  cluster,
  taskDefinition,
  assignPublicIp: true,
  containerOverrides: [{
    containerDefinition,
    environment: [{ name: 'SOME_KEY', value: sfn.JsonPath.stringAt('$.SomeKey') }],
  }],
  launchTarget: new tasks.EcsFargateLaunchTarget(),
  propagatedTagSource: ecs.PropagatedTagSource.TASK_DEFINITION,
});
python
vpc = ec2.Vpc.from_lookup(self, "Vpc",
    is_default=True
)

cluster = ecs.Cluster(self, "FargateCluster", vpc=vpc)

task_definition = ecs.TaskDefinition(self, "TD",
    memory_mi_b="512",
    cpu="256",
    compatibility=ecs.Compatibility.FARGATE
)

container_definition = task_definition.add_container("TheContainer",
    image=ecs.ContainerImage.from_registry("foo/bar"),
    memory_limit_mi_b=256
)

run_task = tasks.EcsRunTask(self, "RunFargate",
    integration_pattern=sfn.IntegrationPattern.RUN_JOB,
    cluster=cluster,
    task_definition=task_definition,
    assign_public_ip=True,
    container_overrides=[tasks.ContainerOverride(
        container_definition=container_definition,
        environment=[tasks.TaskEnvironmentVariable(name="SOME_KEY", value=sfn.JsonPath.string_at("$.SomeKey"))]
    )],
    launch_target=tasks.EcsFargateLaunchTarget(),
    propagated_tag_source=ecs.PropagatedTagSource.TASK_DEFINITION
)
java
IVpc vpc = Vpc.fromLookup(this, "Vpc", VpcLookupOptions.builder()
        .isDefault(true)
        .build());

Cluster cluster = Cluster.Builder.create(this, "FargateCluster").vpc(vpc).build();

TaskDefinition taskDefinition = TaskDefinition.Builder.create(this, "TD")
        .memoryMiB("512")
        .cpu("256")
        .compatibility(Compatibility.FARGATE)
        .build();

ContainerDefinition containerDefinition = taskDefinition.addContainer("TheContainer", ContainerDefinitionOptions.builder()
        .image(ContainerImage.fromRegistry("foo/bar"))
        .memoryLimitMiB(256)
        .build());

EcsRunTask runTask = EcsRunTask.Builder.create(this, "RunFargate")
        .integrationPattern(IntegrationPattern.RUN_JOB)
        .cluster(cluster)
        .taskDefinition(taskDefinition)
        .assignPublicIp(true)
        .containerOverrides(List.of(ContainerOverride.builder()
                .containerDefinition(containerDefinition)
                .environment(List.of(TaskEnvironmentVariable.builder().name("SOME_KEY").value(JsonPath.stringAt("$.SomeKey")).build()))
                .build()))
        .launchTarget(new EcsFargateLaunchTarget())
        .propagatedTagSource(PropagatedTagSource.TASK_DEFINITION)
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
var vpc = Vpc.FromLookup(this, "Vpc", new VpcLookupOptions {
    IsDefault = true
});

var cluster = new Cluster(this, "FargateCluster", new ClusterProps { Vpc = vpc });

var taskDefinition = new TaskDefinition(this, "TD", new TaskDefinitionProps {
    MemoryMiB = "512",
    Cpu = "256",
    Compatibility = Compatibility.FARGATE
});

var containerDefinition = taskDefinition.AddContainer("TheContainer", new ContainerDefinitionOptions {
    Image = ContainerImage.FromRegistry("foo/bar"),
    MemoryLimitMiB = 256
});

var runTask = new EcsRunTask(this, "RunFargate", new EcsRunTaskProps {
    IntegrationPattern = IntegrationPattern.RUN_JOB,
    Cluster = cluster,
    TaskDefinition = taskDefinition,
    AssignPublicIp = true,
    ContainerOverrides = new [] { new ContainerOverride {
        ContainerDefinition = containerDefinition,
        Environment = new [] { new TaskEnvironmentVariable { Name = "SOME_KEY", Value = JsonPath.StringAt("$.SomeKey") } }
    } },
    LaunchTarget = new EcsFargateLaunchTarget(),
    PropagatedTagSource = PropagatedTagSource.TASK_DEFINITION
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
vpc := ec2.Vpc_FromLookup(this, jsii.String("Vpc"), &VpcLookupOptions{
	IsDefault: jsii.Boolean(true),
})

cluster := ecs.NewCluster(this, jsii.String("FargateCluster"), &ClusterProps{
	Vpc: Vpc,
})

taskDefinition := ecs.NewTaskDefinition(this, jsii.String("TD"), &TaskDefinitionProps{
	MemoryMiB: jsii.String("512"),
	Cpu: jsii.String("256"),
	Compatibility: ecs.Compatibility_FARGATE,
})

containerDefinition := taskDefinition.AddContainer(jsii.String("TheContainer"), &ContainerDefinitionOptions{
	Image: ecs.ContainerImage_FromRegistry(jsii.String("foo/bar")),
	MemoryLimitMiB: jsii.Number(256),
})

runTask := tasks.NewEcsRunTask(this, jsii.String("RunFargate"), &EcsRunTaskProps{
	IntegrationPattern: sfn.IntegrationPattern_RUN_JOB,
	Cluster: Cluster,
	TaskDefinition: TaskDefinition,
	AssignPublicIp: jsii.Boolean(true),
	ContainerOverrides: []ContainerOverride{
		&ContainerOverride{
			ContainerDefinition: *ContainerDefinition,
			Environment: []TaskEnvironmentVariable{
				&TaskEnvironmentVariable{
					Name: jsii.String("SOME_KEY"),
					Value: sfn.JsonPath_StringAt(jsii.String("$.SomeKey")),
				},
			},
		},
	},
	LaunchTarget: tasks.NewEcsFargateLaunchTarget(),
	PropagatedTagSource: ecs.PropagatedTagSource_TASK_DEFINITION,
})

Initializer ​

ts
new EcsRunTask(scope: Construct, id: string, props: EcsRunTaskProps)
python
EcsRunTask(scope: Construct, id: str, props: EcsRunTaskProps)
java
new EcsRunTask(Construct scope, String id, EcsRunTaskProps props)
csharp
new EcsRunTask(Construct scope, string id, EcsRunTaskProps props)
go
NewEcsRunTask(Scope Construct, Id *string, Props EcsRunTaskProps)

Construct Props ​

assign{ [key: string]: any }assigntyping.Mapping[str, Any]assignMap<String, Object>AssignIDictionary<string, object>Assign*map[string]interface{}= Not assign variables#
Workflow variables to store in this step.

Using workflow variables, you can store data in a step and retrieve that data in future steps.

assignPublicIpbooleanassign_public_ipboolassignPublicIpBooleanAssignPublicIpboolAssignPublicIp*bool= false#
Assign public IP addresses to each task.
clusterIClusterclusterIClusterclusterIClusterClusterIClusterClusterIClusterrequired#
The ECS cluster to run the task on.
commentstringcommentstrcommentStringCommentstringComment*string= No comment#
A comment describing this state.
containerOverridesContainerOverride[]container_overridestyping.List[ContainerOverride]containerOverridesList<ContainerOverride>ContainerOverridesContainerOverride[]ContainerOverrides*[]ContainerOverride= No overrides#
Container setting overrides.

Specify the container to use and the overrides to apply.

cpustringcpustrcpuStringCpustringCpu*string= No override#
Cpu setting override.
credentialsCredentialscredentialsCredentialscredentialsCredentialsCredentialsCredentialsCredentialsCredentials= None (Task is executed using the…#
Credentials for an IAM Role that the State Machine assumes for executing the task.

This enables cross-account resource invocations.

default

Default: None (Task is executed using the State Machine's execution role)

enableExecuteCommandbooleanenable_execute_commandboolenableExecuteCommandBooleanEnableExecuteCommandboolEnableExecuteCommand*bool= false#
Whether ECS Exec should be enabled.
heartbeatDurationheartbeatDurationheartbeatDurationHeartbeatDurationHeartbeatDuration= Nonedeprecated#
use `heartbeatTimeout`
heartbeatTimeoutTimeoutheartbeat_timeoutTimeoutheartbeatTimeoutTimeoutHeartbeatTimeoutTimeoutHeartbeatTimeoutTimeout= None#
Timeout for the heartbeat.

[disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface

inputPathstringinput_pathstrinputPathStringInputPathstringInputPath*string= $#
JSONPath expression to select part of the state to be the input to this state.

May also be the special value JsonPath.DISCARD, which will cause the effective input to be the empty object {}.

integrationPatternIntegrationPatternintegration_patternIntegrationPatternintegrationPatternIntegrationPatternIntegrationPatternIntegrationPatternIntegrationPatternIntegrationPattern= `IntegrationPattern.REQUEST_RESP…#
AWS Step Functions integrates with services directly in the Amazon States Language.

You can control these AWS services using service integration patterns.

Depending on the AWS Service, the Service Integration Pattern availability will vary.

default

Default: IntegrationPattern.REQUEST_RESPONSE for most tasks. IntegrationPattern.RUN_JOB for the following exceptions: BatchSubmitJob, EmrAddStep, EmrCreateCluster, EmrTerminationCluster, and EmrContainersStartJobRun.

launchTargetIEcsLaunchTargetlaunch_targetIEcsLaunchTargetlaunchTargetIEcsLaunchTargetLaunchTargetIEcsLaunchTargetLaunchTargetIEcsLaunchTargetrequired#
An Amazon ECS launch type determines the type of infrastructure on which your tasks and services are hosted.
memoryMiBstringmemory_mi_bstrmemoryMiBStringMemoryMiBstringMemoryMiB*string= No override#
Memory setting override.
outputPathstringoutput_pathstroutputPathStringOutputPathstringOutputPath*string= $#
JSONPath expression to select part of the state to be the output to this state.

May also be the special value JsonPath.DISCARD, which will cause the effective output to be the empty object {}.

outputsanyoutputsAnyoutputsObjectOutputsobjectOutputsinterface{}= $states.result or $states.errorO…#
Used to specify and transform output from the state.
notes · default

When specified, the value overrides the state output default. The output field accepts any JSON value (object, array, string, number, boolean, null). Any string value, including those inside objects or arrays, will be evaluated as JSONata if surrounded by {% %} characters. Output also accepts a JSONata expression directly.

Default: $states.result or $states.errorOutput

propagatedTagSourcePropagatedTagSourcepropagated_tag_sourcePropagatedTagSourcepropagatedTagSourcePropagatedTagSourcePropagatedTagSourcePropagatedTagSourcePropagatedTagSourcePropagatedTagSource= No tags are propagated.#
Specifies whether to propagate the tags from the task definition to the task.

An error will be received if you specify the SERVICE option when running a task.

queryLanguageQueryLanguagequery_languageQueryLanguagequeryLanguageQueryLanguageQueryLanguageQueryLanguageQueryLanguageQueryLanguage= JSONPath#
The name of the query language used by the state.

If the state does not contain a queryLanguage field, then it will use the query language specified in the top-level queryLanguage field.

resultPathstringresult_pathstrresultPathStringResultPathstringResultPath*string= $#
JSONPath expression to indicate where to inject the state's output.

May also be the special value JsonPath.DISCARD, which will cause the state's input to become its output.

resultSelector{ [key: string]: any }result_selectortyping.Mapping[str, Any]resultSelectorMap<String, Object>ResultSelectorIDictionary<string, object>ResultSelector*map[string]interface{}= None#
The JSON that will replace the state's raw result and become the effective result before ResultPath is applied.

You can use ResultSelector to create a payload with values that are static or selected from the state's raw result.

revisionNumbernumberrevision_numberint | floatrevisionNumberNumberRevisionNumberdoubleRevisionNumber*float64= '$latest'#
The revision number of ECS task definition family.
securityGroupsISecurityGroup[]security_groupstyping.List[ISecurityGroup]securityGroupsList<ISecurityGroup>SecurityGroupsISecurityGroup[]SecurityGroups*[]ISecurityGroup= A new security group is created#
Existing security groups to use for the tasks.
stateNamestringstate_namestrstateNameStringStateNamestringStateName*string= The construct ID will be used as…#
Optional name for this state.
default

Default: The construct ID will be used as state name

subnetsSubnetSelectionsubnetsSubnetSelectionsubnetsSubnetSelectionSubnetsSubnetSelectionSubnetsSubnetSelection= Public subnets if assignPublicIp…#
Subnets to place the task's ENIs.
default

Default: Public subnets if assignPublicIp is set. Private subnets otherwise.

taskDefinitionTaskDefinitiontask_definitionTaskDefinitiontaskDefinitionTaskDefinitionTaskDefinitionTaskDefinitionTaskDefinitionTaskDefinitionrequired#
[disable-awslint:ref-via-interface] Task Definition used for running tasks in the service.

Note: this must be TaskDefinition, and not ITaskDefinition, as it requires properties that are not known for imported task definitions If you want to run a RunTask with an imported task definition, consider using CustomState

taskTimeoutTimeouttask_timeoutTimeouttaskTimeoutTimeoutTaskTimeoutTimeoutTaskTimeoutTimeout= None#
Timeout for the task.

[disable-awslint:duration-prop-type] is needed because all props interface in aws-stepfunctions-tasks extend this interface

timeoutDurationtimeoutDurationtimeoutDurationTimeoutDurationTimeoutDuration= Nonedeprecated#
use `taskTimeout`

Properties ​

connectionsConnectionsconnectionsConnectionsconnectionsConnectionsConnectionsConnectionsConnectionsConnectionsrequired#
Manage allowed network traffic for this service.
endStatesINextable[]end_statestyping.List[INextable]endStatesList<INextable>EndStatesINextable[]EndStates*[]INextablerequired#
Continuable states of this Chainable.
idstringidstridStringIdstringId*stringrequired#
Descriptive identifier for this chainable.
nodeNodenodeNodenodeNodeNodeNodeNodeNoderequired#
The tree node.
PROPERTY_INJECTION_IDstringproperty_injection_idstrPROPERTY_INJECTION_IDStringPROPERTY_INJECTION_IDstringPROPERTY_INJECTION_ID*stringrequiredstatic#
Uniquely identifies this class.
startStateStatestart_stateStatestartStateStateStartStateStateStartStateStaterequired#
First state of this Chainable.
stateIdstringstate_idstrstateIdStringStateIdstringStateId*stringrequired#
Tokenized string that evaluates to the state's ID.

Methods ​

addCatch(handler: IChainable, props?: CatchProps): TaskStateBasedef add_catch(self, handler: IChainable, props: typing.Optional[CatchProps] = None) -> TaskStateBasepublic TaskStateBase addCatch(IChainable handler, CatchProps props)public TaskStateBase AddCatch(IChainable handler, CatchProps? props = null)func AddCatch(Handler IChainable, Props CatchProps) TaskStateBase#
Add a recovery handler for this state.

When a particular error occurs, execution will continue at the error handler instead of failing the state machine execution.

addPrefix(x: string): voiddef add_prefix(self, x: str) -> Nonepublic void addPrefix(String x)public void AddPrefix(string x)func AddPrefix(X *string)#
Add a prefix to the stateId of this state.
addRetry(props?: RetryProps): TaskStateBasedef add_retry(self, props: typing.Optional[RetryProps] = None) -> TaskStateBasepublic TaskStateBase addRetry(RetryProps props)public TaskStateBase AddRetry(RetryProps? props = null)func AddRetry(Props RetryProps) TaskStateBase#
Add retry configuration for this state.

This controls if and how the execution will be retried if a particular error occurs.

bindToGraph(graph: StateGraph): voiddef bind_to_graph(self, graph: StateGraph) -> Nonepublic void bindToGraph(StateGraph graph)public void BindToGraph(StateGraph graph)func BindToGraph(Graph StateGraph)#
Register this state as part of the given graph.

Don't call this. It will be called automatically when you work with states normally.

filterNextables(states: State[]): INextable[]@staticmethod def filter_nextables(states: typing.List[State]) -> typing.List[INextable]public static List<INextable> filterNextables(List<State> states)public static INextable[] FilterNextables(State[] states)func FilterNextables(States *[]State) *[]INextablestatic#
Return only the states that allow chaining from an array of states.
findReachableEndStates(start: State, options?: FindStateOptions): State[]@staticmethod def find_reachable_end_states(start: State, options: typing.Optional[FindStateOptions] = None) -> typing.List[State]public static List<State> findReachableEndStates(State start, FindStateOptions options)public static State[] FindReachableEndStates(State start, FindStateOptions? options = null)func FindReachableEndStates(Start State, Options FindStateOptions) *[]Statestatic#
Find the set of end states states reachable through transitions from the given start state.
findReachableStates(start: State, options?: FindStateOptions): State[]@staticmethod def find_reachable_states(start: State, options: typing.Optional[FindStateOptions] = None) -> typing.List[State]public static List<State> findReachableStates(State start, FindStateOptions options)public static State[] FindReachableStates(State start, FindStateOptions? options = null)func FindReachableStates(Start State, Options FindStateOptions) *[]Statestatic#
Find the set of states reachable through transitions from the given start state.

This does not retrieve states from within sub-graphs, such as states within a Parallel state's branch.

isConstruct(x: any): boolean@staticmethod def is_construct(x: Any) -> boolpublic static Boolean isConstruct(Object x)public static bool IsConstruct(object x)func IsConstruct(X interface{}) *boolstatic#
Checks if `x` is a construct.
notes · 1 parameter · returns

Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

Parameters

  • xxxxX — Any object.

Returns: true if x is an object created from a class which extends Construct.

jsonata(scope: Construct, id: string, props: EcsRunTaskJsonataProps): EcsRunTask // chainable@staticmethod def jsonata(scope: Construct, id: str, props: EcsRunTaskJsonataProps) -> EcsRunTaskpublic static EcsRunTask jsonata(Construct scope, String id, EcsRunTaskJsonataProps props)public static EcsRunTask Jsonata(Construct scope, string id, EcsRunTaskJsonataProps props)func Jsonata(Scope Construct, Id *string, Props EcsRunTaskJsonataProps) EcsRunTaskstatic#
Run a Task that using JSONata on ECS or Fargate.
jsonPath(scope: Construct, id: string, props: EcsRunTaskJsonPathProps): EcsRunTask // chainable@staticmethod def json_path(scope: Construct, id: str, props: EcsRunTaskJsonPathProps) -> EcsRunTaskpublic static EcsRunTask jsonPath(Construct scope, String id, EcsRunTaskJsonPathProps props)public static EcsRunTask JsonPath(Construct scope, string id, EcsRunTaskJsonPathProps props)func JsonPath(Scope Construct, Id *string, Props EcsRunTaskJsonPathProps) EcsRunTaskstatic#
Run a Task that using JSONPath on ECS or Fargate.
metric(metricName: string, props?: MetricOptions): Metricdef metric(self, metric_name: str, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metric(String metricName, MetricOptions props)public Metric Metric(string metricName, MetricOptions? props = null)func Metric(MetricName *string, Props MetricOptions) Metric#
Return the given named metric for this Task.
metricFailed(props?: MetricOptions): Metricdef metric_failed(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricFailed(MetricOptions props)public Metric MetricFailed(MetricOptions? props = null)func MetricFailed(Props MetricOptions) Metric#
Metric for the number of times this activity fails.
metricHeartbeatTimedOut(props?: MetricOptions): Metricdef metric_heartbeat_timed_out(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricHeartbeatTimedOut(MetricOptions props)public Metric MetricHeartbeatTimedOut(MetricOptions? props = null)func MetricHeartbeatTimedOut(Props MetricOptions) Metric#
Metric for the number of times the heartbeat times out for this activity.
metricRunTime(props?: MetricOptions): Metricdef metric_run_time(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricRunTime(MetricOptions props)public Metric MetricRunTime(MetricOptions? props = null)func MetricRunTime(Props MetricOptions) Metric#
The interval, in milliseconds, between the time the Task starts and the time it closes.
metricScheduled(props?: MetricOptions): Metricdef metric_scheduled(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricScheduled(MetricOptions props)public Metric MetricScheduled(MetricOptions? props = null)func MetricScheduled(Props MetricOptions) Metric#
Metric for the number of times this activity is scheduled.
metricScheduleTime(props?: MetricOptions): Metricdef metric_schedule_time(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricScheduleTime(MetricOptions props)public Metric MetricScheduleTime(MetricOptions? props = null)func MetricScheduleTime(Props MetricOptions) Metric#
The interval, in milliseconds, for which the activity stays in the schedule state.
metricStarted(props?: MetricOptions): Metricdef metric_started(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricStarted(MetricOptions props)public Metric MetricStarted(MetricOptions? props = null)func MetricStarted(Props MetricOptions) Metric#
Metric for the number of times this activity is started.
metricSucceeded(props?: MetricOptions): Metricdef metric_succeeded(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricSucceeded(MetricOptions props)public Metric MetricSucceeded(MetricOptions? props = null)func MetricSucceeded(Props MetricOptions) Metric#
Metric for the number of times this activity succeeds.
metricTime(props?: MetricOptions): Metricdef metric_time(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricTime(MetricOptions props)public Metric MetricTime(MetricOptions? props = null)func MetricTime(Props MetricOptions) Metric#
The interval, in milliseconds, between the time the activity is scheduled and the time it closes.
metricTimedOut(props?: MetricOptions): Metricdef metric_timed_out(self, props: typing.Optional[MetricOptions] = None) -> Metricpublic Metric metricTimedOut(MetricOptions props)public Metric MetricTimedOut(MetricOptions? props = null)func MetricTimedOut(Props MetricOptions) Metric#
Metric for the number of times this activity times out.
prefixStates(root: IConstruct, prefix: string): void@staticmethod def prefix_states(root: IConstruct, prefix: str) -> Nonepublic static void prefixStates(IConstruct root, String prefix)public static void PrefixStates(IConstruct root, string prefix)func PrefixStates(Root IConstruct, Prefix *string)static#
Add a prefix to the stateId of all States found in a construct tree.
toStateJson(topLevelQueryLanguage?: QueryLanguage): jsondef to_state_json(self, top_level_query_language: typing.Optional[QueryLanguage] = None) -> Anypublic Object toStateJson(QueryLanguage topLevelQueryLanguage)public object ToStateJson(QueryLanguage? topLevelQueryLanguage = null)func ToStateJson(TopLevelQueryLanguage QueryLanguage) interface{}#
Return the Amazon States Language object for this state.
toString(): stringdef to_string(self, ) -> strpublic String toString()public string ToString()func ToString() *string#
Returns a string representation of this construct.
with(...mixins: IMixin[]): IConstructdef with(self, mixins: IMixin) -> IConstructpublic IConstruct with(IMixin mixins)public IConstruct With(IMixin mixins)func With(Mixins IMixin) IConstruct#
Applies one or more mixins to this construct.

Mixins are applied in order. The list of constructs is captured at the start of the call, so constructs added by a mixin will not be visited. Use multiple with() calls if subsequent mixins should apply to added constructs.

1 parameter · returns

Parameters

  • mixinsmixinsmixinsmixinsMixins — The mixins to apply.

Returns: This construct for chaining