Class EcsFargateContainerDefinition
A container orchestrated by ECS that uses Fargate resources.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.Batch
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class EcsFargateContainerDefinition : Construct, IEcsFargateContainerDefinition, IEcsContainerDefinition
Syntax (vb)
Public Class EcsFargateContainerDefinition
Inherits Construct
Implements IEcsFargateContainerDefinition, IEcsContainerDefinition
Remarks
ExampleMetadata: infused
Examples
var jobDefn = new EcsJobDefinition(this, "JobDefn", new EcsJobDefinitionProps {
Container = new EcsFargateContainerDefinition(this, "myFargateContainer", new EcsFargateContainerDefinitionProps {
Image = ContainerImage.FromRegistry("public.ecr.aws/amazonlinux/amazonlinux:latest"),
Memory = Size.Mebibytes(2048),
Cpu = 256,
EphemeralStorageSize = Size.Gibibytes(100),
FargateCpuArchitecture = CpuArchitecture.ARM64,
FargateOperatingSystemFamily = OperatingSystemFamily.LINUX
})
});
Synopsis
Constructors
EcsFargateContainerDefinition(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
EcsFargateContainerDefinition(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
EcsFargateContainerDefinition(Construct, String, IEcsFargateContainerDefinitionProps) |
Properties
AssignPublicIp | Indicates whether the job has a public IP address. |
Command | The command that's passed to the container. |
Cpu | The number of vCPUs reserved for the container. |
Environment | The environment variables to pass to a container. |
EphemeralStorageSize | The size for ephemeral storage. |
ExecutionRole | The role used by Amazon ECS container and AWS Fargate agents to make AWS API calls on your behalf. |
FargateCpuArchitecture | The vCPU architecture of Fargate Runtime. |
FargateOperatingSystemFamily | The operating system for the compute environment. |
FargatePlatformVersion | Which version of Fargate to use when running this container. |
Image | The image that this container will run. |
JobRole | The role that the container can assume. |
LinuxParameters | Linux-specific modifications that are applied to the container, such as details for device mappings. |
LogDriverConfig | The configuration of the log driver. |
Memory | The memory hard limit present to the container. |
ReadonlyRootFilesystem | Gives the container readonly access to its root filesystem. |
Secrets | A map from environment variable names to the secrets for the container. |
User | The user name to use inside the container. |
Volumes | The volumes to mount to this container. |
Methods
AddVolume(EcsVolume) | Add a Volume to this container. |
Constructors
EcsFargateContainerDefinition(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected EcsFargateContainerDefinition(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
EcsFargateContainerDefinition(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected EcsFargateContainerDefinition(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
EcsFargateContainerDefinition(Construct, String, IEcsFargateContainerDefinitionProps)
public EcsFargateContainerDefinition(Construct scope, string id, IEcsFargateContainerDefinitionProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props IEcsFargateContainerDefinitionProps
Properties
AssignPublicIp
Indicates whether the job has a public IP address.
public virtual Nullable<bool> AssignPublicIp { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
For a job that's running on Fargate resources in a private subnet to send outbound traffic to the internet (for example, to pull container images), the private subnet requires a NAT gateway be attached to route requests to the internet.
Command
The command that's passed to the container.
public virtual string[] Command { get; }
Property Value
System.String[]
Cpu
The number of vCPUs reserved for the container.
public virtual double Cpu { get; }
Property Value
System.Double
Remarks
Each vCPU is equivalent to 1,024 CPU shares. For containers running on EC2 resources, you must specify at least one vCPU.
Environment
The environment variables to pass to a container.
public virtual IDictionary<string, string> Environment { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.String>
Remarks
Cannot start with AWS_BATCH
.
We don't recommend using plaintext environment variables for sensitive information, such as credential data.
EphemeralStorageSize
The size for ephemeral storage.
public virtual Size EphemeralStorageSize { get; }
Property Value
ExecutionRole
The role used by Amazon ECS container and AWS Fargate agents to make AWS API calls on your behalf.
public virtual IRole ExecutionRole { get; }
Property Value
FargateCpuArchitecture
The vCPU architecture of Fargate Runtime.
public virtual CpuArchitecture FargateCpuArchitecture { get; }
Property Value
FargateOperatingSystemFamily
The operating system for the compute environment.
public virtual OperatingSystemFamily FargateOperatingSystemFamily { get; }
Property Value
FargatePlatformVersion
Which version of Fargate to use when running this container.
public virtual Nullable<FargatePlatformVersion> FargatePlatformVersion { get; }
Property Value
System.Nullable<FargatePlatformVersion>
Image
The image that this container will run.
public virtual ContainerImage Image { get; }
Property Value
JobRole
LinuxParameters
Linux-specific modifications that are applied to the container, such as details for device mappings.
public virtual LinuxParameters LinuxParameters { get; }
Property Value
LogDriverConfig
The configuration of the log driver.
public virtual ILogDriverConfig LogDriverConfig { get; }
Property Value
Memory
The memory hard limit present to the container.
public virtual Size Memory { get; }
Property Value
Remarks
If your container attempts to exceed the memory specified, the container is terminated. You must specify at least 4 MiB of memory for a job.
ReadonlyRootFilesystem
Gives the container readonly access to its root filesystem.
public virtual Nullable<bool> ReadonlyRootFilesystem { get; }
Property Value
System.Nullable<System.Boolean>
Secrets
A map from environment variable names to the secrets for the container.
public virtual IDictionary<string, Secret> Secrets { get; }
Property Value
System.Collections.Generic.IDictionary<System.String, Secret>
Remarks
Allows your job definitions to reference the secret by the environment variable name defined in this property.
User
The user name to use inside the container.
public virtual string User { get; }
Property Value
System.String
Volumes
The volumes to mount to this container.
public virtual EcsVolume[] Volumes { get; }
Property Value
Remarks
Automatically added to the job definition.
Methods
AddVolume(EcsVolume)
Add a Volume to this container.
public virtual void AddVolume(EcsVolume volume)
Parameters
- volume EcsVolume