Class EcsJobDefinitionProps
Props for EcsJobDefinition.
Inheritance
Namespace: Amazon.CDK.AWS.Batch
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class EcsJobDefinitionProps : Object, IEcsJobDefinitionProps, IJobDefinitionProps
Syntax (vb)
Public Class EcsJobDefinitionProps
Inherits Object
Implements IEcsJobDefinitionProps, IJobDefinitionProps
Remarks
ExampleMetadata: infused
Examples
IVpc vpc;
var ecsJob = new EcsJobDefinition(this, "JobDefn", new EcsJobDefinitionProps {
Container = new EcsEc2ContainerDefinition(this, "containerDefn", new EcsEc2ContainerDefinitionProps {
Image = ContainerImage.FromRegistry("public.ecr.aws/amazonlinux/amazonlinux:latest"),
Memory = Size.Mebibytes(2048),
Cpu = 256
})
});
var queue = new JobQueue(this, "JobQueue", new JobQueueProps {
ComputeEnvironments = new [] { new OrderedComputeEnvironment {
ComputeEnvironment = new ManagedEc2EcsComputeEnvironment(this, "managedEc2CE", new ManagedEc2EcsComputeEnvironmentProps {
Vpc = vpc
}),
Order = 1
} },
Priority = 10
});
var user = new User(this, "MyUser");
ecsJob.GrantSubmitJob(user, queue);
Synopsis
Constructors
EcsJobDefinitionProps() |
Properties
Container | The container that this job will run. |
JobDefinitionName | The name of this job definition. |
Parameters | The default parameters passed to the container These parameters can be referenced in the |
PropagateTags | Whether to propogate tags from the JobDefinition to the ECS task that Batch spawns. |
RetryAttempts | The number of times to retry a job. |
RetryStrategies | Defines the retry behavior for this job. |
SchedulingPriority | The priority of this Job. |
Timeout | The timeout time for jobs that are submitted with this job definition. |
Constructors
EcsJobDefinitionProps()
public EcsJobDefinitionProps()
Properties
Container
The container that this job will run.
public IEcsContainerDefinition Container { get; set; }
Property Value
JobDefinitionName
The name of this job definition.
public string JobDefinitionName { get; set; }
Property Value
System.String
Remarks
Default: - generated by CloudFormation
Parameters
The default parameters passed to the container These parameters can be referenced in the command
that you give to the container.
public IDictionary<string, object> Parameters { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Remarks
PropagateTags
Whether to propogate tags from the JobDefinition to the ECS task that Batch spawns.
public Nullable<bool> PropagateTags { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
RetryAttempts
The number of times to retry a job.
public Nullable<double> RetryAttempts { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
The job is retried on failure the same number of attempts as the value.
Default: 1
RetryStrategies
Defines the retry behavior for this job.
public RetryStrategy[] RetryStrategies { get; set; }
Property Value
Remarks
Default: - no RetryStrategy
SchedulingPriority
The priority of this Job.
public Nullable<double> SchedulingPriority { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
Only used in Fairshare Scheduling to decide which job to run first when there are multiple jobs with the same share identifier.
Default: none
Timeout
The timeout time for jobs that are submitted with this job definition.
public Duration Timeout { get; set; }
Property Value
Remarks
After the amount of time you specify passes, Batch terminates your jobs if they aren't finished.
Default: - no timeout