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 ruby | |
# coding: utf-8 | |
# usage: $0 [some options for `aws ec2`] | |
require 'json' | |
line_format = "%-19s %-23s %-11s %-15s %-15s %-12s %-16s %s" | |
line_length = 142 | |
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
$ RDS_NAME=hogehoge | |
$ echo "[Time] DBInstanceIdentifier AvailabilityZone (SecondaryAvailabilityZone) DBInstanceClass DBInstanceStatus" ; while : | |
do | |
printf "[%s] %s %s (%s) %s %s\n" $(date +%T) \ | |
$(aws rds describe-db-instances --db-instance-identifier ${RDS_NAME} --query DBInstances[].[DBInstanceIdentifier,AvailabilityZone,SecondaryAvailabilityZone,DBInstanceClass,DBInstanceStatus] --output text); | |
sleep 10 || exit | |
done |
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 | |
# print paramaters and format | |
PARAMS=" | |
DBInstanceIdentifier | |
AvailabilityZone | |
SecondaryAvailabilityZone | |
DBInstanceClass | |
DBInstanceStatus | |
" |
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 | |
( | |
echo "InstanceId,Name,Status,PublicIP,PrivateIP,InstanceType,AvailabilityZone,LaunchTime" | |
aws ec2 describe-instances | \ | |
jq -r '.[][].Instances[] | [.InstanceId, | |
[.Tags[] | select(.Key == "Name").Value][], | |
.State.Name, .PublicIpAddress, | |
.PrivateIpAddress, | |
.InstanceType, | |
.Placement.AvailabilityZone, |
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 | |
# -*- coding: utf-8 -*- | |
import os | |
import sys | |
import json | |
import argparse | |
try: | |
import boto3 |
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/sh | |
set -e | |
prog=/usr/bin/mackerel-agent | |
conf=/etc/mackerel-agent/mackerel-agent.conf | |
cloudfront_host="CloudFront" | |
# mkr, AWSCLI インストール | |
yum install -y -q awscli mkr |
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 | |
#----#----#----#----#----#----#----#----#----#----#----#----#----#----#----# | |
function msg() { | |
printf "$*" >&2 | |
} | |
# ヘルプメッセージ | |
function usage() { | |
printf "usage: %s <EC2 Instance ID> [<AMI ID>]\n\n" ${0##*/} >&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
[profile bastion] | |
region = ap-northeast-1 | |
[profile temp-operator] | |
region = ap-northeast-1 | |
[profile System1-Prod] | |
# System 1 - Production < bastion | |
role_arn = arn:aws:iam::666600006666:role/user-watanabe | |
source_profile = bastion |
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 | |
# DEPENDENCY: bash (or zsh), aws-cli, ruby, fzf, highlight | |
# AWS Profile Selector | |
function aws-profile() { | |
# profile 名のリスト選択 | |
local __profile=$(select-aws-profile $@) |
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 | |
# usage: $0 <Access Log URL> <accessId> <accessKey> | |
function usage(){ | |
echo "Usage: ${0##*/} <Access Log URL> <accessId> <accessKey>" | |
echo "" | |
} | |
if [ "$3" = "" ]; then | |
usage |
OlderNewer