Class ManagedCapacityConfiguration

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

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

Use ManagedCapacityConfiguration with the "SCALE_TO_AND_FROM_ZERO" ZeroCapacityStrategy to enable Amazon GameLift Servers to fully manage the MinSize value, switching between 0 and 1 based on game session activity. This is ideal for eliminating compute costs during periods of no game activity. It is particularly beneficial during development when you're away from your desk, iterating on builds for extended periods, in production environments serving low-traffic locations, or for games with long, predictable downtime windows. By automatically managing capacity between 0 and 1 instances, you avoid paying for idle instances while maintaining the ability to serve game sessions when demand arrives. Note that while scale-out is triggered immediately upon receiving a game session request, actual game session availability depends on your server process startup time, so this approach works best with multi-location Fleets where cold-start latency is tolerable. With a "MANUAL" ZeroCapacityStrategy Amazon GameLift Servers will not modify Fleet MinSize values automatically and will not scale out from zero instances in response to game sessions.

See Also:
  • Method Details

    • zeroCapacityStrategy

      public final ZeroCapacityStrategy zeroCapacityStrategy()

      The strategy Amazon GameLift Servers will use to automatically scale your capacity to and from zero instances in response to game session activity. Game session activity refers to any active running sessions or game session requests.

      Possible ZeroCapacityStrategy types include:

      • MANUAL -- (default value) Amazon GameLift Servers will not update capacity to and from zero on your behalf.

      • SCALE_TO_AND_FROM_ZERO -- Amazon GameLift Servers will automatically scale out MinSize and DesiredInstances from 0 to 1 in response to a game session request, and will scale in MinSize and DesiredInstances to 0 after a period with no game session activity. The duration of this scale in period can be configured using ScaleInAfterInactivityMinutes.

      If the service returns an enum value that is not available in the current SDK version, zeroCapacityStrategy will return ZeroCapacityStrategy.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from zeroCapacityStrategyAsString().

      Returns:
      The strategy Amazon GameLift Servers will use to automatically scale your capacity to and from zero instances in response to game session activity. Game session activity refers to any active running sessions or game session requests.

      Possible ZeroCapacityStrategy types include:

      • MANUAL -- (default value) Amazon GameLift Servers will not update capacity to and from zero on your behalf.

      • SCALE_TO_AND_FROM_ZERO -- Amazon GameLift Servers will automatically scale out MinSize and DesiredInstances from 0 to 1 in response to a game session request, and will scale in MinSize and DesiredInstances to 0 after a period with no game session activity. The duration of this scale in period can be configured using ScaleInAfterInactivityMinutes.

      See Also:
    • zeroCapacityStrategyAsString

      public final String zeroCapacityStrategyAsString()

      The strategy Amazon GameLift Servers will use to automatically scale your capacity to and from zero instances in response to game session activity. Game session activity refers to any active running sessions or game session requests.

      Possible ZeroCapacityStrategy types include:

      • MANUAL -- (default value) Amazon GameLift Servers will not update capacity to and from zero on your behalf.

      • SCALE_TO_AND_FROM_ZERO -- Amazon GameLift Servers will automatically scale out MinSize and DesiredInstances from 0 to 1 in response to a game session request, and will scale in MinSize and DesiredInstances to 0 after a period with no game session activity. The duration of this scale in period can be configured using ScaleInAfterInactivityMinutes.

      If the service returns an enum value that is not available in the current SDK version, zeroCapacityStrategy will return ZeroCapacityStrategy.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from zeroCapacityStrategyAsString().

      Returns:
      The strategy Amazon GameLift Servers will use to automatically scale your capacity to and from zero instances in response to game session activity. Game session activity refers to any active running sessions or game session requests.

      Possible ZeroCapacityStrategy types include:

      • MANUAL -- (default value) Amazon GameLift Servers will not update capacity to and from zero on your behalf.

      • SCALE_TO_AND_FROM_ZERO -- Amazon GameLift Servers will automatically scale out MinSize and DesiredInstances from 0 to 1 in response to a game session request, and will scale in MinSize and DesiredInstances to 0 after a period with no game session activity. The duration of this scale in period can be configured using ScaleInAfterInactivityMinutes.

      See Also:
    • scaleInAfterInactivityMinutes

      public final Integer scaleInAfterInactivityMinutes()

      Length of time, in minutes, that Amazon GameLift Servers will wait before scaling in your MinSize and DesiredInstances to 0 after a period with no game session activity. Default: 30 minutes.

      Returns:
      Length of time, in minutes, that Amazon GameLift Servers will wait before scaling in your MinSize and DesiredInstances to 0 after a period with no game session activity. Default: 30 minutes.
    • 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<ManagedCapacityConfiguration.Builder,ManagedCapacityConfiguration>
      Returns:
      a builder for type T
    • builder

      public static ManagedCapacityConfiguration.Builder builder()
    • serializableBuilderClass

      public static Class<? extends ManagedCapacityConfiguration.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.
    • sdkFieldNameToField

      public final Map<String,SdkField<?>> sdkFieldNameToField()
      Specified by:
      sdkFieldNameToField in interface SdkPojo
      Returns:
      The mapping between the field name and its corresponding field.