]> git.bundesbrandschatzamt.de Git - emacsconfig.git/commitdiff
more aws yasnippets
authorAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Tue, 9 May 2017 14:03:24 +0000 (16:03 +0200)
committerAndreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
Tue, 9 May 2017 14:03:24 +0000 (16:03 +0200)
* cloudformation
* ec2 snapshots
* cloudwatch logs

Signed-off-by: Andreas Gerler <baronNOSPAMbundesbrandschatzamt.de>
snippets/eshell-mode/aws-cloudformation-change-ls [new file with mode: 0644]
snippets/eshell-mode/aws-cloudformation-describe-change-set [new file with mode: 0644]
snippets/eshell-mode/aws-cloudformation-describe-stack-events [new file with mode: 0644]
snippets/eshell-mode/aws-cloudformation-ls [new file with mode: 0644]
snippets/eshell-mode/aws-cloudformation-validate-template [new file with mode: 0644]
snippets/eshell-mode/aws-ec2-delete-snapshot [new file with mode: 0644]
snippets/eshell-mode/aws-ec2-delete-volume [new file with mode: 0644]
snippets/eshell-mode/aws-ec2-get-volumes-unused [new file with mode: 0644]
snippets/eshell-mode/aws-ec2-list-subnets [new file with mode: 0644]
snippets/eshell-mode/aws-logs-get-groups [new file with mode: 0644]
snippets/eshell-mode/aws-logs-set-retention [new file with mode: 0644]

diff --git a/snippets/eshell-mode/aws-cloudformation-change-ls b/snippets/eshell-mode/aws-cloudformation-change-ls
new file mode 100644 (file)
index 0000000..f86c867
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: aws-cloudformation-change-ls
+# key: cloud-change-ls
+# --
+aws --profile=${1:$$(yas-choose-value bba-aws-profiles)} ${2:--region=${3:$$(yas-choose-value bba-aws-regions)}} cloudformation list-change-sets --stack-name ${4:`(yank)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
diff --git a/snippets/eshell-mode/aws-cloudformation-describe-change-set b/snippets/eshell-mode/aws-cloudformation-describe-change-set
new file mode 100644 (file)
index 0000000..c2363e6
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: aws-cloudformation-describe-change-set
+# key: cloud-descchange
+# --
+aws --profile=${1:$$(yas-choose-value bba-aws-profiles)} ${2:--region=${3:$$(yas-choose-value bba-aws-regions)}} cloudformation describe-change-set --stack-name ${4:`(yank)`} --change-set-name $5 --output ${6:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
diff --git a/snippets/eshell-mode/aws-cloudformation-describe-stack-events b/snippets/eshell-mode/aws-cloudformation-describe-stack-events
new file mode 100644 (file)
index 0000000..92860f4
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: aws-cloudformation-describe-stack-events
+# key: cloud-events-ls
+# --
+aws --profile=${1:$$(yas-choose-value bba-aws-profiles)} ${2:--region=${3:$$(yas-choose-value bba-aws-regions)}} cloudformation describe-stack-events --stack-name ${4:`(yank)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
diff --git a/snippets/eshell-mode/aws-cloudformation-ls b/snippets/eshell-mode/aws-cloudformation-ls
new file mode 100644 (file)
index 0000000..c1eed23
--- /dev/null
@@ -0,0 +1,23 @@
+# -*- mode: snippet -*-
+# name: aws-cloudformation-ls
+# key: cloud-ls
+# --
+aws --profile=${1:$$(yas-choose-value bba-aws-profiles)} ${2:--region=${3:$$(yas-choose-value bba-aws-regions)}} cloudformation list-stacks --stack-status-filter ${4:$$(yas-choose-value '(
+"CREATE_COMPLETE"
+"CREATE_IN_PROGRESS"
+"CREATE_FAILED"
+"ROLLBACK_IN_PROGRESS"
+"ROLLBACK_FAILED"
+"ROLLBACK_COMPLETE"
+"DELETE_IN_PROGRESS"
+"DELETE_FAILED"
+"DELETE_COMPLETE"
+"UPDATE_IN_PROGRESS"
+"UPDATE_COMPLETE_CLEANUP_IN_PROGRESS"
+"UPDATE_COMPLETE"
+"UPDATE_ROLLBACK_IN_PROGRESS"
+"UPDATE_ROLLBACK_FAILED"
+"UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS"
+"UPDATE_ROLLBACK_COMPLETE"
+"REVIEW_IN_PROGRESS" 
+))} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
diff --git a/snippets/eshell-mode/aws-cloudformation-validate-template b/snippets/eshell-mode/aws-cloudformation-validate-template
new file mode 100644 (file)
index 0000000..aa45c28
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: aws-cloudformation-validate-template
+# key: cloud-val-temp
+# --
+aws --profile=test --region=us-east-1 cloudformation validate-template --template-body file://${1:`(yank)`} --output ${2:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
diff --git a/snippets/eshell-mode/aws-ec2-delete-snapshot b/snippets/eshell-mode/aws-ec2-delete-snapshot
new file mode 100644 (file)
index 0000000..30c4f89
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: aws-ec2-delete-snapshot (yank)
+# key: snap-del
+# --
+# aws --profile=${1:$$(yas-choose-value bba-aws-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" bba-aws-regions)}} ec2 delete-snapshot --snapshot-id ${4:`(yank)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
diff --git a/snippets/eshell-mode/aws-ec2-delete-volume b/snippets/eshell-mode/aws-ec2-delete-volume
new file mode 100644 (file)
index 0000000..6bf130d
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: aws-ec2-delete-volume (yank)
+# key: ebs-del
+# --
+# aws --profile=${1:$$(yas-choose-value bba-aws-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" bba-aws-regions)}} ec2 delete-volume --volume-id ${4:`(yank)`} $0
diff --git a/snippets/eshell-mode/aws-ec2-get-volumes-unused b/snippets/eshell-mode/aws-ec2-get-volumes-unused
new file mode 100644 (file)
index 0000000..d9e3749
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: aws-ec2-get-volumes-unused
+# key: ebs-ls-avail
+# --
+aws --profile=${1:$$(yas-choose-value bba-aws-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" bba-aws-regions)}} ec2 describe-volumes --query 'Volumes[].[VolumeId,Size,VolumeType,CreateTime,State,SnapshotId]' --filters Name=status,Values=available --output ${4:$$(yas-choose-value '("text" "table" "json"))} $0
diff --git a/snippets/eshell-mode/aws-ec2-list-subnets b/snippets/eshell-mode/aws-ec2-list-subnets
new file mode 100644 (file)
index 0000000..0ff5a6f
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: aws-ec2-list-subnets
+# key: sub-ls
+# --
+aws --profile=${1:$$(yas-choose-value bba-aws-profiles)} ${2:--region=${3:$$(yas-choose-value bba-aws-regions)}} ec2 describe-subnets --query "sort_by(sort_by(Subnets[].{VpcId:VpcId, SubnetId:SubnetId, State:State, AvailabilityZone:AvailabilityZone, CidrBlock:CidrBlock, AvailableIpAddressCount:AvailableIpAddressCount Tags:to_string(Tags[].[Key, Value])}, &SubnetId), &VpcId)" --output ${4:$$(yas-choose-value '("table" "text" "json"))} $0
\ No newline at end of file
diff --git a/snippets/eshell-mode/aws-logs-get-groups b/snippets/eshell-mode/aws-logs-get-groups
new file mode 100644 (file)
index 0000000..cf8baff
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: aws-logs-get-groups
+# key: logs-ls
+# --
+aws --profile=${1:$$(yas-choose-value bba-aws-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" bba-aws-regions)}} logs describe-log-groups --output ${4:$$(yas-choose-value '("text" "table" "json"))} $0
diff --git a/snippets/eshell-mode/aws-logs-set-retention b/snippets/eshell-mode/aws-logs-set-retention
new file mode 100644 (file)
index 0000000..218017b
--- /dev/null
@@ -0,0 +1,5 @@
+# -*- mode: snippet -*-
+# name: aws-logs-set-retention
+# key: logs-set-ret
+# --
+aws --profile=${1:$$(yas-choose-value bba-aws-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" bba-aws-regions)}} logs put-retention-policy --log-group-name ${4:`(yank)`} --retention-in-days ${5:$$(yas-choose-value '( "60" "1" "3" "5" "7" "14" "30" "90" "120" "150" "180" "365" "400" "545" "731" "1827" "3653"))} $0