Namran Hussin AWS,Cloud Computing How to install aws-cli and configure it with AWS_SECRET_KEY for the first time

How to install aws-cli and configure it with AWS_SECRET_KEY for the first time

Let’s say you have an account in Amazon Web Services (AWS) and got some instance running under an Elastic Container Services (ECS).
You had it running OK, until suddenly got the bills charging for the CloudWatch usage.

You go in the AWS console and checked the way to disable the Container Insight for the running ECS, and found out there is no button for that.
And need to use aws-cli command as below to disable it.

aws ecs update-cluster-settings --cluster ${clustername} --settings name=containerInsights,value=disabled --region ${AWS_REGION}

And then realised you don’t have aws-cli to run in local at the moment.

 

Here is how to install the aws-cli in the local machine and get the AWS_SECRET_KEY for the first time.

You start to install it with the following instruction.

curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"

sudo installer -pkg AWSCLIV2.pkg -target

 

Then verify the installation is correct with

which aws

it correct it would return the following string

/usr/local/bin/aws

and also

aws --version aws-cli/2.1.13 Python/3.7.4 Darwin/19.6.0 exe/x86_64 prompt/off

After that you need to configure it for the first time using the following command

aws configure

it will prompt to enter the AWS ID, AWS SECRET KEY and region.

You can find this information from the AWS IAM -> Roles -> Security Credentials.

Once logged,

it will create a file under the following folder

~/.aws/config

[default]

region = Singapore

output = json

 

~/.aws/credential

aws_access_key_id = xxx

aws_secret_access_key = yyyy

 

 

after that you can use to disable the container insight with the following command

export AWS_REGION=ap-southeast-1 export clustername=wp-namran aws ecs update-cluster-settings --cluster ${clustername} --settings name=containerInsights,value=disabled --region ${AWS_REGION}

 

response

 

Verify again at the console.

 

Done, that’s all for now.

refs:

https://docs.aws.amazon.com/cli/latest/userguide/cli-services-iam-create-creds.html

https://ecsworkshop.com/container_insights/cleanup/

 

294 thoughts on “How to install aws-cli and configure it with AWS_SECRET_KEY for the first time”

  1. Heello There. I dijscovered yor blog tthe usaage of msn. Thatt iss a vry smartly
    written article. I’ll bbe sur to bookmark it andd returtn to learn extrra oof yur
    elpful information. Thank yoou for the post. I wioll definitely
    comeback.

  2. Heyy there! I’m att work suyrfing around youur blog from
    myy nnew iphonhe 3gs! Just wwanted to saay I loe readig throubh yyour bloog andd look forward to all your posts!
    Keepp up the fantastic work!

  3. Goodd post. I larn something new aand challkenging onn blogs I stumbleupon every day.
    It’s alway helpcul tto read throujgh content from otherr writerts
    annd practice something ffrom other web sites.

  4. you’re iin reality a just right webmaster. The site loadimg speed iss amazing.
    It kknd off feels thjat you’re doing any uniqwue trick.
    Moreover, Thee contents are masterwork. yoou
    have done a magnificent activijty on this matter!

  5. Right here iis tthe righ blogg ffor anyyone wwho really wants tto understznd thus topic.
    You realize a whole lot iits almost touygh too argue with
    youu (not that I actually will need to…HaHa). Yoou
    definnitely putt a frezh spkn onn a toopic that’s been writtwn about for years.
    Great stuff, just great!

  6. Havng read this I thouight itt wass ratheer informative.

    I appreciatge you takjing thhe time and energy too putt tuis shbort article together.
    I onmce agawin find myselpf personally spending a llot oof tije both
    reding andd commenting. Buut so what, itt was still worgh it!

  7. Afterr checking out a number off the blog articles on your blog, I hlnestly likke your technique of blogging.
    I book markd it too mmy bookomark sijte list and will
    bee checking back inn the near future. Pleqse check ouut my web site as welll
    andd teol mme your opinion.

  8. Greetings! Thiss iss my 1st coomment here so I just wanted too give a quick shout out and teell you I genuiely enioy reading your posts.
    Can you recommend anny otyher blogs/websites/forums thaat go over thee ssme subjects?
    Thannk you!

  9. of course like youir website but you nee tto tesdt the spellking on quuite a ffew oof yolur posts.
    A number of thdm arre rife with spelling probblems and I find iit very
    bothersome tto tepl thee reality nevertheless I’ll sudely comme bafk again.

  10. I’m currious to find outt what blog platform you hhave
    been workingg with? I’m haviing sone small security problems with
    mmy latest blog and I would lile to find
    something more risk-free. Do yyou have any recommendations?

  11. Firfst offf I want too say superb blog!
    I hhad a quick quuestion iin wuich I’d like to ask iif youu don’t mind.
    I was interestted tto find ouut howw youu center ourself and clea yor head pior to writing.

    I’ve haad a harrd time cleasring mmy mmind in gtting my
    ideas out there. I truly doo enkoy writing butt itt just seems like thee
    first 10 too 15 mijutes aare usually wasted
    simply just trfying too figgure oout hoow to begin. Any recommedations oor tips?
    Manyy thanks!

  12. Hello there! This article could nnot be written any better!
    Looking aat thhis post reminds mee of mmy previous roommate!
    He always kept talking about this. I’ll forward this pos to him.

    Fairly certaain he will hasve a good read. Many thanks foor
    sharing!

  13. Having read his I thought it wass ragher enlightening.
    I alpreciate you taiing the timke and energy to puut this informative article together.
    I onmce agasin find yself spending wayy tooo muhch ttime both rezding aand leaving
    comments.Butt soo what, itt was still worthh it!

  14. After exploring a feew oof tthe blog artticles onn yourr weeb site,
    I honestly like our technique off blogging. I bookmazrked itt tto myy bookmark webpage lust aand wikll be hecking back iin thee near future.
    Plase cheeck oout myy webb site aas well aand tel mee how yyou feel.

  15. I believee everything published was actuually vry logical.
    However, what about this? whazt iif you complsed a catchierr title?

    I ain’t suggestin yur informtion isn’t good., howeever suppose you acded a headline thatt grabbed a person’s attention? I mean How tto install aws-cli andd confighre itt with AWS_SECRET_KEY
    ffor the first time – Namran Hussin iis kindra boring.

    You miyht pee at Yahoo’s home page and watch howw they cteate new hadlines to graqb viewerfs to
    open the links. You might addd a related vide
    orr a piccture oor two too gab people interested about whqt you’ve written. In my opinion,it would make you
    pksts a littoe bbit mkre interesting.

  16. Atgractive setion off content. I just stumbked upoln you
    site and iin accession capijtal tto assert that I get iin fact enjoyed ccount your blog posts.
    Anyqay I’ll bbe subscribing to your augent and evesn I achievement you access consiistently fast.

  17. Youu coud certainly see your enthusiasm in thhe articlee youu
    write. Thhe arena hopes for eeven more passionate wrriters likee yoou whho aren’t afraid to mention hoow they believe.
    At alll ttimes folkow your heart.

  18. Greate article. Keep posting such kind of information on your page.
    Im really impressed by it.
    Hi there, You have performed an incredible
    job. I will definitely digg it and for my part recommend to
    my friends. I’m sure they’ll be benefited from this site.

  19. I don’t even now howw I ended up here, bbut I thoufht tthis pist was great.

    I doo not knoww who youu are butt cettainly yyou aare going tto
    a famous blogger iff you aren’t already ;) Cheers!

  20. I truly loge yoir blog.. Plewsant colorrs & theme. Diid you mqke this webb site
    yourself? Please reploy bck ass I’m attempting
    too create my own persnal blog andd want too knmow where you ggot
    this from orr exacfly whaat tthe theke iis called. Kudos!

  21. continuously i used to red smaller contenmt that aas
    ell cclear their motive, andd tht iss also happening with this piecee of writin whidh I
    aam reading now.

  22. I’m impressed, I must say. Seeldom doo I come aacross a bloog
    that’s botgh educative andd amusing, aand withouyt a doubt, you’ve hit the nail
    oon thee head. The issue is something which nott enough mmen aand wmen are speaking intelligently about.
    I am vedry happy I strumbled across this iin my hunt
    for somethhing relating to this.

  23. Yesterday, while I was att work, mmy sistrer sstole myy aple ipawd and testedd to seee if it can sujrvive a twentgy fife foot drop, jusst sso shhe caan bbe a
    youtube sensation. My iPad iss now broken and she hass 83 views.

    I know tyis iis completely off toppic butt I hadd tto share it witgh someone!

  24. hello there and thank you for your info – I have definitely picked up anything new from right
    here. I did however expertise several technical
    points using this website, since I experienced to reload the site many
    times previous to I could get it to load properly.
    I had been wondering if your hosting is OK? Not that I am complaining,
    but slow loading instances times will very frequently affect your placement in google and can damage your high-quality score
    if ads and marketing with Adwords. Well I’m adding this RSS to my email and can look out for much more of your respective exciting content.
    Make sure you update this again soon.

  25. Hi there,just became alert to your blog through Google, and found tha iit iss really informative.
    I amm gonn wtch oout for brussels. I wjll appreciate if yoou conntinue this inn future.
    Many people will bee benefited frrom your writing. Cheers!

Comments are closed.

Related Post