Okay.
Hello loggers and welcome to this lecture and this lecture we're going to learn all about the AWB command
line and now the command line is really really powerful.
It enables you to interact with the AWB as a platform anywhere in the world so you can interact directly
with the platform using your laptop using the command line so you can go in and provision things like
easy to instances or S3 Buckets et cetera.
And as a way of doing it without using the AWB as console so let's go ahead and go over to the AWB console.
Okay.
So here I am in the AWB console.
Need to go over to services and we're gonna go over to identity access management.
Now you probably already have a user and group set up but just in case you don't I don't actually have
it in this account so I show you what to do so I'm gonna go over to our users.
I'm gonna add a user I'm going to call this user my easy to user and then I'm gonna give them programmatic
access so we're not going to give them console access it's programmatic access only.
So we're going to use this for the adobe US CLIA.
Next we're going to add our permissions.
So I'm gonna go and create a group to call this my admins group something like that admin group and
then I'm gonna give them administrator access so I'm going to apply this policy to the group and of
course my user will inherit that permissions from the group.
Next I'm gonna go ahead and just keep heading next and then I'm gonna go ahead and hit create user so
that now gives me my access key I.D. and secret access key.
So I want you to go ahead and download this.
And once you've done that go ahead and close it.
Now remember you're only ever be able to get that once if you do lose the access key I.D. and secret
access key you can actually go into your user and then just go over to security credentials and in here
you can make it inactive you can create a new one there.
So that's how you do it.
If you do lose the access key I.D. and secret access key.
Now that I've got that I'm just going to go back over to E2 and I still have that easy two instances
bottle necking at 100 per cent CCU utilization I'm just gonna go in and delete that instance and we'll
just provision new instance quickly now annoyingly I'm actually having an issue right now in Northern
Virginia where the command line is not working for ABC too it is a regional thing it does work in other
regions so I'm just going to switch over to another region.
It should work fine for you when you watch it but it's also a good demonstration to show you that the
command line is completely global you can use it anywhere in the world it's got to switch over to the
London region and I'm going to go in and provision a new AC to instance in here it's going to go ahead
and launch my instance Amazon Lennox to EMI let's use the default values of T2 micro default values
here at our storage at our tags we're just gonna give this a name so I'm going to call it my CLEC too
and then I'm gonna go in and configure my security groups I'm going to create a new security group because
this is a new region which I've never used before so web DMC web DMC I'm just gonna leave port 22 open
to the world and then I'm gonna go ahead and launch and because I've never used this region before I
need to create an existing key pair so I'm just going to change this up here to create a new keeper
and I'm gonna call this key pair London key I'm gonna go ahead and download that and then I'm gonna
go ahead and launch the instance so that is now launching I should be able to see it in here I've already
got the public IP address just gonna go over to my command line I'm in the command line I'm just gonna
move that key pair over to my ss hate directory I'm going to go into my ss hate directory and I'm going
to see h mod my keep hair so I'm going to change the permissions to 400 to lock it down and then I'm
going to SSA each and so SS H easy to then hyphen user and then at then my public IP address then minus
I and then the key pair which is London key dot PM I'm gonna hit yes and there we go.
I am now in my easy to instance I'm going to elevate my privileges to route and then what I'm gonna
do is go ahead and clear the screen.
Okay so to use the obvious command line all we ever need to type is AWOL.
And then the service that we want.
So we could type S three and then l s so this is basically just saying hey tell me what S3 Buckets I've
got now it says unable to locate credentials you can configure credentials by running eight of us configure.
So why don't we do that or run Adobe's configure and now it's asking for our access key I.D. and secret
access case.
I want you to copy and paste those in.
So here's my access key I.D. Here's my secret access key my default region.
You could do type in UST E and then hyphen one and then your default output just hit enter.
Okay.
So what will happen now if we run a W S3 and then L S and there you go you can see my three buckets.
So I am now able to access S3.
I'm able to list all my buckets.
I could type W S S3 and then make bucket and then S3 and we could just do test bucket of course that
name is going to be taken so I'll probably get an error message there go in Arita called an Eric Hurd
bucket already exists but let's go ahead and try that again so do 8 obvious S3 and then make bucket
and then S3 and then we'll just do a whole bunch of random letters and random numbers.
And sorry.
This should be S3 forward slash forward slash.
And there we go it's made my bucket so if I now type AWP S S3 and THEN ELSE I SHOULD BE ABLE TO SEE
MY NEW bucket and there it is there.
So you can use the command line to start provisioning resources within a W as you can provision easy
to instances you can pretty much do almost anything in AWB using the command line.
It's going to clear the screen and we're gonna go over to our home directory and if you type in an L
S in here you can't see anything but there is a hidden directory if go to the S.D. dot a W s. That's
a hidden directory and in here it basically contains your config and your credentials and if you want
to have a look at your credentials you can go ahead and you can see that the access key I.D. and secret
access key are saved in the credentials file in the home directory in the AWB.
Now for this reason it can be a bit of a security risk because if someone goes in and hacks this easy
to instance all they've got to do is go over to the home directory and go into your AWB hidden directory
and just open up this credentials file and then they've got your access key ideas and secret access
key and they can use this access key idea and secret access key to access the AWB platform on other
easy two instances or on their laptop or on their P.C. they can use it to access your database account
anywhere in the world and for that reason Amazon always say do not store your credentials you know do
not hardcoded them do not put them on github for example and it's much safer to use a thing called rolls
and we're gonna cover that off in the next lab.
So what have we learned.
So we've learnt that you can interact with AWB from anywhere in the world just by using the command
line and you'll need to set up access in identity access management.
So we set up our user we put our user into a group and then we applied administrator access policies
to that group which of course the user inherits and the commands themselves and not in the exams but
some basic commands will be useful to know for real life.
So just like what we learnt AWB s three L S or AWB S3 three M.B. make bucket and then the bucket name
things like that and there's lots and lots of documentation on the command line to go ahead and have
a look at it when you get some free time.
So in the next lecture we're going to look at how we can use rolls to access the obvious environment
in a much more secure fashion.
So if you've got the time please join me in the next lecture.
Thank you.