Class JobQueueProps
Props to configure a JobQueue.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.Batch
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class JobQueueProps : Object, IJobQueueProps
Syntax (vb)
Public Class JobQueueProps
Inherits Object
Implements IJobQueueProps
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
JobQueueProps() |
Properties
ComputeEnvironments | The set of compute environments mapped to a job queue and their order relative to each other. |
Enabled | If the job queue is enabled, it is able to accept jobs. |
JobQueueName | The name of the job queue. |
JobStateTimeLimitActions | The set of actions that AWS Batch perform on jobs that remain at the head of the job queue in the specified state longer than specified times. |
Priority | The priority of the job queue. |
SchedulingPolicy | The SchedulingPolicy for this JobQueue. |
Constructors
JobQueueProps()
public JobQueueProps()
Properties
ComputeEnvironments
The set of compute environments mapped to a job queue and their order relative to each other.
public IOrderedComputeEnvironment[] ComputeEnvironments { get; set; }
Property Value
Remarks
The job scheduler uses this parameter to determine which compute environment runs a specific job. Compute environments must be in the VALID state before you can associate them with a job queue. You can associate up to three compute environments with a job queue. All of the compute environments must be either EC2 (EC2 or SPOT) or Fargate (FARGATE or FARGATE_SPOT); EC2 and Fargate compute environments can't be mixed.
Note: All compute environments that are associated with a job queue must share the same architecture. AWS Batch doesn't support mixing compute environment architecture types in a single job queue.
Default: none
Enabled
If the job queue is enabled, it is able to accept jobs.
public Nullable<bool> Enabled { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Otherwise, new jobs can't be added to the queue, but jobs already in the queue can finish.
Default: true
JobQueueName
The name of the job queue.
public string JobQueueName { get; set; }
Property Value
System.String
Remarks
It can be up to 128 letters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_)
Default: - no name
JobStateTimeLimitActions
The set of actions that AWS Batch perform on jobs that remain at the head of the job queue in the specified state longer than specified times.
public IJobStateTimeLimitAction[] JobStateTimeLimitActions { get; set; }
Property Value
Remarks
Default: - no actions
Priority
The priority of the job queue.
public Nullable<double> Priority { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
Job queues with a higher priority are evaluated first when associated with the same compute environment. Priority is determined in descending order. For example, a job queue with a priority of 10 is given scheduling preference over a job queue with a priority of 1.
Default: 1
SchedulingPolicy
The SchedulingPolicy for this JobQueue.
public ISchedulingPolicy SchedulingPolicy { get; set; }
Property Value
Remarks
Instructs the Scheduler how to schedule different jobs.
Default: - no scheduling policy