{"id":1595,"date":"2013-12-03T17:35:00","date_gmt":"2013-12-03T09:35:00","guid":{"rendered":"http:\/\/chow.karmeng.my\/?p=1595"},"modified":"2013-12-03T17:35:00","modified_gmt":"2013-12-03T09:35:00","slug":"how-to-custom-install-awscli-into-linux-based-machine","status":"publish","type":"post","link":"https:\/\/chow.karmeng.my\/?p=1595","title":{"rendered":"How to custom install AWSCli into linux based machine"},"content":{"rendered":"<p>Good new for AWS users, Amazon has release the <a title=\"New AWS Command Line interface\" href=\"http:\/\/aws.typepad.com\/aws\/2013\/09\/new-aws-command-line-interface-cli.html\" target=\"_blank\" rel=\"noopener\">new unified AWSCli was released in September 2013<\/a>. Amazon did provide <a title=\"Multiple ways to setup AWSCli\" href=\"http:\/\/docs.aws.amazon.com\/cli\/latest\/userguide\/cli-chap-getting-set-up.html\" target=\"_blank\" rel=\"noopener\">multiple ways to have the new AWSCli installed<\/a>.<\/p>\n<p>I have to admit the task of installation is more straight forward and simplified compared to the old AWS Cli.<\/p>\n<p>At the time of this post, the AWSCli released version 1.2.6, and it runs on Python 2.6. Hence, this post will provide custom install of AWSCli into linux based machine.<\/p>\n<p>For users who are planning to use the AWSCli bundle provided by Amazon here is the recommended steps in sequence. Disclaimer and note : I have not added any form of error catching or linux distro detection and I am assuming the linux distro used is redhat.<\/p>\n<p>Installing AWSCli using the Amazon awscli-bundle<\/p>\n<pre>mkdir -p \/opt\/apps\/tmp\ncd \/opt\/apps\/tmp\nwget https:\/\/s3.amazonaws.com\/aws-cli\/awscli-bundle.zip\nunzip awscli-bundle.zip\nmkdir -p \/opt\/apps\/$(ls awscli-bundle\/packages\/ | egrep -o 'awscli-[0-9]\\.[0-9]\\.[0-9]')\n.\/awscli-bundle\/install -i \/opt\/apps\/$(ls awscli-bundle\/packages\/ | egrep -o 'awscli-[0-9]\\.[0-9]\\.[0-9]')\n\/opt\/apps\/awscli\/bin\/aws --version\nln -s \/opt\/apps\/$(ls awscli-bundle\/packages\/ | egrep -o 'awscli-[0-9]\\.[0-9]\\.[0-9]') \/opt\/apps\/awscli\nln -s \/opt\/apps\/awscli\/bin\/aws \/usr\/bin\/aws\nln -s \/opt\/apps\/awscli\/bin\/aws.cmd \/usr\/bin\/aws.cmd\ncd ~\nrm -Rf \/opt\/apps\/tmp<\/pre>\n<p>Installing AWS via pip<\/p>\n<pre>python --version\napt-get install python-pip\nyum install python-pip\ncd \/opt\/apps\/\nmkdir tmp\ncd tmp\nwget https:\/\/bitbucket.org\/pypa\/setuptools\/raw\/bootstrap\/ez_setup.py\nwget https:\/\/raw.github.com\/pypa\/pip\/master\/contrib\/get-pip.py\npython ez_setup.py\npython get-pip.py\npip install awscli==1.2.6\naws help\ncd ~\nrm -Rf \/opt\/apps\/tmp<\/pre>\n<p>The advantage of AWSCli bundle over the pip method is, ease of install without need to get ez_setup and pip installed. Since the AWSCli bundle zip is hosted within Amazon Web Service network, it took me less than 1 seconds to download the 5MB AWSCli-bundle.zip file.<\/p>\n<pre>[root@ip-10-255-255-1 ~]# time wget https:\/\/s3.amazonaws.com\/aws-cli\/awscli-bundle.zip\n--2013-11-28 05:25:16-- https:\/\/s3.amazonaws.com\/aws-cli\/awscli-bundle.zip\nResolving s3.amazonaws.com... 176.32.99.46\nConnecting to s3.amazonaws.com|176.32.99.46|:443... connected.\nHTTP request sent, awaiting response... 200 OK\nLength: 5139105 (4.9M) [application\/zip]\nSaving to: `awscli-bundle.zip'\n\n100%[================================================================================================================\n===================================================================================&gt;] 5,139,105 16.0M\/s in 0.3s\n\n2013-11-28 05:25:17 (16.0 MB\/s) - `awscli-bundle.zip' saved [5139105\/5139105]\nreal 0m0.611s\nuser 0m0.096s\nsys 0m0.036s\n[root@ip-10-255-255-1 ~]# time wget https:\/\/s3.amazonaws.com\/aws-cli\/awscli-bundle.zip\n--2013-11-28 05:25:49-- https:\/\/s3.amazonaws.com\/aws-cli\/awscli-bundle.zip\nResolving s3.amazonaws.com... 176.32.99.46\nConnecting to s3.amazonaws.com|176.32.99.46|:443... connected.\nHTTP request sent, awaiting response... 200 OK\nLength: 5139105 (4.9M) [application\/zip]\nSaving to: `awscli-bundle.zip'\n\n100%[================================================================================================================\n===================================================================================&gt;] 5,139,105 19.6M\/s in 0.2s\n\n2013-11-28 05:25:49 (19.6 MB\/s) - `awscli-bundle.zip' saved [5139105\/5139105]\nreal 0m0.338s\nuser 0m0.076s\nsys 0m0.036s<\/pre>\n<p>The downside of using the awscli bundle installation is users need to upload the awscli-bundle.zip into personal version control servers\/services (such as github) in order to have version control of awscli. Therefore, there will be overhead of maintaining the version of the awscli and it will be labor intensive or makes processes complicated.<\/p>\n<p>The only disadvantage of pip AWSCli is the pre-requisite of installing pip. And maybe in the future, would be a permanent removal of older awscli version from the pip public repository.<\/p>\n<p>Administrator using pip will be able to make awscli to be installed into a customed directory such as \/opt\/apps by using the following pip command<\/p>\n<pre>pip install --install-option=\"--prefix=\/opt\/apps\" awscli==1.2.6<\/pre>\n<p>Unfortunately, in doing so pip will no longer able to manage the awscli package. Administrators will need to have a small effort to remove the installed version manually before upgrading the AWSCli using the similar command.<\/p>\n<p>As a closing, to my personal opinion pip is a better way to install and maintaining the version of AWSCli.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Good new for AWS users, Amazon has release the new unified AWSCli was released in September 2013. Amazon did provide multiple ways to have the new AWSCli installed. I have to admit the task of installation is more straight forward &hellip; <a href=\"https:\/\/chow.karmeng.my\/?p=1595\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"quote","meta":{"footnotes":""},"categories":[2,12,13,25],"tags":[42,61,62,63,249,331],"class_list":["post-1595","post","type-post","status-publish","format-quote","hentry","category-amazon-web-service","category-it","category-linux","category-ubuntu","tag-amazon-web-service-2","tag-aws","tag-awscli","tag-awscli-bundle","tag-linux","tag-pip","post_format-post-format-quote"],"_links":{"self":[{"href":"https:\/\/chow.karmeng.my\/index.php?rest_route=\/wp\/v2\/posts\/1595","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chow.karmeng.my\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/chow.karmeng.my\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/chow.karmeng.my\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/chow.karmeng.my\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1595"}],"version-history":[{"count":0,"href":"https:\/\/chow.karmeng.my\/index.php?rest_route=\/wp\/v2\/posts\/1595\/revisions"}],"wp:attachment":[{"href":"https:\/\/chow.karmeng.my\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1595"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/chow.karmeng.my\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1595"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chow.karmeng.my\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1595"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}