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 namespace
healthCheckCommand - 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 a HEALTHY signal to wait on. The port in that example is the cloudforge-synth-service sidecar's own default — see ManagerEnvKeys.SYNTH_SERVICE_DEFAULT_PORT for the one place that port is actually declared
environment - 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 Details

    • SidecarContainer

      public SidecarContainer(String containerName, String image, int containerPort, List<String> healthCheckCommand, Map<String,String> environment)
      Creates an instance of a SidecarContainer record class.
      Parameters:
      containerName - the value for the containerName record component
      image - the value for the image record component
      containerPort - the value for the containerPort record component
      healthCheckCommand - the value for the healthCheckCommand record component
      environment - the value for the environment record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • containerName

      public String containerName()
      Returns the value of the containerName record component.
      Returns:
      the value of the containerName record component
    • image

      public String image()
      Returns the value of the image record component.
      Returns:
      the value of the image record component
    • containerPort

      public int containerPort()
      Returns the value of the containerPort record component.
      Returns:
      the value of the containerPort record component
    • healthCheckCommand

      public List<String> healthCheckCommand()
      Returns the value of the healthCheckCommand record component.
      Returns:
      the value of the healthCheckCommand record component
    • environment

      public Map<String,String> environment()
      Returns the value of the environment record component.
      Returns:
      the value of the environment record component