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

io.cloudshiftdev.awscdk.services.ecs.patterns.ApplicationMultipleTargetGroupsServiceBase.kt Maven / Gradle / Ivy

There is a newer version: 0.10.0
Show newest version
@file:Suppress("RedundantVisibilityModifier","RedundantUnitReturnType","RemoveRedundantQualifierName","unused","UnusedImport","ClassName","REDUNDANT_PROJECTION","DEPRECATION")

package io.cloudshiftdev.awscdk.services.ecs.patterns

import io.cloudshiftdev.awscdk.common.CdkObject
import io.cloudshiftdev.awscdk.common.CdkObjectWrappers
import io.cloudshiftdev.awscdk.services.ecs.ICluster
import io.cloudshiftdev.awscdk.services.elasticloadbalancingv2.ApplicationListener
import io.cloudshiftdev.awscdk.services.elasticloadbalancingv2.ApplicationLoadBalancer
import io.cloudshiftdev.awscdk.services.elasticloadbalancingv2.ApplicationTargetGroup
import io.cloudshiftdev.constructs.Construct
import kotlin.Deprecated
import kotlin.Number
import kotlin.collections.List

/**
 * The base class for ApplicationMultipleTargetGroupsEc2Service and
 * ApplicationMultipleTargetGroupsFargateService classes.
 */
public abstract class ApplicationMultipleTargetGroupsServiceBase(
  cdkObject: software.amazon.awscdk.services.ecs.patterns.ApplicationMultipleTargetGroupsServiceBase,
) : Construct(cdkObject) {
  /**
   * The cluster that hosts the service.
   */
  public open fun cluster(): ICluster = unwrap(this).getCluster().let(ICluster::wrap)

  /**
   * The desired number of instantiations of the task definition to keep running on the service.
   *
   * The default is 1 for all new services and uses the existing services desired count
   * when updating an existing service, if one is not provided.
   */
  public open fun internalDesiredCount(): Number? = unwrap(this).getInternalDesiredCount()

  /**
   * (deprecated) The default listener for the service (first added listener).
   *
   * * Use `listeners` instead.
   */
  @Deprecated(message = "deprecated in CDK")
  public open fun listener(): ApplicationListener =
      unwrap(this).getListener().let(ApplicationListener::wrap)

  /**
   * The listeners of the service.
   */
  public open fun listeners(): List =
      unwrap(this).getListeners().map(ApplicationListener::wrap)

  /**
   * (deprecated) The default Application Load Balancer for the service (first added load balancer).
   *
   * * Use `loadBalancers` instead.
   */
  @Deprecated(message = "deprecated in CDK")
  public open fun loadBalancer(): ApplicationLoadBalancer =
      unwrap(this).getLoadBalancer().let(ApplicationLoadBalancer::wrap)

  /**
   * The load balancers of the service.
   */
  public open fun loadBalancers(): List =
      unwrap(this).getLoadBalancers().map(ApplicationLoadBalancer::wrap)

  /**
   * The target groups of the service.
   */
  public open fun targetGroups(): List =
      unwrap(this).getTargetGroups().map(ApplicationTargetGroup::wrap)

  private class Wrapper(
    cdkObject: software.amazon.awscdk.services.ecs.patterns.ApplicationMultipleTargetGroupsServiceBase,
  ) : ApplicationMultipleTargetGroupsServiceBase(cdkObject)

  public companion object {
    internal
        fun wrap(cdkObject: software.amazon.awscdk.services.ecs.patterns.ApplicationMultipleTargetGroupsServiceBase):
        ApplicationMultipleTargetGroupsServiceBase = CdkObjectWrappers.wrap(cdkObject) as?
        ApplicationMultipleTargetGroupsServiceBase ?: Wrapper(cdkObject)

    internal fun unwrap(wrapped: ApplicationMultipleTargetGroupsServiceBase):
        software.amazon.awscdk.services.ecs.patterns.ApplicationMultipleTargetGroupsServiceBase =
        (wrapped as CdkObject).cdkObject as
        software.amazon.awscdk.services.ecs.patterns.ApplicationMultipleTargetGroupsServiceBase
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy