Class MetabaseApplicationSpec
- All Implemented Interfaces:
ApplicationSpec,DatabaseSpec
Metabase is an open-source business intelligence tool for interactive dashboards and data visualization.
Database Configuration:
- Development/Staging: H2 embedded database (single instance only)
- Production: Use RDS PostgreSQL/MySQL for multi-instance deployments
IMPORTANT: H2 database cannot support multiple instances due to file locking.
For high availability, configure maxInstanceCapacity=1 or use external RDS database.
RDS Configuration (Production):
Set environment variables:- MB_DB_TYPE=postgres
- MB_DB_HOST=your-rds-endpoint.rds.amazonaws.com
- MB_DB_PORT=5432
- MB_DB_DBNAME=metabase
- MB_DB_USER=metabase_user
- MB_DB_PASS=from-secrets-manager
Use Cases:
- SOC2: Audit log analytics and security metrics
- GDPR: Data subject access request reporting
- PCI-DSS: Transaction monitoring dashboards
- Fintech: Fraud detection, revenue metrics, compliance reporting
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.cloudforge.core.interfaces.ApplicationSpec
ApplicationSpec.OptionalPortNested classes/interfaces inherited from interface com.cloudforge.core.interfaces.DatabaseSpec
DatabaseSpec.DatabaseConnection, DatabaseSpec.DatabaseRequirement -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe Secrets Manager secret name for Metabase Pro/Enterprise license token. -
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.containerEnvironmentVariables(String fqdn, boolean sslEnabled, String authMode) Configures application-specific environment variables for the container.containerEnvironmentVariables(String fqdn, boolean sslEnabled, String authMode, DatabaseSpec.DatabaseConnection dbConn) Container environment variables with database connection support.Returns the container user (UID:GID) to run as.Database requirement for this application.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.Get the environment variable name for the Metabase license token.getLicenseSecretName(String stackName) Get the Secrets Manager secret name for the Metabase license token.Returns the OIDC integration handler for this application.booleanReturns whether this application supports OIDC integration.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, defaultCpu, defaultHealthCheckGracePeriod, defaultInstanceType, defaultMemory, description, displayName, getRecommendedAuthMode, getSupportedAuthModes, healthCheckPath, optionalPorts, protectedPaths, publicPaths, supportsEc2, supportsFargateMethods inherited from interface com.cloudforge.core.interfaces.DatabaseSpec
backupRetentionDays, databaseInitScripts, databaseParameters, readReplicaCount, requiresReadReplicas
-
Field Details
-
LICENSE_SECRET_SUFFIX
The Secrets Manager secret name for Metabase Pro/Enterprise license token. Store the license token in this secret to unlock SAML, advanced permissions, audit logging, etc. The secret can be updated in AWS Console without redeploying the stack.- See Also:
-
-
Constructor Details
-
MetabaseApplicationSpec
public MetabaseApplicationSpec()
-
-
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)
-
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")
-
databaseRequirement
Description copied from interface:DatabaseSpecDatabase requirement for this application.- Specified by:
databaseRequirementin interfaceDatabaseSpec- Returns:
- database requirement (required, optional, or none)
-
containerEnvironmentVariables
public Map<String,String> containerEnvironmentVariables(String fqdn, boolean sslEnabled, String authMode) Description copied from interface:ApplicationSpecConfigures application-specific environment variables for the container.Applications can override this to provide custom environment variables based on deployment configuration (FQDN, SSL, authMode, etc.). The infrastructure passes the FQDN, SSL settings, and authentication mode for applications that need reverse proxy configuration or authentication-specific setup.
Example use cases:
- Jenkins: JAVA_OPTS, JENKINS_OPTS for reverse proxy configuration, skip setup wizard for application-oidc
- GitLab: GITLAB_OMNIBUS_CONFIG for external URL configuration and OIDC setup
- Vault: VAULT_ADDR for API endpoint configuration
- Specified by:
containerEnvironmentVariablesin interfaceApplicationSpec- Parameters:
fqdn- The fully qualified domain name (may be null)sslEnabled- Whether SSL is enabledauthMode- The authentication mode (may be null, e.g., "none", "alb-oidc", "application-oidc")- Returns:
- Map of environment variable key-value pairs (never null, may be empty)
-
containerEnvironmentVariables
public Map<String,String> containerEnvironmentVariables(String fqdn, boolean sslEnabled, String authMode, DatabaseSpec.DatabaseConnection dbConn) Container environment variables with database connection support.If database connection is provided, configures Metabase to use RDS PostgreSQL. Otherwise, falls back to H2 embedded database (single instance only).
-
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
-
supportsOidcIntegration
public boolean supportsOidcIntegration()Description copied from interface:ApplicationSpecReturns whether this application supports OIDC integration.Applications with built-in OIDC support (GitLab, Grafana, SonarQube) or plugin support (Jenkins) should return true.
- Specified by:
supportsOidcIntegrationin interfaceApplicationSpec- Returns:
- true if application can integrate with OIDC providers
-
getOidcIntegration
Description copied from interface:ApplicationSpecReturns the OIDC integration handler for this application.This provides application-specific configuration for integrating with Cognito or IAM Identity Center OIDC.
- Specified by:
getOidcIntegrationin interfaceApplicationSpec- Returns:
- OIDC integration handler, or null if not supported
-
getLicenseSecretName
Get the Secrets Manager secret name for the Metabase license token.The license token enables Pro/Enterprise features:
- SAML/SSO authentication
- Advanced permissions and sandboxing
- Audit logging
- Row-level permissions
- Interactive embedding
To add a license:
- Go to AWS Secrets Manager in the AWS Console
- Find the secret: {stackName}/metabase/license-token
- Update the secret value with your Metabase license token
- Restart the ECS task or wait for next deployment
- Parameters:
stackName- the CloudFormation stack name- Returns:
- the full secret name for the license token
-
getLicenseEnvVarName
Get the environment variable name for the Metabase license token.- Returns:
- MB_PREMIUM_EMBEDDING_TOKEN
-
toString
-