Load Balanced Web Service
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
String
The name of your service.
type
String
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
Map
The image section contains parameters relating to the Docker build configuration and exposed port.
image.build
String or Map
If you specify a 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
$ 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
$ docker build --file path/to/dockerfile --build-arg key=value context/dir
.
You can 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.
image.port
Integer
The port exposed in your Dockerfile. Copilot should parse this value for you from your EXPOSE
instruction.
http
Map
The http section contains parameters related to integrating your service with an Application Load Balancer.
http.path
String
Requests to this path will be forwarded to your service. Each Load Balanced Web Service should listen on a unique path.
http.healthcheck
String
Path exposed in your container to handle target group health check requests.
http.stickiness
Boolean
Indicates whether sticky sessions are enabled.
cpu
Integer
Number of CPU units for the task. See the Amazon ECS docs for valid CPU values.
memory
Integer
Amount of memory in MiB used by the task. See the Amazon ECS docs for valid memory values.
count
Integer or Map
If you specify a number:
count: 5
Alternatively, you can specify a map for setting up autoscaling:
count:
range: 1-10
cpu_percentage: 70
memory_percentage: 80
count.range
String
Specify a minimum and maximum bound for the number of tasks your service should maintain.
count.cpu_percentage
Integer
Scale up or down based on the average CPU your service should maintain.
count.memory_percentage
Integer
Scale up or down based on the average memory your service should maintain.
variables
Map
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
Key-value pairs that represents secret values from AWS Systems Manager Parameter Store that will passed to your service as environment variables securely.
environments
Map
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.