Skip to content

sparrc/auto-ecs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

auto-ecs

scripts for auto-setup of an ECS cluster and agent workdir

Pre-reqs:

  1. AWS access configured
  2. awscli and jq installed
  3. create an IAM role called ecsInstanceRole with the following policy attached: AmazonEC2ContainerServiceforEC2Role. see here for more details on this role.
  4. your ssh key imported to all regions:
./create-key-pairs.sh ~/.ssh/id_ed25519.pub

Directions:

# create default network setup:
aws cloudformation create-stack --stack-name Default-ECS --template-body file://cfn/ecs-default-network-stack.yaml
# create a cluster in us-west-2 (this will have no instances)
./create-cluster.sh us-west-2 myCluster
# add an m5.large ec2 container instance to cluster (defaults to m5.large)
./add-instance-to-cluster.sh myCluster m5.large
# register a task definition
aws ecs register-task-definition --region us-west-2 --cli-input-json file://sampletask.json
# run the task definition "dd" on cluster
./run-task.sh myCluster dd

Teardown:

  1. Run remove-instances-from-cluster.sh CLUSTER_NAME to terminate all instances in cluster, but keep the cluster.
  2. Run delete-cluster.sh CLUSTER_NAME to terminate all instances in cluster and delete it's cloudformation stack.

About

scripts for auto-setup of an ECS cluster and agent workdir

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages