Class CfnJobDefinition
A CloudFormation AWS::Batch::JobDefinition
.
Inherited Members
Namespace: Amazon.CDK.AWS.Batch
Assembly: Amazon.CDK.AWS.Batch.dll
Syntax (csharp)
public class CfnJobDefinition : CfnResource, IConstruct, IDependable, IInspectable
Syntax (vb)
Public Class CfnJobDefinition
Inherits CfnResource
Implements IConstruct, IDependable, IInspectable
Remarks
The AWS::Batch::JobDefinition
resource specifies the parameters for an AWS Batch job definition. For more information, see Job Definitions in the ** .
CloudformationResource: AWS::Batch::JobDefinition
Link: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-batch-jobdefinition.html
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Batch;
var labels;
var limits;
var options;
var parameters;
var requests;
var tags;
var cfnJobDefinition = new CfnJobDefinition(this, "MyCfnJobDefinition", new CfnJobDefinitionProps {
Type = "type",
// the properties below are optional
ContainerProperties = new ContainerPropertiesProperty {
Image = "image",
// the properties below are optional
Command = new [] { "command" },
Environment = new [] { new EnvironmentProperty {
Name = "name",
Value = "value"
} },
EphemeralStorage = new EphemeralStorageProperty {
SizeInGiB = 123
},
ExecutionRoleArn = "executionRoleArn",
FargatePlatformConfiguration = new FargatePlatformConfigurationProperty {
PlatformVersion = "platformVersion"
},
InstanceType = "instanceType",
JobRoleArn = "jobRoleArn",
LinuxParameters = new LinuxParametersProperty {
Devices = new [] { new DeviceProperty {
ContainerPath = "containerPath",
HostPath = "hostPath",
Permissions = new [] { "permissions" }
} },
InitProcessEnabled = false,
MaxSwap = 123,
SharedMemorySize = 123,
Swappiness = 123,
Tmpfs = new [] { new TmpfsProperty {
ContainerPath = "containerPath",
Size = 123,
// the properties below are optional
MountOptions = new [] { "mountOptions" }
} }
},
LogConfiguration = new LogConfigurationProperty {
LogDriver = "logDriver",
// the properties below are optional
Options = options,
SecretOptions = new [] { new SecretProperty {
Name = "name",
ValueFrom = "valueFrom"
} }
},
Memory = 123,
MountPoints = new [] { new MountPointsProperty {
ContainerPath = "containerPath",
ReadOnly = false,
SourceVolume = "sourceVolume"
} },
NetworkConfiguration = new NetworkConfigurationProperty {
AssignPublicIp = "assignPublicIp"
},
Privileged = false,
ReadonlyRootFilesystem = false,
ResourceRequirements = new [] { new ResourceRequirementProperty {
Type = "type",
Value = "value"
} },
Secrets = new [] { new SecretProperty {
Name = "name",
ValueFrom = "valueFrom"
} },
Ulimits = new [] { new UlimitProperty {
HardLimit = 123,
Name = "name",
SoftLimit = 123
} },
User = "user",
Vcpus = 123,
Volumes = new [] { new VolumesProperty {
EfsVolumeConfiguration = new EfsVolumeConfigurationProperty {
FileSystemId = "fileSystemId",
// the properties below are optional
AuthorizationConfig = new AuthorizationConfigProperty {
AccessPointId = "accessPointId",
Iam = "iam"
},
RootDirectory = "rootDirectory",
TransitEncryption = "transitEncryption",
TransitEncryptionPort = 123
},
Host = new VolumesHostProperty {
SourcePath = "sourcePath"
},
Name = "name"
} }
},
EksProperties = new EksPropertiesProperty {
PodProperties = new PodPropertiesProperty {
Containers = new [] { new EksContainerProperty {
Image = "image",
// the properties below are optional
Args = new [] { "args" },
Command = new [] { "command" },
Env = new [] { new EksContainerEnvironmentVariableProperty {
Name = "name",
// the properties below are optional
Value = "value"
} },
ImagePullPolicy = "imagePullPolicy",
Name = "name",
Resources = new ResourcesProperty {
Limits = limits,
Requests = requests
},
SecurityContext = new SecurityContextProperty {
Privileged = false,
ReadOnlyRootFilesystem = false,
RunAsGroup = 123,
RunAsNonRoot = false,
RunAsUser = 123
},
VolumeMounts = new [] { new EksContainerVolumeMountProperty {
MountPath = "mountPath",
Name = "name",
ReadOnly = false
} }
} },
DnsPolicy = "dnsPolicy",
HostNetwork = false,
Metadata = new MetadataProperty {
Labels = labels
},
ServiceAccountName = "serviceAccountName",
Volumes = new [] { new EksVolumeProperty {
Name = "name",
// the properties below are optional
EmptyDir = new EmptyDirProperty {
Medium = "medium",
SizeLimit = "sizeLimit"
},
HostPath = new HostPathProperty {
Path = "path"
},
Secret = new EksSecretProperty {
SecretName = "secretName",
// the properties below are optional
Optional = false
}
} }
}
},
JobDefinitionName = "jobDefinitionName",
NodeProperties = new NodePropertiesProperty {
MainNode = 123,
NodeRangeProperties = new [] { new NodeRangePropertyProperty {
TargetNodes = "targetNodes",
// the properties below are optional
Container = new ContainerPropertiesProperty {
Image = "image",
// the properties below are optional
Command = new [] { "command" },
Environment = new [] { new EnvironmentProperty {
Name = "name",
Value = "value"
} },
EphemeralStorage = new EphemeralStorageProperty {
SizeInGiB = 123
},
ExecutionRoleArn = "executionRoleArn",
FargatePlatformConfiguration = new FargatePlatformConfigurationProperty {
PlatformVersion = "platformVersion"
},
InstanceType = "instanceType",
JobRoleArn = "jobRoleArn",
LinuxParameters = new LinuxParametersProperty {
Devices = new [] { new DeviceProperty {
ContainerPath = "containerPath",
HostPath = "hostPath",
Permissions = new [] { "permissions" }
} },
InitProcessEnabled = false,
MaxSwap = 123,
SharedMemorySize = 123,
Swappiness = 123,
Tmpfs = new [] { new TmpfsProperty {
ContainerPath = "containerPath",
Size = 123,
// the properties below are optional
MountOptions = new [] { "mountOptions" }
} }
},
LogConfiguration = new LogConfigurationProperty {
LogDriver = "logDriver",
// the properties below are optional
Options = options,
SecretOptions = new [] { new SecretProperty {
Name = "name",
ValueFrom = "valueFrom"
} }
},
Memory = 123,
MountPoints = new [] { new MountPointsProperty {
ContainerPath = "containerPath",
ReadOnly = false,
SourceVolume = "sourceVolume"
} },
NetworkConfiguration = new NetworkConfigurationProperty {
AssignPublicIp = "assignPublicIp"
},
Privileged = false,
ReadonlyRootFilesystem = false,
ResourceRequirements = new [] { new ResourceRequirementProperty {
Type = "type",
Value = "value"
} },
Secrets = new [] { new SecretProperty {
Name = "name",
ValueFrom = "valueFrom"
} },
Ulimits = new [] { new UlimitProperty {
HardLimit = 123,
Name = "name",
SoftLimit = 123
} },
User = "user",
Vcpus = 123,
Volumes = new [] { new VolumesProperty {
EfsVolumeConfiguration = new EfsVolumeConfigurationProperty {
FileSystemId = "fileSystemId",
// the properties below are optional
AuthorizationConfig = new AuthorizationConfigProperty {
AccessPointId = "accessPointId",
Iam = "iam"
},
RootDirectory = "rootDirectory",
TransitEncryption = "transitEncryption",
TransitEncryptionPort = 123
},
Host = new VolumesHostProperty {
SourcePath = "sourcePath"
},
Name = "name"
} }
}
} },
NumNodes = 123
},
Parameters = parameters,
PlatformCapabilities = new [] { "platformCapabilities" },
PropagateTags = false,
RetryStrategy = new RetryStrategyProperty {
Attempts = 123,
EvaluateOnExit = new [] { new EvaluateOnExitProperty {
Action = "action",
// the properties below are optional
OnExitCode = "onExitCode",
OnReason = "onReason",
OnStatusReason = "onStatusReason"
} }
},
SchedulingPriority = 123,
Tags = tags,
Timeout = new TimeoutProperty {
AttemptDurationSeconds = 123
}
});
Synopsis
Constructors
CfnJobDefinition(Construct, String, ICfnJobDefinitionProps) | Create a new |
CfnJobDefinition(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
CfnJobDefinition(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Properties
CFN_RESOURCE_TYPE_NAME | The CloudFormation resource type name for this resource class. |
CfnProperties | |
ContainerProperties | An object with various properties specific to Amazon ECS based jobs. |
EksProperties | An object with various properties that are specific to Amazon EKS based jobs. |
JobDefinitionName | The name of the job definition. |
NodeProperties | An object with various properties that are specific to multi-node parallel jobs. |
Parameters | Default parameters or parameter substitution placeholders that are set in the job definition. |
PlatformCapabilities | The platform capabilities required by the job definition. |
PropagateTags | Specifies whether to propagate the tags from the job or job definition to the corresponding Amazon ECS task. |
RetryStrategy | The retry strategy to use for failed jobs that are submitted with this job definition. |
SchedulingPriority | The scheduling priority of the job definition. |
Tags | The tags that are applied to the job definition. |
Timeout | The timeout time for jobs that are submitted with this job definition. |
Type | The type of job definition. |
Methods
Inspect(TreeInspector) | Examines the CloudFormation resource and discloses attributes. |
RenderProperties(IDictionary<String, Object>) |
Constructors
CfnJobDefinition(Construct, String, ICfnJobDefinitionProps)
Create a new AWS::Batch::JobDefinition
.
public CfnJobDefinition(Construct scope, string id, ICfnJobDefinitionProps props)
Parameters
- scope Construct
- scope in which this resource is defined.
- id System.String
- scoped id of the resource.
- props ICfnJobDefinitionProps
- resource properties.
CfnJobDefinition(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected CfnJobDefinition(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
CfnJobDefinition(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected CfnJobDefinition(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Properties
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
public static string CFN_RESOURCE_TYPE_NAME { get; }
Property Value
System.String
CfnProperties
protected override IDictionary<string, object> CfnProperties { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
Overrides
ContainerProperties
An object with various properties specific to Amazon ECS based jobs.
public virtual object ContainerProperties { get; set; }
Property Value
System.Object
Remarks
Valid values are containerProperties
, eksProperties
, and nodeProperties
. Only one can be specified.
EksProperties
An object with various properties that are specific to Amazon EKS based jobs.
public virtual object EksProperties { get; set; }
Property Value
System.Object
Remarks
Valid values are containerProperties
, eksProperties
, and nodeProperties
. Only one can be specified.
JobDefinitionName
The name of the job definition.
public virtual string JobDefinitionName { get; set; }
Property Value
System.String
Remarks
NodeProperties
An object with various properties that are specific to multi-node parallel jobs.
public virtual object NodeProperties { get; set; }
Property Value
System.Object
Remarks
Valid values are containerProperties
, eksProperties
, and nodeProperties
. Only one can be specified.
If the job runs on Fargate resources, don't specify nodeProperties
. Use containerProperties
instead.
Parameters
Default parameters or parameter substitution placeholders that are set in the job definition.
public virtual object Parameters { get; set; }
Property Value
System.Object
Remarks
Parameters are specified as a key-value pair mapping. Parameters in a SubmitJob
request override any corresponding parameter defaults from the job definition. For more information about specifying parameters, see Job definition parameters in the AWS Batch User Guide .
PlatformCapabilities
The platform capabilities required by the job definition.
public virtual string[] PlatformCapabilities { get; set; }
Property Value
System.String[]
Remarks
If no value is specified, it defaults to EC2
. Jobs run on Fargate resources specify FARGATE
.
PropagateTags
Specifies whether to propagate the tags from the job or job definition to the corresponding Amazon ECS task.
public virtual object PropagateTags { get; set; }
Property Value
System.Object
Remarks
If no value is specified, the tags aren't propagated. Tags can only be propagated to the tasks when the tasks are created. For tags with the same name, job tags are given priority over job definitions tags. If the total number of combined tags from the job and job definition is over 50, the job is moved to the FAILED
state.
RetryStrategy
The retry strategy to use for failed jobs that are submitted with this job definition.
public virtual object RetryStrategy { get; set; }
Property Value
System.Object
Remarks
SchedulingPriority
The scheduling priority of the job definition.
public virtual Nullable<double> SchedulingPriority { get; set; }
Property Value
System.Nullable<System.Double>
Remarks
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
The tags that are applied to the job definition.
public virtual TagManager Tags { get; }
Property Value
Remarks
Timeout
The timeout time for jobs that are submitted with this job definition.
public virtual object Timeout { get; set; }
Property Value
System.Object
Remarks
After the amount of time you specify passes, AWS Batch terminates your jobs if they aren't finished.
Type
The type of job definition.
public virtual string Type { get; set; }
Property Value
System.String
Remarks
For more information about multi-node parallel jobs, see Creating a multi-node parallel job definition in the AWS Batch User Guide .
If the job is run on Fargate resources, then multinode
isn't supported.
Methods
Inspect(TreeInspector)
Examines the CloudFormation resource and discloses attributes.
public virtual void Inspect(TreeInspector inspector)
Parameters
- inspector TreeInspector
- tree inspector to collect and process attributes.
RenderProperties(IDictionary<String, Object>)
protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
Parameters
- props System.Collections.Generic.IDictionary<System.String, System.Object>
Returns
System.Collections.Generic.IDictionary<System.String, System.Object>