All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awscdk.services.ecs.ContainerDefinitionOptions Maven / Gradle / Ivy

There is a newer version: 1.204.0
Show newest version
package software.amazon.awscdk.services.ecs;

/**
 * Example:
 * 

*

 * TaskDefinition taskDefinition;
 * Cluster cluster;
 * // Add a container to the task definition
 * ContainerDefinition specificContainer = taskDefinition.addContainer("Container", ContainerDefinitionOptions.builder()
 *         .image(ContainerImage.fromRegistry("/aws/aws-example-app"))
 *         .memoryLimitMiB(2048)
 *         .build());
 * // Add a port mapping
 * specificContainer.addPortMappings(PortMapping.builder()
 *         .containerPort(7600)
 *         .protocol(Protocol.TCP)
 *         .build());
 * Ec2Service.Builder.create(this, "Service")
 *         .cluster(cluster)
 *         .taskDefinition(taskDefinition)
 *         .cloudMapOptions(CloudMapOptions.builder()
 *                 // Create SRV records - useful for bridge networking
 *                 .dnsRecordType(DnsRecordType.SRV)
 *                 // Targets port TCP port 7600 `specificContainer`
 *                 .container(specificContainer)
 *                 .containerPort(7600)
 *                 .build())
 *         .build();
 * 
*/ @javax.annotation.Generated(value = "jsii-pacmak/1.52.1 (build 5ccc8f6)", date = "2022-01-20T19:50:05.530Z") @software.amazon.jsii.Jsii(module = software.amazon.awscdk.services.ecs.$Module.class, fqn = "@aws-cdk/aws-ecs.ContainerDefinitionOptions") @software.amazon.jsii.Jsii.Proxy(ContainerDefinitionOptions.Jsii$Proxy.class) @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public interface ContainerDefinitionOptions extends software.amazon.jsii.JsiiSerializable { /** * The image used to start a container. *

* 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 */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @org.jetbrains.annotations.NotNull software.amazon.awscdk.services.ecs.ContainerImage getImage(); /** * 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. *

* Default: - CMD value built into container image. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable java.util.List getCommand() { return null; } /** * The name of the container. *

* Default: - id of node associated with ContainerDefinition. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable java.lang.String getContainerName() { return null; } /** * The minimum number of CPU units to reserve for the container. *

* Default: - No minimum CPU units reserved. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable java.lang.Number getCpu() { return null; } /** * Specifies whether networking is disabled within the container. *

* When this parameter is true, networking is disabled within the container. *

* Default: false */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable java.lang.Boolean getDisableNetworking() { return null; } /** * A list of DNS search domains that are presented to the container. *

* Default: - No search domains. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable java.util.List getDnsSearchDomains() { return null; } /** * A list of DNS servers that are presented to the container. *

* Default: - Default DNS servers. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable java.util.List getDnsServers() { return null; } /** * A key/value map of labels to add to the container. *

* Default: - No labels. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable java.util.Map getDockerLabels() { return null; } /** * A list of strings to provide custom labels for SELinux and AppArmor multi-level security systems. *

* Default: - No security labels. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable java.util.List getDockerSecurityOptions() { return null; } /** * The ENTRYPOINT value to pass to the container. *

* Default: - Entry point configured in container. *

* @see https://docs.docker.com/engine/reference/builder/#entrypoint */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable java.util.List getEntryPoint() { return null; } /** * The environment variables to pass to the container. *

* Default: - No environment variables. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable java.util.Map getEnvironment() { return null; } /** * The environment files to pass to the container. *

* Default: - No environment files. *

* @see https://docs.aws.amazon.com/AmazonECS/latest/developerguide/taskdef-envfiles.html */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable java.util.List getEnvironmentFiles() { return null; } /** * Specifies whether the container is marked 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 */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable java.lang.Boolean getEssential() { return null; } /** * A list of hostnames and IP address mappings to append to the /etc/hosts file on the container. *

* Default: - No extra hosts. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable java.util.Map getExtraHosts() { return null; } /** * The number of GPUs assigned to the container. *

* Default: - No GPUs assigned. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable java.lang.Number getGpuCount() { return null; } /** * The health check command and associated configuration parameters for the container. *

* Default: - Health check configuration from container. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.ecs.HealthCheck getHealthCheck() { return null; } /** * The hostname to use for your container. *

* Default: - Automatic hostname. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable java.lang.String getHostname() { return null; } /** * The inference accelerators referenced by the container. *

* Default: - No inference accelerators assigned. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable java.util.List getInferenceAcceleratorResources() { return null; } /** * Linux-specific modifications that are applied to the container, such as Linux kernel capabilities. *

* For more information see KernelCapabilities. *

* Default: - No Linux parameters. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.ecs.LinuxParameters getLinuxParameters() { return null; } /** * The log configuration specification for the container. *

* Default: - Containers use the same logging driver that the Docker daemon uses. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable software.amazon.awscdk.services.ecs.LogDriver getLogging() { return null; } /** * The amount (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. *

* Default: - No memory limit. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable java.lang.Number getMemoryLimitMiB() { return null; } /** * The soft limit (in MiB) of memory to reserve for the container. *

* 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. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable java.lang.Number getMemoryReservationMiB() { return null; } /** * The port mappings to add to the container definition. *

* Default: - No ports are mapped. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable java.util.List getPortMappings() { return null; } /** * Specifies whether the container is marked as privileged. *

* When this parameter is true, the container is given elevated privileges on the host container instance (similar to the root user). *

* Default: false */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable java.lang.Boolean getPrivileged() { return null; } /** * When this parameter is true, the container is given read-only access to its root file system. *

* Default: false */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable java.lang.Boolean getReadonlyRootFilesystem() { return null; } /** * The secret environment variables to pass to the container. *

* Default: - No secret environment variables. */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable java.util.Map getSecrets() { return null; } /** * Time duration (in seconds) to wait before giving up on resolving dependencies for a container. *

* Default: - none */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable software.amazon.awscdk.core.Duration getStartTimeout() { return null; } /** * Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own. *

* Default: - none */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable software.amazon.awscdk.core.Duration getStopTimeout() { return null; } /** * A list of namespaced kernel parameters to set in the container. *

* Default: - No system controls are set. *

* @see https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_systemcontrols */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable java.util.List getSystemControls() { return null; } /** * The user name to use inside the container. *

* Default: root */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable java.lang.String getUser() { return null; } /** * The working directory in which to run commands inside the container. *

* Default: / */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) default @org.jetbrains.annotations.Nullable java.lang.String getWorkingDirectory() { return null; } /** * @return a {@link Builder} of {@link ContainerDefinitionOptions} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) static Builder builder() { return new Builder(); } /** * A builder for {@link ContainerDefinitionOptions} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public static final class Builder implements software.amazon.jsii.Builder { software.amazon.awscdk.services.ecs.ContainerImage image; java.util.List command; java.lang.String containerName; java.lang.Number cpu; java.lang.Boolean disableNetworking; java.util.List dnsSearchDomains; java.util.List dnsServers; java.util.Map dockerLabels; java.util.List dockerSecurityOptions; java.util.List entryPoint; java.util.Map environment; java.util.List environmentFiles; java.lang.Boolean essential; java.util.Map extraHosts; java.lang.Number gpuCount; software.amazon.awscdk.services.ecs.HealthCheck healthCheck; java.lang.String hostname; java.util.List inferenceAcceleratorResources; software.amazon.awscdk.services.ecs.LinuxParameters linuxParameters; software.amazon.awscdk.services.ecs.LogDriver logging; java.lang.Number memoryLimitMiB; java.lang.Number memoryReservationMiB; java.util.List portMappings; java.lang.Boolean privileged; java.lang.Boolean readonlyRootFilesystem; java.util.Map secrets; software.amazon.awscdk.core.Duration startTimeout; software.amazon.awscdk.core.Duration stopTimeout; java.util.List systemControls; java.lang.String user; java.lang.String workingDirectory; /** * Sets the value of {@link ContainerDefinitionOptions#getImage} * @param image The image used to start a container. This parameter is required. * 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 * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder image(software.amazon.awscdk.services.ecs.ContainerImage image) { this.image = image; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getCommand} * @param 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. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder command(java.util.List command) { this.command = command; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getContainerName} * @param containerName The name of the container. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder containerName(java.lang.String containerName) { this.containerName = containerName; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getCpu} * @param cpu The minimum number of CPU units to reserve for the container. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder cpu(java.lang.Number cpu) { this.cpu = cpu; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getDisableNetworking} * @param disableNetworking Specifies whether networking is disabled within the container. * When this parameter is true, networking is disabled within the container. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder disableNetworking(java.lang.Boolean disableNetworking) { this.disableNetworking = disableNetworking; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getDnsSearchDomains} * @param dnsSearchDomains A list of DNS search domains that are presented to the container. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder dnsSearchDomains(java.util.List dnsSearchDomains) { this.dnsSearchDomains = dnsSearchDomains; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getDnsServers} * @param dnsServers A list of DNS servers that are presented to the container. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder dnsServers(java.util.List dnsServers) { this.dnsServers = dnsServers; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getDockerLabels} * @param dockerLabels A key/value map of labels to add to the container. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder dockerLabels(java.util.Map dockerLabels) { this.dockerLabels = dockerLabels; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getDockerSecurityOptions} * @param dockerSecurityOptions A list of strings to provide custom labels for SELinux and AppArmor multi-level security systems. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder dockerSecurityOptions(java.util.List dockerSecurityOptions) { this.dockerSecurityOptions = dockerSecurityOptions; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getEntryPoint} * @param entryPoint The ENTRYPOINT value to pass to the container. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder entryPoint(java.util.List entryPoint) { this.entryPoint = entryPoint; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getEnvironment} * @param environment The environment variables to pass to the container. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder environment(java.util.Map environment) { this.environment = environment; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getEnvironmentFiles} * @param environmentFiles The environment files to pass to the container. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @SuppressWarnings("unchecked") public Builder environmentFiles(java.util.List environmentFiles) { this.environmentFiles = (java.util.List)environmentFiles; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getEssential} * @param essential Specifies whether the container is marked 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. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder essential(java.lang.Boolean essential) { this.essential = essential; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getExtraHosts} * @param extraHosts A list of hostnames and IP address mappings to append to the /etc/hosts file on the container. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder extraHosts(java.util.Map extraHosts) { this.extraHosts = extraHosts; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getGpuCount} * @param gpuCount The number of GPUs assigned to the container. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder gpuCount(java.lang.Number gpuCount) { this.gpuCount = gpuCount; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getHealthCheck} * @param healthCheck The health check command and associated configuration parameters for the container. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder healthCheck(software.amazon.awscdk.services.ecs.HealthCheck healthCheck) { this.healthCheck = healthCheck; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getHostname} * @param hostname The hostname to use for your container. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder hostname(java.lang.String hostname) { this.hostname = hostname; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getInferenceAcceleratorResources} * @param inferenceAcceleratorResources The inference accelerators referenced by the container. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder inferenceAcceleratorResources(java.util.List inferenceAcceleratorResources) { this.inferenceAcceleratorResources = inferenceAcceleratorResources; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getLinuxParameters} * @param linuxParameters Linux-specific modifications that are applied to the container, such as Linux kernel capabilities. * For more information see KernelCapabilities. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder linuxParameters(software.amazon.awscdk.services.ecs.LinuxParameters linuxParameters) { this.linuxParameters = linuxParameters; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getLogging} * @param logging The log configuration specification for the container. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder logging(software.amazon.awscdk.services.ecs.LogDriver logging) { this.logging = logging; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getMemoryLimitMiB} * @param memoryLimitMiB The amount (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. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder memoryLimitMiB(java.lang.Number memoryLimitMiB) { this.memoryLimitMiB = memoryLimitMiB; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getMemoryReservationMiB} * @param memoryReservationMiB The soft limit (in MiB) of memory to reserve for the container. * 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. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder memoryReservationMiB(java.lang.Number memoryReservationMiB) { this.memoryReservationMiB = memoryReservationMiB; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getPortMappings} * @param portMappings The port mappings to add to the container definition. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @SuppressWarnings("unchecked") public Builder portMappings(java.util.List portMappings) { this.portMappings = (java.util.List)portMappings; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getPrivileged} * @param privileged Specifies whether the container is marked as privileged. * When this parameter is true, the container is given elevated privileges on the host container instance (similar to the root user). * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder privileged(java.lang.Boolean privileged) { this.privileged = privileged; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getReadonlyRootFilesystem} * @param readonlyRootFilesystem When this parameter is true, the container is given read-only access to its root file system. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder readonlyRootFilesystem(java.lang.Boolean readonlyRootFilesystem) { this.readonlyRootFilesystem = readonlyRootFilesystem; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getSecrets} * @param secrets The secret environment variables to pass to the container. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @SuppressWarnings("unchecked") public Builder secrets(java.util.Map secrets) { this.secrets = (java.util.Map)secrets; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getStartTimeout} * @param startTimeout Time duration (in seconds) to wait before giving up on resolving dependencies for a container. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder startTimeout(software.amazon.awscdk.core.Duration startTimeout) { this.startTimeout = startTimeout; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getStopTimeout} * @param stopTimeout Time duration (in seconds) to wait before the container is forcefully killed if it doesn't exit normally on its own. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder stopTimeout(software.amazon.awscdk.core.Duration stopTimeout) { this.stopTimeout = stopTimeout; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getSystemControls} * @param systemControls A list of namespaced kernel parameters to set in the container. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @SuppressWarnings("unchecked") public Builder systemControls(java.util.List systemControls) { this.systemControls = (java.util.List)systemControls; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getUser} * @param user The user name to use inside the container. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder user(java.lang.String user) { this.user = user; return this; } /** * Sets the value of {@link ContainerDefinitionOptions#getWorkingDirectory} * @param workingDirectory The working directory in which to run commands inside the container. * @return {@code this} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) public Builder workingDirectory(java.lang.String workingDirectory) { this.workingDirectory = workingDirectory; return this; } /** * Builds the configured instance. * @return a new instance of {@link ContainerDefinitionOptions} * @throws NullPointerException if any required attribute was not provided */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @Override public ContainerDefinitionOptions build() { return new Jsii$Proxy(this); } } /** * An implementation for {@link ContainerDefinitionOptions} */ @software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Stable) @software.amazon.jsii.Internal final class Jsii$Proxy extends software.amazon.jsii.JsiiObject implements ContainerDefinitionOptions { private final software.amazon.awscdk.services.ecs.ContainerImage image; private final java.util.List command; private final java.lang.String containerName; private final java.lang.Number cpu; private final java.lang.Boolean disableNetworking; private final java.util.List dnsSearchDomains; private final java.util.List dnsServers; private final java.util.Map dockerLabels; private final java.util.List dockerSecurityOptions; private final java.util.List entryPoint; private final java.util.Map environment; private final java.util.List environmentFiles; private final java.lang.Boolean essential; private final java.util.Map extraHosts; private final java.lang.Number gpuCount; private final software.amazon.awscdk.services.ecs.HealthCheck healthCheck; private final java.lang.String hostname; private final java.util.List inferenceAcceleratorResources; private final software.amazon.awscdk.services.ecs.LinuxParameters linuxParameters; private final software.amazon.awscdk.services.ecs.LogDriver logging; private final java.lang.Number memoryLimitMiB; private final java.lang.Number memoryReservationMiB; private final java.util.List portMappings; private final java.lang.Boolean privileged; private final java.lang.Boolean readonlyRootFilesystem; private final java.util.Map secrets; private final software.amazon.awscdk.core.Duration startTimeout; private final software.amazon.awscdk.core.Duration stopTimeout; private final java.util.List systemControls; private final java.lang.String user; private final java.lang.String workingDirectory; /** * Constructor that initializes the object based on values retrieved from the JsiiObject. * @param objRef Reference to the JSII managed object. */ protected Jsii$Proxy(final software.amazon.jsii.JsiiObjectRef objRef) { super(objRef); this.image = software.amazon.jsii.Kernel.get(this, "image", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ecs.ContainerImage.class)); this.command = software.amazon.jsii.Kernel.get(this, "command", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class))); this.containerName = software.amazon.jsii.Kernel.get(this, "containerName", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); this.cpu = software.amazon.jsii.Kernel.get(this, "cpu", software.amazon.jsii.NativeType.forClass(java.lang.Number.class)); this.disableNetworking = software.amazon.jsii.Kernel.get(this, "disableNetworking", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class)); this.dnsSearchDomains = software.amazon.jsii.Kernel.get(this, "dnsSearchDomains", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class))); this.dnsServers = software.amazon.jsii.Kernel.get(this, "dnsServers", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class))); this.dockerLabels = software.amazon.jsii.Kernel.get(this, "dockerLabels", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class))); this.dockerSecurityOptions = software.amazon.jsii.Kernel.get(this, "dockerSecurityOptions", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class))); this.entryPoint = software.amazon.jsii.Kernel.get(this, "entryPoint", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class))); this.environment = software.amazon.jsii.Kernel.get(this, "environment", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class))); this.environmentFiles = software.amazon.jsii.Kernel.get(this, "environmentFiles", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ecs.EnvironmentFile.class))); this.essential = software.amazon.jsii.Kernel.get(this, "essential", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class)); this.extraHosts = software.amazon.jsii.Kernel.get(this, "extraHosts", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class))); this.gpuCount = software.amazon.jsii.Kernel.get(this, "gpuCount", software.amazon.jsii.NativeType.forClass(java.lang.Number.class)); this.healthCheck = software.amazon.jsii.Kernel.get(this, "healthCheck", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ecs.HealthCheck.class)); this.hostname = software.amazon.jsii.Kernel.get(this, "hostname", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); this.inferenceAcceleratorResources = software.amazon.jsii.Kernel.get(this, "inferenceAcceleratorResources", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(java.lang.String.class))); this.linuxParameters = software.amazon.jsii.Kernel.get(this, "linuxParameters", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ecs.LinuxParameters.class)); this.logging = software.amazon.jsii.Kernel.get(this, "logging", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ecs.LogDriver.class)); this.memoryLimitMiB = software.amazon.jsii.Kernel.get(this, "memoryLimitMiB", software.amazon.jsii.NativeType.forClass(java.lang.Number.class)); this.memoryReservationMiB = software.amazon.jsii.Kernel.get(this, "memoryReservationMiB", software.amazon.jsii.NativeType.forClass(java.lang.Number.class)); this.portMappings = software.amazon.jsii.Kernel.get(this, "portMappings", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ecs.PortMapping.class))); this.privileged = software.amazon.jsii.Kernel.get(this, "privileged", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class)); this.readonlyRootFilesystem = software.amazon.jsii.Kernel.get(this, "readonlyRootFilesystem", software.amazon.jsii.NativeType.forClass(java.lang.Boolean.class)); this.secrets = software.amazon.jsii.Kernel.get(this, "secrets", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ecs.Secret.class))); this.startTimeout = software.amazon.jsii.Kernel.get(this, "startTimeout", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.core.Duration.class)); this.stopTimeout = software.amazon.jsii.Kernel.get(this, "stopTimeout", software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.core.Duration.class)); this.systemControls = software.amazon.jsii.Kernel.get(this, "systemControls", software.amazon.jsii.NativeType.listOf(software.amazon.jsii.NativeType.forClass(software.amazon.awscdk.services.ecs.SystemControl.class))); this.user = software.amazon.jsii.Kernel.get(this, "user", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); this.workingDirectory = software.amazon.jsii.Kernel.get(this, "workingDirectory", software.amazon.jsii.NativeType.forClass(java.lang.String.class)); } /** * Constructor that initializes the object based on literal property values passed by the {@link Builder}. */ @SuppressWarnings("unchecked") protected Jsii$Proxy(final Builder builder) { super(software.amazon.jsii.JsiiObject.InitializationMode.JSII); this.image = java.util.Objects.requireNonNull(builder.image, "image is required"); this.command = builder.command; this.containerName = builder.containerName; this.cpu = builder.cpu; this.disableNetworking = builder.disableNetworking; this.dnsSearchDomains = builder.dnsSearchDomains; this.dnsServers = builder.dnsServers; this.dockerLabels = builder.dockerLabels; this.dockerSecurityOptions = builder.dockerSecurityOptions; this.entryPoint = builder.entryPoint; this.environment = builder.environment; this.environmentFiles = (java.util.List)builder.environmentFiles; this.essential = builder.essential; this.extraHosts = builder.extraHosts; this.gpuCount = builder.gpuCount; this.healthCheck = builder.healthCheck; this.hostname = builder.hostname; this.inferenceAcceleratorResources = builder.inferenceAcceleratorResources; this.linuxParameters = builder.linuxParameters; this.logging = builder.logging; this.memoryLimitMiB = builder.memoryLimitMiB; this.memoryReservationMiB = builder.memoryReservationMiB; this.portMappings = (java.util.List)builder.portMappings; this.privileged = builder.privileged; this.readonlyRootFilesystem = builder.readonlyRootFilesystem; this.secrets = (java.util.Map)builder.secrets; this.startTimeout = builder.startTimeout; this.stopTimeout = builder.stopTimeout; this.systemControls = (java.util.List)builder.systemControls; this.user = builder.user; this.workingDirectory = builder.workingDirectory; } @Override public final software.amazon.awscdk.services.ecs.ContainerImage getImage() { return this.image; } @Override public final java.util.List getCommand() { return this.command; } @Override public final java.lang.String getContainerName() { return this.containerName; } @Override public final java.lang.Number getCpu() { return this.cpu; } @Override public final java.lang.Boolean getDisableNetworking() { return this.disableNetworking; } @Override public final java.util.List getDnsSearchDomains() { return this.dnsSearchDomains; } @Override public final java.util.List getDnsServers() { return this.dnsServers; } @Override public final java.util.Map getDockerLabels() { return this.dockerLabels; } @Override public final java.util.List getDockerSecurityOptions() { return this.dockerSecurityOptions; } @Override public final java.util.List getEntryPoint() { return this.entryPoint; } @Override public final java.util.Map getEnvironment() { return this.environment; } @Override public final java.util.List getEnvironmentFiles() { return this.environmentFiles; } @Override public final java.lang.Boolean getEssential() { return this.essential; } @Override public final java.util.Map getExtraHosts() { return this.extraHosts; } @Override public final java.lang.Number getGpuCount() { return this.gpuCount; } @Override public final software.amazon.awscdk.services.ecs.HealthCheck getHealthCheck() { return this.healthCheck; } @Override public final java.lang.String getHostname() { return this.hostname; } @Override public final java.util.List getInferenceAcceleratorResources() { return this.inferenceAcceleratorResources; } @Override public final software.amazon.awscdk.services.ecs.LinuxParameters getLinuxParameters() { return this.linuxParameters; } @Override public final software.amazon.awscdk.services.ecs.LogDriver getLogging() { return this.logging; } @Override public final java.lang.Number getMemoryLimitMiB() { return this.memoryLimitMiB; } @Override public final java.lang.Number getMemoryReservationMiB() { return this.memoryReservationMiB; } @Override public final java.util.List getPortMappings() { return this.portMappings; } @Override public final java.lang.Boolean getPrivileged() { return this.privileged; } @Override public final java.lang.Boolean getReadonlyRootFilesystem() { return this.readonlyRootFilesystem; } @Override public final java.util.Map getSecrets() { return this.secrets; } @Override public final software.amazon.awscdk.core.Duration getStartTimeout() { return this.startTimeout; } @Override public final software.amazon.awscdk.core.Duration getStopTimeout() { return this.stopTimeout; } @Override public final java.util.List getSystemControls() { return this.systemControls; } @Override public final java.lang.String getUser() { return this.user; } @Override public final java.lang.String getWorkingDirectory() { return this.workingDirectory; } @Override @software.amazon.jsii.Internal public com.fasterxml.jackson.databind.JsonNode $jsii$toJson() { final com.fasterxml.jackson.databind.ObjectMapper om = software.amazon.jsii.JsiiObjectMapper.INSTANCE; final com.fasterxml.jackson.databind.node.ObjectNode data = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); data.set("image", om.valueToTree(this.getImage())); if (this.getCommand() != null) { data.set("command", om.valueToTree(this.getCommand())); } if (this.getContainerName() != null) { data.set("containerName", om.valueToTree(this.getContainerName())); } if (this.getCpu() != null) { data.set("cpu", om.valueToTree(this.getCpu())); } if (this.getDisableNetworking() != null) { data.set("disableNetworking", om.valueToTree(this.getDisableNetworking())); } if (this.getDnsSearchDomains() != null) { data.set("dnsSearchDomains", om.valueToTree(this.getDnsSearchDomains())); } if (this.getDnsServers() != null) { data.set("dnsServers", om.valueToTree(this.getDnsServers())); } if (this.getDockerLabels() != null) { data.set("dockerLabels", om.valueToTree(this.getDockerLabels())); } if (this.getDockerSecurityOptions() != null) { data.set("dockerSecurityOptions", om.valueToTree(this.getDockerSecurityOptions())); } if (this.getEntryPoint() != null) { data.set("entryPoint", om.valueToTree(this.getEntryPoint())); } if (this.getEnvironment() != null) { data.set("environment", om.valueToTree(this.getEnvironment())); } if (this.getEnvironmentFiles() != null) { data.set("environmentFiles", om.valueToTree(this.getEnvironmentFiles())); } if (this.getEssential() != null) { data.set("essential", om.valueToTree(this.getEssential())); } if (this.getExtraHosts() != null) { data.set("extraHosts", om.valueToTree(this.getExtraHosts())); } if (this.getGpuCount() != null) { data.set("gpuCount", om.valueToTree(this.getGpuCount())); } if (this.getHealthCheck() != null) { data.set("healthCheck", om.valueToTree(this.getHealthCheck())); } if (this.getHostname() != null) { data.set("hostname", om.valueToTree(this.getHostname())); } if (this.getInferenceAcceleratorResources() != null) { data.set("inferenceAcceleratorResources", om.valueToTree(this.getInferenceAcceleratorResources())); } if (this.getLinuxParameters() != null) { data.set("linuxParameters", om.valueToTree(this.getLinuxParameters())); } if (this.getLogging() != null) { data.set("logging", om.valueToTree(this.getLogging())); } if (this.getMemoryLimitMiB() != null) { data.set("memoryLimitMiB", om.valueToTree(this.getMemoryLimitMiB())); } if (this.getMemoryReservationMiB() != null) { data.set("memoryReservationMiB", om.valueToTree(this.getMemoryReservationMiB())); } if (this.getPortMappings() != null) { data.set("portMappings", om.valueToTree(this.getPortMappings())); } if (this.getPrivileged() != null) { data.set("privileged", om.valueToTree(this.getPrivileged())); } if (this.getReadonlyRootFilesystem() != null) { data.set("readonlyRootFilesystem", om.valueToTree(this.getReadonlyRootFilesystem())); } if (this.getSecrets() != null) { data.set("secrets", om.valueToTree(this.getSecrets())); } if (this.getStartTimeout() != null) { data.set("startTimeout", om.valueToTree(this.getStartTimeout())); } if (this.getStopTimeout() != null) { data.set("stopTimeout", om.valueToTree(this.getStopTimeout())); } if (this.getSystemControls() != null) { data.set("systemControls", om.valueToTree(this.getSystemControls())); } if (this.getUser() != null) { data.set("user", om.valueToTree(this.getUser())); } if (this.getWorkingDirectory() != null) { data.set("workingDirectory", om.valueToTree(this.getWorkingDirectory())); } final com.fasterxml.jackson.databind.node.ObjectNode struct = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); struct.set("fqn", om.valueToTree("@aws-cdk/aws-ecs.ContainerDefinitionOptions")); struct.set("data", data); final com.fasterxml.jackson.databind.node.ObjectNode obj = com.fasterxml.jackson.databind.node.JsonNodeFactory.instance.objectNode(); obj.set("$jsii.struct", struct); return obj; } @Override public final boolean equals(final Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ContainerDefinitionOptions.Jsii$Proxy that = (ContainerDefinitionOptions.Jsii$Proxy) o; if (!image.equals(that.image)) return false; if (this.command != null ? !this.command.equals(that.command) : that.command != null) return false; if (this.containerName != null ? !this.containerName.equals(that.containerName) : that.containerName != null) return false; if (this.cpu != null ? !this.cpu.equals(that.cpu) : that.cpu != null) return false; if (this.disableNetworking != null ? !this.disableNetworking.equals(that.disableNetworking) : that.disableNetworking != null) return false; if (this.dnsSearchDomains != null ? !this.dnsSearchDomains.equals(that.dnsSearchDomains) : that.dnsSearchDomains != null) return false; if (this.dnsServers != null ? !this.dnsServers.equals(that.dnsServers) : that.dnsServers != null) return false; if (this.dockerLabels != null ? !this.dockerLabels.equals(that.dockerLabels) : that.dockerLabels != null) return false; if (this.dockerSecurityOptions != null ? !this.dockerSecurityOptions.equals(that.dockerSecurityOptions) : that.dockerSecurityOptions != null) return false; if (this.entryPoint != null ? !this.entryPoint.equals(that.entryPoint) : that.entryPoint != null) return false; if (this.environment != null ? !this.environment.equals(that.environment) : that.environment != null) return false; if (this.environmentFiles != null ? !this.environmentFiles.equals(that.environmentFiles) : that.environmentFiles != null) return false; if (this.essential != null ? !this.essential.equals(that.essential) : that.essential != null) return false; if (this.extraHosts != null ? !this.extraHosts.equals(that.extraHosts) : that.extraHosts != null) return false; if (this.gpuCount != null ? !this.gpuCount.equals(that.gpuCount) : that.gpuCount != null) return false; if (this.healthCheck != null ? !this.healthCheck.equals(that.healthCheck) : that.healthCheck != null) return false; if (this.hostname != null ? !this.hostname.equals(that.hostname) : that.hostname != null) return false; if (this.inferenceAcceleratorResources != null ? !this.inferenceAcceleratorResources.equals(that.inferenceAcceleratorResources) : that.inferenceAcceleratorResources != null) return false; if (this.linuxParameters != null ? !this.linuxParameters.equals(that.linuxParameters) : that.linuxParameters != null) return false; if (this.logging != null ? !this.logging.equals(that.logging) : that.logging != null) return false; if (this.memoryLimitMiB != null ? !this.memoryLimitMiB.equals(that.memoryLimitMiB) : that.memoryLimitMiB != null) return false; if (this.memoryReservationMiB != null ? !this.memoryReservationMiB.equals(that.memoryReservationMiB) : that.memoryReservationMiB != null) return false; if (this.portMappings != null ? !this.portMappings.equals(that.portMappings) : that.portMappings != null) return false; if (this.privileged != null ? !this.privileged.equals(that.privileged) : that.privileged != null) return false; if (this.readonlyRootFilesystem != null ? !this.readonlyRootFilesystem.equals(that.readonlyRootFilesystem) : that.readonlyRootFilesystem != null) return false; if (this.secrets != null ? !this.secrets.equals(that.secrets) : that.secrets != null) return false; if (this.startTimeout != null ? !this.startTimeout.equals(that.startTimeout) : that.startTimeout != null) return false; if (this.stopTimeout != null ? !this.stopTimeout.equals(that.stopTimeout) : that.stopTimeout != null) return false; if (this.systemControls != null ? !this.systemControls.equals(that.systemControls) : that.systemControls != null) return false; if (this.user != null ? !this.user.equals(that.user) : that.user != null) return false; return this.workingDirectory != null ? this.workingDirectory.equals(that.workingDirectory) : that.workingDirectory == null; } @Override public final int hashCode() { int result = this.image.hashCode(); result = 31 * result + (this.command != null ? this.command.hashCode() : 0); result = 31 * result + (this.containerName != null ? this.containerName.hashCode() : 0); result = 31 * result + (this.cpu != null ? this.cpu.hashCode() : 0); result = 31 * result + (this.disableNetworking != null ? this.disableNetworking.hashCode() : 0); result = 31 * result + (this.dnsSearchDomains != null ? this.dnsSearchDomains.hashCode() : 0); result = 31 * result + (this.dnsServers != null ? this.dnsServers.hashCode() : 0); result = 31 * result + (this.dockerLabels != null ? this.dockerLabels.hashCode() : 0); result = 31 * result + (this.dockerSecurityOptions != null ? this.dockerSecurityOptions.hashCode() : 0); result = 31 * result + (this.entryPoint != null ? this.entryPoint.hashCode() : 0); result = 31 * result + (this.environment != null ? this.environment.hashCode() : 0); result = 31 * result + (this.environmentFiles != null ? this.environmentFiles.hashCode() : 0); result = 31 * result + (this.essential != null ? this.essential.hashCode() : 0); result = 31 * result + (this.extraHosts != null ? this.extraHosts.hashCode() : 0); result = 31 * result + (this.gpuCount != null ? this.gpuCount.hashCode() : 0); result = 31 * result + (this.healthCheck != null ? this.healthCheck.hashCode() : 0); result = 31 * result + (this.hostname != null ? this.hostname.hashCode() : 0); result = 31 * result + (this.inferenceAcceleratorResources != null ? this.inferenceAcceleratorResources.hashCode() : 0); result = 31 * result + (this.linuxParameters != null ? this.linuxParameters.hashCode() : 0); result = 31 * result + (this.logging != null ? this.logging.hashCode() : 0); result = 31 * result + (this.memoryLimitMiB != null ? this.memoryLimitMiB.hashCode() : 0); result = 31 * result + (this.memoryReservationMiB != null ? this.memoryReservationMiB.hashCode() : 0); result = 31 * result + (this.portMappings != null ? this.portMappings.hashCode() : 0); result = 31 * result + (this.privileged != null ? this.privileged.hashCode() : 0); result = 31 * result + (this.readonlyRootFilesystem != null ? this.readonlyRootFilesystem.hashCode() : 0); result = 31 * result + (this.secrets != null ? this.secrets.hashCode() : 0); result = 31 * result + (this.startTimeout != null ? this.startTimeout.hashCode() : 0); result = 31 * result + (this.stopTimeout != null ? this.stopTimeout.hashCode() : 0); result = 31 * result + (this.systemControls != null ? this.systemControls.hashCode() : 0); result = 31 * result + (this.user != null ? this.user.hashCode() : 0); result = 31 * result + (this.workingDirectory != null ? this.workingDirectory.hashCode() : 0); return result; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy