(defcustom aws-snippets-regions aws-snippets--default-regions
"List of AWS regions for selections."
+ :tag "regions"
:type '(choice (string :tag "Region")
(repeat :tag "List of Regions"
(string :tag "Region")))
:group 'aws-snippets
)
-
(defconst aws-snippets--default-profiles
'("test" "prod"))
(defcustom aws-snippets-profiles aws-snippets--default-profiles
"List of AWS profiles for selections."
+ :tag "profiles"
:type '(choice (string :tag "Profile")
(repeat :tag "List of Profiles"
(string :tag "Profiles")))
(defcustom aws-snippets-filters aws-snippets--default-filters
"List of AWS filters for selections."
+ :tag "default-filters"
:type '(choice (string :tag "Filter")
(repeat :tag "List of Filters"
(string :tag "Filter")))
:group 'aws-snippets
)
+(defconst aws-snippets--ami-ls-query
+ '"reverse(sort_by(Images, &CreationDate)[].{CreationDate:CreationDate,Name:Name,ImageId:ImageId,Public:Public,Description:Description})")
+
+(defcustom aws-snippets-ami-ls-query aws-snippets--ami-ls-query
+ "Query string used for ami-ls."
+ :tag "ami-ls-query"
+ :group 'aws-snippets
+ :type 'string
+ )
+
+(defconst aws-snippets--autoscaling-describe-auto-scaling-groups-query
+ '"AutoScalingGroups[].{Name: AutoScalingGroupName, Desired: DesiredCapacity,Min: MinSize, Max: MaxSize}")
+
+(defcustom aws-snippets-autoscaling-describe-auto-scaling-groups-query aws-snippets--autoscaling-describe-auto-scaling-groups-query
+ "Query string used for autoscaling-describe-auto-scaling-groups."
+ :tag "autoscaling-describe-auto-scaling-groups"
+ :group 'aws-snippets
+ :type 'string
+ )
+
+(defconst aws-snippets--autoscaling-describe-launch-configurations-query
+ '"reverse(sort_by(LaunchConfigurations &CreatedTime)[*].[LaunchConfigurationName, CreatedTime])")
+
+(defcustom aws-snippets-autoscaling-describe-launch-configurations-query aws-snippets--autoscaling-describe-launch-configurations-query
+ "Query string used for autoscaling-describe-launch-configurations."
+ :tag "autoscaling-describe-launch-configurations-query"
+ :group 'aws-snippets
+ :type 'string
+ )
+
+(defconst aws-snippets--ec2-get-dns-names-query
+ '"Reservations[].Instances[?State.Name=='running'].[InstanceId, PublicDnsName]")
+(defcustom aws-snippets-ec2-get-dns-names-query aws-snippets--ec2-get-dns-names-query
+ "Query string used for aws-ec2-get-dns-names."
+ :tag "ec2-get-dns-names-query"
+ :group 'aws-snippets
+ :type 'string
+ )
+
+(defconst aws-snippets--ec2-get-instance-volumes-query
+ '"Reservations[].Instances[].[join(\`,\`,Tags[?Key==\`Name\`].Value),join(' ', BlockDeviceMappings[].Ebs.VolumeId)]")
+
+(defcustom aws-snippets-ec2-get-instance-volumes-query aws-snippets--ec2-get-instance-volumes-query
+ "Query string used for ec2-get-instance-volumes."
+ :tag "ec2-get-instance-volumes-query"
+ :group 'aws-snippets
+ :type 'string
+ )
+
+(defconst aws-snippets--ec2-get-securitygroups-query
+ '"sort_by(SecurityGroups, &GroupName)[*].[GroupName, GroupId, Description]")
+
+(defcustom aws-snippets-ec2-get-securitygroups-query aws-snippets--ec2-get-securitygroups
+ "Query string used for ec2-get-securitygroups."
+ :tag "ec2-get-securitygroups-query"
+ :group 'aws-snippets
+ :type 'string
+ )
+
+(defconst aws-snippets--ec2-get-snapshots-query
+ '"Snapshots[].[join(\`,\`,Tags[?Key==\`Name\`].Value),StartTime,Description,SnapshotId,VolumeId,VolumeSize,Progress]")
+
+(defcustom aws-snippets-ec2-get-snapshots-query aws-snippets--ec2-get-snapshots-query
+ "Query string used for ec2-get-snapshots-query."
+ :tag "ec2-get-snapshots-query"
+ :group 'aws-snippets
+ :type 'string
+ )
+
+(defconst aws-snippets--ec2-get-volumes-query
+ '"Volumes[].[VolumeId,State,SnapshotId,join(\`,\`,Tags[?Key==\`Name\`].Value)]")
+
+(defcustom aws-snippets-ec2-get-volumes-query aws-snippets--ec2-get-volumes-query
+ "Query string used for ec2-get-volumes-query."
+ :tag "ec2-get-volumes-query"
+ :group 'aws-snippets
+ :type 'string
+ )
+
+(defconst aws-snippets--ec2-get-volumes-unused-query
+ '"Volumes[].[VolumeId,Size,VolumeType,CreateTime,State,SnapshotId]")
+
+(defcustom aws-snippets-ec2-get-volumes-unused-query aws-snippets--ec2-get-volumes-unused-query
+ "Query string used for ec2-get-volumes-unused-query."
+ :tag "ec2-get-volumes-unused-query"
+ :group 'aws-snippets
+ :type 'string
+ )
+
+(defconst aws-snippets--ec2-instance-running-query
+ '"Reservations[].Instances[].[InstanceId, State.Name]")
+
+(defcustom aws-snippets-ec2-instance-running-query aws-snippets--ec2-instance-running-query
+ "Query string used for ec2-instance-running."
+ :tag "ec2-instance-running-query"
+ :group 'aws-snippets
+ :type 'string
+ )
(defconst aws-snippets--ec2-list-instances-query
'"Reservations[].Instances[].[join(\`,\`,Tags[?Key==\`Name\`].Value),join(\`,\`,Tags[?Key==\`Schedule\`].Value),InstanceId, State.Name, PublicDnsName, InstanceType,Placement.AvailabilityZone,LaunchTime]")
(defcustom aws-snippets-ec2-list-instances-query aws-snippets--ec2-list-instances-query
"Query string used for ec2 describe-instances."
+ :tag "ec2-list-instances-query"
+ :group 'aws-snippets
+ :type 'string
+ )
+
+(defconst aws-snippets--ec2-list-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)")
+
+(defcustom aws-snippets-ec2-list-subnets-query aws-snippets--ec2-list-subnets-query
+ "Query string used for ec2-list-subnets."
+ :tag "ec2-list-subnets-query"
+ :group 'aws-snippets
+ :type 'string
+ )
+
+(defconst aws-snippets--ec2-list-vpcs-query
+ '"sort_by(Vpcs[].{VpcId:VpcId, State:State, AvailabilityZone:AvailabilityZone, CidrBlock:CidrBlock, AvailableIpAddressCount:AvailableIpAddressCount Tags:to_string(Tags[].[Key, Value])}, &VpcId)")
+
+(defcustom aws-snippets-ec2-list-vpcs-query aws-snippets--ec2-list-vpcs-query
+ "Query string used for ec2-list-vpcs."
+ :tag "ec2-list-vpcs-query"
+ :group 'aws-snippets
+ :type 'string
+ )
+
+(defconst aws-snippets--elb-get-list-query
+ '"reverse(sort_by(LoadBalancerDescriptions, &CreatedTime)[].[LoadBalancerName, CreatedTime])")
+
+(defcustom aws-snippets-elb-get-list-query aws-snippets--elb-get-list-query
+ "Query string used for elb-get-list."
+ :tag "elb-get-list-query"
:group 'aws-snippets
:type 'string
)
+
+(defconst aws-snippets--emr-list-clusters-query
+ '"Clusters[*].{ID: Id, NAME: Name}")
+
+(defcustom aws-snippets-emr-list-clusters-query aws-snippets--emr-list-clusters-query
+ "Query string used for emr-list-clusters."
+ :tag "emr-list-clusters-query"
+ :group 'aws-snippets
+ :type 'string
+ )
+
+(defconst aws-snippets--rds-describe-instances-query
+ '"DBInstances[*].[DBInstanceIdentifier,DbiResourceId, Endpoint.Address]")
+
+(defcustom aws-snippets-rds-describe-instances-query aws-snippets--rds-describe-instances-query
+ "Query string used for rds describe-db-instances."
+ :tag "rds-describe-db-instances-query"
+ :group 'aws-snippets
+ :type 'string
+ )
+
+(defconst aws-snippets--route53-list-hosted-zones-query
+ '"HostedZones[].[Id, Name]")
+
+(defcustom aws-snippets-route53-list-hosted-zones-query aws-snippets--route53-list-hosted-zones-query
+ "Query string used for route53 list-hosted-zones."
+ :tag "route53-list-hosted-zones-query"
+ :group 'aws-snippets
+ :type 'string
+ )
+
+(defconst aws-snippets--aws-support-ls-query
+ '"reverse(sort_by(cases, &timeCreated)[].[caseId, subject, timeCreated, displayId])")
+
+(defcustom aws-snippets-aws-support-ls-query aws-snippets--aws-support-ls-query
+ "Query string used for aws support-ls-query."
+ :tag "aws-support-ls-query"
+ :group 'aws-snippets
+ :type 'string
+ )
+
;;;###autoload
(defun aws-snippets-initialize ()
"Initialize package."
+++ /dev/null
-# -*- mode: snippet -*-
-# name: ami-ls
-# key: ami-ls
-# group: aws
-# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} ec2 describe-images --owners \$`(if (string-equal major-mode "eshell-mode")(message "{")(message "("))` aws --profile=$1 ec2 describe-security-groups --group-names 'Default' --query 'SecurityGroups[0].OwnerId' --output text `(if (string-equal major-mode "eshell-mode")(message "}")(message ")"))` --query "reverse(sort_by(Images, &CreationDate)[].{CreationDate:CreationDate,Name:Name,ImageId:ImageId,Public:Public,Description:Description})" --output ${4:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
--- /dev/null
+# -*- mode: snippet -*-
+# name: aws-ami-ls
+# key: ami-ls
+# group: aws
+# --
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} ec2 describe-images --owners \$`(if (string-equal major-mode "eshell-mode")(message "{")(message "("))` aws --profile=$1 ec2 describe-security-groups --group-names 'Default' --query 'SecurityGroups[0].OwnerId' --output text `(if (string-equal major-mode "eshell-mode")(message "}")(message ")"))` --query "`(print aws-snippets-ami-ls-query)`" --output ${4:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
# key: asg-ls
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-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
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)}} autoscaling describe-auto-scaling-groups --query '`(print aws-snippets-autoscaling-describe-auto-scaling-groups-query)`' --output ${4:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
# key: asl-ls
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-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
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)}} autoscaling describe-launch-configurations --query '`(print aws-snippets-autoscaling-describe-launch-configurations-query)`' --output ${4:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
# key: aws-autoscaling-update-auto-scaling-group-min-max
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-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
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)}} autoscaling update-auto-scaling-group --auto-scaling-group-name ${4:`(current-kill 0)`} --min-size $5 --max-size $6 $0
\ No newline at end of file
# key: cloud-change-ls
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} cloudformation list-change-sets --stack-name ${4:`(yank)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} cloudformation list-change-sets --stack-name ${4:`(current-kill 0)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
# key: cloud-descchange
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-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
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} cloudformation describe-change-set --stack-name ${4:`(current-kill 0)`} --change-set-name $5 --output ${6:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
# key: cloud-desc
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} cloudformation describe-stacks --stack-name ${4:`(yank)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} cloudformation describe-stacks --stack-name ${4:`(current-kill 0)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
# key: cloud-events-ls
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} cloudformation describe-stack-events --stack-name ${4:`(yank)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} cloudformation describe-stack-events --stack-name ${4:`(current-kill 0)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
# key: cloud-val-temp
# group: aws
# --
-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
+aws --profile=test --region=us-east-1 cloudformation validate-template --template-body file://${1:`(current-kill 0)`} --output ${2:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
# key: snap-del
# group: aws
# --
-# aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)}} ec2 delete-snapshot --snapshot-id ${4:`(yank)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)}} ec2 delete-snapshot --snapshot-id ${4:`(current-kill 0)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
# key: ebs-del
# group: aws
# --
-# aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)}} ec2 delete-volume --volume-id ${4:`(yank)`} $0
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)}} ec2 delete-volume --volume-id ${4:`(current-kill 0)`} $0
# key: ec2-attribute
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} ec2 describe-instance-attribute --instance-id ${4:`(yank)`} --attribute ${5:$$(yas-choose-value '("instanceType" "kernel" "ramdisk" "userData" "disableApiTermination" "instanceInitiatedShutdownBehavior" "rootDeviceName" "blockDeviceMapping" "productCodes" "sourceDestCheck" "groupSet" "ebsOptimized" "sriovNetSupport"))} $0
\ No newline at end of file
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} ec2 describe-instance-attribute --instance-id ${4:`(current-kill 0)`} --attribute ${5:$$(yas-choose-value '("instanceType" "kernel" "ramdisk" "userData" "disableApiTermination" "instanceInitiatedShutdownBehavior" "rootDeviceName" "blockDeviceMapping" "productCodes" "sourceDestCheck" "groupSet" "ebsOptimized" "sriovNetSupport"))} $0
\ No newline at end of file
# key: aws-ec2-describe-instance-status
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} ec2 describe-instance-status --instance-ids ${4:`(yank)`} $0
\ No newline at end of file
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} ec2 describe-instance-status --instance-ids ${4:`(current-kill 0)`} $0
\ No newline at end of file
# key: ec2-userdata
# group: aws
# --
-(base64-decode-string (shell-command-to-string "aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} ec2 describe-instance-attribute --instance-id ${4:`(yank)`} --attribute userData --query 'UserData.Value' --output text"))$0
+(base64-decode-string (shell-command-to-string "aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} ec2 describe-instance-attribute --instance-id ${4:`(current-kill 0)`} --attribute userData --query 'UserData.Value' --output text"))$0
# key: ec2-console
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} ec2 get-console-output --output text --instance-id ${4:`(yank)`} >#<buffer *$4-console-output*> $0
\ No newline at end of file
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} ec2 get-console-output --output text --instance-id ${4:`(current-kill 0)`} >#<buffer *$4-console-output*> $0
\ No newline at end of file
# key: aws-ec2-get-dns-names
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-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
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} ec2 describe-instances --filters "Name=tag:Name,Values=$4" --query "`(print aws-snippets-ec2-get-dns-names-query)`" --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
# key: ec2-det
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} ec2 describe-instances --instance-ids ${4:`(yank)`} $0
\ No newline at end of file
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} ec2 describe-instances --instance-ids ${4:`(current-kill 0)`} $0
\ No newline at end of file
# key: ec2-vol
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)}} ec2 describe-instances --query "Reservations[].Instances[].[join(\`,\`,Tags[?Key==\`Name\`].Value),join(' ', BlockDeviceMappings[].Ebs.VolumeId)]" --output ${4:$$(yas-choose-value '("text" "table" "json"))} $0
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)}} ec2 describe-instances --query "`(print aws-snippets-ec2-get-instance-volumes-query)`" --output ${4:$$(yas-choose-value '("text" "table" "json"))} $0
# key: aws-ec2-get-securitygroup-details
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)}} ec2 describe-security-groups --group-ids ${4:`(yank)`} $0
\ No newline at end of file
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)}} ec2 describe-security-groups --group-ids ${4:`(current-kill 0)`} $0
\ No newline at end of file
# key: aws-ec2-get-securitygroup-references
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)}} ec2 describe-security-group-references --group-id ${4:`(yank)`} $0
\ No newline at end of file
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)}} ec2 describe-security-group-references --group-id ${4:`(current-kill 0)`} $0
\ No newline at end of file
# -*- mode: snippet -*-
# name: aws-ec2-get-securitygroups
-# key: aws-ec2-get-securitygroups
+# key: sg-ls
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)}} ec2 describe-security-groups --query "sort_by(SecurityGroups, &GroupName)[*].[GroupName, GroupId, Description]" --output ${4:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)}} ec2 describe-security-groups --query "`(print aws-snippets-ec2-get-securitygroups-query)`" --output ${4:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
# key: snap-det
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)}} ec2 describe-snapshots --snapshot-id ${4:`(yank)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)}} ec2 describe-snapshots --snapshot-id ${4:`(current-kill 0)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
# key: snap-ls
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)}} ec2 describe-snapshots --query 'Snapshots[].[join(\`,\`,Tags[?Key==\`Name\`].Value),StartTime,Description,SnapshotId,VolumeId,VolumeSize,Progress]' --output ${4:$$(yas-choose-value '("text" "table" "json"))} $0
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)}} ec2 describe-snapshots --query '`(print aws-snippets-ec2-get-snapshots-query)`' --output ${4:$$(yas-choose-value '("text" "table" "json"))} $0
# key: ebs-ls
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)}} ec2 describe-volumes --query 'Volumes[].[VolumeId,State,SnapshotId,join(\`,\`,Tags[?Key==\`Name\`].Value)]' --output ${4:$$(yas-choose-value '("text" "table" "json"))} $0
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)}} ec2 describe-volumes --query '`(print aws-snippets-ec2-get-volumes-query)`' --output ${4:$$(yas-choose-value '("text" "table" "json"))} $0
# key: ebs-ls-avail
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-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
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)}} ec2 describe-volumes --query '`(print aws-snippets-ec2-get-volumes-unused-query)`' --filters Name=status,Values=available --output ${4:$$(yas-choose-value '("text" "table" "json"))} $0
# -*- mode: snippet -*-
# name: aws-ec2-instance-running
-# key: aws-ec2-instance-running
+# key: ec2state
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} ec2 describe-instances --instance-ids $4 --query "Reservations[].Instances[].[InstanceId, State.Name]" --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} ec2 describe-instances --instance-ids ${4:`(current-kill 0)`} --query "`(print aws-snippets-ec2-instance-running-query)`" --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
# key: sub-ls
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-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
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} ec2 describe-subnets --query "`(print aws-snippets-ec2-list-subnets-query)`" --output ${4:$$(yas-choose-value '("table" "text" "json"))} $0
\ No newline at end of file
# key: vpc-ls
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} ec2 describe-vpcs --query "sort_by(Vpcs[].{VpcId:VpcId, State:State, AvailabilityZone:AvailabilityZone, CidrBlock:CidrBlock, AvailableIpAddressCount:AvailableIpAddressCount Tags:to_string(Tags[].[Key, Value])}, &VpcId)" --output ${4:$$(yas-choose-value '("table" "text" "json"))} $0
\ No newline at end of file
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} ec2 describe-vpcs --query "`(print aws-snippets-ec2-list-vpcs-query)`" --output ${4:$$(yas-choose-value '("table" "text" "json"))} $0
\ No newline at end of file
# key: ebs-det
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)}} ec2 describe-volumes --volume-ids ${4:`(yank)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)}} ec2 describe-volumes --volume-ids ${4:`(current-kill 0)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
# key: aws-elb-describe-instance-health
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} elb describe-instance-health --load-balancer-name ${4:`(yank)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} elb describe-instance-health --load-balancer-name ${4:`(current-kill 0)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
# key: aws-elb-describe-load-balancer
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} elb describe-load-balancers --load-balancer-name ${4:`(yank)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} elb describe-load-balancers --load-balancer-name ${4:`(current-kill 0)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
# key: aws-elb-describe-load-balancer-attributes
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} elb describe-load-balancer-attributes --load-balancer-name ${4:`(yank)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} elb describe-load-balancer-attributes --load-balancer-name ${4:`(current-kill 0)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
# key: elb-ls
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} elb describe-load-balancers --query "reverse(sort_by(LoadBalancerDescriptions, &CreatedTime)[].[LoadBalancerName, CreatedTime])" --output ${4:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} elb describe-load-balancers --query "`(print aws-snippets-elb-get-list-query)`" --output ${4:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
# key: aws-emr-describe-cluster
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} --region=${2:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)} emr describe-cluster --cluster-id ${3: `(yank)`} --output ${4:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} --region=${2:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)} emr describe-cluster --cluster-id ${3: `(current-kill 0)`} --output ${4:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
# key: emr-ls
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} --region=${2:$$(yas-choose-value "\$\{REGION\}" aws-snippets-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
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} --region=${2:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)} emr list-clusters --active --query '`(print aws-snippets-emr-list-clusters-query)`' --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
# key: logs-set-ret
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-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
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value "\$\{REGION\}" aws-snippets-regions)}} logs put-retention-policy --log-group-name ${4:`(current-kill 0)`} --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
# key: aws-rds-describe-db-instance-details
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} rds describe-db-instances --db-instance-identifier ${4:`(yank)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} rds describe-db-instances --db-instance-identifier ${4:`(current-kill 0)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
# key: rds-ls
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} rds describe-db-instances --query "DBInstances[*].[DBInstanceIdentifier,DbiResourceId, Endpoint.Address]" --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} rds describe-db-instances --query "`(print aws-snippets-rds-describe-instances-query)`" --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
# key: aws-rds-describe-parameters
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} rds describe-db-parameters --db-parameter-group-name ${4:`(yank)`} --query "Parameters[*][ParameterName, ParameterValue]" --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} rds describe-db-parameters --db-parameter-group-name ${4:`(current-kill 0)`} --query "Parameters[*][ParameterName, ParameterValue]" --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
# key: r53-ls
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} route53 list-hosted-zones --query 'HostedZones[].[Id, Name]' --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} route53 list-hosted-zones --query '`(print aws-snippets-route53-list-hosted-zones-query)`' --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
# key: aws-route53-list-resource-record-sets
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} route53 list-resource-record-sets --hosted-zone-id ${2:`(yank)`} --query \"ResourceRecordSets[?contains(Name, '$3')]\" --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} route53 list-resource-record-sets --hosted-zone-id ${2:`(current-kill 0)`} --query \"ResourceRecordSets[?contains(Name, '$3')]\" --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
# key: support-desc
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} support describe-communications --case-id ${4:`(yank)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} support describe-communications --case-id ${4:`(current-kill 0)`} --output ${5:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
+++ /dev/null
-# -*- mode: snippet -*-
-# name: aws-support-ls
-# key: support-ls
-# group: aws
-# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} support describe-cases --no-include-communications --query "reverse(sort_by(cases, &timeCreated)[].[subject, timeCreated, displayId])" --output ${4:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
# key: support-ls
# group: aws
# --
-aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} support describe-cases --no-include-communications --query "reverse(sort_by(cases, &timeCreated)[].[caseId, subject, timeCreated, displayId])" --output ${4:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file
+aws --profile=${1:$$(yas-choose-value aws-snippets-profiles)} ${2:--region=${3:$$(yas-choose-value aws-snippets-regions)}} support describe-cases --no-include-communications --query "`(print aws-snippets-aws-support-ls-query)`" --output ${4:$$(yas-choose-value '("text" "table" "json"))} $0
\ No newline at end of file