@Stability(value=Experimental) public static final class ContainerDefinition.Builder extends Object implements software.amazon.jsii.Builder<ContainerDefinition>
ContainerDefinition.| Modifier and Type | Method and Description |
|---|---|
ContainerDefinition |
build() |
ContainerDefinition.Builder |
command(List<String> command)
(experimental) The command that is passed to the container.
|
ContainerDefinition.Builder |
containerName(String containerName)
(experimental) The name of the container.
|
ContainerDefinition.Builder |
cpu(Number cpu)
(experimental) The minimum number of CPU units to reserve for the container.
|
static ContainerDefinition.Builder |
create(software.constructs.Construct scope,
String id) |
ContainerDefinition.Builder |
disableNetworking(Boolean disableNetworking)
(experimental) Specifies whether networking is disabled within the container.
|
ContainerDefinition.Builder |
dnsSearchDomains(List<String> dnsSearchDomains)
(experimental) A list of DNS search domains that are presented to the container.
|
ContainerDefinition.Builder |
dnsServers(List<String> dnsServers)
(experimental) A list of DNS servers that are presented to the container.
|
ContainerDefinition.Builder |
dockerLabels(Map<String,String> dockerLabels)
(experimental) A key/value map of labels to add to the container.
|
ContainerDefinition.Builder |
dockerSecurityOptions(List<String> dockerSecurityOptions)
(experimental) A list of strings to provide custom labels for SELinux and AppArmor multi-level security systems.
|
ContainerDefinition.Builder |
entryPoint(List<String> entryPoint)
(experimental) The ENTRYPOINT value to pass to the container.
|
ContainerDefinition.Builder |
environment(Map<String,String> environment)
(experimental) The environment variables to pass to the container.
|
ContainerDefinition.Builder |
environmentFiles(List<? extends EnvironmentFile> environmentFiles)
(experimental) The environment files to pass to the container.
|
ContainerDefinition.Builder |
essential(Boolean essential)
(experimental) Specifies whether the container is marked essential.
|
ContainerDefinition.Builder |
extraHosts(Map<String,String> extraHosts)
(experimental) A list of hostnames and IP address mappings to append to the /etc/hosts file on the container.
|
ContainerDefinition.Builder |
gpuCount(Number gpuCount)
(experimental) The number of GPUs assigned to the container.
|
ContainerDefinition.Builder |
healthCheck(HealthCheck healthCheck)
(experimental) The health check command and associated configuration parameters for the container.
|
ContainerDefinition.Builder |
hostname(String hostname)
(experimental) The hostname to use for your container.
|
ContainerDefinition.Builder |
image(ContainerImage image)
(experimental) The image used to start a container.
|
ContainerDefinition.Builder |
inferenceAcceleratorResources(List<String> inferenceAcceleratorResources)
(experimental) The inference accelerators referenced by the container.
|
ContainerDefinition.Builder |
linuxParameters(LinuxParameters linuxParameters)
(experimental) Linux-specific modifications that are applied to the container, such as Linux kernel capabilities.
|
ContainerDefinition.Builder |
logging(LogDriver logging)
(experimental) The log configuration specification for the container.
|
ContainerDefinition.Builder |
memoryLimitMiB(Number memoryLimitMiB)
(experimental) The amount (in MiB) of memory to present to the container.
|
ContainerDefinition.Builder |
memoryReservationMiB(Number memoryReservationMiB)
(experimental) The soft limit (in MiB) of memory to reserve for the container.
|
ContainerDefinition.Builder |
portMappings(List<? extends PortMapping> portMappings)
(experimental) The port mappings to add to the container definition.
|
ContainerDefinition.Builder |
privileged(Boolean privileged)
(experimental) Specifies whether the container is marked as privileged.
|
ContainerDefinition.Builder |
readonlyRootFilesystem(Boolean readonlyRootFilesystem)
(experimental) When this parameter is true, the container is given read-only access to its root file system.
|
ContainerDefinition.Builder |
secrets(Map<String,? extends Secret> secrets)
(experimental) The secret environment variables to pass to the container.
|
ContainerDefinition.Builder |
startTimeout(Duration startTimeout)
(experimental) Time duration (in seconds) to wait before giving up on resolving dependencies for a container.
|
ContainerDefinition.Builder |
stopTimeout(Duration stopTimeout)
(experimental) Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own.
|
ContainerDefinition.Builder |
taskDefinition(TaskDefinition taskDefinition)
(experimental) The name of the task definition that includes this container definition.
|
ContainerDefinition.Builder |
user(String user)
(experimental) The user name to use inside the container.
|
ContainerDefinition.Builder |
workingDirectory(String workingDirectory)
(experimental) The working directory in which to run commands inside the container.
|
@Stability(value=Experimental) public static ContainerDefinition.Builder create(software.constructs.Construct scope, String id)
scope - This parameter is required.id - This parameter is required.ContainerDefinition.Builder.@Stability(value=Experimental) public ContainerDefinition.Builder image(ContainerImage image)
This string is passed directly to the Docker daemon. Images in the Docker Hub registry are available by default. Other repositories are specified with either repository-url/image:tag or repository-url/image@digest. TODO: Update these to specify using classes of IContainerImage
image - The image used to start a container. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder command(List<String> command)
If you provide a shell command as a single string, you have to quote command-line arguments.
Default: - CMD value built into container image.
command - The command that is passed to the container. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder containerName(String containerName)
Default: - id of node associated with ContainerDefinition.
containerName - The name of the container. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder cpu(Number cpu)
Default: - No minimum CPU units reserved.
cpu - The minimum number of CPU units to reserve for the container. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder disableNetworking(Boolean disableNetworking)
When this parameter is true, networking is disabled within the container.
Default: false
disableNetworking - Specifies whether networking is disabled within the container. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder dnsSearchDomains(List<String> dnsSearchDomains)
Default: - No search domains.
dnsSearchDomains - A list of DNS search domains that are presented to the container. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder dnsServers(List<String> dnsServers)
Default: - Default DNS servers.
dnsServers - A list of DNS servers that are presented to the container. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder dockerLabels(Map<String,String> dockerLabels)
Default: - No labels.
dockerLabels - A key/value map of labels to add to the container. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder dockerSecurityOptions(List<String> dockerSecurityOptions)
Default: - No security labels.
dockerSecurityOptions - A list of strings to provide custom labels for SELinux and AppArmor multi-level security systems. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder entryPoint(List<String> entryPoint)
Default: - Entry point configured in container.
entryPoint - The ENTRYPOINT value to pass to the container. This parameter is required.thishttps://docs.docker.com/engine/reference/builder/#entrypoint@Stability(value=Experimental) public ContainerDefinition.Builder environment(Map<String,String> environment)
Default: - No environment variables.
environment - The environment variables to pass to the container. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder environmentFiles(List<? extends EnvironmentFile> environmentFiles)
Default: - No environment files.
environmentFiles - The environment files to pass to the container. This parameter is required.thishttps://docs.aws.amazon.com/AmazonECS/latest/developerguide/taskdef-envfiles.html@Stability(value=Experimental) public ContainerDefinition.Builder essential(Boolean essential)
If the essential parameter of a container is marked as true, and that container fails or stops for any reason, all other containers that are part of the task are stopped. If the essential parameter of a container is marked as false, then its failure does not affect the rest of the containers in a task. All tasks must have at least one essential container.
If this parameter is omitted, a container is assumed to be essential.
Default: true
essential - Specifies whether the container is marked essential. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder extraHosts(Map<String,String> extraHosts)
Default: - No extra hosts.
extraHosts - A list of hostnames and IP address mappings to append to the /etc/hosts file on the container. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder gpuCount(Number gpuCount)
Default: - No GPUs assigned.
gpuCount - The number of GPUs assigned to the container. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder healthCheck(HealthCheck healthCheck)
Default: - Health check configuration from container.
healthCheck - The health check command and associated configuration parameters for the container. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder hostname(String hostname)
Default: - Automatic hostname.
hostname - The hostname to use for your container. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder inferenceAcceleratorResources(List<String> inferenceAcceleratorResources)
Default: - No inference accelerators assigned.
inferenceAcceleratorResources - The inference accelerators referenced by the container. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder linuxParameters(LinuxParameters linuxParameters)
For more information see KernelCapabilities.
Default: - No Linux parameters.
linuxParameters - Linux-specific modifications that are applied to the container, such as Linux kernel capabilities. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder logging(LogDriver logging)
Default: - Containers use the same logging driver that the Docker daemon uses.
logging - The log configuration specification for the container. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder memoryLimitMiB(Number memoryLimitMiB)
If your container attempts to exceed the allocated memory, the container is terminated.
At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services.
Default: - No memory limit.
memoryLimitMiB - The amount (in MiB) of memory to present to the container. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder memoryReservationMiB(Number memoryReservationMiB)
When system memory is under heavy contention, Docker attempts to keep the container memory to this soft limit. However, your container can consume more memory when it needs to, up to either the hard limit specified with the memory parameter (if applicable), or all of the available memory on the container instance, whichever comes first.
At least one of memoryLimitMiB and memoryReservationMiB is required for non-Fargate services.
Default: - No memory reserved.
memoryReservationMiB - The soft limit (in MiB) of memory to reserve for the container. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder portMappings(List<? extends PortMapping> portMappings)
Default: - No ports are mapped.
portMappings - The port mappings to add to the container definition. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder privileged(Boolean privileged)
When this parameter is true, the container is given elevated privileges on the host container instance (similar to the root user).
Default: false
privileged - Specifies whether the container is marked as privileged. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder readonlyRootFilesystem(Boolean readonlyRootFilesystem)
Default: false
readonlyRootFilesystem - When this parameter is true, the container is given read-only access to its root file system. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder secrets(Map<String,? extends Secret> secrets)
Default: - No secret environment variables.
secrets - The secret environment variables to pass to the container. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder startTimeout(Duration startTimeout)
Default: - none
startTimeout - Time duration (in seconds) to wait before giving up on resolving dependencies for a container. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder stopTimeout(Duration stopTimeout)
Default: - none
stopTimeout - Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder user(String user)
Default: root
user - The user name to use inside the container. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder workingDirectory(String workingDirectory)
Default: /
workingDirectory - The working directory in which to run commands inside the container. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition.Builder taskDefinition(TaskDefinition taskDefinition)
[disable-awslint:ref-via-interface]
taskDefinition - The name of the task definition that includes this container definition. This parameter is required.this@Stability(value=Experimental) public ContainerDefinition build()
build in interface software.amazon.jsii.Builder<ContainerDefinition>Copyright © 2021. All rights reserved.