Last active
August 29, 2015 13:56
-
-
Save rch850/9000224 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Reset max_connections | |
aws rds reset-db-parameter-group --db-parameter-group-name ENTERYOURS --parameters "ParameterName=max_connections,ApplyMethod=immediate" | |
# Enable All Cross-Zone Load Balancing | |
for lb in $(aws elb describe-load-balancers --query="LoadBalancerDescriptions[].LoadBalancerName" --output text); do | |
echo $lb | |
aws elb modify-load-balancer-attributes --load-balancer-name $lb --load-balancer-attributes '{"CrossZoneLoadBalancing":{"Enabled":true}}' | |
done | |
# Print my cf stack | |
aws ec2 describe-instances --instance-id $(curl -s http://169.254.169.254/latest/meta-data/instance-id) --region ap-northeast-1 --query "Reservations[*].Instances[*].Tags[*]" --output text | grep "^aws:cloudformation:stack-name" | cut -f2 | |
# Print my vpc | |
aws ec2 describe-instances --instance-id $(curl -s http://169.254.169.254/latest/meta-data/instance-id) --region ap-northeast-1 --query "Reservations[*].Instances[*].VpcId" --output text | |
# Set environment variables from EC2 tags | |
# WARNING: some tag_key might be invalid as a variable name | |
while read tag_key tag_value; do | |
export EC2_TAG_${tag_key}="$tag_value" | |
done < <(aws ec2 describe-instances --instance-id $instance_id --query "Reservations[*].Instances[*].Tags[*]" --output text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment