{"id":543,"date":"2018-07-25T15:33:15","date_gmt":"2018-07-25T15:33:15","guid":{"rendered":"http:\/\/kaizen-koka.com\/?p=543"},"modified":"2018-07-25T18:56:51","modified_gmt":"2018-07-25T18:56:51","slug":"aws-cli","status":"publish","type":"post","link":"https:\/\/kaizen-koka.com\/?p=543","title":{"rendered":"AWS CLI"},"content":{"rendered":"<p>\n\tsteps for aws auto complete&nbsp;\n<\/p>\n<p>\n\t1. which aws_completer\n<\/p>\n<p>\n\t2. complete -C &#39;\/Library\/Python\/3.6\/bin\/aws_completer&#39; aws\n<\/p>\n<p>\n\tQuick Reference on aws cli commands:\n<\/p>\n<p>\n\tlist all the s3 buckets\n<\/p>\n<p>\n\taws s3 ls\n<\/p>\n<p>\n\tList ec2&nbsp; instance details by name\n<\/p>\n<p>\n\taws ec2 describe-instances &#8211;filters &quot;Name=tag:Name,Values=*myinstance*&quot; &#8211;region us-east-1\n<\/p>\n<p>\n\tto further filter to instance id&#39;s only\n<\/p>\n<p>\n\taws ec2 describe-instances &#8211;filters &quot;Name=tag:Name,Values=*myinstance*&quot; &#8211;output text &#8211;query &#39;Reservations[*].Instances[*].InstanceId&#39; &#8211;region us-east-1\n<\/p>\n<p>\n\tto display aws cli&nbsp;result of ec2 instance name, private ip and instanceId\n<\/p>\n<p>\n\taws ec2 describe-instances &#8211;filters &quot;Name=tag:Name,Values=*myinstance*&quot; &#8211;output text &#8211;query &#39;Reservations[*].Instances[*].[PrivateIpAddress,InstanceId,Tags[?Key==`Name`].Value]&#39; &#8211;region us-east-1\n<\/p>\n<p>\n\tto display aws cli result in json format\n<\/p>\n<p>\n\taws ec2 describe-instances &#8211;filters &quot;Name=tag:Name,Values=*myinstance*&quot; &#8211;output json &#8211;query &#39;Reservations[*].Instances[*].[PrivateIpAddress,InstanceId,Tags[?Key==`Name`].Value]&#39; &#8211;region us-east-1\n<\/p>\n<p>\n\taws ec2 describe-instances &#8211;filters &quot;Name=tag:Name,Values=*propensity*&quot; &#8211;output json &#8211;query &#39;Reservations[*].Instances[*].[ImageId,PrivateIpAddress,InstanceId,Tags[?Key==`Name`],Tags[?Key==`ASV`]]&#39; &#8211;region us-west-2\n<\/p>\n<p>\n\t&#8212;&#8212;- To terminate\/delete ASG(auto scalling group), ELB(Elastic load balancer), EC2 and Launch Configuration through CLI,&nbsp;\n<\/p>\n<p>\n\taws elb delete-load-balancer &#8211;load-balancer-name {instance-name} &#8211;region us-west-2<br \/>\n\taws ec2 terminate-instances &#8211;instance-ids {instance-id} &#8211;region us-west-2<br \/>\n\taws autoscaling delete-auto-scaling-group &#8211;auto-scaling-group-name {instance-name} &#8211;region us-west-2<br \/>\n\taws autoscaling delete-launch-configuration &#8211;launch-configuration-name {instance-name} &nbsp;&#8211;region us-west-2\n<\/p>\n<p>\n\t&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>steps for aws auto complete&nbsp; 1. which aws_completer 2. complete -C &#39;\/Library\/Python\/3.6\/bin\/aws_completer&#39; aws Quick Reference on aws cli commands: list all the s3 buckets aws s3 ls List ec2&nbsp; instance [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[2],"tags":[],"class_list":["post-543","post","type-post","status-publish","format-standard","hentry","category-technology"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p70lnf-8L","jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/kaizen-koka.com\/index.php?rest_route=\/wp\/v2\/posts\/543","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kaizen-koka.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kaizen-koka.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kaizen-koka.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kaizen-koka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=543"}],"version-history":[{"count":6,"href":"https:\/\/kaizen-koka.com\/index.php?rest_route=\/wp\/v2\/posts\/543\/revisions"}],"predecessor-version":[{"id":549,"href":"https:\/\/kaizen-koka.com\/index.php?rest_route=\/wp\/v2\/posts\/543\/revisions\/549"}],"wp:attachment":[{"href":"https:\/\/kaizen-koka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kaizen-koka.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kaizen-koka.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}