JobDefinition

Provides a Batch Job Definition resource.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var test = new Aws.Batch.JobDefinition("test", new Aws.Batch.JobDefinitionArgs
        {
            ContainerProperties = @"{
 ""command"": [""ls"", ""-la""],
 ""image"": ""busybox"",
 ""memory"": 1024,
 ""vcpus"": 1,
 ""volumes"": [
      {
        ""host"": {
          ""sourcePath"": ""/tmp""
        },
        ""name"": ""tmp""
      }
    ],
 ""environment"": [
     {""name"": ""VARNAME"", ""value"": ""VARVAL""}
 ],
 ""mountPoints"": [
     {
          ""sourceVolume"": ""tmp"",
          ""containerPath"": ""/tmp"",
          ""readOnly"": false
        }
 ],
    ""ulimits"": [
      {
        ""hardLimit"": 1024,
        ""name"": ""nofile"",
        ""softLimit"": 1024
      }
    ]
}

",
            Type = "container",
        });
    }

}
package main

import (
    "fmt"

    "github.com/pulumi/pulumi-aws/sdk/v2/go/aws/batch"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := batch.NewJobDefinition(ctx, "test", &batch.JobDefinitionArgs{
            ContainerProperties: pulumi.String(fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v%v", "{\n", "  \"command\": [\"ls\", \"-la\"],\n", " \"image\": \"busybox\",\n", " \"memory\": 1024,\n", "   \"vcpus\": 1,\n", "   \"volumes\": [\n", "      {\n", "        \"host\": {\n", "          \"sourcePath\": \"/tmp\"\n", "        },\n", "        \"name\": \"tmp\"\n", "      }\n", "    ],\n", "  \"environment\": [\n", "      {\"name\": \"VARNAME\", \"value\": \"VARVAL\"}\n", "  ],\n", "  \"mountPoints\": [\n", "      {\n", "          \"sourceVolume\": \"tmp\",\n", "          \"containerPath\": \"/tmp\",\n", "          \"readOnly\": false\n", "        }\n", "   ],\n", "    \"ulimits\": [\n", "      {\n", "        \"hardLimit\": 1024,\n", "        \"name\": \"nofile\",\n", "        \"softLimit\": 1024\n", "      }\n", "    ]\n", "}\n", "\n")),
            Type: pulumi.String("container"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_aws as aws

test = aws.batch.JobDefinition("test",
    container_properties="""{
    "command": ["ls", "-la"],
    "image": "busybox",
    "memory": 1024,
    "vcpus": 1,
    "volumes": [
      {
        "host": {
          "sourcePath": "/tmp"
        },
        "name": "tmp"
      }
    ],
    "environment": [
        {"name": "VARNAME", "value": "VARVAL"}
    ],
    "mountPoints": [
        {
          "sourceVolume": "tmp",
          "containerPath": "/tmp",
          "readOnly": false
        }
    ],
    "ulimits": [
      {
        "hardLimit": 1024,
        "name": "nofile",
        "softLimit": 1024
      }
    ]
}

""",
    type="container")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const test = new aws.batch.JobDefinition("test", {
    containerProperties: `{
    "command": ["ls", "-la"],
    "image": "busybox",
    "memory": 1024,
    "vcpus": 1,
    "volumes": [
      {
        "host": {
          "sourcePath": "/tmp"
        },
        "name": "tmp"
      }
    ],
    "environment": [
        {"name": "VARNAME", "value": "VARVAL"}
    ],
    "mountPoints": [
        {
          "sourceVolume": "tmp",
          "containerPath": "/tmp",
          "readOnly": false
        }
    ],
    "ulimits": [
      {
        "hardLimit": 1024,
        "name": "nofile",
        "softLimit": 1024
      }
    ]
}
`,
    type: "container",
});

Create a JobDefinition Resource

def JobDefinition(resource_name, opts=None, container_properties=None, name=None, parameters=None, retry_strategy=None, timeout=None, type=None, __props__=None);
name string
The unique name of the resource.
args JobDefinitionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args JobDefinitionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args JobDefinitionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

JobDefinition Resource Properties

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

Inputs

The JobDefinition resource accepts the following input properties:

Type string

The type of job definition. Must be container

ContainerProperties string

A valid container properties provided as a single valid JSON document. This parameter is required if the type parameter is container.

Name string

Specifies the name of the job definition.

Parameters Dictionary<string, string>

Specifies the parameter substitution placeholders to set in the job definition.

RetryStrategy JobDefinitionRetryStrategyArgs

Specifies the retry strategy to use for failed jobs that are submitted with this job definition. Maximum number of retry_strategy is 1. Defined below.

Timeout JobDefinitionTimeoutArgs

Specifies the timeout for jobs so that if a job runs longer, AWS Batch terminates the job. Maximum number of timeout is 1. Defined below.

Type string

The type of job definition. Must be container

ContainerProperties string

A valid container properties provided as a single valid JSON document. This parameter is required if the type parameter is container.

Name string

Specifies the name of the job definition.

Parameters map[string]string

Specifies the parameter substitution placeholders to set in the job definition.

RetryStrategy JobDefinitionRetryStrategy

Specifies the retry strategy to use for failed jobs that are submitted with this job definition. Maximum number of retry_strategy is 1. Defined below.

Timeout JobDefinitionTimeout

Specifies the timeout for jobs so that if a job runs longer, AWS Batch terminates the job. Maximum number of timeout is 1. Defined below.

type string

The type of job definition. Must be container

containerProperties string

A valid container properties provided as a single valid JSON document. This parameter is required if the type parameter is container.

name string

Specifies the name of the job definition.

parameters {[key: string]: string}

Specifies the parameter substitution placeholders to set in the job definition.

retryStrategy JobDefinitionRetryStrategy

Specifies the retry strategy to use for failed jobs that are submitted with this job definition. Maximum number of retry_strategy is 1. Defined below.

timeout JobDefinitionTimeout

Specifies the timeout for jobs so that if a job runs longer, AWS Batch terminates the job. Maximum number of timeout is 1. Defined below.

type str

The type of job definition. Must be container

container_properties str

A valid container properties provided as a single valid JSON document. This parameter is required if the type parameter is container.

name str

Specifies the name of the job definition.

parameters Dict[str, str]

Specifies the parameter substitution placeholders to set in the job definition.

retry_strategy Dict[JobDefinitionRetryStrategy]

Specifies the retry strategy to use for failed jobs that are submitted with this job definition. Maximum number of retry_strategy is 1. Defined below.

timeout Dict[JobDefinitionTimeout]

Specifies the timeout for jobs so that if a job runs longer, AWS Batch terminates the job. Maximum number of timeout is 1. Defined below.

Outputs

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

Arn string

The Amazon Resource Name of the job definition.

Id string
The provider-assigned unique ID for this managed resource.
Revision int

The revision of the job definition.

Arn string

The Amazon Resource Name of the job definition.

Id string
The provider-assigned unique ID for this managed resource.
Revision int

The revision of the job definition.

arn string

The Amazon Resource Name of the job definition.

id string
The provider-assigned unique ID for this managed resource.
revision number

The revision of the job definition.

arn str

The Amazon Resource Name of the job definition.

id str
The provider-assigned unique ID for this managed resource.
revision float

The revision of the job definition.

Look up an Existing JobDefinition Resource

Get an existing JobDefinition 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?: JobDefinitionState, opts?: CustomResourceOptions): JobDefinition
static get(resource_name, id, opts=None, arn=None, container_properties=None, name=None, parameters=None, retry_strategy=None, revision=None, timeout=None, type=None, __props__=None);
func GetJobDefinition(ctx *Context, name string, id IDInput, state *JobDefinitionState, opts ...ResourceOption) (*JobDefinition, error)
public static JobDefinition Get(string name, Input<string> id, JobDefinitionState? 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:

Arn string

The Amazon Resource Name of the job definition.

ContainerProperties string

A valid container properties provided as a single valid JSON document. This parameter is required if the type parameter is container.

Name string

Specifies the name of the job definition.

Parameters Dictionary<string, string>

Specifies the parameter substitution placeholders to set in the job definition.

RetryStrategy JobDefinitionRetryStrategyArgs

Specifies the retry strategy to use for failed jobs that are submitted with this job definition. Maximum number of retry_strategy is 1. Defined below.

Revision int

The revision of the job definition.

Timeout JobDefinitionTimeoutArgs

Specifies the timeout for jobs so that if a job runs longer, AWS Batch terminates the job. Maximum number of timeout is 1. Defined below.

Type string

The type of job definition. Must be container

Arn string

The Amazon Resource Name of the job definition.

ContainerProperties string

A valid container properties provided as a single valid JSON document. This parameter is required if the type parameter is container.

Name string

Specifies the name of the job definition.

Parameters map[string]string

Specifies the parameter substitution placeholders to set in the job definition.

RetryStrategy JobDefinitionRetryStrategy

Specifies the retry strategy to use for failed jobs that are submitted with this job definition. Maximum number of retry_strategy is 1. Defined below.

Revision int

The revision of the job definition.

Timeout JobDefinitionTimeout

Specifies the timeout for jobs so that if a job runs longer, AWS Batch terminates the job. Maximum number of timeout is 1. Defined below.

Type string

The type of job definition. Must be container

arn string

The Amazon Resource Name of the job definition.

containerProperties string

A valid container properties provided as a single valid JSON document. This parameter is required if the type parameter is container.

name string

Specifies the name of the job definition.

parameters {[key: string]: string}

Specifies the parameter substitution placeholders to set in the job definition.

retryStrategy JobDefinitionRetryStrategy

Specifies the retry strategy to use for failed jobs that are submitted with this job definition. Maximum number of retry_strategy is 1. Defined below.

revision number

The revision of the job definition.

timeout JobDefinitionTimeout

Specifies the timeout for jobs so that if a job runs longer, AWS Batch terminates the job. Maximum number of timeout is 1. Defined below.

type string

The type of job definition. Must be container

arn str

The Amazon Resource Name of the job definition.

container_properties str

A valid container properties provided as a single valid JSON document. This parameter is required if the type parameter is container.

name str

Specifies the name of the job definition.

parameters Dict[str, str]

Specifies the parameter substitution placeholders to set in the job definition.

retry_strategy Dict[JobDefinitionRetryStrategy]

Specifies the retry strategy to use for failed jobs that are submitted with this job definition. Maximum number of retry_strategy is 1. Defined below.

revision float

The revision of the job definition.

timeout Dict[JobDefinitionTimeout]

Specifies the timeout for jobs so that if a job runs longer, AWS Batch terminates the job. Maximum number of timeout is 1. Defined below.

type str

The type of job definition. Must be container

Supporting Types

JobDefinitionRetryStrategy

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Attempts int

The number of times to move a job to the RUNNABLE status. You may specify between 1 and 10 attempts.

Attempts int

The number of times to move a job to the RUNNABLE status. You may specify between 1 and 10 attempts.

attempts number

The number of times to move a job to the RUNNABLE status. You may specify between 1 and 10 attempts.

attempts float

The number of times to move a job to the RUNNABLE status. You may specify between 1 and 10 attempts.

JobDefinitionTimeout

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

AttemptDurationSeconds int

The time duration in seconds after which AWS Batch terminates your jobs if they have not finished. The minimum value for the timeout is 60 seconds.

AttemptDurationSeconds int

The time duration in seconds after which AWS Batch terminates your jobs if they have not finished. The minimum value for the timeout is 60 seconds.

attemptDurationSeconds number

The time duration in seconds after which AWS Batch terminates your jobs if they have not finished. The minimum value for the timeout is 60 seconds.

attemptDurationSeconds float

The time duration in seconds after which AWS Batch terminates your jobs if they have not finished. The minimum value for the timeout is 60 seconds.

Package Details

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