Interface IJobQueueProps
Props to configure a JobQueue.
Namespace: Amazon.CDK.AWS.Batch
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IJobQueueProps
Syntax (vb)
Public Interface 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
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. |
Priority | The priority of the job queue. |
SchedulingPolicy | The SchedulingPolicy for this JobQueue. |
Properties
ComputeEnvironments
The set of compute environments mapped to a job queue and their order relative to each other.
virtual IOrderedComputeEnvironment[] ComputeEnvironments { get; }
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.
virtual Nullable<bool> Enabled { get; }
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.
virtual string JobQueueName { get; }
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
Priority
The priority of the job queue.
virtual Nullable<double> Priority { get; }
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.
virtual ISchedulingPolicy SchedulingPolicy { get; }
Property Value
Remarks
Instructs the Scheduler how to schedule different jobs.
Default: - no scheduling policy