Skip to content

Instantly share code, notes, and snippets.

@rossf7
Created May 26, 2015 11:29
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rossf7/27729f3fa099df3fe095 to your computer and use it in GitHub Desktop.
Save rossf7/27729f3fa099df3fe095 to your computer and use it in GitHub Desktop.
force12-ecs-launch-config
#cloud-config
coreos:
units:
-
name: amazon-ecs-agent.service
command: start
runtime: true
content: |
[Unit]
Description=Amazon ECS Agent
After=docker.service
Requires=docker.service
[Service]
Environment=ECS_CLUSTER=default
Environment=ECS_LOGLEVEL=info
Environment=ECS_ENGINE_AUTH_TYPE=dockercfg
Environment=ECS_ENGINE_AUTH_DATA={"quay.io":{"auth":"REMOVED","email":"REMOVED"}}
ExecStartPre=-/usr/bin/docker kill ecs-agent
ExecStartPre=-/usr/bin/docker rm ecs-agent
ExecStartPre=/usr/bin/docker pull amazon/amazon-ecs-agent:v1.0.0
ExecStart=/usr/bin/docker run --name ecs-agent --env=ECS_CLUSTER=${ECS_CLUSTER} --env=ECS_LOGLEVEL=${ECS_LOGLEVEL} --env=ECS_ENGINE_AUTH_TYPE --env=ECS_ENGINE_AUTH_DATA --publish=127.0.0.1:51678:51678 --volume=/var/run/docker.sock:/var/run/docker.sock amazon/amazon-ecs-agent:v1.0.0
ExecStop=/usr/bin/docker stop ecs-agent
-
name: newrelic-system-monitor.service
command: start
runtime: true
content: |
[Unit]
Description=New Relic System Monitor (nrsysmond)
After=amazon-ecs-agent.service
Requires=docker.service
[Service]
TimeoutStartSec=10m
ExecStartPre=-/usr/bin/docker kill nrsysmond
ExecStartPre=-/usr/bin/docker rm nrsysmond
ExecStartPre=/usr/bin/docker pull newrelic/nrsysmond:latest
ExecStart=/usr/bin/docker run --name nrsysmond --rm \
-v /proc:/proc -v /sys:/sys -v /dev:/dev -v /var/run/docker.sock:/var/run/docker.sock --privileged=true --net=host \
-e NRSYSMOND_license_key=REMOVED \
-e NRSYSMOND_loglevel=info \
-e NRSYSMOND_hostname=%H \
newrelic/nrsysmond:latest
ExecStop=/usr/bin/docker stop -t 30 nrsysmond
#cloud-config
coreos:
units:
-
name: amazon-ecs-agent.service
command: start
runtime: true
content: |
[Unit]
Description=Amazon ECS Agent
After=docker.service
Requires=docker.service
[Service]
Environment=ECS_CLUSTER=staging
Environment=ECS_LOGLEVEL=info
Environment=ECS_ENGINE_AUTH_TYPE=dockercfg
Environment=ECS_ENGINE_AUTH_DATA={"quay.io":{"auth":"REMOVED","email":"REMOVED"}}
ExecStartPre=-/usr/bin/docker kill ecs-agent
ExecStartPre=-/usr/bin/docker rm ecs-agent
ExecStartPre=/usr/bin/docker pull amazon/amazon-ecs-agent:v1.1.0
ExecStart=/usr/bin/docker run --name ecs-agent --env=ECS_CLUSTER=${ECS_CLUSTER} --env=ECS_LOGLEVEL=${ECS_LOGLEVEL} --env=ECS_ENGINE_AUTH_TYPE --env=ECS_ENGINE_AUTH_DATA --publish=127.0.0.1:51678:51678 --volume=/var/run/docker.sock:/var/run/docker.sock amazon/amazon-ecs-agent:v1.1.0
ExecStop=/usr/bin/docker stop ecs-agent
-
name: newrelic-system-monitor.service
command: start
runtime: true
content: |
[Unit]
Description=New Relic System Monitor (nrsysmond)
After=amazon-ecs-agent.service
Requires=docker.service
[Service]
TimeoutStartSec=10m
ExecStartPre=-/usr/bin/docker kill nrsysmond
ExecStartPre=-/usr/bin/docker rm nrsysmond
ExecStartPre=/usr/bin/docker pull newrelic/nrsysmond:latest
ExecStart=/usr/bin/docker run --name nrsysmond --rm \
-v /proc:/proc -v /sys:/sys -v /dev:/dev -v /var/run/docker.sock:/var/run/docker.sock --privileged=true --net=host \
-e NRSYSMOND_license_key=REMOVED \
-e NRSYSMOND_loglevel=info \
-e NRSYSMOND_hostname=%H \
newrelic/nrsysmond:latest
ExecStop=/usr/bin/docker stop -t 30 nrsysmond
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment