JobQueueArgs

data class JobQueueArgs(val computeEnvironmentOrders: Output<List<JobQueueComputeEnvironmentOrderArgs>>? = null, val computeEnvironments: Output<List<String>>? = null, val name: Output<String>? = null, val priority: Output<Int>? = null, val schedulingPolicyArn: Output<String>? = null, val state: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val timeouts: Output<JobQueueTimeoutsArgs>? = null) : ConvertibleToJava<JobQueueArgs>

Provides a Batch Job Queue resource.

Example Usage

Basic Job Queue

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const testQueue = new aws.batch.JobQueue("test_queue", {
name: "tf-test-batch-job-queue",
state: "ENABLED",
priority: 1,
computeEnvironmentOrders: [
{
order: 1,
computeEnvironment: testEnvironment1.arn,
},
{
order: 2,
computeEnvironment: testEnvironment2.arn,
},
],
});
import pulumi
import pulumi_aws as aws
test_queue = aws.batch.JobQueue("test_queue",
name="tf-test-batch-job-queue",
state="ENABLED",
priority=1,
compute_environment_orders=[
aws.batch.JobQueueComputeEnvironmentOrderArgs(
order=1,
compute_environment=test_environment1["arn"],
),
aws.batch.JobQueueComputeEnvironmentOrderArgs(
order=2,
compute_environment=test_environment2["arn"],
),
])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var testQueue = new Aws.Batch.JobQueue("test_queue", new()
{
Name = "tf-test-batch-job-queue",
State = "ENABLED",
Priority = 1,
ComputeEnvironmentOrders = new[]
{
new Aws.Batch.Inputs.JobQueueComputeEnvironmentOrderArgs
{
Order = 1,
ComputeEnvironment = testEnvironment1.Arn,
},
new Aws.Batch.Inputs.JobQueueComputeEnvironmentOrderArgs
{
Order = 2,
ComputeEnvironment = testEnvironment2.Arn,
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/batch"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := batch.NewJobQueue(ctx, "test_queue", &batch.JobQueueArgs{
Name: pulumi.String("tf-test-batch-job-queue"),
State: pulumi.String("ENABLED"),
Priority: pulumi.Int(1),
ComputeEnvironmentOrders: batch.JobQueueComputeEnvironmentOrderArray{
&batch.JobQueueComputeEnvironmentOrderArgs{
Order: pulumi.Int(1),
ComputeEnvironment: pulumi.Any(testEnvironment1.Arn),
},
&batch.JobQueueComputeEnvironmentOrderArgs{
Order: pulumi.Int(2),
ComputeEnvironment: pulumi.Any(testEnvironment2.Arn),
},
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.batch.JobQueue;
import com.pulumi.aws.batch.JobQueueArgs;
import com.pulumi.aws.batch.inputs.JobQueueComputeEnvironmentOrderArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var testQueue = new JobQueue("testQueue", JobQueueArgs.builder()
.name("tf-test-batch-job-queue")
.state("ENABLED")
.priority(1)
.computeEnvironmentOrders(
JobQueueComputeEnvironmentOrderArgs.builder()
.order(1)
.computeEnvironment(testEnvironment1.arn())
.build(),
JobQueueComputeEnvironmentOrderArgs.builder()
.order(2)
.computeEnvironment(testEnvironment2.arn())
.build())
.build());
}
}
resources:
testQueue:
type: aws:batch:JobQueue
name: test_queue
properties:
name: tf-test-batch-job-queue
state: ENABLED
priority: 1
computeEnvironmentOrders:
- order: 1
computeEnvironment: ${testEnvironment1.arn}
- order: 2
computeEnvironment: ${testEnvironment2.arn}

Job Queue with a fair share scheduling policy

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.batch.SchedulingPolicy("example", {
name: "example",
fairSharePolicy: {
computeReservation: 1,
shareDecaySeconds: 3600,
shareDistributions: [{
shareIdentifier: "A1*",
weightFactor: 0.1,
}],
},
});
const exampleJobQueue = new aws.batch.JobQueue("example", {
name: "tf-test-batch-job-queue",
schedulingPolicyArn: example.arn,
state: "ENABLED",
priority: 1,
computeEnvironmentOrders: [
{
order: 1,
computeEnvironment: testEnvironment1.arn,
},
{
order: 2,
computeEnvironment: testEnvironment2.arn,
},
],
});
import pulumi
import pulumi_aws as aws
example = aws.batch.SchedulingPolicy("example",
name="example",
fair_share_policy=aws.batch.SchedulingPolicyFairSharePolicyArgs(
compute_reservation=1,
share_decay_seconds=3600,
share_distributions=[aws.batch.SchedulingPolicyFairSharePolicyShareDistributionArgs(
share_identifier="A1*",
weight_factor=0.1,
)],
))
example_job_queue = aws.batch.JobQueue("example",
name="tf-test-batch-job-queue",
scheduling_policy_arn=example.arn,
state="ENABLED",
priority=1,
compute_environment_orders=[
aws.batch.JobQueueComputeEnvironmentOrderArgs(
order=1,
compute_environment=test_environment1["arn"],
),
aws.batch.JobQueueComputeEnvironmentOrderArgs(
order=2,
compute_environment=test_environment2["arn"],
),
])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.Batch.SchedulingPolicy("example", new()
{
Name = "example",
FairSharePolicy = new Aws.Batch.Inputs.SchedulingPolicyFairSharePolicyArgs
{
ComputeReservation = 1,
ShareDecaySeconds = 3600,
ShareDistributions = new[]
{
new Aws.Batch.Inputs.SchedulingPolicyFairSharePolicyShareDistributionArgs
{
ShareIdentifier = "A1*",
WeightFactor = 0.1,
},
},
},
});
var exampleJobQueue = new Aws.Batch.JobQueue("example", new()
{
Name = "tf-test-batch-job-queue",
SchedulingPolicyArn = example.Arn,
State = "ENABLED",
Priority = 1,
ComputeEnvironmentOrders = new[]
{
new Aws.Batch.Inputs.JobQueueComputeEnvironmentOrderArgs
{
Order = 1,
ComputeEnvironment = testEnvironment1.Arn,
},
new Aws.Batch.Inputs.JobQueueComputeEnvironmentOrderArgs
{
Order = 2,
ComputeEnvironment = testEnvironment2.Arn,
},
},
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/batch"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := batch.NewSchedulingPolicy(ctx, "example", &batch.SchedulingPolicyArgs{
Name: pulumi.String("example"),
FairSharePolicy: &batch.SchedulingPolicyFairSharePolicyArgs{
ComputeReservation: pulumi.Int(1),
ShareDecaySeconds: pulumi.Int(3600),
ShareDistributions: batch.SchedulingPolicyFairSharePolicyShareDistributionArray{
&batch.SchedulingPolicyFairSharePolicyShareDistributionArgs{
ShareIdentifier: pulumi.String("A1*"),
WeightFactor: pulumi.Float64(0.1),
},
},
},
})
if err != nil {
return err
}
_, err = batch.NewJobQueue(ctx, "example", &batch.JobQueueArgs{
Name: pulumi.String("tf-test-batch-job-queue"),
SchedulingPolicyArn: example.Arn,
State: pulumi.String("ENABLED"),
Priority: pulumi.Int(1),
ComputeEnvironmentOrders: batch.JobQueueComputeEnvironmentOrderArray{
&batch.JobQueueComputeEnvironmentOrderArgs{
Order: pulumi.Int(1),
ComputeEnvironment: pulumi.Any(testEnvironment1.Arn),
},
&batch.JobQueueComputeEnvironmentOrderArgs{
Order: pulumi.Int(2),
ComputeEnvironment: pulumi.Any(testEnvironment2.Arn),
},
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.batch.SchedulingPolicy;
import com.pulumi.aws.batch.SchedulingPolicyArgs;
import com.pulumi.aws.batch.inputs.SchedulingPolicyFairSharePolicyArgs;
import com.pulumi.aws.batch.JobQueue;
import com.pulumi.aws.batch.JobQueueArgs;
import com.pulumi.aws.batch.inputs.JobQueueComputeEnvironmentOrderArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var example = new SchedulingPolicy("example", SchedulingPolicyArgs.builder()
.name("example")
.fairSharePolicy(SchedulingPolicyFairSharePolicyArgs.builder()
.computeReservation(1)
.shareDecaySeconds(3600)
.shareDistributions(SchedulingPolicyFairSharePolicyShareDistributionArgs.builder()
.shareIdentifier("A1*")
.weightFactor(0.1)
.build())
.build())
.build());
var exampleJobQueue = new JobQueue("exampleJobQueue", JobQueueArgs.builder()
.name("tf-test-batch-job-queue")
.schedulingPolicyArn(example.arn())
.state("ENABLED")
.priority(1)
.computeEnvironmentOrders(
JobQueueComputeEnvironmentOrderArgs.builder()
.order(1)
.computeEnvironment(testEnvironment1.arn())
.build(),
JobQueueComputeEnvironmentOrderArgs.builder()
.order(2)
.computeEnvironment(testEnvironment2.arn())
.build())
.build());
}
}
resources:
example:
type: aws:batch:SchedulingPolicy
properties:
name: example
fairSharePolicy:
computeReservation: 1
shareDecaySeconds: 3600
shareDistributions:
- shareIdentifier: A1*
weightFactor: 0.1
exampleJobQueue:
type: aws:batch:JobQueue
name: example
properties:
name: tf-test-batch-job-queue
schedulingPolicyArn: ${example.arn}
state: ENABLED
priority: 1
computeEnvironmentOrders:
- order: 1
computeEnvironment: ${testEnvironment1.arn}
- order: 2
computeEnvironment: ${testEnvironment2.arn}

Import

Using pulumi import, import Batch Job Queue using the arn. For example:

$ pulumi import aws:batch/jobQueue:JobQueue test_queue arn:aws:batch:us-east-1:123456789012:job-queue/sample

Constructors

Link copied to clipboard
constructor(computeEnvironmentOrders: Output<List<JobQueueComputeEnvironmentOrderArgs>>? = null, computeEnvironments: Output<List<String>>? = null, name: Output<String>? = null, priority: Output<Int>? = null, schedulingPolicyArn: Output<String>? = null, state: Output<String>? = null, tags: Output<Map<String, String>>? = null, timeouts: Output<JobQueueTimeoutsArgs>? = null)

Properties

Link copied to clipboard

The set of compute environments mapped to a job queue and their order relative to each other. 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.

Link copied to clipboard
val computeEnvironments: Output<List<String>>? = null

(Optional) This parameter is deprecated, please use compute_environment_order instead. List of compute environment ARNs mapped to a job queue. The position of the compute environments in the list will dictate the order. When importing a AWS Batch Job Queue, the parameter compute_environments will always be used over compute_environment_order. Please adjust your HCL accordingly.

Link copied to clipboard
val name: Output<String>? = null

Specifies the name of the job queue.

Link copied to clipboard
val priority: Output<Int>? = null

The priority of the job queue. Job queues with a higher priority are evaluated first when associated with the same compute environment.

Link copied to clipboard
val schedulingPolicyArn: Output<String>? = null

The ARN of the fair share scheduling policy. If this parameter is specified, the job queue uses a fair share scheduling policy. If this parameter isn't specified, the job queue uses a first in, first out (FIFO) scheduling policy. After a job queue is created, you can replace but can't remove the fair share scheduling policy.

Link copied to clipboard
val state: Output<String>? = null

The state of the job queue. Must be one of: ENABLED or DISABLED

Link copied to clipboard
val tags: Output<Map<String, String>>? = null

Key-value map of resource tags. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard
val timeouts: Output<JobQueueTimeoutsArgs>? = null

Functions

Link copied to clipboard
open override fun toJava(): JobQueueArgs