Class Deployment

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

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

The details of an Amazon ECS service deployment. This is used only when a service uses the ECS deployment controller type.

See Also:
  • Method Details

    • id

      public final String id()

      The ID of the deployment.

      Returns:
      The ID of the deployment.
    • status

      public final String status()

      The status of the deployment. The following describes each state.

      PRIMARY

      The most recent deployment of a service.

      ACTIVE

      A service deployment that still has running tasks, but are in the process of being replaced with a new PRIMARY deployment.

      INACTIVE

      A deployment that has been completely replaced.

      Returns:
      The status of the deployment. The following describes each state.

      PRIMARY

      The most recent deployment of a service.

      ACTIVE

      A service deployment that still has running tasks, but are in the process of being replaced with a new PRIMARY deployment.

      INACTIVE

      A deployment that has been completely replaced.

    • taskDefinition

      public final String taskDefinition()

      The most recent task definition that was specified for the tasks in the service to use.

      Returns:
      The most recent task definition that was specified for the tasks in the service to use.
    • desiredCount

      public final Integer desiredCount()

      The most recent desired count of tasks that was specified for the service to deploy or maintain.

      Returns:
      The most recent desired count of tasks that was specified for the service to deploy or maintain.
    • pendingCount

      public final Integer pendingCount()

      The number of tasks in the deployment that are in the PENDING status.

      Returns:
      The number of tasks in the deployment that are in the PENDING status.
    • runningCount

      public final Integer runningCount()

      The number of tasks in the deployment that are in the RUNNING status.

      Returns:
      The number of tasks in the deployment that are in the RUNNING status.
    • failedTasks

      public final Integer failedTasks()

      The number of consecutively failed tasks in the deployment. A task is considered a failure if the service scheduler can't launch the task, the task doesn't transition to a RUNNING state, or if it fails any of its defined health checks and is stopped.

      Once a service deployment has one or more successfully running tasks, the failed task count resets to zero and stops being evaluated.

      Returns:
      The number of consecutively failed tasks in the deployment. A task is considered a failure if the service scheduler can't launch the task, the task doesn't transition to a RUNNING state, or if it fails any of its defined health checks and is stopped.

      Once a service deployment has one or more successfully running tasks, the failed task count resets to zero and stops being evaluated.

    • createdAt

      public final Instant createdAt()

      The Unix timestamp for the time when the service deployment was created.

      Returns:
      The Unix timestamp for the time when the service deployment was created.
    • updatedAt

      public final Instant updatedAt()

      The Unix timestamp for the time when the service deployment was last updated.

      Returns:
      The Unix timestamp for the time when the service deployment was last updated.
    • hasCapacityProviderStrategy

      public final boolean hasCapacityProviderStrategy()
      For responses, this returns true if the service returned a value for the CapacityProviderStrategy 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.
    • capacityProviderStrategy

      public final List<CapacityProviderStrategyItem> capacityProviderStrategy()

      The capacity provider strategy that the deployment is using.

      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 hasCapacityProviderStrategy() method.

      Returns:
      The capacity provider strategy that the deployment is using.
    • launchType

      public final LaunchType launchType()

      The launch type the tasks in the service are using. For more information, see Amazon ECS Launch Types in the Amazon Elastic Container Service Developer Guide.

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

      Returns:
      The launch type the tasks in the service are using. For more information, see Amazon ECS Launch Types in the Amazon Elastic Container Service Developer Guide.
      See Also:
    • launchTypeAsString

      public final String launchTypeAsString()

      The launch type the tasks in the service are using. For more information, see Amazon ECS Launch Types in the Amazon Elastic Container Service Developer Guide.

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

      Returns:
      The launch type the tasks in the service are using. For more information, see Amazon ECS Launch Types in the Amazon Elastic Container Service Developer Guide.
      See Also:
    • platformVersion

      public final String platformVersion()

      The platform version that your tasks in the service run on. A platform version is only specified for tasks using the Fargate launch type. If one isn't specified, the LATEST platform version is used. For more information, see Fargate Platform Versions in the Amazon Elastic Container Service Developer Guide.

      Returns:
      The platform version that your tasks in the service run on. A platform version is only specified for tasks using the Fargate launch type. If one isn't specified, the LATEST platform version is used. For more information, see Fargate Platform Versions in the Amazon Elastic Container Service Developer Guide.
    • platformFamily

      public final String platformFamily()

      The operating system that your tasks in the service, or tasks are running on. A platform family is specified only for tasks using the Fargate launch type.

      All tasks that run as part of this service must use the same platformFamily value as the service, for example, LINUX..

      Returns:
      The operating system that your tasks in the service, or tasks are running on. A platform family is specified only for tasks using the Fargate launch type.

      All tasks that run as part of this service must use the same platformFamily value as the service, for example, LINUX..

    • networkConfiguration

      public final NetworkConfiguration networkConfiguration()

      The VPC subnet and security group configuration for tasks that receive their own elastic network interface by using the awsvpc networking mode.

      Returns:
      The VPC subnet and security group configuration for tasks that receive their own elastic network interface by using the awsvpc networking mode.
    • rolloutState

      public final DeploymentRolloutState rolloutState()

      The rolloutState of a service is only returned for services that use the rolling update ( ECS) deployment type that aren't behind a Classic Load Balancer.

      The rollout state of the deployment. When a service deployment is started, it begins in an IN_PROGRESS state. When the service reaches a steady state, the deployment transitions to a COMPLETED state. If the service fails to reach a steady state and circuit breaker is turned on, the deployment transitions to a FAILED state. A deployment in FAILED state doesn't launch any new tasks. For more information, see DeploymentCircuitBreaker.

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

      Returns:

      The rolloutState of a service is only returned for services that use the rolling update ( ECS) deployment type that aren't behind a Classic Load Balancer.

      The rollout state of the deployment. When a service deployment is started, it begins in an IN_PROGRESS state. When the service reaches a steady state, the deployment transitions to a COMPLETED state. If the service fails to reach a steady state and circuit breaker is turned on, the deployment transitions to a FAILED state. A deployment in FAILED state doesn't launch any new tasks. For more information, see DeploymentCircuitBreaker.

      See Also:
    • rolloutStateAsString

      public final String rolloutStateAsString()

      The rolloutState of a service is only returned for services that use the rolling update ( ECS) deployment type that aren't behind a Classic Load Balancer.

      The rollout state of the deployment. When a service deployment is started, it begins in an IN_PROGRESS state. When the service reaches a steady state, the deployment transitions to a COMPLETED state. If the service fails to reach a steady state and circuit breaker is turned on, the deployment transitions to a FAILED state. A deployment in FAILED state doesn't launch any new tasks. For more information, see DeploymentCircuitBreaker.

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

      Returns:

      The rolloutState of a service is only returned for services that use the rolling update ( ECS) deployment type that aren't behind a Classic Load Balancer.

      The rollout state of the deployment. When a service deployment is started, it begins in an IN_PROGRESS state. When the service reaches a steady state, the deployment transitions to a COMPLETED state. If the service fails to reach a steady state and circuit breaker is turned on, the deployment transitions to a FAILED state. A deployment in FAILED state doesn't launch any new tasks. For more information, see DeploymentCircuitBreaker.

      See Also:
    • rolloutStateReason

      public final String rolloutStateReason()

      A description of the rollout state of a deployment.

      Returns:
      A description of the rollout state of a deployment.
    • serviceConnectConfiguration

      public final ServiceConnectConfiguration serviceConnectConfiguration()

      The details of the Service Connect configuration that's used by this deployment. Compare the configuration between multiple deployments when troubleshooting issues with new deployments.

      The configuration for this service to discover and connect to services, and be discovered by, and connected from, other services within a namespace.

      Tasks that run in a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For more information, see Service Connect in the Amazon Elastic Container Service Developer Guide.

      Returns:
      The details of the Service Connect configuration that's used by this deployment. Compare the configuration between multiple deployments when troubleshooting issues with new deployments.

      The configuration for this service to discover and connect to services, and be discovered by, and connected from, other services within a namespace.

      Tasks that run in a namespace can use short names to connect to services in the namespace. Tasks can connect to services across all of the clusters in the namespace. Tasks connect through a managed proxy container that collects logs and metrics for increased visibility. Only the tasks that Amazon ECS services create are supported with Service Connect. For more information, see Service Connect in the Amazon Elastic Container Service Developer Guide.

    • hasServiceConnectResources

      public final boolean hasServiceConnectResources()
      For responses, this returns true if the service returned a value for the ServiceConnectResources 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.
    • serviceConnectResources

      public final List<ServiceConnectServiceResource> serviceConnectResources()

      The list of Service Connect resources that are associated with this deployment. Each list entry maps a discovery name to a Cloud Map service name.

      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 hasServiceConnectResources() method.

      Returns:
      The list of Service Connect resources that are associated with this deployment. Each list entry maps a discovery name to a Cloud Map service name.
    • hasVolumeConfigurations

      public final boolean hasVolumeConfigurations()
      For responses, this returns true if the service returned a value for the VolumeConfigurations 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.
    • volumeConfigurations

      public final List<ServiceVolumeConfiguration> volumeConfigurations()

      The details of the volume that was configuredAtLaunch. You can configure different settings like the size, throughput, volumeType, and ecryption in ServiceManagedEBSVolumeConfiguration. The name of the volume must match the name from the task definition.

      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 hasVolumeConfigurations() method.

      Returns:
      The details of the volume that was configuredAtLaunch. You can configure different settings like the size, throughput, volumeType, and ecryption in ServiceManagedEBSVolumeConfiguration. The name of the volume must match the name from the task definition.
    • toBuilder

      public Deployment.Builder 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<Deployment.Builder,Deployment>
      Returns:
      a builder for type T
    • builder

      public static Deployment.Builder builder()
    • serializableBuilderClass

      public static Class<? extends Deployment.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.