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
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forEcsFargateContainerDefinition.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default, software.constructs.IConstruct.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.services.batch.IEcsContainerDefinition
IEcsContainerDefinition.Jsii$Default, IEcsContainerDefinition.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.services.batch.IEcsFargateContainerDefinition
IEcsFargateContainerDefinition.Jsii$Default, IEcsFargateContainerDefinition.Jsii$Proxy -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEcsFargateContainerDefinition(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedEcsFargateContainerDefinition(software.amazon.jsii.JsiiObjectRef objRef) EcsFargateContainerDefinition(software.constructs.Construct scope, String id, EcsFargateContainerDefinitionProps props) -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd 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.Whether to enable ecs exec for this 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, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
PROPERTY_INJECTION_ID
Uniquely identifies this class.
-
-
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:
addVolumein 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:
getCpuin interfaceIEcsContainerDefinition
-
getExecutionRole
The role used by Amazon ECS container and AWS Fargate agents to make AWS API calls on your behalf.- Specified by:
getExecutionRolein interfaceIEcsContainerDefinition- See Also:
-
getImage
The image that this container will run.- Specified by:
getImagein 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:
getMemoryin interfaceIEcsContainerDefinition
-
getVolumes
The volumes to mount to this container.Automatically added to the job definition.
- Specified by:
getVolumesin 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:
getAssignPublicIpin interfaceIEcsFargateContainerDefinition- See Also:
-
getCommand
The command that's passed to the container.- Specified by:
getCommandin interfaceIEcsContainerDefinition- See Also:
-
getEnableExecuteCommand
Whether to enable ecs exec for this container.- Specified by:
getEnableExecuteCommandin interfaceIEcsContainerDefinition
-
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:
getEnvironmentin interfaceIEcsContainerDefinition
-
getEphemeralStorageSize
The size for ephemeral storage.- Specified by:
getEphemeralStorageSizein interfaceIEcsFargateContainerDefinition
-
getFargateCpuArchitecture
The vCPU architecture of Fargate Runtime.- Specified by:
getFargateCpuArchitecturein interfaceIEcsFargateContainerDefinition
-
getFargateOperatingSystemFamily
The operating system for the compute environment.- Specified by:
getFargateOperatingSystemFamilyin interfaceIEcsFargateContainerDefinition
-
getFargatePlatformVersion
Which version of Fargate to use when running this container.- Specified by:
getFargatePlatformVersionin interfaceIEcsFargateContainerDefinition
-
getJobRole
The role that the container can assume.- Specified by:
getJobRolein interfaceIEcsContainerDefinition- See Also:
-
getLinuxParameters
Linux-specific modifications that are applied to the container, such as details for device mappings.- Specified by:
getLinuxParametersin interfaceIEcsContainerDefinition
-
getLogDriverConfig
The configuration of the log driver.- Specified by:
getLogDriverConfigin interfaceIEcsContainerDefinition
-
getReadonlyRootFilesystem
Gives the container readonly access to its root filesystem.- Specified by:
getReadonlyRootFilesystemin 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:
getSecretsin interfaceIEcsContainerDefinition- See Also:
-
getUser
The user name to use inside the container.- Specified by:
getUserin interfaceIEcsContainerDefinition
-