Package com.cloudforgeci.api.compute
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
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordContainer for application system components created by the factory.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default, software.constructs.IConstruct.Jsii$Proxy -
Field Summary
Fields inherited from class com.cloudforgeci.api.core.annotation.BaseFactory
cfc, config, ctx -
Constructor Summary
ConstructorsConstructorDescriptionApplicationFactory(software.constructs.Construct scope, String id, RuntimeType runtime, ApplicationSpec applicationSpec) -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate()Creates the application deployment infrastructure.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.createEc2(software.constructs.Construct scope, String id, DeploymentContext cfc, SecurityProfile security, ApplicationSpec applicationSpec) Creates an EC2-based application deployment with specific security profile.createEc2(software.constructs.Construct scope, String id, DeploymentContext cfc, ApplicationSpec applicationSpec) Creates an EC2-based application deployment.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.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.createFargate(software.constructs.Construct scope, String id, DeploymentContext cfc, ApplicationSpec applicationSpec) Static helper method for creating a Fargate-based application deployment.Gets the infrastructure factories created during deployment.Methods inherited from class com.cloudforgeci.api.core.annotation.BaseFactory
getDeploymentContext, getSecurityProfileConfiguration, getSystemContextMethods inherited from class software.constructs.Construct
getNode, isConstruct, toStringMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
ApplicationFactory
public ApplicationFactory(software.constructs.Construct scope, String id, RuntimeType runtime, ApplicationSpec applicationSpec)
-
-
Method Details
-
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:
createin classBaseFactory
-
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 scopeid- Unique identifier for the deploymentcfc- Deployment context containing configuration parametersapplicationSpec- 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 scopeid- Unique identifier for the deploymentcfc- Deployment context containing configuration parameterssecurity- Security profile determining security hardening levelapplicationSpec- 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 scopeid- Unique identifier for the deploymentcfc- Deployment context containing configuration parameterssecurity- Security profile determining security hardening leveliamProfile- IAM profile for access controlapplicationSpec- 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 scopeid- Unique identifier for the deploymentcfc- Deployment context containing configuration parametersapplicationSpec- 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 scopeid- Unique identifier for the deploymentcfc- Deployment context containing configuration parameterssecurity- Security profile determining security hardening levelapplicationSpec- 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 scopeid- Unique identifier for the deploymentcfc- Deployment context containing configuration parameterssecurity- Security profile determining security hardening leveliamProfile- IAM profile for access controlapplicationSpec- The ApplicationSpec defining the application- Returns:
- ApplicationSystem containing references to created infrastructure components
-