Class ScalingFactory

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
com.cloudforgeci.api.core.annotation.BaseFactory
com.cloudforgeci.api.scaling.ScalingFactory
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

public class ScalingFactory extends BaseFactory
  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode

    Nested classes/interfaces inherited from interface software.constructs.IConstruct

    software.constructs.IConstruct.Jsii$Default, software.constructs.IConstruct.Jsii$Proxy
  • Field Summary

    Fields inherited from class BaseFactory

    cfc, config, ctx
  • Constructor Summary

    Constructors
    Constructor
    Description
    ScalingFactory(software.constructs.Construct scope, String id)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Abstract method that must be implemented by all factory subclasses.
    void
    Fails synthesis when a deployment requests more than one instance (minInstanceCapacity/maxInstanceCapacity above 1, or enableAutoScaling) for an application that can't safely run that way, in either of two distinct senses: ApplicationSpec.supportsAutoScaling() is false -- no clustering/HA support at all in this edition, such as the Jenkins controller or the Nexus/SonarQube community editions. ApplicationSpec.requiresSequentialDeploymentWithoutDatabase() is true and no managed database connection is provisioned ( ctx.dbConnection empty) -- a single-writer embedded-file database (e.g.
    void
    scale(software.amazon.awscdk.services.autoscaling.AutoScalingGroup asg)
     
    void
    scale(software.amazon.awscdk.services.ecs.FargateService service)
     

    Methods inherited from class software.constructs.Construct

    getNode, isConstruct, toString

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Constructor Details

    • ScalingFactory

      public ScalingFactory(software.constructs.Construct scope, String id)
  • Method Details

    • create

      public void create()
      Description copied from class: BaseFactory
      Abstract method that must be implemented by all factory subclasses. This method should contain the actual infrastructure creation logic.
      Specified by:
      create in class BaseFactory
    • rejectUnsupportedAutoScaling

      public void rejectUnsupportedAutoScaling()
      Fails synthesis when a deployment requests more than one instance (minInstanceCapacity/maxInstanceCapacity above 1, or enableAutoScaling) for an application that can't safely run that way, in either of two distinct senses:
      • ApplicationSpec.supportsAutoScaling() is false -- no clustering/HA support at all in this edition, such as the Jenkins controller or the Nexus/SonarQube community editions.
      • ApplicationSpec.requiresSequentialDeploymentWithoutDatabase() is true and no managed database connection is provisioned ( ctx.dbConnection empty) -- a single-writer embedded-file database (e.g. CloudForge Manager's own H2) has no way to coordinate more than one writer; two replicas both racing to become that database's primary is exactly the deployment-time version of the same problem FargateFactory's minHealthyPercent(0)/maxHealthyPercent(100) rollout override already defends against for a single *replacement*, but that override doesn't -- can't -- prevent two simultaneously-running peers when desiredCount > 1 itself is the actual request. A managed database handles concurrent writers safely, so this only applies while none is configured.
      UIs may hide these fields, but this check is the enforcement point.

      Called from both scale(FargateService) and scale(AutoScalingGroup) -- the EC2 runtime's own paths to more than one instance -- and, standalone (public, for exactly this reason), from FargateFactory#create(): Fargate's OWN scaling wiring lives in each topology configuration class's wireBaseAutoscalingAndDns (e.g. CmsServiceTopologyConfiguration), already correctly guarded against double-registering autoScaleTaskCount -- scale(FargateService) itself is never invoked for a real Fargate deploy, only this validation is.

    • scale

      public void scale(software.amazon.awscdk.services.ecs.FargateService service)
    • scale

      public void scale(software.amazon.awscdk.services.autoscaling.AutoScalingGroup asg)