Class EksJobDefinition
A JobDefinition that uses Eks orchestration.
Inherited Members
Namespace: Amazon.CDK.AWS.Batch
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class EksJobDefinition : Resource, IEksJobDefinition, IJobDefinition, IResource
Syntax (vb)
Public Class EksJobDefinition
Inherits Resource
Implements IEksJobDefinition, IJobDefinition, IResource
Remarks
Resource: AWS::Batch::JobDefinition
ExampleMetadata: infused
Examples
var jobDefn = new EksJobDefinition(this, "eksf2", new EksJobDefinitionProps {
Container = new EksContainerDefinition(this, "container", new EksContainerDefinitionProps {
Image = ContainerImage.FromRegistry("amazon/amazon-ecs-sample"),
Volumes = new [] { EksVolume.EmptyDir(new EmptyDirVolumeOptions {
Name = "myEmptyDirVolume",
MountPath = "/mount/path",
Medium = EmptyDirMediumType.MEMORY,
Readonly = true,
SizeLimit = Size.Mebibytes(2048)
}) }
})
});
Synopsis
Constructors
EksJobDefinition(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
EksJobDefinition(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
EksJobDefinition(Construct, String, IEksJobDefinitionProps) |
Properties
Container | The container this Job Definition will run. |
DnsPolicy | The DNS Policy of the pod used by this Job Definition. |
JobDefinitionArn | The ARN of this job definition. |
JobDefinitionName | The name of this job definition. |
Parameters | The default parameters passed to the container These parameters can be referenced in the |
RetryAttempts | The number of times to retry a job. |
RetryStrategies | Defines the retry behavior for this job. |
SchedulingPriority | The priority of this Job. |
ServiceAccount | The name of the service account that's used to run the container. |
Timeout | The timeout time for jobs that are submitted with this job definition. |
UseHostNetwork | If specified, the Pod used by this Job Definition will use the host's network IP address. |
Methods
AddRetryStrategy(RetryStrategy) | Add a RetryStrategy to this JobDefinition. |
FromEksJobDefinitionArn(Construct, String, String) | Import an EksJobDefinition by its arn. |
Constructors
EksJobDefinition(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected EksJobDefinition(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
EksJobDefinition(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected EksJobDefinition(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
EksJobDefinition(Construct, String, IEksJobDefinitionProps)
public EksJobDefinition(Construct scope, string id, IEksJobDefinitionProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props IEksJobDefinitionProps
Properties
Container
The container this Job Definition will run.
public virtual EksContainerDefinition Container { get; }
Property Value
DnsPolicy
The DNS Policy of the pod used by this Job Definition.
public virtual Nullable<DnsPolicy> DnsPolicy { get; }
Property Value
System.Nullable<DnsPolicy>
JobDefinitionArn
The ARN of this job definition.
public virtual string JobDefinitionArn { get; }
Property Value
System.String
JobDefinitionName
The name of this job definition.
public virtual string JobDefinitionName { get; }
Property Value
System.String
Parameters
The default parameters passed to the container These parameters can be referenced in the command
that you give to the container.
public virtual IDictionary<string, object> Parameters { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.Object>
RetryAttempts
The number of times to retry a job.
public virtual Nullable<double> RetryAttempts { get; }
Property Value
System.Nullable<System.Double>
Remarks
The job is retried on failure the same number of attempts as the value.
RetryStrategies
Defines the retry behavior for this job.
public virtual RetryStrategy[] RetryStrategies { get; }
Property Value
SchedulingPriority
The priority of this Job.
public virtual Nullable<double> SchedulingPriority { get; }
Property Value
System.Nullable<System.Double>
Remarks
Only used in Fairshare Scheduling to decide which job to run first when there are multiple jobs with the same share identifier.
ServiceAccount
The name of the service account that's used to run the container.
public virtual string ServiceAccount { get; }
Property Value
System.String
Remarks
service accounts are Kubernetes method of identification and authentication, roughly analogous to IAM users.
Timeout
The timeout time for jobs that are submitted with this job definition.
public virtual Duration Timeout { get; }
Property Value
Remarks
After the amount of time you specify passes, Batch terminates your jobs if they aren't finished.
UseHostNetwork
If specified, the Pod used by this Job Definition will use the host's network IP address.
public virtual Nullable<bool> UseHostNetwork { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Otherwise, the Kubernetes pod networking model is enabled. Most AWS Batch workloads are egress-only and don't require the overhead of IP allocation for each pod for incoming connections.
Methods
AddRetryStrategy(RetryStrategy)
Add a RetryStrategy to this JobDefinition.
public virtual void AddRetryStrategy(RetryStrategy strategy)
Parameters
- strategy RetryStrategy
FromEksJobDefinitionArn(Construct, String, String)
Import an EksJobDefinition by its arn.
public static IEksJobDefinition FromEksJobDefinitionArn(Construct scope, string id, string eksJobDefinitionArn)
Parameters
- scope Constructs.Construct
- id System.String
- eksJobDefinitionArn System.String
Returns