Skip to content
This repository was archived by the owner on Jun 22, 2026. It is now read-only.

Load Balanced Web Service Manifest

Efe Karakus edited this page Sep 21, 2020 · 4 revisions

List of all available properties for a 'Load Balanced Web Service' manifest.

# Your service name will be used in naming your resources like log groups, ECS services, etc.
name: frontend
# The "architecture" of the service you're running.
type: Load Balanced Web Service

image:
  # Path to your service's Dockerfile.
  build: ./Dockerfile
  # Port exposed through your container to route traffic to it.
  port: 80

http:
  # Requests to this path will be forwarded to your service. 
  # To match all requests you can use the "/" path. 
  path: '/'

  # You can specify a custom health check path. The default is "/"
  # healthcheck: "/"

  # You can specify whether to enable sticky sessions.
  # stickiness: true

# Number of CPU units for the task.
cpu: 256
# Amount of memory in MiB used by the task.
memory: 512
# Number of tasks that should be running in your service. You can also specify a map for autoscaling.
count: 1

variables:                    # Optional. Pass environment variables as key value pairs.
  LOG_LEVEL: info

secrets:                      # Optional. Pass secrets from AWS Systems Manager (SSM) Parameter Store.
  GITHUB_TOKEN: GITHUB_TOKEN  # The key is the name of the environment variable, the value is the name of the SSM parameter.


# Optional. You can override any of the values defined above by environment.
environments:
  test:
    count: 2               # Number of tasks to run for the "test" environment.
  • name: The name of your service.

  • type: The architecture type for your service. A Load balanced web service is an internet-facing service that's behind a load balancer, orchestrated by Amazon ECS on AWS Fargate.

  • image: The image section contains parameters relating to the Docker build configuration and exposed port.

    • build: Can be specified either as a string or a map. If you specify a simple string, Copilot interprets it as the path to your Dockerfile. It will assume that the dirname of the string you specify should be the build context. The manifest:

      image:
        build: path/to/dockerfile

      will result in the following call to docker build: $ docker build --file path/to/dockerfile path/to

      You can also specify build as a map:

      image:
        build:
         dockerfile: path/to/dockerfile
         context: context/dir
         args:
           key: value

      In this case, copilot will use the context directory you specified and convert the key-value pairs under args to --build-arg overrides. The equivalent docker build call will be: $ docker build --file path/to/dockerfile --build-arg key=value context/dir.

      You can also omit fields and Copilot will do its best to understand what you mean. For example, if you specify context but not dockerfile, Copilot will run Docker in the context directory and assume that your Dockerfile is named "Dockerfile." If you specify dockerfile but no context, Copilot assumes you want to run Docker in the directory that contains dockerfile.

      All paths are relative to your workspace root.

    • port: The port exposed in your Dockerfile. Copilot should parse this value for you.

    • healtcheck: Path exposed in your container to handle target group health check requests.

    • stickiness: Boolean that indicates whether sticky sessions are enabled.

  • cpu: Number of CPU units for the task. See the Amazon ECS docs for valid CPU values.

  • memory: Amount of memory in MiB used by the task. See the Amazon ECS docs for valid memory values.

  • count: Can be specified either as a number or a map. If you specify a number:

    count: 5

    The service will set the desired count to 5 and maintain 5 tasks in your service.

    Alternatively, you can specify a map for setting up autoscaling:

    count:
      range: 1-10
      cpu_percentage: 70
      memory_percentage: 80
    • range: Specify a minimum and maximum bound for the number of tasks your service should maintain.
    • cpu_percentage: Scale up or down based on the average CPU your service should maintain.
    • memory_percentage: Scale up or down based on the average memory your service should maintain.
  • variables: Map of key-value pairs that represents environment variables that will be passed to your service. Copilot will include a number of environment variables by default for you.

  • secrets: Map of key-value pairs that represents secret values from AWS Systems Manager Parameter Store that will passed to your service as environment variables securely.

  • environments: The environment section lets you overwrite any value in your manifest based on the environment you're in. In the example manifest above, we're overriding the count parameter so that we can run 2 copies of our service in our prod environment.

Clone this wiki locally