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
| #!/usr/bin/env python | |
| import boto3 | |
| import collections | |
| import datetime | |
| import time | |
| ec = boto3.client('ec2',region_name="us-east-1") | |
| reservations = ec.describe_instances().get('Reservations',[]) | |
| instances = [ |
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 | |
| export DOMAIN=test.info | |
| export PROFILE=default | |
| aws --profile ${PROFILE} route53 list-resource-record-sets --hosted-zone-id $(aws --profile ${PROFILE} route53 list-hosted-zones-by-name --dns-name ${DOMAIN} --max-items 1 | jq -r .HostedZones[0].Id) > /tmp/${DOMAIN}.json | |
| for a in $(cat /tmp/${DOMAIN}.json | jq -r '.[][] | "\(.Name),\(.ResourceRecords[0].Value)"' | sort | uniq); do | |
| rr=$(echo $a | awk -F"," '{print $1}') | |
| value=$(echo $a | awk -F"," '{print $2}') | |
| echo -n "$rr,$value," |
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 | |
| InstanceId=$1 | |
| #for region in `aws ec2 describe-regions --output text | cut -f3` #unoptimized list order | |
| for region in us-east-1 us-east-2 us-west-1 us-west-2 eu-north-1 ap-south-1 eu-west-3 eu-west-2 eu-west-1 ap-northeast-2 ap-northeast-1 sa-east-1 ca-central-1 ap-southeast-1 ap-southeast-2 eu-central-1; | |
| do | |
| Name=$(aws ec2 describe-instances --region $region --instance-ids=$InstanceId | jq -r '.Reservations[].Instances[].Tags[] | select(.Key=="Name").Value') | |
| if [ "$Name" != "" ]; | |
| then | |
| echo $Name | |
| break |
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 | |
| InstanceName=$1 | |
| #for region in `aws ec2 describe-regions --output text | cut -f3` #unoptimized list order, but dynamic | |
| for region in us-east-1 us-east-2 us-west-1 us-west-2 eu-north-1 ap-south-1 eu-west-3 eu-west-2 eu-west-1 ap-northeast-2 ap-northeast-1 sa-east-1 ca-central-1 ap-southeast-1 ap-southeast-2 eu-central-1; | |
| do | |
| Id=$(aws ec2 describe-instances --region $region --filters Name=tag-value,Values=$InstanceName | jq -r .Reservations[].Instances[].InstanceId) | |
| if [ "$Id" != "" ]; | |
| then | |
| echo $Id | |
| break |
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
| #!/usr/bin/env python | |
| from __future__ import print_function | |
| import sys | |
| import os | |
| import json | |
| import boto3 | |
| from botocore.exceptions import ClientError |
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
| #!/usr/bin/env python | |
| from __future__ import print_function | |
| import json | |
| import boto3 | |
| domains_client=boto3.client('route53domains') | |
| resource_client=boto3.client('route53') | |
| paginator = resource_client.get_paginator('list_hosted_zones') |
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 | |
| aws route53 list-health-checks | jq -r '["ID","FQDN"], ["--","---"], (.[][] | [.Id, .HealthCheckConfig.FullyQualifiedDomainName]) | @tsv' |
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
| #!/usr/bin/env python | |
| from __future__ import print_function | |
| import json | |
| import boto3 | |
| ip="1.1.1.1/32" | |
| new_ip="2.2.2.2/32"' | |
| for region in ["us-east-1","us-west-1", "us-west-2"]: |
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
| #!/usr/bin/env python | |
| from __future__ import print_function | |
| import json | |
| import boto3 | |
| for region in ["us-east-1","us-west-1", "us-west-2"]: | |
| ec2=boto3.client('ec2', region ) | |
| sgs = ec2.describe_security_groups()["SecurityGroups"] | |
| for sg in sgs: |
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
| #!/usr/bin/env escript | |
| %% -*- erlang -*- | |
| %% Author: Drew Gulino | |
| -module(new_rel_file). | |
| -export([main/1]). | |
| write_terms(Filename, List) -> | |
| Format = fun(Term) -> io_lib:format("~tp.~n", [Term]) end, | |
| Text = lists:map(Format, List), |