--- /dev/null
+# -*- mode: snippet -*-
+# name: aws-autoscaling-describe-auto-scaling-groups
+# key: aws-autoscaling-describe-auto-scaling-groups
+# --
+aws --profile=${1:$$(yas-choose-value '("prod" "test"))} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" bba-aws-regions)}} autoscaling describe-auto-scaling-groups --query 'AutoScalingGroups[].{Name: AutoScalingGroupName, Desired: DesiredCapacity,Min: MinSize, Max: MaxSize}' --output ${4:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
--- /dev/null
+# -*- mode: snippet -*-
+# name: aws-autoscaling-describe-launch-configurations
+# key: aws-autoscaling-describe-launch-configurations
+# --
+aws --profile=${1:$$(yas-choose-value '("prod" "test"))} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" bba-aws-regions)}} autoscaling describe-launch-configurations --query 'reverse(sort_by(LaunchConfigurations &CreatedTime)[*].[LaunchConfigurationName, CreatedTime])' --output ${4:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
--- /dev/null
+# -*- mode: snippet -*-
+# name: aws-autoscaling-update-auto-scaling-group-min-max
+# key: aws-autoscaling-update-auto-scaling-group-min-max
+# --
+aws --profile=${1:$$(yas-choose-value '("prod" "test"))} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" bba-aws-regions)}} autoscaling update-auto-scaling-group --auto-scaling-group-name ${4:`(yank)`} --min-size $5 --max-size $6 $0
\ No newline at end of file
# name: aws-ec2-get-dns-names
# key: aws-ec2-get-dns-names
# --
-aws --profile=${1:$$(yas-choose-value '("prod" "test"))} ${2:--region=${3:$$(yas-choose-value bba-aws-regions)}} ec2 describe-instances --filters "Name=tag:Name,Values=$4" --query "Reservations[].Instances[?State.Name=='running'].[InstanceId, PublicDnsName]" --output ${5:$$(yas-choose-value '("table" "text" "json"))} $0
+aws --profile=${1:$$(yas-choose-value '("prod" "test"))} ${2:--region=${3:$$(yas-choose-value bba-aws-regions)}} ec2 describe-instances --filters "Name=tag:Name,Values=$4" --query "Reservations[].Instances[?State.Name=='running'].[InstanceId, PublicDnsName]" --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
# name: aws-ec2-instance-running
# key: aws-ec2-instance-running
# --
-aws --profile=${1:$$(yas-choose-value '("prod" "test"))} ${2:--region=${3:$$(yas-choose-value bba-aws-regions)}} ec2 describe-instances --instance-ids $4 --query "Reservations[].Instances[].[InstanceId, State.Name]" --output ${5:$$(yas-choose-value '("table" "text" "json"))} $0
+aws --profile=${1:$$(yas-choose-value '("prod" "test"))} ${2:--region=${3:$$(yas-choose-value bba-aws-regions)}} ec2 describe-instances --instance-ids $4 --query "Reservations[].Instances[].[InstanceId, State.Name]" --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
--- /dev/null
+# -*- mode: snippet -*-
+# name: aws-emr-list-clusters
+# key: aws-emr-list-clusters
+# --
+aws --profile=${1:$$(yas-choose-value '("prod" "test"))} --region=${2:$$(yas-choose-value "\$\{REGION\}" bba-aws-regions)} emr list-clusters --active --query 'Clusters[*].{ID: Id, NAME: Name}' --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
--- /dev/null
+# -*- mode: snippet -*-
+# name: aws-filters
+# key: awsfil
+# --
+--filters "Name=${1:$$(yas-choose-value '("tag:Name" "tag:Type" "instance.group-id" "private-ip-address"))},Values=$2" $0
\ No newline at end of file
--- /dev/null
+# -*- mode: snippet -*-
+# name: aws-regions
+# key: awsreg
+# --
+--region=${1:$$(yas-choose-value "\$\{REGION\}" bba-aws-regions)} $0
\ No newline at end of file
--- /dev/null
+# -*- mode: snippet -*-
+# name: aws-route53-list-hosted-zones
+# key: aws-route53-list-hosted-zones
+# --
+aws --profile=${1:$$(yas-choose-value '("prod" "test"))} route53 list-hosted-zones --query 'HostedZones[].[Id, Name]' --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
--- /dev/null
+# -*- mode: snippet -*-
+# name: aws-route53-list-resource-record-sets
+# key: aws-route53-list-resource-record-sets
+# --
+aws --profile=${1:$$(yas-choose-value '("prod" "test"))} route53 list-resource-record-sets --hosted-zone-id ${2:`(yank)`} --query \"ResourceRecordSets[?contains(Name, '$3')].Name\" --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
eshell-mode
+shell-mode
\ No newline at end of file
--- /dev/null
+# -*- mode: snippet -*-
+# name: aws-iam-userlist
+# key: aws-iam-userlist
+# --
+for user in $(aws --profile=${1:$$(yas-choose-value '("prod" "test"))} iam list-users --query 'Users[*].UserName' --output text); do aws --profile=$1 iam list-access-keys --user-name $user --query \"AccessKeyMetadata[?Status=='Active'].[UserName, AccessKeyId]\" --output text; done $0
\ No newline at end of file