Class EcsFargateContainerDefinition
- All Implemented Interfaces:
IEcsContainerDefinition
,IEcsFargateContainerDefinition
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
Example:
EcsJobDefinition jobDefn = EcsJobDefinition.Builder.create(this, "JobDefn") .container(EcsFargateContainerDefinition.Builder.create(this, "myFargateContainer") .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) .build()) .build();
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A fluent builder forEcsFargateContainerDefinition
.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default, software.constructs.IConstruct.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.batch.IEcsContainerDefinition
IEcsContainerDefinition.Jsii$Default, IEcsContainerDefinition.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.batch.IEcsFargateContainerDefinition
IEcsFargateContainerDefinition.Jsii$Default, IEcsFargateContainerDefinition.Jsii$Proxy
-
Constructor Summary
ModifierConstructorDescriptionprotected
EcsFargateContainerDefinition
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
EcsFargateContainerDefinition
(software.amazon.jsii.JsiiObjectRef objRef) EcsFargateContainerDefinition
(software.constructs.Construct scope, String id, EcsFargateContainerDefinitionProps props) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a Volume to this container.Indicates whether the job has a public IP address.The command that's passed to the container.getCpu()
The number of vCPUs reserved for the container.The environment variables to pass to a container.The size for ephemeral storage.The role used by Amazon ECS container and AWS Fargate agents to make AWS API calls on your behalf.The vCPU architecture of Fargate Runtime.The operating system for the compute environment.Which version of Fargate to use when running this container.getImage()
The image that this container will run.The role that the container can assume.Linux-specific modifications that are applied to the container, such as details for device mappings.The configuration of the log driver.The memory hard limit present to the container.Gives the container readonly access to its root filesystem.A map from environment variable names to the secrets for the container.getUser()
The user name to use inside the container.The volumes to mount to this container.Methods inherited from class software.constructs.Construct
getNode, isConstruct, toString
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.constructs.IConstruct
getNode
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
EcsFargateContainerDefinition
protected EcsFargateContainerDefinition(software.amazon.jsii.JsiiObjectRef objRef) -
EcsFargateContainerDefinition
protected EcsFargateContainerDefinition(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
EcsFargateContainerDefinition
@Stability(Stable) public EcsFargateContainerDefinition(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull EcsFargateContainerDefinitionProps props) - Parameters:
scope
- This parameter is required.id
- This parameter is required.props
- This parameter is required.
-
-
Method Details
-
addVolume
Add a Volume to this container.- Specified by:
addVolume
in interfaceIEcsContainerDefinition
- Parameters:
volume
- This parameter is required.
-
getCpu
The number of vCPUs reserved for the container.Each vCPU is equivalent to 1,024 CPU shares. For containers running on EC2 resources, you must specify at least one vCPU.
- Specified by:
getCpu
in interfaceIEcsContainerDefinition
-
getExecutionRole
The role used by Amazon ECS container and AWS Fargate agents to make AWS API calls on your behalf.- Specified by:
getExecutionRole
in interfaceIEcsContainerDefinition
- See Also:
-
getImage
The image that this container will run.- Specified by:
getImage
in interfaceIEcsContainerDefinition
-
getMemory
The memory hard limit present to the container.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.
- Specified by:
getMemory
in interfaceIEcsContainerDefinition
-
getVolumes
The volumes to mount to this container.Automatically added to the job definition.
- Specified by:
getVolumes
in interfaceIEcsContainerDefinition
-
getAssignPublicIp
Indicates whether the job has a public IP address.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.
- Specified by:
getAssignPublicIp
in interfaceIEcsFargateContainerDefinition
- See Also:
-
getCommand
The command that's passed to the container.- Specified by:
getCommand
in interfaceIEcsContainerDefinition
- See Also:
-
getEnvironment
The environment variables to pass to a container.Cannot start with
AWS_BATCH
. We don't recommend using plaintext environment variables for sensitive information, such as credential data.- Specified by:
getEnvironment
in interfaceIEcsContainerDefinition
-
getEphemeralStorageSize
The size for ephemeral storage.- Specified by:
getEphemeralStorageSize
in interfaceIEcsFargateContainerDefinition
-
getFargateCpuArchitecture
The vCPU architecture of Fargate Runtime.- Specified by:
getFargateCpuArchitecture
in interfaceIEcsFargateContainerDefinition
-
getFargateOperatingSystemFamily
The operating system for the compute environment.- Specified by:
getFargateOperatingSystemFamily
in interfaceIEcsFargateContainerDefinition
-
getFargatePlatformVersion
Which version of Fargate to use when running this container.- Specified by:
getFargatePlatformVersion
in interfaceIEcsFargateContainerDefinition
-
getJobRole
The role that the container can assume.- Specified by:
getJobRole
in interfaceIEcsContainerDefinition
- See Also:
-
getLinuxParameters
Linux-specific modifications that are applied to the container, such as details for device mappings.- Specified by:
getLinuxParameters
in interfaceIEcsContainerDefinition
-
getLogDriverConfig
The configuration of the log driver.- Specified by:
getLogDriverConfig
in interfaceIEcsContainerDefinition
-
getReadonlyRootFilesystem
Gives the container readonly access to its root filesystem.- Specified by:
getReadonlyRootFilesystem
in interfaceIEcsContainerDefinition
-
getSecrets
A map from environment variable names to the secrets for the container.Allows your job definitions to reference the secret by the environment variable name defined in this property.
- Specified by:
getSecrets
in interfaceIEcsContainerDefinition
- See Also:
-
getUser
The user name to use inside the container.- Specified by:
getUser
in interfaceIEcsContainerDefinition
-