Interface EcsContainerDefinitionProps
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Subinterfaces:
EcsEc2ContainerDefinitionProps
,EcsFargateContainerDefinitionProps
- All Known Implementing Classes:
EcsContainerDefinitionProps.Jsii$Proxy
,EcsEc2ContainerDefinitionProps.Jsii$Proxy
,EcsFargateContainerDefinitionProps.Jsii$Proxy
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.*; import software.amazon.awscdk.services.batch.*; import software.amazon.awscdk.services.ecs.*; import software.amazon.awscdk.services.iam.*; ContainerImage containerImage; EcsVolume ecsVolume; LinuxParameters linuxParameters; LogDriver logDriver; Role role; Secret secret; Size size; EcsContainerDefinitionProps ecsContainerDefinitionProps = EcsContainerDefinitionProps.builder() .cpu(123) .image(containerImage) .memory(size) // the properties below are optional .command(List.of("command")) .environment(Map.of( "environmentKey", "environment")) .executionRole(role) .jobRole(role) .linuxParameters(linuxParameters) .logging(logDriver) .readonlyRootFilesystem(false) .secrets(Map.of( "secretsKey", secret)) .user("user") .volumes(List.of(ecsVolume)) .build();
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forEcsContainerDefinitionProps
static final class
An implementation forEcsContainerDefinitionProps
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
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.default IRole
The role used by Amazon ECS container and AWS Fargate agents to make AWS API calls on your behalf.getImage()
The image that this container will run.default IRole
The role that the container can assume.default LinuxParameters
Linux-specific modifications that are applied to the container, such as details for device mappings.default LogDriver
The loging configuration for this Job.The memory hard limit present to the container.default Boolean
Gives the container readonly access to its root filesystem.A map from environment variable names to the secrets for the container.default String
getUser()
The user name to use inside the container.The volumes to mount to this container.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
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.
-
getImage
The image that this container will run. -
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.
-
getCommand
The command that's passed to the container.Default: - no command
- 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.Default: - no environment variables
-
getExecutionRole
The role used by Amazon ECS container and AWS Fargate agents to make AWS API calls on your behalf.Default: - a Role will be created
- See Also:
-
getJobRole
The role that the container can assume.Default: - no job role
- See Also:
-
getLinuxParameters
Linux-specific modifications that are applied to the container, such as details for device mappings.Default: none
-
getLogging
The loging configuration for this Job.Default: - the log configuration of the Docker daemon
-
getReadonlyRootFilesystem
Gives the container readonly access to its root filesystem.Default: false
-
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.
Default: - no secrets
- See Also:
-
getUser
The user name to use inside the container.Default: - no user
-
getVolumes
The volumes to mount to this container.Automatically added to the job definition.
Default: - no volumes
-
builder
-