The config.yml
file should live in a .deploy
directory at the root of your project. Before proceeding it will help to read the assumptions around infrastructure naming that this tool makes.
name: coolapp
org: myorg
cluster: clustername
ecrRepo: reponame
projectDirectory: app
qa:
service: coolservice
taskRole: myCoolRole
executionRole: myCoolTaskExecutionRole
envFile: env-file.env
deployment:
command: ["npm", "start"]
cpu: 1
memory: 128
port: 3001
desiredCount: 1
version: latest # optional
maxHealthyPercent: 150 # optional
minHealthyPercent: 100 # optional
loadBalancer:
targetGroupArn: target::group::arn
logging:
logDriver: syslog
options:
syslog-address: udp://<ip_address>:2233
Below are a list of all the top level properties required in the config file. There are three required top level properties and then environment specific configuration declarations.
name
(string)
This should be the name of the application you're deploying. Its value will be used to name the container in the task definition, and it is also the default value for the ECR repo and cluster to deploy to if custom values are not set.
org
(string)
This property is used to namespace all ECR repos and clusters in your AWS setup. It's used in few places in the assumptions document.
- The top-level namespace of ECR repo's
- The top-level namespace of all ECS clusters
cluster
(string)
An optional parameter for the name of the cluster to launch the service in, to
which Airmail will add the org name and environment prefixes. If not set,
Airmail will use the value of the name
field.
ecrRepo
(string)
An optional parameter for the name of the ECR repo to push the container image to, to
which Airmail will add the org name and environment prefixes. If not set,
Airmail will use the value of the name
field.
projectDirectory
(string)
This is just the directory where your application can be found relative to the .deploy
directory you're running the command from. The assumption here is that there will be a Dockerfile in the directory you point to and that the application will be in the same directory.
After the top level properties of name
, org
, and projectDirectory
you will begin to define configuration for each environment. To do this simply define a new property that is the name of your environment. For this example we will proceed with an environment called qa
, but this name can be anything that makes sense for your setup. The values of these properties have direct correlation to properties for ECS task/service declarations.
(string)
The name of the ECS service deployed into the cluster.
string
The IAM role the container assumes when runnning. Find more details here: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#task_role_arn
string
The IAM role for pulling from ECR/publishing container logs to Cloudwatch. Find more details here: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#execution_role_arn
object
An object with different properties related to the deployment of the ECS task. Values in here directly correspond to the container runtime environment. Details can be found here: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_environment
array (optional)
The command to run inside the container to begin running.
integer
The number of CPU units the ECS container agent will reserve for the container
integer
The amount of memory (in MiB) used by the task
integer
The port the container exposes. Used for load balancing
integer
The number of instances of the task to run
string (optional)
The version to use for tagging the container image when building. If this value is not defined then it will be pulled from the version
property in the package.json
file in the same directory of the Dockerfile used for building the application
integer (optional) [default: 200]
The upper limit on the number of tasks your service will run. More info: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/basic-service-params.html
integer (optional) [default: 80]
The lower limit on the number of tasks your service will run. More info: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/basic-service-params.html
object (optional)
Right now Airmail assumes you're load balancing your deployment. It's super rudimentary and will be worked on soon.
string (optional)
The ARN of the target group for an ALB
object (optional)
An object for configuring the log driver of your task definition. More details: https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_LogConfiguration.html
string (optional)
The name of the log driver to use. See logging documentation provided by AWS for valid values.
object (optional)
An object of options passed to the logging driver. These options depend on the logging driver used.