Skip to content

Configuration File

Daniel Kang edited this page Oct 25, 2016 · 21 revisions

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                      
  https: no                         
  port: 80                          
                                    
  health_check:
    interval: 30s                   
    path: "/ping"                   
    status: "200-299"               
    timeout: 10s
    healthy_limit: 5
    unhealthy_limit: 5

aws:
  elb_name: echo_elb
  elb_target_group_name: echo_elb_tg
  elb_security_group_name: echo_elb_sg
  ecr_namespace: coldbrew/echo

docker:
  bin: "/usr/local/bin/docker"

Attributes

Application

.name

Name of the application.

  • Default: (application directory name)
  • Limits: Max 32 characters. Alphanumeric, underline, and dash characters.

.cluster

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.

.port

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

CPU resources your application unit needs. 1.0 = 1 core unit.

  • Default: 0.5

.memory

Memory limits for your application unit. You can use m, `g' to indicate mega bytes and giga bytes.

  • Default: "500m"

.units

The number of application units to deploy.

  • Default: 1

.env

Environment variables for your application. These variables will be passed to your application when they run in the container.

Load Balancer

.load_balancer.enabled

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

.load_balancer.https

Set this to true to set up a HTTPS load balancer. This is not supported in the current version.

  • Default: false

.load_balancer.port

Listening port (TCP) of the load balancer.

  • Default: 80

Load Balancer Health Check

Load balancer (ELB Target Group) does perform health checks on your application units.

.load_balancer.health_check.interval

Defines how often health check should be performed on each application unit.

  • Default: 15s

.load_balancer.health_check.path

Specifies the URL path for the health check. Load balancer will make a HTTP request to this URL path to determine application unit's health.

  • Default: "/"

.load_balancer.health_check.status

Specifies expected HTTP status. To pass the health checks, your application needs to return these status codes when received a HTTP request on the health check path (.load_balancer.health_check.path). This can be a single status (e.g. "200"), multiple statuses ("200,201,202"), or a range of status ("200-299").

  • Default: "200-299"

.load_balancer.health_check.timeout

Timeout limits of each individual health check request. To pass the health check, your application needs to return HTTP status within this time limit.

  • Default: 10s

.load_balancer.health_check.healthy-limit

If your application passes

  • Default: 3

.load_balancer.health_check.unhealthy-limit

  • Default: 3

AWS

.aws.elb_name

If no ELB Load Balancer found with this name, CLI will create and configure a new one.

  • Default: "{application-name}-elb"

.aws.elb_target_group_name

If no ELB Target Group found with this name, CLI will create and configure a new one.

  • Default: "{application-name}-elb-tg"

.aws.elb_security_group_name

If no EC2 Security Group found with this name, CLI will create and configure a new one.

  • Default: "{application-name}-elb-sg"

.aws.ecr_repo_name

  • Default: "coldbrew/{app-name}"

Docker

.docker.bin

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

Deployment and Configuration Changes

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.

Configuration File

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.