UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

146 lines 5.32 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.JobQueue = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a Batch Job Queue resource. * * ## Example Usage * * ### Basic Job Queue * * ```typescript * 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, * }, * ], * }); * ``` * * ### Job Queue with a fair share scheduling policy * * ```typescript * 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 * * Using `pulumi import`, import Batch Job Queue using the `arn`. For example: * * ```sh * $ pulumi import aws:batch/jobQueue:JobQueue test_queue arn:aws:batch:us-east-1:123456789012:job-queue/sample * ``` */ class JobQueue extends pulumi.CustomResource { /** * Get an existing JobQueue resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new JobQueue(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of JobQueue. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === JobQueue.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state?.arn; resourceInputs["computeEnvironmentOrders"] = state?.computeEnvironmentOrders; resourceInputs["jobStateTimeLimitActions"] = state?.jobStateTimeLimitActions; resourceInputs["name"] = state?.name; resourceInputs["priority"] = state?.priority; resourceInputs["region"] = state?.region; resourceInputs["schedulingPolicyArn"] = state?.schedulingPolicyArn; resourceInputs["state"] = state?.state; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["timeouts"] = state?.timeouts; } else { const args = argsOrState; if (args?.priority === undefined && !opts.urn) { throw new Error("Missing required property 'priority'"); } if (args?.state === undefined && !opts.urn) { throw new Error("Missing required property 'state'"); } resourceInputs["computeEnvironmentOrders"] = args?.computeEnvironmentOrders; resourceInputs["jobStateTimeLimitActions"] = args?.jobStateTimeLimitActions; resourceInputs["name"] = args?.name; resourceInputs["priority"] = args?.priority; resourceInputs["region"] = args?.region; resourceInputs["schedulingPolicyArn"] = args?.schedulingPolicyArn; resourceInputs["state"] = args?.state; resourceInputs["tags"] = args?.tags; resourceInputs["timeouts"] = args?.timeouts; resourceInputs["arn"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(JobQueue.__pulumiType, name, resourceInputs, opts); } } exports.JobQueue = JobQueue; /** @internal */ JobQueue.__pulumiType = 'aws:batch/jobQueue:JobQueue'; //# sourceMappingURL=jobQueue.js.map