Skip to content

Instantly share code, notes, and snippets.

@dkarchmer
Created September 6, 2016 21:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dkarchmer/fb34d37458858eeeead456e454e41f1a to your computer and use it in GitHub Desktop.
Save dkarchmer/fb34d37458858eeeead456e454e41f1a to your computer and use it in GitHub Desktop.
AWSIID=$(aws ec2 run-instances --image-id ami-8da458e6 --count 1 --instance-type t2.micro \
--key-name myKeys --security-group-ids sg-XXXXXXXX \
| json -aH Instances | json -aH InstanceId); time aws ec2 wait instance-running
aws ecs register-task-definition --cli-input-json file://elasticsearch.json --region us-east-1
aws ecs register-task-definition --cli-input-json file://redis.json --region us-east-1
aws ecs list-task-definitions --region us-east-1
aws ecs run-task --task-definition foobar-elasticsearch:1 --count 1 --region us-east-1
{
"family": "foobar-elasticsearch",
"containerDefinitions": [
{
"name": "elasticsearch",
"image": "elasticsearch",
"cpu": 384,
"memory": 384,
"essential": true,
"environment": [
{ "name": "HAYSTACK_PORT", "value": "9200" }
],
"portMappings": [
{ "hostPort": 9200, "containerPort": 9200 }
]
}
]
}
{
"family": "foobar-redis",
"containerDefinitions": [
{
"name": "redis",
"image": "redis:latest",
"cpu": 384,
"memory": 384,
"essential": true,
"portMappings": [
{ "hostPort": 6379, "containerPort": 6379 }
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment