Class EcsFargateContainerDefinition.Builder

java.lang.Object
software.amazon.awscdk.services.batch.EcsFargateContainerDefinition.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<EcsFargateContainerDefinition>
Enclosing class:
EcsFargateContainerDefinition

@Stability(Stable) public static final class EcsFargateContainerDefinition.Builder extends Object implements software.amazon.jsii.Builder<EcsFargateContainerDefinition>
A fluent builder for EcsFargateContainerDefinition.
  • Method Details

    • create

      @Stability(Stable) public static EcsFargateContainerDefinition.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of EcsFargateContainerDefinition.Builder.
    • cpu

      @Stability(Stable) public EcsFargateContainerDefinition.Builder cpu(Number cpu)
      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.

      Parameters:
      cpu - The number of vCPUs reserved for the container. This parameter is required.
      Returns:
      this
    • image

      @Stability(Stable) public EcsFargateContainerDefinition.Builder image(ContainerImage image)
      The image that this container will run.

      Parameters:
      image - The image that this container will run. This parameter is required.
      Returns:
      this
    • memory

      @Stability(Stable) public EcsFargateContainerDefinition.Builder memory(Size memory)
      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.

      Parameters:
      memory - The memory hard limit present to the container. This parameter is required.
      Returns:
      this
    • command

      @Stability(Stable) public EcsFargateContainerDefinition.Builder command(List<String> command)
      The command that's passed to the container.

      Default: - no command

      Parameters:
      command - The command that's passed to the container. This parameter is required.
      Returns:
      this
      See Also:
    • environment

      @Stability(Stable) public EcsFargateContainerDefinition.Builder environment(Map<String,String> environment)
      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

      Parameters:
      environment - The environment variables to pass to a container. This parameter is required.
      Returns:
      this
    • executionRole

      @Stability(Stable) public EcsFargateContainerDefinition.Builder executionRole(IRole executionRole)
      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

      Parameters:
      executionRole - The role used by Amazon ECS container and AWS Fargate agents to make AWS API calls on your behalf. This parameter is required.
      Returns:
      this
      See Also:
    • jobRole

      @Stability(Stable) public EcsFargateContainerDefinition.Builder jobRole(IRole jobRole)
      The role that the container can assume.

      Default: - no job role

      Parameters:
      jobRole - The role that the container can assume. This parameter is required.
      Returns:
      this
      See Also:
    • linuxParameters

      @Stability(Stable) public EcsFargateContainerDefinition.Builder linuxParameters(LinuxParameters linuxParameters)
      Linux-specific modifications that are applied to the container, such as details for device mappings.

      Default: none

      Parameters:
      linuxParameters - Linux-specific modifications that are applied to the container, such as details for device mappings. This parameter is required.
      Returns:
      this
    • logging

      @Stability(Stable) public EcsFargateContainerDefinition.Builder logging(LogDriver logging)
      The loging configuration for this Job.

      Default: - the log configuration of the Docker daemon

      Parameters:
      logging - The loging configuration for this Job. This parameter is required.
      Returns:
      this
    • readonlyRootFilesystem

      @Stability(Stable) public EcsFargateContainerDefinition.Builder readonlyRootFilesystem(Boolean readonlyRootFilesystem)
      Gives the container readonly access to its root filesystem.

      Default: false

      Parameters:
      readonlyRootFilesystem - Gives the container readonly access to its root filesystem. This parameter is required.
      Returns:
      this
    • secrets

      @Stability(Stable) public EcsFargateContainerDefinition.Builder secrets(Map<String,? extends Secret> secrets)
      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

      Parameters:
      secrets - A map from environment variable names to the secrets for the container. This parameter is required.
      Returns:
      this
      See Also:
    • user

      @Stability(Stable) public EcsFargateContainerDefinition.Builder user(String user)
      The user name to use inside the container.

      Default: - no user

      Parameters:
      user - The user name to use inside the container. This parameter is required.
      Returns:
      this
    • volumes

      @Stability(Stable) public EcsFargateContainerDefinition.Builder volumes(List<? extends EcsVolume> volumes)
      The volumes to mount to this container.

      Automatically added to the job definition.

      Default: - no volumes

      Parameters:
      volumes - The volumes to mount to this container. This parameter is required.
      Returns:
      this
    • assignPublicIp

      @Stability(Stable) public EcsFargateContainerDefinition.Builder assignPublicIp(Boolean assignPublicIp)
      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.

      Default: false

      Parameters:
      assignPublicIp - Indicates whether the job has a public IP address. This parameter is required.
      Returns:
      this
      See Also:
    • ephemeralStorageSize

      @Stability(Stable) public EcsFargateContainerDefinition.Builder ephemeralStorageSize(Size ephemeralStorageSize)
      The size for ephemeral storage.

      Default: - 20 GiB

      Parameters:
      ephemeralStorageSize - The size for ephemeral storage. This parameter is required.
      Returns:
      this
    • fargateCpuArchitecture

      @Stability(Stable) public EcsFargateContainerDefinition.Builder fargateCpuArchitecture(CpuArchitecture fargateCpuArchitecture)
      The vCPU architecture of Fargate Runtime.

      Default: - X86_64

      Parameters:
      fargateCpuArchitecture - The vCPU architecture of Fargate Runtime. This parameter is required.
      Returns:
      this
    • fargateOperatingSystemFamily

      @Stability(Stable) public EcsFargateContainerDefinition.Builder fargateOperatingSystemFamily(OperatingSystemFamily fargateOperatingSystemFamily)
      The operating system for the compute environment.

      Default: - LINUX

      Parameters:
      fargateOperatingSystemFamily - The operating system for the compute environment. This parameter is required.
      Returns:
      this
    • fargatePlatformVersion

      @Stability(Stable) public EcsFargateContainerDefinition.Builder fargatePlatformVersion(FargatePlatformVersion fargatePlatformVersion)
      Which version of Fargate to use when running this container.

      Default: LATEST

      Parameters:
      fargatePlatformVersion - Which version of Fargate to use when running this container. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public EcsFargateContainerDefinition build()
      Specified by:
      build in interface software.amazon.jsii.Builder<EcsFargateContainerDefinition>
      Returns:
      a newly built instance of EcsFargateContainerDefinition.