Interface Ec2Context
- All Known Implementing Classes:
Ec2ContextImpl
public interface Ec2Context
Runtime context information for EC2 UserData configuration.
This interface provides applications with the runtime information they need to make decisions during UserData script generation, such as:
- Whether to use EFS or EBS for storage
- Stack name for resource naming and logging
- Runtime environment (EC2 vs Fargate)
- Security profile for compliance requirements
Applications use this context to adapt their configuration based on the deployment environment.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns the EFS access point ID if EFS is available.default StringauthMode()Returns the configured authentication mode ("none","alb-oidc", or"application-oidc") — the same valueApplicationSpec.containerEnvironmentVariablesreceives for Fargate/ECS, so EC2 UserData can reach auth/env parity with the ECS task definition.efsId()Returns the EFS filesystem ID if EFS is available.default Stringfqdn()Returns the fully-qualified domain name for this deployment, if a domain is configured.booleanhasEfs()Returns whether EFS is available in this deployment.Returns the runtime type as a string.Returns the security profile as a string.default booleanReturns whether TLS/SSL is enabled for this deployment (affects the scheme used when building a public URL for the application, e.g.Returns the CloudFormation stack name.
-
Method Details
-
stackName
String stackName()Returns the CloudFormation stack name. Used for resource naming and CloudWatch log group names.- Returns:
- stack name (e.g., "jenkins-prod")
-
runtimeType
String runtimeType()Returns the runtime type as a string. Typically "EC2" or "FARGATE".- Returns:
- runtime type in lowercase (e.g., "ec2")
-
securityProfile
String securityProfile()Returns the security profile as a string. Used for compliance-aware logging and configuration.- Returns:
- security profile in lowercase (e.g., "dev", "staging", "production")
-
hasEfs
boolean hasEfs()Returns whether EFS is available in this deployment. If true, applications should use EFS for storage. If false, applications should use EBS for storage.- Returns:
- true if EFS is configured and available
-
efsId
-
accessPointId
-
authMode
Returns the configured authentication mode ("none","alb-oidc", or"application-oidc") — the same valueApplicationSpec.containerEnvironmentVariablesreceives for Fargate/ECS, so EC2 UserData can reach auth/env parity with the ECS task definition.Default
"none"for implementations predating this method (source compatibility).- Returns:
- auth mode string, e.g. "none"
- Since:
- 3.2.0
-
fqdn
Returns the fully-qualified domain name for this deployment, if a domain is configured.- Returns:
- FQDN (e.g., "manager.example.com"), or
nullif no domain is configured - Since:
- 3.2.0
-
sslEnabled
default boolean sslEnabled()Returns whether TLS/SSL is enabled for this deployment (affects the scheme used when building a public URL for the application, e.g.https://vshttp://).- Returns:
- true if SSL is enabled
- Since:
- 3.2.0
-