Class RedisApplicationSpec
java.lang.Object
com.cloudforgeci.api.application.database.RedisApplicationSpec
- All Implemented Interfaces:
ApplicationSpec
@ApplicationPlugin(value="redis",
category="database",
displayName="Redis",
description="In-memory data store and cache",
defaultCpu=512,
defaultMemory=1024,
defaultInstanceType="t3.micro",
supportsFargate=true,
supportsEc2=true,
supportsOidc=false)
public class RedisApplicationSpec
extends Object
implements ApplicationSpec
Redis ApplicationSpec implementation.
Redis is an in-memory data structure store used as database, cache, and message broker.
Key Features:
- In-memory key-value store
- Support for multiple data structures (strings, lists, sets, hashes)
- Pub/sub messaging
- Persistence options (RDB, AOF)
- High performance
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.cloudforge.core.interfaces.ApplicationSpec
ApplicationSpec.OptionalPort -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a unique identifier for this application.intReturns the primary application port.voidconfigureUserData(UserDataBuilder builder, Ec2Context context) Configure EC2 UserData script for application installation and setup.Returns the container path where application data is stored.Returns the container user (UID:GID) to run as.Returns the default container image for this application.Returns the EBS device name for EC2 instances when not using EFS.Returns the EC2 data path where application stores persistent data.Returns CloudWatch log file paths for EC2 monitoring.Returns the EFS path for this application's data.Returns the EFS permissions for the access point.Returns optional ports that can be enabled via deployment configuration.toString()Returns the volume name for this application.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.cloudforge.core.interfaces.ApplicationSpec
category, containerEnvironmentVariables, defaultCpu, defaultHealthCheckGracePeriod, defaultInstanceType, defaultMemory, description, displayName, getOidcIntegration, getRecommendedAuthMode, getSupportedAuthModes, healthCheckPath, protectedPaths, publicPaths, supportsEc2, supportsFargate, supportsOidcIntegration
-
Constructor Details
-
RedisApplicationSpec
public RedisApplicationSpec()
-
-
Method Details
-
applicationId
Description copied from interface:ApplicationSpecReturns a unique identifier for this application. Used for logging, metrics, and resource naming.- Specified by:
applicationIdin interfaceApplicationSpec- Returns:
- application identifier (e.g., "jenkins", "gitlab", "vault")
-
defaultContainerImage
Description copied from interface:ApplicationSpecReturns the default container image for this application. Can be overridden by deployment context configuration.- Specified by:
defaultContainerImagein interfaceApplicationSpec- Returns:
- container image string (e.g., "jenkins/jenkins:lts")
-
applicationPort
public int applicationPort()Description copied from interface:ApplicationSpecReturns the primary application port. This is the port the application listens on inside the container.- Specified by:
applicationPortin interfaceApplicationSpec- Returns:
- application port (e.g., 8080 for Jenkins)
-
optionalPorts
Description copied from interface:ApplicationSpecReturns optional ports that can be enabled via deployment configuration.These ports are NOT exposed by default. Users must set the corresponding configKey to true in their deployment configuration to enable each port.
Example implementation for Mattermost:
@Override public List<OptionalPort> optionalPorts() { return List.of( OptionalPort.outboundTcp(587, "enableSmtp", "SMTP Email"), OptionalPort.inboundTcp(8074, "enableClustering", "Cluster Gossip") ); }User enables in deployment-context.json:
{ "enableSmtp": true, "enableClustering": true }- Specified by:
optionalPortsin interfaceApplicationSpec- Returns:
- list of optional ports (empty by default - most apps only need primary port)
-
containerDataPath
Description copied from interface:ApplicationSpecReturns the container path where application data is stored. This is where the volume will be mounted inside the container.- Specified by:
containerDataPathin interfaceApplicationSpec- Returns:
- container mount path (e.g., "/var/jenkins_home")
-
efsDataPath
Description copied from interface:ApplicationSpecReturns the EFS path for this application's data. This is the path within the EFS filesystem.- Specified by:
efsDataPathin interfaceApplicationSpec- Returns:
- EFS path (e.g., "/jenkins")
-
volumeName
Description copied from interface:ApplicationSpecReturns the volume name for this application. Used to reference the volume in task definitions.- Specified by:
volumeNamein interfaceApplicationSpec- Returns:
- volume name (e.g., "jenkinsHome")
-
containerUser
Description copied from interface:ApplicationSpecReturns the container user (UID:GID) to run as. Important for file permissions when using EFS.- Specified by:
containerUserin interfaceApplicationSpec- Returns:
- user in format "UID:GID" (e.g., "1000:1000")
-
efsPermissions
Description copied from interface:ApplicationSpecReturns the EFS permissions for the access point.- Specified by:
efsPermissionsin interfaceApplicationSpec- Returns:
- permissions string (e.g., "750")
-
ebsDeviceName
Description copied from interface:ApplicationSpecReturns the EBS device name for EC2 instances when not using EFS. This is the device that will be formatted and mounted for application data.- Specified by:
ebsDeviceNamein interfaceApplicationSpec- Returns:
- EBS device path (e.g., "/dev/xvdh")
-
ec2DataPath
Description copied from interface:ApplicationSpecReturns the EC2 data path where application stores persistent data. This may differ from containerDataPath depending on application packaging.- Specified by:
ec2DataPathin interfaceApplicationSpec- Returns:
- EC2 mount path (e.g., "/var/lib/jenkins")
-
ec2LogPaths
Description copied from interface:ApplicationSpecReturns CloudWatch log file paths for EC2 monitoring. These files will be streamed to CloudWatch Logs for centralized logging.- Specified by:
ec2LogPathsin interfaceApplicationSpec- Returns:
- list of absolute log file paths (e.g., ["/var/log/jenkins/jenkins.log"])
-
configureUserData
Description copied from interface:ApplicationSpecConfigure EC2 UserData script for application installation and setup.The implementation should use the UserDataBuilder to add application-specific installation commands while leveraging infrastructure helpers for storage mounting and CloudWatch configuration.
The infrastructure handles:
- System updates
- EFS vs EBS storage mounting (based on availability)
- CloudWatch Agent installation and configuration
- File permissions and ownership
The application provides:
- Application installation commands (yum/dnf install, etc.)
- Application configuration
- Service startup commands
- Specified by:
configureUserDatain interfaceApplicationSpec- Parameters:
builder- The UserDataBuilder providing infrastructure helperscontext- The Ec2Context providing runtime information
-
toString
-