Skip to content

Instantly share code, notes, and snippets.

@helaili
Last active August 29, 2015 14:16
Show Gist options
  • Save helaili/24920cc99e5f24923a82 to your computer and use it in GitHub Desktop.
Save helaili/24920cc99e5f24923a82 to your computer and use it in GitHub Desktop.
Automate GitHub Enterprise provisioning on AWS - Env vars AWS_ACCESS_KEY and AWS_SECRET_KEY should be set
key=alain-eu-west-1
region=eu-west-1
groupName=gh-group
groupDescription="gh-group description"
ami=ami-1141d466
ec2-create-group --region $region $groupName -d $groupDescription
ec2-authorize --region $region $groupName -P tcp -p 8443
ec2-authorize --region $region $groupName -P tcp -p 8080
ec2-authorize --region $region $groupName -P tcp -p 122
ec2-authorize --region $region $groupName -P udp -p 1194
ec2-authorize --region $region $groupName -P udp -p 161
ec2-authorize --region $region $groupName -P tcp -p 443
ec2-authorize --region $region $groupName -P tcp -p 80
ec2-authorize --region $region $groupName -P tcp -p 22
ec2-authorize --region $region $groupName -P tcp -p 9418
ec2-authorize --region $region $groupName -P tcp -p 25
ec2-run-instances $ami --key $key --region $region --group $groupName \
--instance-type r3.xlarge \
--block-device-mapping '/dev/xvdf=:100:true:gp2' \
--ebs-optimized
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment