From: Andreas Gerler Date: Tue, 9 May 2017 14:03:24 +0000 (+0200) Subject: more aws yasnippets X-Git-Url: http://git.bundesbrandschatzamt.de/?a=commitdiff_plain;h=7b970c44e7d154ccd9c4cb7b80e3000200c95c95;p=emacsconfig.git more aws yasnippets * cloudformation * ec2 snapshots * cloudwatch logs Signed-off-by: Andreas Gerler --- diff --git a/snippets/eshell-mode/aws-cloudformation-change-ls b/snippets/eshell-mode/aws-cloudformation-change-ls new file mode 100644 index 00000000..f86c867f --- /dev/null +++ b/snippets/eshell-mode/aws-cloudformation-change-ls @@ -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 index 00000000..c2363e64 --- /dev/null +++ b/snippets/eshell-mode/aws-cloudformation-describe-change-set @@ -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 index 00000000..92860f48 --- /dev/null +++ b/snippets/eshell-mode/aws-cloudformation-describe-stack-events @@ -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 index 00000000..c1eed230 --- /dev/null +++ b/snippets/eshell-mode/aws-cloudformation-ls @@ -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 index 00000000..aa45c28a --- /dev/null +++ b/snippets/eshell-mode/aws-cloudformation-validate-template @@ -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 index 00000000..30c4f896 --- /dev/null +++ b/snippets/eshell-mode/aws-ec2-delete-snapshot @@ -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 index 00000000..6bf130d2 --- /dev/null +++ b/snippets/eshell-mode/aws-ec2-delete-volume @@ -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 index 00000000..d9e3749b --- /dev/null +++ b/snippets/eshell-mode/aws-ec2-get-volumes-unused @@ -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 index 00000000..0ff5a6f7 --- /dev/null +++ b/snippets/eshell-mode/aws-ec2-list-subnets @@ -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 index 00000000..cf8baff5 --- /dev/null +++ b/snippets/eshell-mode/aws-logs-get-groups @@ -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 index 00000000..218017b9 --- /dev/null +++ b/snippets/eshell-mode/aws-logs-set-retention @@ -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