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
new JobDefinition(name: string, args: JobDefinitionArgs, opts?: CustomResourceOptions);def JobDefinition(resource_name, opts=None, container_properties=None, name=None, parameters=None, retry_strategy=None, timeout=None, type=None, __props__=None);func NewJobDefinition(ctx *Context, name string, args JobDefinitionArgs, opts ...ResourceOption) (*JobDefinition, error)public JobDefinition(string name, JobDefinitionArgs args, CustomResourceOptions? opts = null)- 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- Container
Properties string A valid container properties provided as a single valid JSON document. This parameter is required if the
typeparameter iscontainer.- Name string
Specifies the name of the job definition.
- Parameters Dictionary<string, string>
Specifies the parameter substitution placeholders to set in the job definition.
- Retry
Strategy JobDefinition Retry Strategy Args Specifies the retry strategy to use for failed jobs that are submitted with this job definition. Maximum number of
retry_strategyis1. Defined below.- Timeout
Job
Definition Timeout Args Specifies the timeout for jobs so that if a job runs longer, AWS Batch terminates the job. Maximum number of
timeoutis1. Defined below.
- Type string
The type of job definition. Must be
container- Container
Properties string A valid container properties provided as a single valid JSON document. This parameter is required if the
typeparameter iscontainer.- Name string
Specifies the name of the job definition.
- Parameters map[string]string
Specifies the parameter substitution placeholders to set in the job definition.
- Retry
Strategy JobDefinition Retry Strategy Specifies the retry strategy to use for failed jobs that are submitted with this job definition. Maximum number of
retry_strategyis1. Defined below.- Timeout
Job
Definition Timeout Specifies the timeout for jobs so that if a job runs longer, AWS Batch terminates the job. Maximum number of
timeoutis1. Defined below.
- type string
The type of job definition. Must be
container- container
Properties string A valid container properties provided as a single valid JSON document. This parameter is required if the
typeparameter iscontainer.- name string
Specifies the name of the job definition.
- parameters {[key: string]: string}
Specifies the parameter substitution placeholders to set in the job definition.
- retry
Strategy JobDefinition Retry Strategy Specifies the retry strategy to use for failed jobs that are submitted with this job definition. Maximum number of
retry_strategyis1. Defined below.- timeout
Job
Definition Timeout Specifies the timeout for jobs so that if a job runs longer, AWS Batch terminates the job. Maximum number of
timeoutis1. 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
typeparameter iscontainer.- 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[JobDefinition Retry Strategy] Specifies the retry strategy to use for failed jobs that are submitted with this job definition. Maximum number of
retry_strategyis1. Defined below.- timeout
Dict[Job
Definition Timeout] Specifies the timeout for jobs so that if a job runs longer, AWS Batch terminates the job. Maximum number of
timeoutis1. Defined below.
Outputs
All input properties are implicitly available as output properties. Additionally, the JobDefinition resource produces the following output properties:
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): JobDefinitionstatic 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.
- Container
Properties string A valid container properties provided as a single valid JSON document. This parameter is required if the
typeparameter iscontainer.- Name string
Specifies the name of the job definition.
- Parameters Dictionary<string, string>
Specifies the parameter substitution placeholders to set in the job definition.
- Retry
Strategy JobDefinition Retry Strategy Args Specifies the retry strategy to use for failed jobs that are submitted with this job definition. Maximum number of
retry_strategyis1. Defined below.- Revision int
The revision of the job definition.
- Timeout
Job
Definition Timeout Args Specifies the timeout for jobs so that if a job runs longer, AWS Batch terminates the job. Maximum number of
timeoutis1. Defined below.- Type string
The type of job definition. Must be
container
- Arn string
The Amazon Resource Name of the job definition.
- Container
Properties string A valid container properties provided as a single valid JSON document. This parameter is required if the
typeparameter iscontainer.- Name string
Specifies the name of the job definition.
- Parameters map[string]string
Specifies the parameter substitution placeholders to set in the job definition.
- Retry
Strategy JobDefinition Retry Strategy Specifies the retry strategy to use for failed jobs that are submitted with this job definition. Maximum number of
retry_strategyis1. Defined below.- Revision int
The revision of the job definition.
- Timeout
Job
Definition Timeout Specifies the timeout for jobs so that if a job runs longer, AWS Batch terminates the job. Maximum number of
timeoutis1. Defined below.- Type string
The type of job definition. Must be
container
- arn string
The Amazon Resource Name of the job definition.
- container
Properties string A valid container properties provided as a single valid JSON document. This parameter is required if the
typeparameter iscontainer.- name string
Specifies the name of the job definition.
- parameters {[key: string]: string}
Specifies the parameter substitution placeholders to set in the job definition.
- retry
Strategy JobDefinition Retry Strategy Specifies the retry strategy to use for failed jobs that are submitted with this job definition. Maximum number of
retry_strategyis1. Defined below.- revision number
The revision of the job definition.
- timeout
Job
Definition Timeout Specifies the timeout for jobs so that if a job runs longer, AWS Batch terminates the job. Maximum number of
timeoutis1. 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
typeparameter iscontainer.- 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[JobDefinition Retry Strategy] Specifies the retry strategy to use for failed jobs that are submitted with this job definition. Maximum number of
retry_strategyis1. Defined below.- revision float
The revision of the job definition.
- timeout
Dict[Job
Definition Timeout] Specifies the timeout for jobs so that if a job runs longer, AWS Batch terminates the job. Maximum number of
timeoutis1. Defined below.- type str
The type of job definition. Must be
container
Supporting Types
JobDefinitionRetryStrategy
JobDefinitionTimeout
- Attempt
Duration intSeconds The time duration in seconds after which AWS Batch terminates your jobs if they have not finished. The minimum value for the timeout is
60seconds.
- Attempt
Duration intSeconds The time duration in seconds after which AWS Batch terminates your jobs if they have not finished. The minimum value for the timeout is
60seconds.
- attempt
Duration numberSeconds The time duration in seconds after which AWS Batch terminates your jobs if they have not finished. The minimum value for the timeout is
60seconds.
- attempt
Duration floatSeconds The time duration in seconds after which AWS Batch terminates your jobs if they have not finished. The minimum value for the timeout is
60seconds.
Package Details
- Repository
- https://github.com/pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
awsTerraform Provider.