I hereby claim:
- I am aaroncaito on github.
- I am aaroncaito (https://keybase.io/aaroncaito) on keybase.
- I have a public key ASA7rblCYllGjbN6ONoEd9ZPH2Dk0vdbaqZnKdzNvy7QMgo
To claim this, I am signing this object:
#!/usr/bin/env python3 | |
''' | |
Sample script creates some ec2 instances, applies security rules, and | |
configures salt reporting to master. | |
''' | |
import boto.ec2, time, os |
servers=( $$host1 $$host2 $$host3 ) | |
for server in ${servers[@]}; do ip=`dig +short $server`; echo "-=# $server #=- -=@ $ip @=-"; done | |
pbpaste > ~/var/servers | |
cat ~/var/servers | grep $$public_ip |
servers=$(aws ec2 describe-instances --filters "Name=tag:opsworks:stack,Values=$$<TAG>" --profile AIM --query "Reservations[*].Instances[*].PublicIpAddress") | |
for server in ${servers[@]} | |
do | |
echo "-=# $server #=-" | |
test=`ssh -t -i .ssh/$$<KEY> ubuntu@$server 'if tail /var/log/apache2/error.log | grep Segmentation > /dev/null; then echo -n "1"; else echo -n "0"; fi'` | |
echo $test | |
if [ $test == 1 ] | |
then | |
echo "Segmentation fault found, restarting apache2 on $server" | |
ssh -t -i .ssh/$$<KEY> ubuntu@$server 'sudo service apache2 restart' |
cidrs=(1.18.12.0/24 | |
1.15.46.253/24 | |
1.65.231.0/24) | |
for cidr in ${cidrs[@]};do aws ec2 authorize-security-group-ingress --profile <some-profile> --group-id <some-sec-group> --protocol tcp --port 22 --cidr $cidr --dry-run; done |
``` | |
# DEMO TO SHOW RESOURCE RELATIONSHIPS | |
## NOT TO BE USED WITHOUT SIGNIFICANT CHANGES | |
- Complete resource requirements | |
- Don't use inline rules for security groups as you'll have circular dependencies | |
- Probably use a lot more variables with settings files per environment | |
- Make pod blocks and turn them into re-usable module | |
- Make vpc&zone as module as well | |
- Newer terraform handles lists better, better ways to do stuff |
I hereby claim:
To claim this, I am signing this object:
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
phone = phone.replace(/[- ()]/g, "") | |
return "1"+phone |