github.com/recobe182/terraform@v0.8.5-0.20170117231232-49ab22a935b7/examples/aws-ecs-alb/cloud-config.yml (about)

     1  #cloud-config
     2  coreos:
     3    units:
     4     - name: update-engine.service
     5       command: stop
     6     - name: amazon-ecs-agent.service
     7       command: start
     8       runtime: true
     9       content: |
    10         [Unit]
    11         Description=AWS ECS Agent
    12         Documentation=https://docs.aws.amazon.com/AmazonECS/latest/developerguide/
    13         Requires=docker.socket
    14         After=docker.socket
    15  
    16         [Service]
    17         Environment=ECS_CLUSTER=${ecs_cluster_name}
    18         Environment=ECS_LOGLEVEL=${ecs_log_level}
    19         Environment=ECS_VERSION=${ecs_agent_version}
    20         Restart=on-failure
    21         RestartSec=30
    22         RestartPreventExitStatus=5
    23         SyslogIdentifier=ecs-agent
    24         ExecStartPre=-/bin/mkdir -p /var/log/ecs /var/ecs-data /etc/ecs
    25         ExecStartPre=-/usr/bin/docker kill ecs-agent
    26         ExecStartPre=-/usr/bin/docker rm ecs-agent
    27         ExecStartPre=/usr/bin/docker pull amazon/amazon-ecs-agent:$${ECS_VERSION}
    28         ExecStart=/usr/bin/docker run --name ecs-agent \
    29                                       --volume=/var/run/docker.sock:/var/run/docker.sock \
    30                                       --volume=/var/log/ecs:/log \
    31                                       --volume=/var/ecs-data:/data \
    32                                       --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro \
    33                                       --volume=/run/docker/execdriver/native:/var/lib/docker/execdriver/native:ro \
    34                                       --publish=127.0.0.1:51678:51678 \
    35                                       --env=ECS_LOGFILE=/log/ecs-agent.log \
    36                                       --env=ECS_LOGLEVEL=$${ECS_LOGLEVEL} \
    37                                       --env=ECS_DATADIR=/data \
    38                                       --env=ECS_CLUSTER=$${ECS_CLUSTER} \
    39                                       --env=ECS_AVAILABLE_LOGGING_DRIVERS='["awslogs"]' \
    40                                       --log-driver=awslogs \
    41                                       --log-opt awslogs-region=${aws_region} \
    42                                       --log-opt awslogs-group=${ecs_log_group_name} \
    43                                       amazon/amazon-ecs-agent:$${ECS_VERSION}