Class ScheduledEc2TaskImageOptions.Builder
java.lang.Object
software.amazon.awscdk.services.ecs.patterns.ScheduledEc2TaskImageOptions.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<ScheduledEc2TaskImageOptions>
- Enclosing interface:
- ScheduledEc2TaskImageOptions
@Stability(Stable)
public static final class ScheduledEc2TaskImageOptions.Builder
extends Object
implements software.amazon.jsii.Builder<ScheduledEc2TaskImageOptions>
A builder for
ScheduledEc2TaskImageOptions
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.Sets the value ofScheduledTaskImageProps.getCommand()
containerName
(String containerName) Sets the value ofScheduledTaskImageProps.getContainerName()
Sets the value ofScheduledEc2TaskImageOptions.getCpu()
environment
(Map<String, String> environment) Sets the value ofScheduledTaskImageProps.getEnvironment()
image
(ContainerImage image) Sets the value ofScheduledTaskImageProps.getImage()
Sets the value ofScheduledTaskImageProps.getLogDriver()
memoryLimitMiB
(Number memoryLimitMiB) Sets the value ofScheduledEc2TaskImageOptions.getMemoryLimitMiB()
memoryReservationMiB
(Number memoryReservationMiB) Sets the value ofScheduledEc2TaskImageOptions.getMemoryReservationMiB()
Sets the value ofScheduledTaskImageProps.getSecrets()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
cpu
Sets the value ofScheduledEc2TaskImageOptions.getCpu()
- Parameters:
cpu
- The minimum number of CPU units to reserve for the container.- Returns:
this
-
memoryLimitMiB
@Stability(Stable) public ScheduledEc2TaskImageOptions.Builder memoryLimitMiB(Number memoryLimitMiB) Sets the value ofScheduledEc2TaskImageOptions.getMemoryLimitMiB()
- Parameters:
memoryLimitMiB
- The hard limit (in MiB) of memory to present to the container. 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.
- Returns:
this
-
memoryReservationMiB
@Stability(Stable) public ScheduledEc2TaskImageOptions.Builder memoryReservationMiB(Number memoryReservationMiB) Sets the value ofScheduledEc2TaskImageOptions.getMemoryReservationMiB()
- Parameters:
memoryReservationMiB
- The soft limit (in MiB) of memory to reserve for the container. When system memory is under contention, Docker attempts to keep the container memory within the limit. If the container requires more memory, it can consume up to the value specified by the Memory property 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.
- Returns:
this
-
image
Sets the value ofScheduledTaskImageProps.getImage()
- Parameters:
image
- The image used to start a container. This parameter is required. Image or taskDefinition must be specified, but not both.- Returns:
this
-
command
Sets the value ofScheduledTaskImageProps.getCommand()
- Parameters:
command
- The command that is passed to the container. If you provide a shell command as a single string, you have to quote command-line arguments.- Returns:
this
-
containerName
Sets the value ofScheduledTaskImageProps.getContainerName()
- Parameters:
containerName
- Optional name for the container added.- Returns:
this
-
environment
@Stability(Stable) public ScheduledEc2TaskImageOptions.Builder environment(Map<String, String> environment) Sets the value ofScheduledTaskImageProps.getEnvironment()
- Parameters:
environment
- The environment variables to pass to the container.- Returns:
this
-
logDriver
Sets the value ofScheduledTaskImageProps.getLogDriver()
- Parameters:
logDriver
- The log driver to use.- Returns:
this
-
secrets
@Stability(Stable) public ScheduledEc2TaskImageOptions.Builder secrets(Map<String, ? extends Secret> secrets) Sets the value ofScheduledTaskImageProps.getSecrets()
- Parameters:
secrets
- The secret to expose to the container as an environment variable.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<ScheduledEc2TaskImageOptions>
- Returns:
- a new instance of
ScheduledEc2TaskImageOptions
- Throws:
NullPointerException
- if any required attribute was not provided
-