Interface IEcsContainerDefinition
A container that can be run with ECS orchestration.
Namespace: Amazon.CDK.AWS.Batch
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IEcsContainerDefinition
Syntax (vb)
Public Interface IEcsContainerDefinition
Inherits IConstruct, IDependable
Synopsis
Properties
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. |
ExecutionRole | The role used by Amazon ECS container and AWS Fargate agents to make AWS API calls on your behalf. |
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. |
Properties
Command
The command that's passed to the container.
virtual string[] Command { get; }
Property Value
System.String[]
Remarks
Cpu
The number of vCPUs reserved for the container.
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.
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.
Default: - no environment variables
ExecutionRole
The role used by Amazon ECS container and AWS Fargate agents to make AWS API calls on your behalf.
IRole ExecutionRole { get; }
Property Value
Remarks
Image
JobRole
The role that the container can assume.
virtual IRole JobRole { get; }
Property Value
Remarks
Default: - no jobRole
See: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html
LinuxParameters
Linux-specific modifications that are applied to the container, such as details for device mappings.
virtual LinuxParameters LinuxParameters { get; }
Property Value
Remarks
Default: none
LogDriverConfig
The configuration of the log driver.
virtual ILogDriverConfig LogDriverConfig { get; }
Property Value
Memory
The memory hard limit present to the container.
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.
virtual Nullable<bool> ReadonlyRootFilesystem { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
Default: false
Secrets
A map from environment variable names to the secrets for the container.
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.
Default: - no secrets
See: https://docs.aws.amazon.com/batch/latest/userguide/specifying-sensitive-data.html
User
The user name to use inside the container.
virtual string User { get; }
Property Value
System.String
Remarks
Default: - no user
Volumes
The volumes to mount to this container.
EcsVolume[] Volumes { get; }
Property Value
Remarks
Automatically added to the job definition.
Default: - no volumes