]> git.bundesbrandschatzamt.de Git - emacsconfig.git/commitdiff
aws snippets for the world!
authorAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Wed, 16 Mar 2016 13:09:51 +0000 (14:09 +0100)
committerAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Wed, 16 Mar 2016 13:09:51 +0000 (14:09 +0100)
- adding aws-elb-search to search through all load balancers to grep for
  eg an instance-id.

snippets/eshell-mode/aws-elb-search [new file with mode: 0644]
snippets/eshell-mode/aws-filters

diff --git a/snippets/eshell-mode/aws-elb-search b/snippets/eshell-mode/aws-elb-search
new file mode 100644 (file)
index 0000000..080e8ea
--- /dev/null
@@ -0,0 +1,9 @@
+# -*- mode: snippet -*-
+# name: aws-elb-search
+# key: aws-elb-search
+# --
+for REGION in `(insert-string (mapconcat 'identity bba-aws-regions " "))`; do
+    for BALANCER in \`aws --profile=${1:$$(yas-choose-value '("prod" "test"))} --region=\${REGION} elb describe-load-balancers --query "reverse(sort_by(LoadBalancerDescriptions, &CreatedTime)[].[LoadBalancerName])" --output text\`; do
+        aws --profile=$1 --region=\${REGION} elb describe-load-balancers --load-balancer-name \${BALANCER} --output text | awk "{print \\"\${REGION}:\${BALANCER}:\\"\\\$0}"
+    done
+done $0
index 63e0c39118d9f49c24aae827d9f655b48403d264..42755bd4fa7c9710c4cbd9463db97ce8c2cc210c 100644 (file)
@@ -2,4 +2,4 @@
 # name: aws-filters
 # key: awsfil
 # --
---filters "Name=${1:$$(yas-choose-value '("tag:Name" "tag:Project" "tag:Type" "instance.group-id" "private-ip-address"))},Values=$2" $0
\ No newline at end of file
+--filters "Name=${1:$$(yas-choose-value '("tag:Name" "tag:Project" "tag:Type" "tag:Cluster" "instance.group-id" "private-ip-address"))},Values=$2" $0
\ No newline at end of file