Record Class ApplicationSpec.SidecarContainer
java.lang.Object
java.lang.Record
com.cloudforge.core.interfaces.ApplicationSpec.SidecarContainer
- Record Components:
containerName- unique name within the task definition (also the log stream prefix)image- container image reference (registry/repo:tag)containerPort- port the sidecar listens on inside the task's shared network namespacehealthCheckCommand- ECS container health check command, e.g.List.of("CMD-SHELL", "curl -f http://localhost:8090/v1/healthz || exit 1")— required, since the main container's startup dependency needs aHEALTHYsignal to wait on. The port in that example is thecloudforge-synth-servicesidecar's own default — seeManagerEnvKeys.SYNTH_SERVICE_DEFAULT_PORTfor the one place that port is actually declaredenvironment- environment variables for the sidecar container
- Enclosing interface:
ApplicationSpec
public static record ApplicationSpec.SidecarContainer(String containerName, String image, int containerPort, List<String> healthCheckCommand, Map<String,String> environment)
extends Record
Declares an always-running, same-Fargate-task companion container:
ContainerFactory
adds it to the same task definition as this app's own container, wires the main container
to wait for it (a startup dependency on HEALTHY, not SUCCESS — unlike the
SAML certificate init container this deliberately isn't modeled after, a sidecar never
exits), and gives it its own CloudWatch log stream. No IAM task-role grants and no inbound
security-group rule are added for it — a sidecar reachable only over the task's own loopback
interface (the way every container in one Fargate/awsvpc task already shares one ENI)
needs neither.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecontainerNamerecord component.intReturns the value of thecontainerPortrecord component.Returns the value of theenvironmentrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thehealthCheckCommandrecord component.image()Returns the value of theimagerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SidecarContainer
public SidecarContainer(String containerName, String image, int containerPort, List<String> healthCheckCommand, Map<String, String> environment) Creates an instance of aSidecarContainerrecord class.- Parameters:
containerName- the value for thecontainerNamerecord componentimage- the value for theimagerecord componentcontainerPort- the value for thecontainerPortrecord componenthealthCheckCommand- the value for thehealthCheckCommandrecord componentenvironment- the value for theenvironmentrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
containerName
Returns the value of thecontainerNamerecord component.- Returns:
- the value of the
containerNamerecord component
-
image
-
containerPort
public int containerPort()Returns the value of thecontainerPortrecord component.- Returns:
- the value of the
containerPortrecord component
-
healthCheckCommand
Returns the value of thehealthCheckCommandrecord component.- Returns:
- the value of the
healthCheckCommandrecord component
-
environment
Returns the value of theenvironmentrecord component.- Returns:
- the value of the
environmentrecord component
-