-
Notifications
You must be signed in to change notification settings - Fork 17
Configuration File
Configuration file defines how your application should be configured and deployed in the target environment (AWS). You can think of a configuration file as a manifest or a blueprint of the target infrastructure.
Here's a sample configuration file in YAML format:
name: echo
cluster: cluster1
port: 8080
cpu: 1.0
memory: 200m
units: 4
load_balancer:
enabled: true
port: 80
https_port: 443
health_check:
interval: 30s
path: "/ping"
status: "200-299"
timeout: 10s
healthy_limit: 5
unhealthy_limit: 5
logging:
driver: awslogs
options:
awslogs-group: echologs
aws:
elb_name: echo_elb
elb_target_group_name: echo_elb_tg
elb_security_group_name: echo_elb_sg
elb_certificate_arn: "arn:aws:acm:region_name:account_id:certificate/identifier"
ecr_repo_name: coldbrew/echo
docker:
bin: "/usr/local/bin/docker"
Name of the application.
- Default: (application directory name)
- Limits: Max 32 characters. Alphanumeric, underline, and dash characters.
Name of the cluster where your application will run. You use cluster-create command to create a new cluster.
- Default:
"cluster1"
- Limits: Max 32 characters. Alphanumeric, underline, and dash characters.
Specify a port number if your application listens on a TCP port. This must match the value of EXPOSE
in Dockerfile
.
If your application does not listen on TCP port, specify 0
.
Multiple ports will be supported in the future release.
- Default:
80
CPU resources your application unit needs. 1.0
= 1 core unit.
- Default:
0.5
Memory limits for your application unit. You can use m
, `g' to indicate mega bytes and giga bytes.
- Default:
"500m"
The number of application units to deploy.
- Default:
1
Environment variables for your application. These variables will be passed to your application when they run in the container.
Set this to true
if you want to attach a load balancer to the application. Otherwise the application will not have a load balancer.
- Default:
false
Listening port (TCP) of the load balancer. If you're enabling HTTPS (.load_balancer.https_port
), you can disable HTTP traffic by specifying 0
.
- Default:
80
HTTPS port for the load balancer. To enable HTTPS traffic, you have to specify HTTPS port number (typically 443
) using this attribute. You also have to specify ACM Certificate ARN using .aws.elb_certificate_arn
config.
- Default:
(none)
Load balancer periodically sends requests to your application units to test their status. These tests are called health checks.
The approximate amount of time between health checks of an individual application unit. The range is 5 to 300 seconds.
- Default:
15s
The ping path that is the destination on the targets for health checks.
- Default:
"/"
The HTTP codes to use when checking for a successful response from a target. You can specify a single status (e.g. "200"
), multiple statuses ("200,201,202"
), or a range of status ("200-299"
).
- Default:
"200-299"
The amount of time during which no response from a target means a failed health check. The range is 2 to 60 seconds.
- Default:
10s
The number of consecutive successful health checks required before considering an unhealthy target healthy. The range is 2 to 10.
- Default:
3
The number of consecutive failed health checks required before considering a target unhealthy. The range is 2 to 10.
- Default:
3
Logging driver name. See here for available logging drivers.
AWS Logs (CloudWatch Logs) is is installed in the default coldbrew-cli ECS Container Instances. To use it, simply specify "awslogs"
here.
Logging driver specific options.
By default, coldbrew-cli will create and configure an ELB Load Balancer for your application. But, if you want to use an existing ELB load balancer, you can specify the name of it here.
- Default:
"{application-name}-elb"
By default, coldbrew-cli will create and configure an ELB Target Group for your application. But, if you want to use an existing ELB Target Group, you can specify the name of it here. Make sure your ELB Target Group is properly configured with your ELB Load Balancer (e.g. having listeners).
- Default:
"{application-name}-elb-tg"
By default, coldbrew-cli will create and configure an EC2 Security Group for the ELB Load Balanacer. But, if you want to use an existing EC2 Security Group, you can specify the name of it here.
- Default:
"{application-name}-elb-sg"
To enable HTTPS for ELB Load Balancer, you must specify ACM Certificate ARN.
- Default:
(none)
Specify the name of ECR Repository of your application's Docker images.
- Default:
"coldbrew/{app-name}"
coldbrew-cli use docker
executable to build and push Docker images. You can use this to specify your own docker executable (e.g. "/usr/local/bin/docker"
)
- Default:
docker
When you deploy
your application for the first time, configuration file will be used to create and configure AWS resources for your application. If you make some changes in the configuration file and deploy
again, not all changes will be reflected immediately. See this for more details.
Typically you can put the configuration file at the root directory of your project, but, if the configuration file is located in different location, you can use --config
flag to specify its path (either absolute path or relative to the application directory).
Currently, json
or yaml
file formats are supported. You can specify the format using --config-format
flag.