HashiCorp Nomad

v0.2.1 published on Tuesday, Dec 7, 2021 by Pulumi

Job

Create a Job Resource

new Job(name: string, args: JobArgs, opts?: CustomResourceOptions);
@overload
def Job(resource_name: str,
        opts: Optional[ResourceOptions] = None,
        deregister_on_destroy: Optional[bool] = None,
        deregister_on_id_change: Optional[bool] = None,
        detach: Optional[bool] = None,
        hcl2: Optional[JobHcl2Args] = None,
        jobspec: Optional[str] = None,
        json: Optional[bool] = None,
        policy_override: Optional[bool] = None,
        purge_on_destroy: Optional[bool] = None)
@overload
def Job(resource_name: str,
        args: JobArgs,
        opts: Optional[ResourceOptions] = None)
func NewJob(ctx *Context, name string, args JobArgs, opts ...ResourceOption) (*Job, error)
public Job(string name, JobArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args JobArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args JobArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args JobArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args JobArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Job Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Job resource accepts the following input properties:

Jobspec string
(string: <required>) - The contents of the jobspec to register.
DeregisterOnDestroy bool
If true, the job will be deregistered on destroy.
DeregisterOnIdChange bool
(boolean: true) - Determines if the job will be deregistered if the ID of the job in the jobspec changes.
Detach bool
(boolean: true) - If true, the provider will return immediately after creating or updating, instead of monitoring.
Hcl2 JobHcl2Args
(block: optional) - Options for the HCL2 jobspec parser.
Json bool
(boolean: false) - Set this to true if your jobspec is structured with JSON instead of the default HCL.
PolicyOverride bool
(boolean: false) - Determines if the job will override any soft-mandatory Sentinel policies and register even if they fail.
PurgeOnDestroy bool
(boolean: false) - Set this to true if you want the job to be purged when the resource is destroyed.
Jobspec string
(string: <required>) - The contents of the jobspec to register.
DeregisterOnDestroy bool
If true, the job will be deregistered on destroy.
DeregisterOnIdChange bool
(boolean: true) - Determines if the job will be deregistered if the ID of the job in the jobspec changes.
Detach bool
(boolean: true) - If true, the provider will return immediately after creating or updating, instead of monitoring.
Hcl2 JobHcl2Args
(block: optional) - Options for the HCL2 jobspec parser.
Json bool
(boolean: false) - Set this to true if your jobspec is structured with JSON instead of the default HCL.
PolicyOverride bool
(boolean: false) - Determines if the job will override any soft-mandatory Sentinel policies and register even if they fail.
PurgeOnDestroy bool
(boolean: false) - Set this to true if you want the job to be purged when the resource is destroyed.
jobspec string
(string: <required>) - The contents of the jobspec to register.
deregisterOnDestroy boolean
If true, the job will be deregistered on destroy.
deregisterOnIdChange boolean
(boolean: true) - Determines if the job will be deregistered if the ID of the job in the jobspec changes.
detach boolean
(boolean: true) - If true, the provider will return immediately after creating or updating, instead of monitoring.
hcl2 JobHcl2Args
(block: optional) - Options for the HCL2 jobspec parser.
json boolean
(boolean: false) - Set this to true if your jobspec is structured with JSON instead of the default HCL.
policyOverride boolean
(boolean: false) - Determines if the job will override any soft-mandatory Sentinel policies and register even if they fail.
purgeOnDestroy boolean
(boolean: false) - Set this to true if you want the job to be purged when the resource is destroyed.
jobspec str
(string: <required>) - The contents of the jobspec to register.
deregister_on_destroy bool
If true, the job will be deregistered on destroy.
deregister_on_id_change bool
(boolean: true) - Determines if the job will be deregistered if the ID of the job in the jobspec changes.
detach bool
(boolean: true) - If true, the provider will return immediately after creating or updating, instead of monitoring.
hcl2 JobHcl2Args
(block: optional) - Options for the HCL2 jobspec parser.
json bool
(boolean: false) - Set this to true if your jobspec is structured with JSON instead of the default HCL.
policy_override bool
(boolean: false) - Determines if the job will override any soft-mandatory Sentinel policies and register even if they fail.
purge_on_destroy bool
(boolean: false) - Set this to true if you want the job to be purged when the resource is destroyed.

Outputs

All input properties are implicitly available as output properties. Additionally, the Job resource produces the following output properties:

AllocationIds List<string>
The IDs for allocations associated with this job.
Datacenters List<string>
The target datacenters for the job, as derived from the jobspec.
DeploymentId string
If detach = false, the ID for the deployment associated with the last job create/update, if one exists.
DeploymentStatus string
If detach = false, the status for the deployment associated with the last job create/update, if one exists.
Id string
The provider-assigned unique ID for this managed resource.
ModifyIndex string
Integer that increments for each change. Used to detect any changes between plan and apply.
Name string
The name of the job, as derived from the jobspec.
Namespace string
The namespace of the job, as derived from the jobspec.
Region string
The target region for the job, as derived from the jobspec.
TaskGroups List<JobTaskGroup>
Type string
The type of the job, as derived from the jobspec.
AllocationIds []string
The IDs for allocations associated with this job.
Datacenters []string
The target datacenters for the job, as derived from the jobspec.
DeploymentId string
If detach = false, the ID for the deployment associated with the last job create/update, if one exists.
DeploymentStatus string
If detach = false, the status for the deployment associated with the last job create/update, if one exists.
Id string
The provider-assigned unique ID for this managed resource.
ModifyIndex string
Integer that increments for each change. Used to detect any changes between plan and apply.
Name string
The name of the job, as derived from the jobspec.
Namespace string
The namespace of the job, as derived from the jobspec.
Region string
The target region for the job, as derived from the jobspec.
TaskGroups []JobTaskGroup
Type string
The type of the job, as derived from the jobspec.
allocationIds string[]
The IDs for allocations associated with this job.
datacenters string[]
The target datacenters for the job, as derived from the jobspec.
deploymentId string
If detach = false, the ID for the deployment associated with the last job create/update, if one exists.
deploymentStatus string
If detach = false, the status for the deployment associated with the last job create/update, if one exists.
id string
The provider-assigned unique ID for this managed resource.
modifyIndex string
Integer that increments for each change. Used to detect any changes between plan and apply.
name string
The name of the job, as derived from the jobspec.
namespace string
The namespace of the job, as derived from the jobspec.
region string
The target region for the job, as derived from the jobspec.
taskGroups JobTaskGroup[]
type string
The type of the job, as derived from the jobspec.
allocation_ids Sequence[str]
The IDs for allocations associated with this job.
datacenters Sequence[str]
The target datacenters for the job, as derived from the jobspec.
deployment_id str
If detach = false, the ID for the deployment associated with the last job create/update, if one exists.
deployment_status str
If detach = false, the status for the deployment associated with the last job create/update, if one exists.
id str
The provider-assigned unique ID for this managed resource.
modify_index str
Integer that increments for each change. Used to detect any changes between plan and apply.
name str
The name of the job, as derived from the jobspec.
namespace str
The namespace of the job, as derived from the jobspec.
region str
The target region for the job, as derived from the jobspec.
task_groups Sequence[JobTaskGroup]
type str
The type of the job, as derived from the jobspec.

Look up an Existing Job Resource

Get an existing Job resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: JobState, opts?: CustomResourceOptions): Job
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        allocation_ids: Optional[Sequence[str]] = None,
        datacenters: Optional[Sequence[str]] = None,
        deployment_id: Optional[str] = None,
        deployment_status: Optional[str] = None,
        deregister_on_destroy: Optional[bool] = None,
        deregister_on_id_change: Optional[bool] = None,
        detach: Optional[bool] = None,
        hcl2: Optional[JobHcl2Args] = None,
        jobspec: Optional[str] = None,
        json: Optional[bool] = None,
        modify_index: Optional[str] = None,
        name: Optional[str] = None,
        namespace: Optional[str] = None,
        policy_override: Optional[bool] = None,
        purge_on_destroy: Optional[bool] = None,
        region: Optional[str] = None,
        task_groups: Optional[Sequence[JobTaskGroupArgs]] = None,
        type: Optional[str] = None) -> Job
func GetJob(ctx *Context, name string, id IDInput, state *JobState, opts ...ResourceOption) (*Job, error)
public static Job Get(string name, Input<string> id, JobState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

AllocationIds List<string>
The IDs for allocations associated with this job.
Datacenters List<string>
The target datacenters for the job, as derived from the jobspec.
DeploymentId string
If detach = false, the ID for the deployment associated with the last job create/update, if one exists.
DeploymentStatus string
If detach = false, the status for the deployment associated with the last job create/update, if one exists.
DeregisterOnDestroy bool
If true, the job will be deregistered on destroy.
DeregisterOnIdChange bool
(boolean: true) - Determines if the job will be deregistered if the ID of the job in the jobspec changes.
Detach bool
(boolean: true) - If true, the provider will return immediately after creating or updating, instead of monitoring.
Hcl2 JobHcl2Args
(block: optional) - Options for the HCL2 jobspec parser.
Jobspec string
(string: <required>) - The contents of the jobspec to register.
Json bool
(boolean: false) - Set this to true if your jobspec is structured with JSON instead of the default HCL.
ModifyIndex string
Integer that increments for each change. Used to detect any changes between plan and apply.
Name string
The name of the job, as derived from the jobspec.
Namespace string
The namespace of the job, as derived from the jobspec.
PolicyOverride bool
(boolean: false) - Determines if the job will override any soft-mandatory Sentinel policies and register even if they fail.
PurgeOnDestroy bool
(boolean: false) - Set this to true if you want the job to be purged when the resource is destroyed.
Region string
The target region for the job, as derived from the jobspec.
TaskGroups List<JobTaskGroupArgs>
Type string
The type of the job, as derived from the jobspec.
AllocationIds []string
The IDs for allocations associated with this job.
Datacenters []string
The target datacenters for the job, as derived from the jobspec.
DeploymentId string
If detach = false, the ID for the deployment associated with the last job create/update, if one exists.
DeploymentStatus string
If detach = false, the status for the deployment associated with the last job create/update, if one exists.
DeregisterOnDestroy bool
If true, the job will be deregistered on destroy.
DeregisterOnIdChange bool
(boolean: true) - Determines if the job will be deregistered if the ID of the job in the jobspec changes.
Detach bool
(boolean: true) - If true, the provider will return immediately after creating or updating, instead of monitoring.
Hcl2 JobHcl2Args
(block: optional) - Options for the HCL2 jobspec parser.
Jobspec string
(string: <required>) - The contents of the jobspec to register.
Json bool
(boolean: false) - Set this to true if your jobspec is structured with JSON instead of the default HCL.
ModifyIndex string
Integer that increments for each change. Used to detect any changes between plan and apply.
Name string
The name of the job, as derived from the jobspec.
Namespace string
The namespace of the job, as derived from the jobspec.
PolicyOverride bool
(boolean: false) - Determines if the job will override any soft-mandatory Sentinel policies and register even if they fail.
PurgeOnDestroy bool
(boolean: false) - Set this to true if you want the job to be purged when the resource is destroyed.
Region string
The target region for the job, as derived from the jobspec.
TaskGroups []JobTaskGroupArgs
Type string
The type of the job, as derived from the jobspec.
allocationIds string[]
The IDs for allocations associated with this job.
datacenters string[]
The target datacenters for the job, as derived from the jobspec.
deploymentId string
If detach = false, the ID for the deployment associated with the last job create/update, if one exists.
deploymentStatus string
If detach = false, the status for the deployment associated with the last job create/update, if one exists.
deregisterOnDestroy boolean
If true, the job will be deregistered on destroy.
deregisterOnIdChange boolean
(boolean: true) - Determines if the job will be deregistered if the ID of the job in the jobspec changes.
detach boolean
(boolean: true) - If true, the provider will return immediately after creating or updating, instead of monitoring.
hcl2 JobHcl2Args
(block: optional) - Options for the HCL2 jobspec parser.
jobspec string
(string: <required>) - The contents of the jobspec to register.
json boolean
(boolean: false) - Set this to true if your jobspec is structured with JSON instead of the default HCL.
modifyIndex string
Integer that increments for each change. Used to detect any changes between plan and apply.
name string
The name of the job, as derived from the jobspec.
namespace string
The namespace of the job, as derived from the jobspec.
policyOverride boolean
(boolean: false) - Determines if the job will override any soft-mandatory Sentinel policies and register even if they fail.
purgeOnDestroy boolean
(boolean: false) - Set this to true if you want the job to be purged when the resource is destroyed.
region string
The target region for the job, as derived from the jobspec.
taskGroups JobTaskGroupArgs[]
type string
The type of the job, as derived from the jobspec.
allocation_ids Sequence[str]
The IDs for allocations associated with this job.
datacenters Sequence[str]
The target datacenters for the job, as derived from the jobspec.
deployment_id str
If detach = false, the ID for the deployment associated with the last job create/update, if one exists.
deployment_status str
If detach = false, the status for the deployment associated with the last job create/update, if one exists.
deregister_on_destroy bool
If true, the job will be deregistered on destroy.
deregister_on_id_change bool
(boolean: true) - Determines if the job will be deregistered if the ID of the job in the jobspec changes.
detach bool
(boolean: true) - If true, the provider will return immediately after creating or updating, instead of monitoring.
hcl2 JobHcl2Args
(block: optional) - Options for the HCL2 jobspec parser.
jobspec str
(string: <required>) - The contents of the jobspec to register.
json bool
(boolean: false) - Set this to true if your jobspec is structured with JSON instead of the default HCL.
modify_index str
Integer that increments for each change. Used to detect any changes between plan and apply.
name str
The name of the job, as derived from the jobspec.
namespace str
The namespace of the job, as derived from the jobspec.
policy_override bool
(boolean: false) - Determines if the job will override any soft-mandatory Sentinel policies and register even if they fail.
purge_on_destroy bool
(boolean: false) - Set this to true if you want the job to be purged when the resource is destroyed.
region str
The target region for the job, as derived from the jobspec.
task_groups Sequence[JobTaskGroupArgs]
type str
The type of the job, as derived from the jobspec.

Supporting Types

JobHcl2

AllowFs bool
(boolean: false) - Set this to true to be able to use HCL2 filesystem functions
Enabled bool
(boolean: false) - Set this to true if your jobspec uses the HCL2 format instead of the default HCL.
Vars Dictionary<string, object>
AllowFs bool
(boolean: false) - Set this to true to be able to use HCL2 filesystem functions
Enabled bool
(boolean: false) - Set this to true if your jobspec uses the HCL2 format instead of the default HCL.
Vars map[string]interface{}
allowFs boolean
(boolean: false) - Set this to true to be able to use HCL2 filesystem functions
enabled boolean
(boolean: false) - Set this to true if your jobspec uses the HCL2 format instead of the default HCL.
vars {[key: string]: any}
allow_fs bool
(boolean: false) - Set this to true to be able to use HCL2 filesystem functions
enabled bool
(boolean: false) - Set this to true if your jobspec uses the HCL2 format instead of the default HCL.
vars Mapping[str, Any]

JobTaskGroup

Count int
Meta map[string]interface{}
Name string
Tasks []JobTaskGroupTask
Volumes []JobTaskGroupVolume
count number
meta {[key: string]: any}
name string
tasks JobTaskGroupTask[]
volumes JobTaskGroupVolume[]

JobTaskGroupTask

Driver string
Meta Dictionary<string, object>
Name string
VolumeMounts List<JobTaskGroupTaskVolumeMount>
Driver string
Meta map[string]interface{}
Name string
VolumeMounts []JobTaskGroupTaskVolumeMount
driver string
meta {[key: string]: any}
name string
volumeMounts JobTaskGroupTaskVolumeMount[]

JobTaskGroupTaskVolumeMount

Destination string
ReadOnly bool
Volume string
Destination string
ReadOnly bool
Volume string
destination string
readOnly boolean
volume string

JobTaskGroupVolume

Name string
ReadOnly bool
Source string
Type string
Name string
ReadOnly bool
Source string
Type string
name string
readOnly boolean
source string
type string
name str
read_only bool
source str
type str

Package Details

Repository
https://github.com/pulumi/pulumi-nomad
License
Apache-2.0
Notes
This Pulumi package is based on the nomad Terraform Provider.