Try AWS Native preview for resources not in the classic version.
AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi
aws.batch.getJobDefinition
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
AWS Classic v6.42.0 published on Wednesday, Jun 26, 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:
- Arn
Prefix string - Container
Orchestration stringType - The orchestration type of the compute environment.
- Eks
Properties List<GetJob Definition Eks Property> - 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
- Node
Properties List<GetJob Definition Node Property> - 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 List<GetJob Definition Retry Strategy> - 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.
- Dictionary<string, string>
- Timeouts
List<Get
Job Definition Timeout> - 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
, andVCPU
. - Arn string
- Name string
- The name of the volume.
- Revision int
- Status string
- Arn
Prefix string - Container
Orchestration stringType - The orchestration type of the compute environment.
- Eks
Properties []GetJob Definition Eks Property - 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
- Node
Properties []GetJob Definition Node Property - 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 []GetJob Definition Retry Strategy - 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.
- map[string]string
- Timeouts
[]Get
Job Definition Timeout - 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
, andVCPU
. - Arn string
- Name string
- The name of the volume.
- Revision int
- Status string
- arn
Prefix String - container
Orchestration StringType - The orchestration type of the compute environment.
- eks
Properties List<GetJob Definition Eks Property> - 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
- node
Properties List<GetJob Definition Node Property> - 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 List<GetJob Definition Retry Strategy> - 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 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.
- Map<String,String>
- timeouts
List<Get
Job Definition Timeout> - 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
, andVCPU
. - arn String
- name String
- The name of the volume.
- revision Integer
- status String
- arn
Prefix string - container
Orchestration stringType - The orchestration type of the compute environment.
- eks
Properties GetJob Definition Eks Property[] - 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
- node
Properties GetJob Definition Node Property[] - 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 GetJob Definition Retry Strategy[] - 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 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.
- {[key: string]: string}
- timeouts
Get
Job Definition Timeout[] - 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
, andVCPU
. - arn string
- name string
- The name of the volume.
- revision number
- status string
- arn_
prefix str - container_
orchestration_ strtype - The orchestration type of the compute environment.
- eks_
properties Sequence[GetJob Definition Eks Property] - 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[GetJob Definition Node Property] - 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[GetJob Definition Retry Strategy] - 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.
- Mapping[str, str]
- timeouts
Sequence[Get
Job Definition Timeout] - 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
, andVCPU
. - arn str
- name str
- The name of the volume.
- revision int
- status str
- arn
Prefix String - container
Orchestration StringType - The orchestration type of the compute environment.
- eks
Properties 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
- node
Properties 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.
- retry
Strategies 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.
- scheduling
Priority 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.
- 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
, andVCPU
. - arn String
- name String
- The name of the volume.
- revision Number
- status String
Supporting Types
GetJobDefinitionEksProperty
- Pod
Properties List<object> - The properties for the Kubernetes pod resources of a job.
- Pod
Properties []interface{} - The properties for the Kubernetes pod resources of a job.
- pod
Properties List<Object> - The properties for the Kubernetes pod resources of a job.
- pod
Properties 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.
- pod
Properties List<Any> - The properties for the Kubernetes pod resources of a job.
GetJobDefinitionNodeProperty
- 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 List<object>Properties - 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.
- 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 []interface{}Properties - 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.
- main
Node 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.
- node
Range List<Object>Properties - A list of node ranges and their properties that are associated with a multi-node parallel job.
- num
Nodes Integer - The number of nodes that are associated with a multi-node parallel job.
- main
Node 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.
- node
Range any[]Properties - A list of node ranges and their properties that are associated with a multi-node parallel job.
- num
Nodes 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_ Sequence[Any]properties - 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.
- main
Node 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.
- node
Range List<Any>Properties - A list of node ranges and their properties that are associated with a multi-node parallel job.
- num
Nodes 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.
- Evaluate
On List<object>Exits - 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 []interface{}Exits - 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.
- evaluate
On List<Object>Exits - 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.
- evaluate
On any[]Exits - 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_ Sequence[Any]exits - 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.
- evaluate
On List<Any>Exits - Array of up to 5 objects that specify the conditions where jobs are retried or failed.
GetJobDefinitionTimeout
- Attempt
Duration intSeconds - The job timeout time (in seconds) that's measured from the job attempt's startedAt timestamp.
- Attempt
Duration intSeconds - The job timeout time (in seconds) that's measured from the job attempt's startedAt timestamp.
- attempt
Duration IntegerSeconds - The job timeout time (in seconds) that's measured from the job attempt's startedAt timestamp.
- attempt
Duration numberSeconds - The job timeout time (in seconds) that's measured from the job attempt's startedAt timestamp.
- attempt_
duration_ intseconds - The job timeout time (in seconds) that's measured from the job attempt's startedAt timestamp.
- attempt
Duration NumberSeconds - 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.
Try AWS Native preview for resources not in the classic version.
AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi