1. Packages
  2. AWS Classic
  3. API Docs
  4. batch
  5. getJobDefinition

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.33.1 published on Thursday, May 2, 2024 by Pulumi

aws.batch.getJobDefinition

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.33.1 published on Thursday, May 2, 2024 by Pulumi

    Data source for managing an AWS Batch Job Definition.

    Example Usage

    Lookup via Arn

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const arn = aws.batch.getJobDefinition({
        arn: "arn:aws:batch:us-east-1:012345678910:job-definition/example",
    });
    
    import pulumi
    import pulumi_aws as aws
    
    arn = aws.batch.get_job_definition(arn="arn:aws:batch:us-east-1:012345678910:job-definition/example")
    
    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.LookupJobDefinition(ctx, &batch.LookupJobDefinitionArgs{
    			Arn: pulumi.StringRef("arn:aws:batch:us-east-1:012345678910:job-definition/example"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var arn = Aws.Batch.GetJobDefinition.Invoke(new()
        {
            Arn = "arn:aws:batch:us-east-1:012345678910:job-definition/example",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.batch.BatchFunctions;
    import com.pulumi.aws.batch.inputs.GetJobDefinitionArgs;
    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) {
            final var arn = BatchFunctions.getJobDefinition(GetJobDefinitionArgs.builder()
                .arn("arn:aws:batch:us-east-1:012345678910:job-definition/example")
                .build());
    
        }
    }
    
    variables:
      arn:
        fn::invoke:
          Function: aws:batch:getJobDefinition
          Arguments:
            arn: arn:aws:batch:us-east-1:012345678910:job-definition/example
    

    Lookup via Name

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const name = aws.batch.getJobDefinition({
        name: "example",
        revision: 2,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    name = aws.batch.get_job_definition(name="example",
        revision=2)
    
    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.LookupJobDefinition(ctx, &batch.LookupJobDefinitionArgs{
    			Name:     pulumi.StringRef("example"),
    			Revision: pulumi.IntRef(2),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var name = Aws.Batch.GetJobDefinition.Invoke(new()
        {
            Name = "example",
            Revision = 2,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.batch.BatchFunctions;
    import com.pulumi.aws.batch.inputs.GetJobDefinitionArgs;
    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) {
            final var name = BatchFunctions.getJobDefinition(GetJobDefinitionArgs.builder()
                .name("example")
                .revision(2)
                .build());
    
        }
    }
    
    variables:
      name:
        fn::invoke:
          Function: aws:batch:getJobDefinition
          Arguments:
            name: example
            revision: 2
    

    Using getJobDefinition

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getJobDefinition(args: GetJobDefinitionArgs, opts?: InvokeOptions): Promise<GetJobDefinitionResult>
    function getJobDefinitionOutput(args: GetJobDefinitionOutputArgs, opts?: InvokeOptions): Output<GetJobDefinitionResult>
    def get_job_definition(arn: Optional[str] = None,
                           name: Optional[str] = None,
                           revision: Optional[int] = None,
                           status: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetJobDefinitionResult
    def get_job_definition_output(arn: Optional[pulumi.Input[str]] = None,
                           name: Optional[pulumi.Input[str]] = None,
                           revision: Optional[pulumi.Input[int]] = None,
                           status: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetJobDefinitionResult]
    func LookupJobDefinition(ctx *Context, args *LookupJobDefinitionArgs, opts ...InvokeOption) (*LookupJobDefinitionResult, error)
    func LookupJobDefinitionOutput(ctx *Context, args *LookupJobDefinitionOutputArgs, opts ...InvokeOption) LookupJobDefinitionResultOutput

    > Note: This function is named LookupJobDefinition in the Go SDK.

    public static class GetJobDefinition 
    {
        public static Task<GetJobDefinitionResult> InvokeAsync(GetJobDefinitionArgs args, InvokeOptions? opts = null)
        public static Output<GetJobDefinitionResult> Invoke(GetJobDefinitionInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetJobDefinitionResult> getJobDefinition(GetJobDefinitionArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:batch/getJobDefinition:getJobDefinition
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Arn string
    ARN of the Job Definition. Do not begin the description with "An", "The", "Defines", "Indicates", or "Specifies," as these are verbose. In other words, "Indicates the amount of storage," can be rewritten as "Amount of storage," without losing any information.
    Name string
    The name of the job definition to register. It can be up to 128 letters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).
    Revision int
    The revision of the job definition.
    Status string
    The status of the job definition.
    Arn string
    ARN of the Job Definition. Do not begin the description with "An", "The", "Defines", "Indicates", or "Specifies," as these are verbose. In other words, "Indicates the amount of storage," can be rewritten as "Amount of storage," without losing any information.
    Name string
    The name of the job definition to register. It can be up to 128 letters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).
    Revision int
    The revision of the job definition.
    Status string
    The status of the job definition.
    arn String
    ARN of the Job Definition. Do not begin the description with "An", "The", "Defines", "Indicates", or "Specifies," as these are verbose. In other words, "Indicates the amount of storage," can be rewritten as "Amount of storage," without losing any information.
    name String
    The name of the job definition to register. It can be up to 128 letters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).
    revision Integer
    The revision of the job definition.
    status String
    The status of the job definition.
    arn string
    ARN of the Job Definition. Do not begin the description with "An", "The", "Defines", "Indicates", or "Specifies," as these are verbose. In other words, "Indicates the amount of storage," can be rewritten as "Amount of storage," without losing any information.
    name string
    The name of the job definition to register. It can be up to 128 letters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).
    revision number
    The revision of the job definition.
    status string
    The status of the job definition.
    arn str
    ARN of the Job Definition. Do not begin the description with "An", "The", "Defines", "Indicates", or "Specifies," as these are verbose. In other words, "Indicates the amount of storage," can be rewritten as "Amount of storage," without losing any information.
    name str
    The name of the job definition to register. It can be up to 128 letters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).
    revision int
    The revision of the job definition.
    status str
    The status of the job definition.
    arn String
    ARN of the Job Definition. Do not begin the description with "An", "The", "Defines", "Indicates", or "Specifies," as these are verbose. In other words, "Indicates the amount of storage," can be rewritten as "Amount of storage," without losing any information.
    name String
    The name of the job definition to register. It can be up to 128 letters long. It can contain uppercase and lowercase letters, numbers, hyphens (-), and underscores (_).
    revision Number
    The revision of the job definition.
    status String
    The status of the job definition.

    getJobDefinition Result

    The following output properties are available:

    ArnPrefix string
    ContainerOrchestrationType string
    The orchestration type of the compute environment.
    EksProperties List<GetJobDefinitionEksProperty>
    An object with various properties that are specific to Amazon EKS based jobs. This must not be specified for Amazon ECS based job definitions.
    Id string
    The ARN
    NodeProperties List<GetJobDefinitionNodeProperty>
    An object with various properties specific to multi-node parallel jobs. If you specify node properties for a job, it becomes a multi-node parallel job. For more information, see Multi-node Parallel Jobs in the AWS Batch User Guide. If the job definition's type parameter is container, then you must specify either containerProperties or nodeProperties.
    RetryStrategies List<GetJobDefinitionRetryStrategy>
    The retry strategy to use for failed jobs that are submitted with this job definition. Any retry strategy that's specified during a SubmitJob operation overrides the retry strategy defined here. If a job is terminated due to a timeout, it isn't retried.
    SchedulingPriority int
    The scheduling priority for jobs that are submitted with this job definition. This only affects jobs in job queues with a fair share policy. Jobs with a higher scheduling priority are scheduled before jobs with a lower scheduling priority.
    Tags Dictionary<string, string>
    Timeouts List<GetJobDefinitionTimeout>
    The timeout configuration for jobs that are submitted with this job definition, after which AWS Batch terminates your jobs if they have not finished. If a job is terminated due to a timeout, it isn't retried. The minimum value for the timeout is 60 seconds.
    Type string
    The type of resource to assign to a container. The supported resources include GPU, MEMORY, and VCPU.
    Arn string
    Name string
    The name of the volume.
    Revision int
    Status string
    ArnPrefix string
    ContainerOrchestrationType string
    The orchestration type of the compute environment.
    EksProperties []GetJobDefinitionEksProperty
    An object with various properties that are specific to Amazon EKS based jobs. This must not be specified for Amazon ECS based job definitions.
    Id string
    The ARN
    NodeProperties []GetJobDefinitionNodeProperty
    An object with various properties specific to multi-node parallel jobs. If you specify node properties for a job, it becomes a multi-node parallel job. For more information, see Multi-node Parallel Jobs in the AWS Batch User Guide. If the job definition's type parameter is container, then you must specify either containerProperties or nodeProperties.
    RetryStrategies []GetJobDefinitionRetryStrategy
    The retry strategy to use for failed jobs that are submitted with this job definition. Any retry strategy that's specified during a SubmitJob operation overrides the retry strategy defined here. If a job is terminated due to a timeout, it isn't retried.
    SchedulingPriority int
    The scheduling priority for jobs that are submitted with this job definition. This only affects jobs in job queues with a fair share policy. Jobs with a higher scheduling priority are scheduled before jobs with a lower scheduling priority.
    Tags map[string]string
    Timeouts []GetJobDefinitionTimeout
    The timeout configuration for jobs that are submitted with this job definition, after which AWS Batch terminates your jobs if they have not finished. If a job is terminated due to a timeout, it isn't retried. The minimum value for the timeout is 60 seconds.
    Type string
    The type of resource to assign to a container. The supported resources include GPU, MEMORY, and VCPU.
    Arn string
    Name string
    The name of the volume.
    Revision int
    Status string
    arnPrefix String
    containerOrchestrationType String
    The orchestration type of the compute environment.
    eksProperties List<GetJobDefinitionEksProperty>
    An object with various properties that are specific to Amazon EKS based jobs. This must not be specified for Amazon ECS based job definitions.
    id String
    The ARN
    nodeProperties List<GetJobDefinitionNodeProperty>
    An object with various properties specific to multi-node parallel jobs. If you specify node properties for a job, it becomes a multi-node parallel job. For more information, see Multi-node Parallel Jobs in the AWS Batch User Guide. If the job definition's type parameter is container, then you must specify either containerProperties or nodeProperties.
    retryStrategies List<GetJobDefinitionRetryStrategy>
    The retry strategy to use for failed jobs that are submitted with this job definition. Any retry strategy that's specified during a SubmitJob operation overrides the retry strategy defined here. If a job is terminated due to a timeout, it isn't retried.
    schedulingPriority Integer
    The scheduling priority for jobs that are submitted with this job definition. This only affects jobs in job queues with a fair share policy. Jobs with a higher scheduling priority are scheduled before jobs with a lower scheduling priority.
    tags Map<String,String>
    timeouts List<GetJobDefinitionTimeout>
    The timeout configuration for jobs that are submitted with this job definition, after which AWS Batch terminates your jobs if they have not finished. If a job is terminated due to a timeout, it isn't retried. The minimum value for the timeout is 60 seconds.
    type String
    The type of resource to assign to a container. The supported resources include GPU, MEMORY, and VCPU.
    arn String
    name String
    The name of the volume.
    revision Integer
    status String
    arnPrefix string
    containerOrchestrationType string
    The orchestration type of the compute environment.
    eksProperties GetJobDefinitionEksProperty[]
    An object with various properties that are specific to Amazon EKS based jobs. This must not be specified for Amazon ECS based job definitions.
    id string
    The ARN
    nodeProperties GetJobDefinitionNodeProperty[]
    An object with various properties specific to multi-node parallel jobs. If you specify node properties for a job, it becomes a multi-node parallel job. For more information, see Multi-node Parallel Jobs in the AWS Batch User Guide. If the job definition's type parameter is container, then you must specify either containerProperties or nodeProperties.
    retryStrategies GetJobDefinitionRetryStrategy[]
    The retry strategy to use for failed jobs that are submitted with this job definition. Any retry strategy that's specified during a SubmitJob operation overrides the retry strategy defined here. If a job is terminated due to a timeout, it isn't retried.
    schedulingPriority number
    The scheduling priority for jobs that are submitted with this job definition. This only affects jobs in job queues with a fair share policy. Jobs with a higher scheduling priority are scheduled before jobs with a lower scheduling priority.
    tags {[key: string]: string}
    timeouts GetJobDefinitionTimeout[]
    The timeout configuration for jobs that are submitted with this job definition, after which AWS Batch terminates your jobs if they have not finished. If a job is terminated due to a timeout, it isn't retried. The minimum value for the timeout is 60 seconds.
    type string
    The type of resource to assign to a container. The supported resources include GPU, MEMORY, and VCPU.
    arn string
    name string
    The name of the volume.
    revision number
    status string
    arn_prefix str
    container_orchestration_type str
    The orchestration type of the compute environment.
    eks_properties Sequence[GetJobDefinitionEksProperty]
    An object with various properties that are specific to Amazon EKS based jobs. This must not be specified for Amazon ECS based job definitions.
    id str
    The ARN
    node_properties Sequence[GetJobDefinitionNodeProperty]
    An object with various properties specific to multi-node parallel jobs. If you specify node properties for a job, it becomes a multi-node parallel job. For more information, see Multi-node Parallel Jobs in the AWS Batch User Guide. If the job definition's type parameter is container, then you must specify either containerProperties or nodeProperties.
    retry_strategies Sequence[GetJobDefinitionRetryStrategy]
    The retry strategy to use for failed jobs that are submitted with this job definition. Any retry strategy that's specified during a SubmitJob operation overrides the retry strategy defined here. If a job is terminated due to a timeout, it isn't retried.
    scheduling_priority int
    The scheduling priority for jobs that are submitted with this job definition. This only affects jobs in job queues with a fair share policy. Jobs with a higher scheduling priority are scheduled before jobs with a lower scheduling priority.
    tags Mapping[str, str]
    timeouts Sequence[GetJobDefinitionTimeout]
    The timeout configuration for jobs that are submitted with this job definition, after which AWS Batch terminates your jobs if they have not finished. If a job is terminated due to a timeout, it isn't retried. The minimum value for the timeout is 60 seconds.
    type str
    The type of resource to assign to a container. The supported resources include GPU, MEMORY, and VCPU.
    arn str
    name str
    The name of the volume.
    revision int
    status str
    arnPrefix String
    containerOrchestrationType String
    The orchestration type of the compute environment.
    eksProperties List<Property Map>
    An object with various properties that are specific to Amazon EKS based jobs. This must not be specified for Amazon ECS based job definitions.
    id String
    The ARN
    nodeProperties List<Property Map>
    An object with various properties specific to multi-node parallel jobs. If you specify node properties for a job, it becomes a multi-node parallel job. For more information, see Multi-node Parallel Jobs in the AWS Batch User Guide. If the job definition's type parameter is container, then you must specify either containerProperties or nodeProperties.
    retryStrategies List<Property Map>
    The retry strategy to use for failed jobs that are submitted with this job definition. Any retry strategy that's specified during a SubmitJob operation overrides the retry strategy defined here. If a job is terminated due to a timeout, it isn't retried.
    schedulingPriority Number
    The scheduling priority for jobs that are submitted with this job definition. This only affects jobs in job queues with a fair share policy. Jobs with a higher scheduling priority are scheduled before jobs with a lower scheduling priority.
    tags Map<String>
    timeouts List<Property Map>
    The timeout configuration for jobs that are submitted with this job definition, after which AWS Batch terminates your jobs if they have not finished. If a job is terminated due to a timeout, it isn't retried. The minimum value for the timeout is 60 seconds.
    type String
    The type of resource to assign to a container. The supported resources include GPU, MEMORY, and VCPU.
    arn String
    name String
    The name of the volume.
    revision Number
    status String

    Supporting Types

    GetJobDefinitionEksProperty

    PodProperties List<object>
    The properties for the Kubernetes pod resources of a job.
    PodProperties []interface{}
    The properties for the Kubernetes pod resources of a job.
    podProperties List<Object>
    The properties for the Kubernetes pod resources of a job.
    podProperties any[]
    The properties for the Kubernetes pod resources of a job.
    pod_properties Sequence[Any]
    The properties for the Kubernetes pod resources of a job.
    podProperties List<Any>
    The properties for the Kubernetes pod resources of a job.

    GetJobDefinitionNodeProperty

    MainNode int
    Specifies the node index for the main node of a multi-node parallel job. This node index value must be fewer than the number of nodes.
    NodeRangeProperties List<object>
    A list of node ranges and their properties that are associated with a multi-node parallel job.
    NumNodes int
    The number of nodes that are associated with a multi-node parallel job.
    MainNode int
    Specifies the node index for the main node of a multi-node parallel job. This node index value must be fewer than the number of nodes.
    NodeRangeProperties []interface{}
    A list of node ranges and their properties that are associated with a multi-node parallel job.
    NumNodes int
    The number of nodes that are associated with a multi-node parallel job.
    mainNode Integer
    Specifies the node index for the main node of a multi-node parallel job. This node index value must be fewer than the number of nodes.
    nodeRangeProperties List<Object>
    A list of node ranges and their properties that are associated with a multi-node parallel job.
    numNodes Integer
    The number of nodes that are associated with a multi-node parallel job.
    mainNode number
    Specifies the node index for the main node of a multi-node parallel job. This node index value must be fewer than the number of nodes.
    nodeRangeProperties any[]
    A list of node ranges and their properties that are associated with a multi-node parallel job.
    numNodes number
    The number of nodes that are associated with a multi-node parallel job.
    main_node int
    Specifies the node index for the main node of a multi-node parallel job. This node index value must be fewer than the number of nodes.
    node_range_properties Sequence[Any]
    A list of node ranges and their properties that are associated with a multi-node parallel job.
    num_nodes int
    The number of nodes that are associated with a multi-node parallel job.
    mainNode Number
    Specifies the node index for the main node of a multi-node parallel job. This node index value must be fewer than the number of nodes.
    nodeRangeProperties List<Any>
    A list of node ranges and their properties that are associated with a multi-node parallel job.
    numNodes Number
    The number of nodes that are associated with a multi-node parallel job.

    GetJobDefinitionRetryStrategy

    Attempts int
    The number of times to move a job to the RUNNABLE status.
    EvaluateOnExits List<object>
    Array of up to 5 objects that specify the conditions where jobs are retried or failed.
    Attempts int
    The number of times to move a job to the RUNNABLE status.
    EvaluateOnExits []interface{}
    Array of up to 5 objects that specify the conditions where jobs are retried or failed.
    attempts Integer
    The number of times to move a job to the RUNNABLE status.
    evaluateOnExits List<Object>
    Array of up to 5 objects that specify the conditions where jobs are retried or failed.
    attempts number
    The number of times to move a job to the RUNNABLE status.
    evaluateOnExits any[]
    Array of up to 5 objects that specify the conditions where jobs are retried or failed.
    attempts int
    The number of times to move a job to the RUNNABLE status.
    evaluate_on_exits Sequence[Any]
    Array of up to 5 objects that specify the conditions where jobs are retried or failed.
    attempts Number
    The number of times to move a job to the RUNNABLE status.
    evaluateOnExits List<Any>
    Array of up to 5 objects that specify the conditions where jobs are retried or failed.

    GetJobDefinitionTimeout

    AttemptDurationSeconds int
    The job timeout time (in seconds) that's measured from the job attempt's startedAt timestamp.
    AttemptDurationSeconds int
    The job timeout time (in seconds) that's measured from the job attempt's startedAt timestamp.
    attemptDurationSeconds Integer
    The job timeout time (in seconds) that's measured from the job attempt's startedAt timestamp.
    attemptDurationSeconds number
    The job timeout time (in seconds) that's measured from the job attempt's startedAt timestamp.
    attempt_duration_seconds int
    The job timeout time (in seconds) that's measured from the job attempt's startedAt timestamp.
    attemptDurationSeconds Number
    The job timeout time (in seconds) that's measured from the job attempt's startedAt timestamp.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aws Terraform Provider.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.33.1 published on Thursday, May 2, 2024 by Pulumi