Class ContainerDefinitionInput

java.lang.Object
software.amazon.awssdk.services.gamelift.model.ContainerDefinitionInput
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<ContainerDefinitionInput.Builder,ContainerDefinitionInput>

@Generated("software.amazon.awssdk:codegen") public final class ContainerDefinitionInput extends Object implements SdkPojo, Serializable, ToCopyableBuilder<ContainerDefinitionInput.Builder,ContainerDefinitionInput>

This data type is used with the Amazon GameLift containers feature, which is currently in public preview.

Describes a container's configuration, resources, and start instructions. Use this data type to create a container group definition. For the properties of a container that's been deployed to a fleet, see ContainerDefinition. You can't change these properties after you've created the container group definition. If you need a container group with different properties, then you must create a new one.

Used with: CreateContainerGroupDefinition

See Also:
  • Method Details

    • containerName

      public final String containerName()

      A string that uniquely identifies the container definition within a container group.

      Returns:
      A string that uniquely identifies the container definition within a container group.
    • imageUri

      public final String imageUri()

      The location of a container image that $short; will copy and deploy to a container fleet. Images in Amazon Elastic Container Registry private repositories are supported. The repository must be in the same Amazon Web Services account and Amazon Web Services Region where you're creating the container group definition. For limits on image size, see Amazon GameLift endpoints and quotas. You can use any of the following image URI formats:

      • Image ID only: [AWS account].dkr.ecr.[AWS region].amazonaws.com/[repository ID]

      • Image ID and digest: [AWS account].dkr.ecr.[AWS region].amazonaws.com/[repository ID]@[digest]

      • Image ID and tag: [AWS account].dkr.ecr.[AWS region].amazonaws.com/[repository ID]:[tag]

      Returns:
      The location of a container image that $short; will copy and deploy to a container fleet. Images in Amazon Elastic Container Registry private repositories are supported. The repository must be in the same Amazon Web Services account and Amazon Web Services Region where you're creating the container group definition. For limits on image size, see Amazon GameLift endpoints and quotas. You can use any of the following image URI formats:

      • Image ID only: [AWS account].dkr.ecr.[AWS region].amazonaws.com/[repository ID]

      • Image ID and digest: [AWS account].dkr.ecr.[AWS region].amazonaws.com/[repository ID]@[digest]

      • Image ID and tag: [AWS account].dkr.ecr.[AWS region].amazonaws.com/[repository ID]:[tag]

    • memoryLimits

      public final ContainerMemoryLimits memoryLimits()

      The amount of memory to make available to the container. If you don't specify memory limits for this container, then it shares the container group's total memory allocation.

      Related data type: ContainerGroupDefinition$TotalMemoryLimit

      Returns:
      The amount of memory to make available to the container. If you don't specify memory limits for this container, then it shares the container group's total memory allocation.

      Related data type: ContainerGroupDefinition$TotalMemoryLimit

    • portConfiguration

      public final ContainerPortConfiguration portConfiguration()

      A set of ports that Amazon GameLift can assign to processes in the container. All processes that accept inbound traffic connections, including game server processes, must be assigned a port from this set. The set of ports must be large enough to assign one to each process in the container that needs one. If the container includes your game server, include enough ports to assign one port to each concurrent server process (as defined in a container fleet's RuntimeConfiguration). For more details, see Networking for container fleets.

      Container ports aren't directly accessed by inbound traffic. Amazon GameLift maps these container ports to externally accessible connection ports, which are assigned as needed from the container fleet's ConnectionPortRange.

      Returns:
      A set of ports that Amazon GameLift can assign to processes in the container. All processes that accept inbound traffic connections, including game server processes, must be assigned a port from this set. The set of ports must be large enough to assign one to each process in the container that needs one. If the container includes your game server, include enough ports to assign one port to each concurrent server process (as defined in a container fleet's RuntimeConfiguration). For more details, see Networking for container fleets.

      Container ports aren't directly accessed by inbound traffic. Amazon GameLift maps these container ports to externally accessible connection ports, which are assigned as needed from the container fleet's ConnectionPortRange.

    • cpu

      public final Integer cpu()

      The number of CPU units to reserve for this container. The container can use more resources when needed, if available. Note: 1 vCPU unit equals 1024 CPU units. If you don't reserve CPU units for this container, then it shares the total CPU limit for the container group. This property is similar to the Amazon ECS container definition parameter environment (Amazon Elastic Container Service Developer Guide).

      Related data type: ContainerGroupDefinition$TotalCpuLimit

      Returns:
      The number of CPU units to reserve for this container. The container can use more resources when needed, if available. Note: 1 vCPU unit equals 1024 CPU units. If you don't reserve CPU units for this container, then it shares the total CPU limit for the container group. This property is similar to the Amazon ECS container definition parameter environment (Amazon Elastic Container Service Developer Guide).

      Related data type: ContainerGroupDefinition$TotalCpuLimit

    • healthCheck

      public final ContainerHealthCheck healthCheck()

      Configuration for a non-terminal health check. A container automatically restarts if it stops functioning. This parameter lets you define additional reasons to consider a container unhealthy and restart it. You can set a health check for any container except for the essential container in the replica container group. If an essential container in the daemon group fails a health check, the entire container group is restarted.

      Returns:
      Configuration for a non-terminal health check. A container automatically restarts if it stops functioning. This parameter lets you define additional reasons to consider a container unhealthy and restart it. You can set a health check for any container except for the essential container in the replica container group. If an essential container in the daemon group fails a health check, the entire container group is restarted.
    • hasCommand

      public final boolean hasCommand()
      For responses, this returns true if the service returned a value for the Command property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • command

      public final List<String> command()

      A command to pass to the container on startup. Add multiple arguments as additional strings in the array. See the ContainerDefinition command parameter in the Amazon Elastic Container Service API reference.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasCommand() method.

      Returns:
      A command to pass to the container on startup. Add multiple arguments as additional strings in the array. See the ContainerDefinition command parameter in the Amazon Elastic Container Service API reference.
    • essential

      public final Boolean essential()

      Specifies whether the container is vital for the container group to function properly. If an essential container fails, it causes the entire container group to restart. Each container group must have an essential container.

      Replica container groups - A replica group must have exactly one essential container. Use the following to configure an essential replica container:

      • Choose a container is running your game server and the Amazon GameLift Agent.

      • Include a port configuration. This container runs your game server processes, and each process requires a container port to allow access to game clients.

      • Don't configure a health check. The Agent handles this task for the essential replica container.

      Daemon container groups - A daemon group must have at least one essential container.

      Returns:
      Specifies whether the container is vital for the container group to function properly. If an essential container fails, it causes the entire container group to restart. Each container group must have an essential container.

      Replica container groups - A replica group must have exactly one essential container. Use the following to configure an essential replica container:

      • Choose a container is running your game server and the Amazon GameLift Agent.

      • Include a port configuration. This container runs your game server processes, and each process requires a container port to allow access to game clients.

      • Don't configure a health check. The Agent handles this task for the essential replica container.

      Daemon container groups - A daemon group must have at least one essential container.

    • hasEntryPoint

      public final boolean hasEntryPoint()
      For responses, this returns true if the service returned a value for the EntryPoint property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • entryPoint

      public final List<String> entryPoint()

      An entry point to pass to the container on startup. Add multiple arguments as additional strings in the array. See the ContainerDefinition::entryPoint parameter in the Amazon Elastic Container Service API Reference.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasEntryPoint() method.

      Returns:
      An entry point to pass to the container on startup. Add multiple arguments as additional strings in the array. See the ContainerDefinition::entryPoint parameter in the Amazon Elastic Container Service API Reference.
    • workingDirectory

      public final String workingDirectory()

      The directory in the container where commands are run. See the ContainerDefinition::workingDirectory parameter in the Amazon Elastic Container Service API Reference.

      Returns:
      The directory in the container where commands are run. See the ContainerDefinition::workingDirectory parameter in the Amazon Elastic Container Service API Reference.
    • hasEnvironment

      public final boolean hasEnvironment()
      For responses, this returns true if the service returned a value for the Environment property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • environment

      public final List<ContainerEnvironment> environment()

      A set of environment variables to pass to the container on startup. See the ContainerDefinition::environment parameter in the Amazon Elastic Container Service API Reference.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasEnvironment() method.

      Returns:
      A set of environment variables to pass to the container on startup. See the ContainerDefinition::environment parameter in the Amazon Elastic Container Service API Reference.
    • hasDependsOn

      public final boolean hasDependsOn()
      For responses, this returns true if the service returned a value for the DependsOn property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • dependsOn

      public final List<ContainerDependency> dependsOn()

      Sets up dependencies between this container and the status of other containers in the same container group. A container can have dependencies on multiple different containers.

      You can use dependencies to establish a startup/shutdown sequence across the container group. A container startup dependency is reversed on shutdown.

      For example, you might specify that SideCarContainerB has a START dependency on SideCarContainerA. This dependency means that SideCarContainerB can't start until after SideCarContainerA has started. This dependency is reversed on shutdown, which means that SideCarContainerB must shut down before SideCarContainerA can shut down.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasDependsOn() method.

      Returns:
      Sets up dependencies between this container and the status of other containers in the same container group. A container can have dependencies on multiple different containers.

      You can use dependencies to establish a startup/shutdown sequence across the container group. A container startup dependency is reversed on shutdown.

      For example, you might specify that SideCarContainerB has a START dependency on SideCarContainerA. This dependency means that SideCarContainerB can't start until after SideCarContainerA has started. This dependency is reversed on shutdown, which means that SideCarContainerB must shut down before SideCarContainerA can shut down.

    • toBuilder

      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<ContainerDefinitionInput.Builder,ContainerDefinitionInput>
      Returns:
      a builder for type T
    • builder

      public static ContainerDefinitionInput.Builder builder()
    • serializableBuilderClass

      public static Class<? extends ContainerDefinitionInput.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      Description copied from interface: SdkPojo
      Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • toString

      public final String toString()
      Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.