]> git.bundesbrandschatzamt.de Git - emacsconfig.git/commitdiff
yasnippets for Amazon AWS.
authorAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Fri, 26 Feb 2016 13:02:51 +0000 (14:02 +0100)
committerAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Fri, 26 Feb 2016 13:08:42 +0000 (14:08 +0100)
- more snippets for amazon aws cli

12 files changed:
snippets/eshell-mode/aws-autoscaling-describe-auto-scaling-groups [new file with mode: 0644]
snippets/eshell-mode/aws-autoscaling-describe-launch-configurations [new file with mode: 0644]
snippets/eshell-mode/aws-autoscaling-update-auto-scaling-group-min-max [new file with mode: 0644]
snippets/eshell-mode/aws-ec2-get-dns-names
snippets/eshell-mode/aws-ec2-instance-running
snippets/eshell-mode/aws-emr-list-clusters [new file with mode: 0644]
snippets/eshell-mode/aws-filters [new file with mode: 0644]
snippets/eshell-mode/aws-regions [new file with mode: 0644]
snippets/eshell-mode/aws-route53-list-hosted-zones [new file with mode: 0644]
snippets/eshell-mode/aws-route53-list-resource-record-sets [new file with mode: 0644]
snippets/sh-mode/.yas-parents
snippets/shell-mode/aws-iam-userlist [new file with mode: 0644]

diff --git a/snippets/eshell-mode/aws-autoscaling-describe-auto-scaling-groups b/snippets/eshell-mode/aws-autoscaling-describe-auto-scaling-groups
new file mode 100644 (file)
index 0000000..2d71f0f
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- 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
diff --git a/snippets/eshell-mode/aws-autoscaling-describe-launch-configurations b/snippets/eshell-mode/aws-autoscaling-describe-launch-configurations
new file mode 100644 (file)
index 0000000..ebdfb98
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- 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
diff --git a/snippets/eshell-mode/aws-autoscaling-update-auto-scaling-group-min-max b/snippets/eshell-mode/aws-autoscaling-update-auto-scaling-group-min-max
new file mode 100644 (file)
index 0000000..4c4c206
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- 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
index fdc9456e1f28fed1c0cdffa72a0308ef26638669..23d594e4338c87761debb1442ee0460c6f8c1f0c 100644 (file)
@@ -2,4 +2,4 @@
 # 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
index efb8633f0b89f66084055a8473cabadc382dcd31..2147130cce0942412d966d82965d29955e39f5fc 100644 (file)
@@ -2,4 +2,4 @@
 # 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
diff --git a/snippets/eshell-mode/aws-emr-list-clusters b/snippets/eshell-mode/aws-emr-list-clusters
new file mode 100644 (file)
index 0000000..b8a553f
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- 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
diff --git a/snippets/eshell-mode/aws-filters b/snippets/eshell-mode/aws-filters
new file mode 100644 (file)
index 0000000..98d421f
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- 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
diff --git a/snippets/eshell-mode/aws-regions b/snippets/eshell-mode/aws-regions
new file mode 100644 (file)
index 0000000..0c8500c
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: aws-regions
+# key: awsreg
+# --
+--region=${1:$$(yas-choose-value "\$\{REGION\}" bba-aws-regions)} $0
\ No newline at end of file
diff --git a/snippets/eshell-mode/aws-route53-list-hosted-zones b/snippets/eshell-mode/aws-route53-list-hosted-zones
new file mode 100644 (file)
index 0000000..145558c
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- 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
diff --git a/snippets/eshell-mode/aws-route53-list-resource-record-sets b/snippets/eshell-mode/aws-route53-list-resource-record-sets
new file mode 100644 (file)
index 0000000..0692c35
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- 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
index 2de397c80bbf3ef86a546d2e49e292c6c3821a36..d2c5b0d017ac7454ec706511c691809a2544ae96 100644 (file)
@@ -1 +1,2 @@
 eshell-mode
+shell-mode
\ No newline at end of file
diff --git a/snippets/shell-mode/aws-iam-userlist b/snippets/shell-mode/aws-iam-userlist
new file mode 100644 (file)
index 0000000..eeea8be
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- 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