@pulumi/nomad
Version: 
A Pulumi package for creating and managing nomad cloud resources.
263 lines (262 loc) • 10 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "./types/input";
import * as outputs from "./types/output";
export declare class Job extends pulumi.CustomResource {
    /**
     * Get an existing Job 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: string, id: pulumi.Input<pulumi.ID>, state?: JobState, opts?: pulumi.CustomResourceOptions): Job;
    /**
     * Returns true if the given object is an instance of Job.  This is designed to work even
     * when multiple copies of the Pulumi SDK have been loaded into the same process.
     */
    static isInstance(obj: any): obj is Job;
    /**
     * The IDs for allocations associated with this job.
     *
     * @deprecated Retrieving allocation IDs from the job resource is deprecated and will be removed in a future release. Use the nomad.getAllocations data source instead.
     */
    readonly allocationIds: pulumi.Output<string[]>;
    /**
     * The target datacenters for the job, as derived from the jobspec.
     */
    readonly datacenters: pulumi.Output<string[]>;
    /**
     * If detach = false, the ID for the deployment associated with the last job create/update, if one exists.
     */
    readonly deploymentId: pulumi.Output<string>;
    /**
     * If detach = false, the status for the deployment associated with the last job create/update, if one exists.
     */
    readonly deploymentStatus: pulumi.Output<string>;
    /**
     * If true, the job will be deregistered on destroy.
     */
    readonly deregisterOnDestroy: pulumi.Output<boolean | undefined>;
    /**
     * `(boolean: true)` - Determines if the job will be
     * deregistered if the ID of the job in the jobspec changes.
     */
    readonly deregisterOnIdChange: pulumi.Output<boolean | undefined>;
    /**
     * `(boolean: true)` - If true, the provider will return immediately
     * after creating or updating, instead of monitoring.
     */
    readonly detach: pulumi.Output<boolean | undefined>;
    /**
     * `(block: optional)` - Options for the HCL2 jobspec parser.
     */
    readonly hcl2: pulumi.Output<outputs.JobHcl2 | undefined>;
    /**
     * `(string: <required>)` - The contents of the jobspec to register.
     */
    readonly jobspec: pulumi.Output<string>;
    /**
     * `(boolean: false)` - Set this to `true` if your jobspec is structured with
     * JSON instead of the default HCL.
     */
    readonly json: pulumi.Output<boolean | undefined>;
    /**
     * Integer that increments for each change. Used to detect any changes between plan and apply.
     */
    readonly modifyIndex: pulumi.Output<string>;
    /**
     * The name of the job, as derived from the jobspec.
     */
    readonly name: pulumi.Output<string>;
    /**
     * The namespace of the job, as derived from the jobspec.
     */
    readonly namespace: pulumi.Output<string>;
    /**
     * `(boolean: false)` - Determines if the job will override any
     * soft-mandatory Sentinel policies and register even if they fail.
     */
    readonly policyOverride: pulumi.Output<boolean | undefined>;
    /**
     * `(boolean: false)` - Set this to true if you want the job to
     * be purged when the resource is destroyed.
     */
    readonly purgeOnDestroy: pulumi.Output<boolean | undefined>;
    /**
     * @deprecated Retrieving allocation IDs from the job resource is deprecated and will be removed in a future release. Use the nomad.getAllocations data source instead.
     */
    readonly readAllocationIds: pulumi.Output<boolean | undefined>;
    /**
     * The target region for the job, as derived from the jobspec.
     */
    readonly region: pulumi.Output<string>;
    /**
     * `(boolean: false)` - Set this to true to force the job to run
     * again if its status is `dead`.
     */
    readonly rerunIfDead: pulumi.Output<boolean | undefined>;
    /**
     * The status of the job.
     */
    readonly status: pulumi.Output<string>;
    readonly taskGroups: pulumi.Output<outputs.JobTaskGroup[]>;
    /**
     * The type of the job, as derived from the jobspec.
     */
    readonly type: pulumi.Output<string>;
    /**
     * Create a Job resource with the given unique name, arguments, and options.
     *
     * @param name The _unique_ name of the resource.
     * @param args The arguments to use to populate this resource's properties.
     * @param opts A bag of options that control this resource's behavior.
     */
    constructor(name: string, args: JobArgs, opts?: pulumi.CustomResourceOptions);
}
/**
 * Input properties used for looking up and filtering Job resources.
 */
export interface JobState {
    /**
     * The IDs for allocations associated with this job.
     *
     * @deprecated Retrieving allocation IDs from the job resource is deprecated and will be removed in a future release. Use the nomad.getAllocations data source instead.
     */
    allocationIds?: pulumi.Input<pulumi.Input<string>[]>;
    /**
     * The target datacenters for the job, as derived from the jobspec.
     */
    datacenters?: pulumi.Input<pulumi.Input<string>[]>;
    /**
     * If detach = false, the ID for the deployment associated with the last job create/update, if one exists.
     */
    deploymentId?: pulumi.Input<string>;
    /**
     * If detach = false, the status for the deployment associated with the last job create/update, if one exists.
     */
    deploymentStatus?: pulumi.Input<string>;
    /**
     * If true, the job will be deregistered on destroy.
     */
    deregisterOnDestroy?: pulumi.Input<boolean>;
    /**
     * `(boolean: true)` - Determines if the job will be
     * deregistered if the ID of the job in the jobspec changes.
     */
    deregisterOnIdChange?: pulumi.Input<boolean>;
    /**
     * `(boolean: true)` - If true, the provider will return immediately
     * after creating or updating, instead of monitoring.
     */
    detach?: pulumi.Input<boolean>;
    /**
     * `(block: optional)` - Options for the HCL2 jobspec parser.
     */
    hcl2?: pulumi.Input<inputs.JobHcl2>;
    /**
     * `(string: <required>)` - The contents of the jobspec to register.
     */
    jobspec?: pulumi.Input<string>;
    /**
     * `(boolean: false)` - Set this to `true` if your jobspec is structured with
     * JSON instead of the default HCL.
     */
    json?: pulumi.Input<boolean>;
    /**
     * Integer that increments for each change. Used to detect any changes between plan and apply.
     */
    modifyIndex?: pulumi.Input<string>;
    /**
     * The name of the job, as derived from the jobspec.
     */
    name?: pulumi.Input<string>;
    /**
     * The namespace of the job, as derived from the jobspec.
     */
    namespace?: pulumi.Input<string>;
    /**
     * `(boolean: false)` - Determines if the job will override any
     * soft-mandatory Sentinel policies and register even if they fail.
     */
    policyOverride?: pulumi.Input<boolean>;
    /**
     * `(boolean: false)` - Set this to true if you want the job to
     * be purged when the resource is destroyed.
     */
    purgeOnDestroy?: pulumi.Input<boolean>;
    /**
     * @deprecated Retrieving allocation IDs from the job resource is deprecated and will be removed in a future release. Use the nomad.getAllocations data source instead.
     */
    readAllocationIds?: pulumi.Input<boolean>;
    /**
     * The target region for the job, as derived from the jobspec.
     */
    region?: pulumi.Input<string>;
    /**
     * `(boolean: false)` - Set this to true to force the job to run
     * again if its status is `dead`.
     */
    rerunIfDead?: pulumi.Input<boolean>;
    /**
     * The status of the job.
     */
    status?: pulumi.Input<string>;
    taskGroups?: pulumi.Input<pulumi.Input<inputs.JobTaskGroup>[]>;
    /**
     * The type of the job, as derived from the jobspec.
     */
    type?: pulumi.Input<string>;
}
/**
 * The set of arguments for constructing a Job resource.
 */
export interface JobArgs {
    /**
     * If true, the job will be deregistered on destroy.
     */
    deregisterOnDestroy?: pulumi.Input<boolean>;
    /**
     * `(boolean: true)` - Determines if the job will be
     * deregistered if the ID of the job in the jobspec changes.
     */
    deregisterOnIdChange?: pulumi.Input<boolean>;
    /**
     * `(boolean: true)` - If true, the provider will return immediately
     * after creating or updating, instead of monitoring.
     */
    detach?: pulumi.Input<boolean>;
    /**
     * `(block: optional)` - Options for the HCL2 jobspec parser.
     */
    hcl2?: pulumi.Input<inputs.JobHcl2>;
    /**
     * `(string: <required>)` - The contents of the jobspec to register.
     */
    jobspec: pulumi.Input<string>;
    /**
     * `(boolean: false)` - Set this to `true` if your jobspec is structured with
     * JSON instead of the default HCL.
     */
    json?: pulumi.Input<boolean>;
    /**
     * `(boolean: false)` - Determines if the job will override any
     * soft-mandatory Sentinel policies and register even if they fail.
     */
    policyOverride?: pulumi.Input<boolean>;
    /**
     * `(boolean: false)` - Set this to true if you want the job to
     * be purged when the resource is destroyed.
     */
    purgeOnDestroy?: pulumi.Input<boolean>;
    /**
     * @deprecated Retrieving allocation IDs from the job resource is deprecated and will be removed in a future release. Use the nomad.getAllocations data source instead.
     */
    readAllocationIds?: pulumi.Input<boolean>;
    /**
     * `(boolean: false)` - Set this to true to force the job to run
     * again if its status is `dead`.
     */
    rerunIfDead?: pulumi.Input<boolean>;
}