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
#!/bin/bash | |
instance_size=$1 | |
cluster_id="mycoolcluster-xxxx" | |
primary_node="mycoolcluster-node" | |
region="us-east-1" | |
pending_status="" | |
check_for='"PendingModifiedValues": {},' | |
aws rds modify-db-instance --db-instance-identifier "${primary_node}" --db-instance-class "${instance_size}" --apply-immediately --region "${region}" |
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
<?php | |
require 'aws.phar'; | |
//=================================================================== | |
// Readme: | |
//=================================================================== | |
// To populate hostnames based on current live values, look up from AWS directly. | |
// Requires: | |
// - aws.phar in same folder as this script, or full path specified in the above require | |
// - IAM role assigned to node that allows Get* for ec2 | |
// |
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
aws ec2 describe-instances --region us-east-1 --filters "Name=tag:Group,Values=fancyapp1" --output json --query 'Reservations[*].Instances[*].{Name:Tags[?Key==`Name`].Value,PublicIP:PublicIpAddress}' |
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
#!/bin/bash | |
# Example how to query AWS for nodes that have been online older than a certain date | |
# Example below returns just the "Name" tag value (intent is for looping through for other actions) | |
# Example below also filters by "state=running" to excluded stopped or pending instances | |
# To get newer than a certain date, just alter ?LaunchTime<=${ec2_older_than_date} for the <= to be >= | |
query_older_than_minutes=10 |
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
from __future__ import print_function | |
import json | |
import datetime | |
import time | |
import boto3 | |
print('Loading function') | |