Class ApplicationFactory

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

public class ApplicationFactory extends BaseFactory
Universal factory class for deploying any application using ApplicationSpec.

This factory supports deployment of any application that implements the ApplicationSpec interface, including:

  • CI/CD: Jenkins, GitLab, Drone, Gitea
  • Monitoring: Grafana, Prometheus
  • Databases: PostgreSQL, Redis
  • Secrets Management: HashiCorp Vault
  • Artifact Registry: Nexus, Harbor
  • Collaboration: Mattermost
  • Analytics: Metabase, Apache Superset

The factory automatically configures:

  • VPC and networking (respects networkMode: public-no-nat, private-with-nat)
  • Application Load Balancer (ALB) with SSL/TLS termination
  • Security groups and IAM roles
  • Storage (EFS or EBS based on application needs)
  • Observability (CloudWatch logs, flow logs, alarms)
  • Auto-scaling (for service deployments)
Since:
3.0.0
Author:
CloudForgeCI
See Also:
  • Constructor Details

  • Method Details

    • getInfrastructure

      public SystemContext.InfrastructureFactories getInfrastructure()
      Gets the infrastructure factories created during deployment.
      Returns:
      Infrastructure factories containing VPC, ALB, EFS, and logging components
    • create

      public void create()
      Creates the application deployment infrastructure. This method is called after SystemContext has been started and ApplicationFactory has been instantiated.
      Specified by:
      create in class BaseFactory
    • createFargate

      public static ApplicationFactory.ApplicationSystem createFargate(software.constructs.Construct scope, String id, DeploymentContext cfc, ApplicationSpec applicationSpec)
      Static helper method for creating a Fargate-based application deployment. This method ensures SystemContext is started before creating the ApplicationFactory.
      Parameters:
      scope - The CDK construct scope
      id - Unique identifier for the deployment
      cfc - Deployment context containing configuration parameters
      applicationSpec - The ApplicationSpec defining the application
      Returns:
      ApplicationSystem containing references to created infrastructure components
    • createFargate

      public static ApplicationFactory.ApplicationSystem createFargate(software.constructs.Construct scope, String id, DeploymentContext cfc, SecurityProfile security, ApplicationSpec applicationSpec)
      Static helper method for creating a Fargate-based application deployment with specific security profile.
      Parameters:
      scope - The CDK construct scope
      id - Unique identifier for the deployment
      cfc - Deployment context containing configuration parameters
      security - Security profile determining security hardening level
      applicationSpec - The ApplicationSpec defining the application
      Returns:
      ApplicationSystem containing references to created infrastructure components
    • createFargate

      public static ApplicationFactory.ApplicationSystem createFargate(software.constructs.Construct scope, String id, DeploymentContext cfc, SecurityProfile security, IAMProfile iamProfile, ApplicationSpec applicationSpec)
      Static helper method for creating a Fargate-based application deployment with explicit IAM profile.
      Parameters:
      scope - The CDK construct scope
      id - Unique identifier for the deployment
      cfc - Deployment context containing configuration parameters
      security - Security profile determining security hardening level
      iamProfile - IAM profile for access control
      applicationSpec - The ApplicationSpec defining the application
      Returns:
      ApplicationSystem containing references to created infrastructure components
    • createEc2

      public static ApplicationFactory.ApplicationSystem createEc2(software.constructs.Construct scope, String id, DeploymentContext cfc, ApplicationSpec applicationSpec)
      Creates an EC2-based application deployment.
      Parameters:
      scope - The CDK construct scope
      id - Unique identifier for the deployment
      cfc - Deployment context containing configuration parameters
      applicationSpec - The ApplicationSpec defining the application
      Returns:
      ApplicationSystem containing references to created infrastructure components
    • createEc2

      public static ApplicationFactory.ApplicationSystem createEc2(software.constructs.Construct scope, String id, DeploymentContext cfc, SecurityProfile security, ApplicationSpec applicationSpec)
      Creates an EC2-based application deployment with specific security profile.
      Parameters:
      scope - The CDK construct scope
      id - Unique identifier for the deployment
      cfc - Deployment context containing configuration parameters
      security - Security profile determining security hardening level
      applicationSpec - The ApplicationSpec defining the application
      Returns:
      ApplicationSystem containing references to created infrastructure components
    • createEc2

      public static ApplicationFactory.ApplicationSystem createEc2(software.constructs.Construct scope, String id, DeploymentContext cfc, SecurityProfile security, IAMProfile iamProfile, ApplicationSpec applicationSpec)
      Static helper method for creating an EC2-based application deployment with explicit IAM profile.
      Parameters:
      scope - The CDK construct scope
      id - Unique identifier for the deployment
      cfc - Deployment context containing configuration parameters
      security - Security profile determining security hardening level
      iamProfile - IAM profile for access control
      applicationSpec - The ApplicationSpec defining the application
      Returns:
      ApplicationSystem containing references to created infrastructure components