Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/sh
# creating security groups
ec2-create-group 'AWS-OpsWorks-Web-Server' -d 'AWS OpsWorks Web server - do not change or delete'
ec2-create-group 'AWS-OpsWorks-Default-Server' -d 'AWS OpsWorks Default server - do not change or delete'
ec2-create-group 'AWS-OpsWorks-Blank-Server' -d 'AWS OpsWorks blank server - do not change or delete'
ec2-create-group 'AWS-OpsWorks-LB-Server' -d 'AWS OpsWorks load balancer - do not change or delete'
ec2-create-group 'AWS-OpsWorks-PHP-App-Server' -d 'AWS OpsWorks PHP-App server - do not change or delete'
ec2-create-group 'AWS-OpsWorks-DB-Master-Server' -d 'AWS OpsWorks database master server - do not change or delete'
ec2-create-group 'AWS-OpsWorks-Memcached-Server' -d 'AWS OpsWorks Memcached server - do not change or delete'
ec2-create-group 'AWS-OpsWorks-Monitoring-Master-Server' -d 'AWS OpsWorks Monitoring Ganglia server - do not change or delete'
ec2-create-group 'AWS-OpsWorks-Rails-App-Server' -d 'AWS OpsWorks Rails-App server - do not change or delete'
ec2-create-group 'AWS-OpsWorks-nodejs-App-Server' -d 'AWS OpsWorks nodejs-App server - do not change or delete'
ec2-create-group 'AWS-OpsWorks-Custom-Server' -d 'AWS OpsWorks custom server - do not change or delete'
# applying rules
ec2-authorize 'AWS-OpsWorks-Web-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-LB-Server'
ec2-authorize 'AWS-OpsWorks-Web-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-LB-Server'
ec2-authorize 'AWS-OpsWorks-Web-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-LB-Server'
ec2-authorize 'AWS-OpsWorks-Web-Server' -P tcp -p 22 -s 0.0.0.0/0
ec2-authorize 'AWS-OpsWorks-Web-Server' -P tcp -p 80 -s 0.0.0.0/0
ec2-authorize 'AWS-OpsWorks-Web-Server' -P tcp -p 443 -s 0.0.0.0/0
ec2-authorize 'AWS-OpsWorks-Default-Server' -P tcp -p 22 -s 0.0.0.0/0
ec2-authorize 'AWS-OpsWorks-Blank-Server' -P tcp -p 22 -s 0.0.0.0/0
ec2-authorize 'AWS-OpsWorks-LB-Server' -P tcp -p 22 -s 0.0.0.0/0
ec2-authorize 'AWS-OpsWorks-LB-Server' -P tcp -p 80 -s 0.0.0.0/0
ec2-authorize 'AWS-OpsWorks-LB-Server' -P tcp -p 443 -s 0.0.0.0/0
ec2-authorize 'AWS-OpsWorks-PHP-App-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-Web-Server'
ec2-authorize 'AWS-OpsWorks-PHP-App-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-LB-Server'
ec2-authorize 'AWS-OpsWorks-PHP-App-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-Web-Server'
ec2-authorize 'AWS-OpsWorks-PHP-App-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-LB-Server'
ec2-authorize 'AWS-OpsWorks-PHP-App-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-Web-Server'
ec2-authorize 'AWS-OpsWorks-PHP-App-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-LB-Server'
ec2-authorize 'AWS-OpsWorks-PHP-App-Server' -P tcp -p 22 -s 0.0.0.0/0
ec2-authorize 'AWS-OpsWorks-PHP-App-Server' -P tcp -p 80 -s 0.0.0.0/0
ec2-authorize 'AWS-OpsWorks-PHP-App-Server' -P tcp -p 443 -s 0.0.0.0/0
ec2-authorize 'AWS-OpsWorks-DB-Master-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-Rails-App-Server'
ec2-authorize 'AWS-OpsWorks-DB-Master-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-PHP-App-Server'
ec2-authorize 'AWS-OpsWorks-DB-Master-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-DB-Master-Server'
ec2-authorize 'AWS-OpsWorks-DB-Master-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-Web-Server'
ec2-authorize 'AWS-OpsWorks-DB-Master-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-Custom-Server'
ec2-authorize 'AWS-OpsWorks-DB-Master-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-nodejs-App-Server'
ec2-authorize 'AWS-OpsWorks-DB-Master-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-Rails-App-Server'
ec2-authorize 'AWS-OpsWorks-DB-Master-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-PHP-App-Server'
ec2-authorize 'AWS-OpsWorks-DB-Master-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-DB-Master-Server'
ec2-authorize 'AWS-OpsWorks-DB-Master-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-Web-Server'
ec2-authorize 'AWS-OpsWorks-DB-Master-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-Custom-Server'
ec2-authorize 'AWS-OpsWorks-DB-Master-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-nodejs-App-Server'
ec2-authorize 'AWS-OpsWorks-DB-Master-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-Rails-App-Server'
ec2-authorize 'AWS-OpsWorks-DB-Master-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-PHP-App-Server'
ec2-authorize 'AWS-OpsWorks-DB-Master-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-DB-Master-Server'
ec2-authorize 'AWS-OpsWorks-DB-Master-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-Web-Server'
ec2-authorize 'AWS-OpsWorks-DB-Master-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-Custom-Server'
ec2-authorize 'AWS-OpsWorks-DB-Master-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-nodejs-App-Server'
ec2-authorize 'AWS-OpsWorks-DB-Master-Server' -P tcp -p 22 -s 0.0.0.0/0
ec2-authorize 'AWS-OpsWorks-Memcached-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-Rails-App-Server'
ec2-authorize 'AWS-OpsWorks-Memcached-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-PHP-App-Server'
ec2-authorize 'AWS-OpsWorks-Memcached-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-Web-Server'
ec2-authorize 'AWS-OpsWorks-Memcached-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-Custom-Server'
ec2-authorize 'AWS-OpsWorks-Memcached-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-nodejs-App-Server'
ec2-authorize 'AWS-OpsWorks-Memcached-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-Rails-App-Server'
ec2-authorize 'AWS-OpsWorks-Memcached-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-PHP-App-Server'
ec2-authorize 'AWS-OpsWorks-Memcached-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-Web-Server'
ec2-authorize 'AWS-OpsWorks-Memcached-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-Custom-Server'
ec2-authorize 'AWS-OpsWorks-Memcached-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-nodejs-App-Server'
ec2-authorize 'AWS-OpsWorks-Memcached-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-Rails-App-Server'
ec2-authorize 'AWS-OpsWorks-Memcached-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-PHP-App-Server'
ec2-authorize 'AWS-OpsWorks-Memcached-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-Web-Server'
ec2-authorize 'AWS-OpsWorks-Memcached-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-Custom-Server'
ec2-authorize 'AWS-OpsWorks-Memcached-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-nodejs-App-Server'
ec2-authorize 'AWS-OpsWorks-Memcached-Server' -P tcp -p 22 -s 0.0.0.0/0
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-Rails-App-Server'
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-PHP-App-Server'
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-DB-Master-Server'
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-Web-Server'
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-LB-Server'
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-Memcached-Server'
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-Default-Server'
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-Custom-Server'
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-nodejs-App-Server'
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-Rails-App-Server'
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-PHP-App-Server'
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-DB-Master-Server'
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-Web-Server'
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-LB-Server'
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-Memcached-Server'
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-Default-Server'
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-Custom-Server'
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-nodejs-App-Server'
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-Rails-App-Server'
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-PHP-App-Server'
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-DB-Master-Server'
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-Web-Server'
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-LB-Server'
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-Memcached-Server'
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-Default-Server'
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-Custom-Server'
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-nodejs-App-Server'
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P tcp -p 22 -s 0.0.0.0/0
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P tcp -p 80 -s 0.0.0.0/0
ec2-authorize 'AWS-OpsWorks-Monitoring-Master-Server' -P tcp -p 443 -s 0.0.0.0/0
ec2-authorize 'AWS-OpsWorks-Rails-App-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-Web-Server'
ec2-authorize 'AWS-OpsWorks-Rails-App-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-LB-Server'
ec2-authorize 'AWS-OpsWorks-Rails-App-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-Web-Server'
ec2-authorize 'AWS-OpsWorks-Rails-App-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-LB-Server'
ec2-authorize 'AWS-OpsWorks-Rails-App-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-Web-Server'
ec2-authorize 'AWS-OpsWorks-Rails-App-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-LB-Server'
ec2-authorize 'AWS-OpsWorks-Rails-App-Server' -P tcp -p 22 -s 0.0.0.0/0
ec2-authorize 'AWS-OpsWorks-Rails-App-Server' -P tcp -p 80 -s 0.0.0.0/0
ec2-authorize 'AWS-OpsWorks-Rails-App-Server' -P tcp -p 443 -s 0.0.0.0/0
ec2-authorize 'AWS-OpsWorks-nodejs-App-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-Web-Server'
ec2-authorize 'AWS-OpsWorks-nodejs-App-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-LB-Server'
ec2-authorize 'AWS-OpsWorks-nodejs-App-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-Web-Server'
ec2-authorize 'AWS-OpsWorks-nodejs-App-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-LB-Server'
ec2-authorize 'AWS-OpsWorks-nodejs-App-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-Web-Server'
ec2-authorize 'AWS-OpsWorks-nodejs-App-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-LB-Server'
ec2-authorize 'AWS-OpsWorks-nodejs-App-Server' -P tcp -p 22 -s 0.0.0.0/0
ec2-authorize 'AWS-OpsWorks-nodejs-App-Server' -P tcp -p 80 -s 0.0.0.0/0
ec2-authorize 'AWS-OpsWorks-nodejs-App-Server' -P tcp -p 443 -s 0.0.0.0/0
ec2-authorize 'AWS-OpsWorks-Custom-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-Rails-App-Server'
ec2-authorize 'AWS-OpsWorks-Custom-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-PHP-App-Server'
ec2-authorize 'AWS-OpsWorks-Custom-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-Web-Server'
ec2-authorize 'AWS-OpsWorks-Custom-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-LB-Server'
ec2-authorize 'AWS-OpsWorks-Custom-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-Custom-Server'
ec2-authorize 'AWS-OpsWorks-Custom-Server' -P tcp -p 1-65535 -o 'AWS-OpsWorks-nodejs-App-Server'
ec2-authorize 'AWS-OpsWorks-Custom-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-Rails-App-Server'
ec2-authorize 'AWS-OpsWorks-Custom-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-PHP-App-Server'
ec2-authorize 'AWS-OpsWorks-Custom-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-Web-Server'
ec2-authorize 'AWS-OpsWorks-Custom-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-LB-Server'
ec2-authorize 'AWS-OpsWorks-Custom-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-Custom-Server'
ec2-authorize 'AWS-OpsWorks-Custom-Server' -P udp -p 1-65535 -o 'AWS-OpsWorks-nodejs-App-Server'
ec2-authorize 'AWS-OpsWorks-Custom-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-Rails-App-Server'
ec2-authorize 'AWS-OpsWorks-Custom-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-PHP-App-Server'
ec2-authorize 'AWS-OpsWorks-Custom-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-Web-Server'
ec2-authorize 'AWS-OpsWorks-Custom-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-LB-Server'
ec2-authorize 'AWS-OpsWorks-Custom-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-Custom-Server'
ec2-authorize 'AWS-OpsWorks-Custom-Server' -P icmp -t -1:-1 -o 'AWS-OpsWorks-nodejs-App-Server'
ec2-authorize 'AWS-OpsWorks-Custom-Server' -P tcp -p 22 -s 0.0.0.0/0
ec2-authorize 'AWS-OpsWorks-Custom-Server' -P tcp -p 80 -s 0.0.0.0/0
ec2-authorize 'AWS-OpsWorks-Custom-Server' -P tcp -p 443 -s 0.0.0.0/0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment