Package com.cloudforgeci.api.compute
Class Ec2Factory
java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
com.cloudforgeci.api.core.annotation.BaseFactory
com.cloudforgeci.api.compute.Ec2Factory
- All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable,software.constructs.IConstruct,software.constructs.IDependable
Factory for creating EC2-based Jenkins compute infrastructure.
This factory creates and configures EC2 instances for Jenkins deployments, including auto-scaling groups, launch templates, and IAM roles. It respects the network mode configuration to place instances in appropriate subnets.
Key Features:
- Auto-scaling groups with configurable min/max capacity
- Launch templates with Jenkins pre-installed
- EBS encryption and proper volume configuration
- IAM roles with EFS access (when EFS is available)
- CloudWatch logging integration
- Network mode awareness (public vs private subnets)
Storage Options:
- EFS: When EFS is available, instances mount EFS for persistent storage
- EBS: When EFS is not available, instances use EBS volumes
Example Usage:
Ec2Factory factory = new Ec2Factory(scope, "JenkinsEC2");
factory.create(ctx);
// Access created resources
AutoScalingGroup asg = ctx.asg.get().orElseThrow();
Role instanceRole = ctx.ec2InstanceRole.get().orElseThrow();
- Since:
- 1.0.0
- Author:
- CloudForgeCI
- See Also:
-
Nested Class Summary
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate()Abstract method that must be implemented by all factory subclasses.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
-
Ec2Factory
-
-
Method Details
-
create
public void create()Description copied from class:BaseFactoryAbstract method that must be implemented by all factory subclasses. This method should contain the actual infrastructure creation logic.- Specified by:
createin classBaseFactory
-