Security Cloud Privacy Tech
Road to re:Invent - Intro to the Aws Cli

Road to re:Invent - Intro to the Aws Cli

Don’t be afraid of the command line (CLI), it’s insanely useful. This live stream explores those uses and shows you how to use the AWS CLI to accomplish some simple but helpful tasks in the AWS Cloud.

Bad Robot Transcript

Good morning, everybody. How you doing? So just the view here. Boom, there we go. Right on. All right. Let me just double check the levels. We are streaming live again on LinkedIn. It is apparently big hair Monday really have to do something with his We are continuing our March down to a tab us reinvent.

We are watching this on YouTube after the fact, please comment below. I will Circle back as I do with every one of these videos on demand address one of your questions are in the next stream. But the idea here is pretty straightforward pretty simple. We’re going to touch on areas of the AWS Cloud.

They may not be familiar with the reason being we have a 69 days from this Monday right now up until when reinvent kicks off in December. Yes, that’s a very very long way away. But there is a ton of different things to watch to learn to understand and comprehend to kind of get the most out of reinvent.

I really want you to get the most out of room and I think it’s a fantastic conference. I think everybody who goes has a blast em, and if you can learn a lot so we covered last time we covered AWS Lambda, which is a critical service that I’m sure we’re going to be actually bouncing a back and forth to a bunch of times and it’s just that important but some of the feedback I got talking to people was that it might have been a little too much because it’s a people maybe you weren’t used to at talking about programming.

They weren’t used to getting their hands dirty. diving in and doing stuff, you know, we set up something pretty sure for pretty simple and I think did the takeaway was that school we see and understand sort of how How this can be a benefit but what season do a little bit more.

Let’s cover some other area. So I thought hey, you know what today? We’re going to cover the command line. And you know, I am apparently you’re crazy Professor because every time I touch my hair it gets worse impressive feat. I know but we’re going to talk about the command line.

So I’m going to switch over to my screen at we’re going to make sure you’re chilling right one cool looking primarily on my display, but I’ll come back for key points at you guys here in a camera. We are going to give ourselves a little bit less time at today.

I what we’re going to do is I’m going to put some time up on this clock make sure it’s the right thing. We’re going to say. what’s a let’s go to 25 minutes after the hour. So 20 minutes on the clock. I need to add sound effects of a stream deck.

I should put sound effects into this to make it a little cooler. And that is what we set up last time. We set up an a Lambda function that helped us every time we dropped something into an S3 bucket and it fired off an event into the logs telling us what we put in and I’m so I think that was pretty straightforward.

I like I said, I got some feedback that led to today’s topic which is the command line. So if questions were going along please fired off in LinkedIn, I have it that browser set up so that I can see the quality of what’s going on. They’re going to double-check the stream quality here, which seems to be good sup.

We are going to talk about the command line interface. Let me adjust fly is a tool that you type in to wait for the command line This is present on pretty much every database managed. Am I at specifically the Amazon Linux am I? It’s a present in a bunch of default things that you find.

So Beanstalk at present on a lot of people containers its present. What is actually the tool that like to manipulate or work with AWS Services. Now, why would you want to do this when I see how I won’t because it’s pretty straightforward and simple and it’s a little less complicated than programming but there’s a really cool and interesting thing about the command line interface and the command line interface is actually a complete and near-perfect mirror of the application programming interface of the apis that run 8 so we saw in last week’s episode the last episode of the show.

We were looking at Lambda and we were doing some things within Lambda based on actions that happened within the AWS API my foot back to that console. So you see here when S3 we added a trigger that meant anytime anyone called the put API. So putting an object putting an object into at 3 and 8 p.m.

I was called to do that and then we reacted to that. Well the command line interface lets us call that API we can actually put an object into S3 from the account. If you want we can also do anything down. So the way the AWS API works is like a mirror image of the command line interface.

So I’ve got a couple examples that I wanted to walk through and to show you but if you want to see something done or me to stumble around and fail doing something, please fired off in the comments here on LinkedIn and we’ll tackle it but this is a standard solution you can install it so you can see here on Mac and Linux you can install it from python directly.

It does run in Python. If your don’t have that setup, you can use Homebrew on python Mac to install on Windows. You can install it through the installer. She just downloaded run the 64-bit or 32-bit. And once you have it installed the font size here, you are going to need to add some credential so you can have credentials every time you run a command.

It’s a pain in the butt. What you can do is actually create a credential file that keeps things I saved and that’s actually the default when you start up. I let me come back to this year. So configuration and credential files is going to save your access key and secret key for the account that you can figure in a profile.

So you don’t always have to add it. Now. If you’re running the CLI in the eighth of his clouds or from an ec2 instance your permissions get assigned that’s a lot easier to handle but we’ve done is I’ve already set up at this profile file so you can see here very fancy access key secret key and then you put your access key and secret key that you get for creating user.

I mean, you can set up your default regions and your default output. So that’s a one-time activity. You guys can figure that out of a great help files the to do that. Example of an AWS command to AWS triggers the seal I missed your calling as a service S3 and then CP copy just like it is on Linux just like it is on Mac copy this local file my video.

MP4 into this bucket S3 my bucket pretty straightforward. So a copy this to that. Very very easy that is a great example of something that works nice and simply right. So if we go to RS3, we have a road to reinvent bucket. Let me pull up my command line.

Make sure you guys can see this. So I’m going to switch programming over 200 or the streaming over to I share I’m going to turn off my logo that we go. I mean up the font size of it here. So if I just simply type clear that awrs, you see it pulls up the help right takes a second.

Then goes we’ll wait a minute. You want help I could do that. I could say give me some help and then you’ll see it’ll just start to automatically page in the command line. So AWS command line unified tool great and gives us the default parameters and how to set this up very very simple and we’re going to quit out of that pushed you to quit we’re going to copy that same command.

Where is a AWS S3 CP and I have a file on my desktop that I’m going to copy to S3 colon colon road to reinvent at and we’re going to flip over real quick. So I’ve got that cute up already have this file in here. We’re going to delete it.

Delete that file. Yes. Yes. The bucket is empty makes a little smoother demo. And now that we come back here. So AWS great invoking the command line tool S3. The service were talking to CP is short for copy cuz it lines up with Windows and Linux and Unix at we’re going to copy this file for my desktop.

So I it’s a ad for a course I did on mastering I walk to add the three. X3 name of the bucket Road Arena if I hit answer fingers crossed this should work. I think I have it configured correctly. And you see my firewalls actually and asked me to make sure I can allow that upload so desktop to Rotary event to my browser.

Hope you guys back to my browser. So here we have that bucket. If I simply click the refresh button on the bucket while we have copied a file to S3. Rocket science amazing super simple. There’s a ton of options are consumed you’re copying things into S3 at but very simple very basic hear.

What we’ve done is used in the command line to push a file into S3 now. We know from last time that could trigger a whole bunch of actions, right? So the reason why I’m showing you this is uploading something in S3. It’s an image we could have sent this to a number of other services to our process that image to do something with that image.

And if we send a document we could do the same if we sent a video we could do a bunch of stuff with having a really straightforward interface for people righteous command line. Just type this command and you’re good or copy this command in your good so you don’t have to have everything crazy complicated right? So I read an article this morning where someone was trying to create a serverless API for some internal usage and any interesting thing they had was there saying was coughing on my arm or leg just upload from if it’s just an internal team thing like you need somebody to transfer a file or the kickoff of workflow.

We just typed in one quick word or command and we were Off to the Races. So I can show you why this might be useful we’re going to search for translate. So translate. I always hesitate showing Google when I’m hot on a livestream, but always use for so translate very very simple, very straightforward take something from one language flip it into another language at with reasonably decent accuracy.

It’s it’s still machine translation, but it gets the point across so your service has a landing page like you’re looking at right now and explain the marketing positioning of its quick blurb natural and accurate language translation could have guessed that from the name Amazon translate, but there are a bunch of services there their names don’t line up what’s going on with the We just kill my notifications here with the with the service.

You normally see some sort of launch video or customer attestation benefits and then use cases right and customer references. It’s the same setup for every Target landing page and that’s actually really really useful but we want to hear is across the Stop Bar. So easy Amazon translate overview features pricing at pricing is important to double-check.

I don’t like running up a random bill. So we’re going to be in the freezer cuz I haven’t sent anything to translation this month and 2 million characters per month for 12 months. So I’m this is an account that set up still with the free tier. But even after that it’s only $15 per million characters.

So if we sent a few characters and I love when they do these fractions of a penny diseases have no idea 15 bucks per million characters, that’s a ton of stuff to throw through translate. So we’re good here. We’re going to be in a fraction. I we should be in the free tier.

We make it into a fractional charge. But what I really want is Resources are the top. You see the service name overview Futures prices resources that will always send you to if there’s training available but also the HTML and PDF versions of the documentation the developer guide now that I’m not a developer, but remember how we talked about the CLI.

The command line interface is a mirror of the API developer to use if we click on HTML we’re going to get to the web version and we’re actually going to flip over to the new look of the web version have cuz this snazzy we get how all this works, right? So we see her supported languages that we have a number of East Asian languages Germanic languages.

So we’re going to start with a source language of English at we’re going to flip that into maybe a romance language of French cuz at least I can give you a reasonable verification of that translation and but there’s been quite a few supported languages, which is really really cool and got to love how finish get to some classification but then Down here.

You have some things that don’t work. So simplified to traditional Chinese and vice-versa doesn’t work at Korean Hebrew will not work as a perineal region to Arabic or Hebrew and for the record in case you’re wondering why I call it finish it from a linguistic perspective finishes just fascinating everybody always ask but my last name is actually Dutch Dutch Canadian 50% Dutch for the record.

But yeah, we’re going to go English to French. But if we understand these cases were trying to translate some some words real real quick. And this is sometimes it’s faster than doing Google translate, but I think it’s a really interesting sort of concept and very simple service to work with from Amazon, right you’ve supported languages and we have language codes for that.

So for English if TN for French, it’s a far that’s really what we need to know. You could have translate automatically configure this if you want not a problem at we’re going to click on getting started and then you’ll see there’s a nice little trick here with getting started in the console so we could go through the web.

And try it and see what’s the temp out but we can really do is getting started with the console will see the command line. So AWS translate translate text. So you wonder why is the double translate but remember r a c l i setup is very simple and very straightforward AWS to trigger the CLI name of the service name of the action in the service.

So if RS3 with AWS S3 CP for copy for translate we’re going to AWS translate translate text is the name of the endpoint or calling with an API call. We’re actually making call for so what we’re going to do here at we’re going to admit the region where I have Source language target language and some texts.

So let’s flip back to our command line which feels like this is more technical than last week. But really it’s not right. So translate translate text and then I’m just going to double-check. I have this source code language ever goes Double Dash source golang Is English Double Dash target language code is going to be French text is Hello World fancy exciting stuff.

If you have questions, let me know hit me up on the stream here in LinkedIn and I am monitoring off the side. But if we send this so, let’s just review this command to make sure we’re Crystal Clear EOS to trigger. The CLI translate is the name of the service were dealing with Translate text is the call with actually making to the translate service.

We’re giving a source language of English a target language of French and we’re saying hello world and we and we get the response which if I hadn’t missed typed would have been correct. Let me send that. We’re hello doesn’t have a W-2 monster and you saw that why do you stop me? You should have stopped me like expelled you up front.

Where could I make mistakes? That’s a ridiculous mistake. I’m glad it was that kind of mistake to start with if we say hello at it’s going to send then turn around and tell us our translated, Texas Board Ramones, which is Flappy Bird word translation what you see with translation similar to natural language processing we were trying to figure out the meaning is the more texts.

You send it the better. So if we go, this is from the livestream to hello, this is from the livestream should have a better translation but live stream is going to mess it up because this is where we going to see where automatic translation generally sucks in French and a lot of the time they use English words for technical stuff and a lot of time they use a literal translations, but there’s an official list of French technology words are very few people use so we’ll see what pops up here translate English to French.

Hello. This is from the livestream we get this this is Joan on the switches. Let’s try that again. Translate translates text with the source language codes at the auto and the target language code. Set to Spanish. I don’t speak Spanish. But let’s see the difference. This is from the livestream so language auto to target language.

And your hola esto es de la transmision en Vivo live. So English, that’s it. Nice and simple pretty straightforward. Now you can send anything you want through to the live stream to the translator. So let’s get a little more complicated because once you’re in the command line, you’re in this entire ecosystem of other command line things.

What we’re going to do is we’re going to pull out a very simple thing back here. Just thinking on the fly at what I’m going to do is I’m just loading up a text editor in the background here and saving a file sample, but what I’ve done is created.

A file that has a bunch of texts that right. So cat is a cabinet. I think who knows cats and the contents of a file from the file to the command line just like it did here so there are two ways to use the CLI in Amazon. I just copied work off of the page the marketing page my words are working just as well as my hair is this morning and as you can tell disastrous, so what we’re going to do is actually use I’m a Json file.

So if I fire that up again and let me just open this So I’m going to change this file a little bit of yours translate likes text files to be in a sec format. So we are going to set up properly and I’m so again, I’m just maintaining the file in the background.

He likes them as Json documents. So that is a document with a little bit more format to it. I’m going to save this and I’ll show you have to start planning and I think he’s got two minutes flat. So but that’s alright sample desktop if we do this. So now what we’ve done you’ll see the difference here is there’s a bracket there is a key and a value in a source language and a code.

So what we’re going to do is we’re actually going to clear that out. We’re going to AWS translate at translate text. Would help if I could spell seal I input Jason and then in this case File. users sample, that should work. Because it did not find my user cuz I forgot one extra.

/ so the way this works is this is a local. So we’ve done a TBS translate translate were using a different input this time using CLI command line interface import Json file and you give a full path to the file starting with file colon slash slash than the full path on Max.

For the root start with that extra / if we do that we are getting a missing input target language code. So we did not specify in our sample language code. We wanted we have a source code, but we don’t have a Target. So I’m going to do that right now.

I’m going to add the target language. Are we go? target language code And in this case, I think I remember my codes. We’re going to double-check. We’re going to fire that command back. There are no perfect. So I sent it sad that same set. But in this case, I asked it to translate to Dutch and Alfred it along.

So the translation text many are on the CLI blah blah blah blah blah. You do not want to see me pronounce this word cuz I’ll probably spit up all over my land. In Dutch, we love to roll our G’s in our ages for some reason but here we go.

We’ve passed it a file, right and that’s worked well, but if we go back to our original, which is basically just sending a text directly what you can actually do and this may or may not work again. We’re trying and is pull that this is totally shot in the dark hair team.

So what you can do is figure out other ways to get text into there. And I think what I needed to do was Slash forum. a little Prime and another little Prime not working still concept pretty straightforward. You have a command line. We’re at a time here, but I wanted to highlight.

This is just a really simple and easy one. A really simple and easy one to do. When was very poignant in Spanish but this is a quick introduction to the AWS CLI. So the CLI is a direct and complete mirror of the API, which means if you’re not comfortable with programming you’re trying to learn each new service.

The command line is really helpful if you just want to do one thing as we saw in our Command to undo scroll on a pier at as we saw an archimandrite here to copy a file from our local system into S3 very very simple AWS for the command line interface S3 for the service CP is a shortcut for copy to make it line up with the rest of the operating system are local file into our destination bucket that worked like a charm.

We also playing around a little bit with the translation feature. So again here we have a WS translate and witches are so hated. Translate for are the service were calling the endpoint or calling his translate text to give it a source code in this case for laundry City Auto is it you figured out translate Target.

We did Spanish or French we did and we gave a text to give a text from configuration file Wilson, give a text directly to the command line that directly for the command line when you remember like I don’t on a Monday with crazy hair and things are going well.

Would you remember how to pipe things at in two places on the command line? It’s really simple and straightforward and you can then actually just pull from various files. Now, there are some limits around a translation in before we sign off. Let’s go to that real quick and just with any AWS service, especially the ones around natural language you are going to see that there are limits.

Now. The good news is is there always documented so we’re back door documentation here on the side guidelines and limits in this case character encoding always needs to be utf-8 which is Unicode generally at four languages at 6 need that’s how you keep all the diacritics the accents of the cool little things and there but here’s the key document size 5000x you need to send smaller chunks of text.

In fact, all of the examples as they like it here. So you translate a webpage. Here’s how you translate a large document. They start by taking the document and breaking it up into smaller pieces that get under the 5,000 bite limit that you can fire off a custom terminology and stuff within the service has a bunch of stuff that is in Amazon translate that we didn’t touch cuz we’re just looking for an example and put the key takeaway hairs at the seal is really handy once you set it up if you’re not in the eighth of his class if you’re running it locally on a laptop or an iMac or whatever.

You’ll need an access key and a secret key. If you’re running it in the AWS Cloud Your Role will dictate what you can do and then remembered AWS name of the service name of the endpoint in a bunch of options if the direct mirror of the programming interface, which makes life really easy and simple for a lot of stuff.

When is great way to learn and kind of play around and poke at the different of your services? And I know this is a little crazy. I mean it’s reflective of my hair. It’s Monday. It’s Monday. I’m going to be for me this also highlights the spirit the spirit of these.

Streams leading up to reinvent her really just casual learning something together making some mistakes. You saw me Miss type of bunch of stuff. It happens to all of us. That’s no reason not to learn just keep moving forward roll with it at learn from your mistakes and you could call person.

This morning we copy to file for the command line to a local eat S3 and we translated some text real simple really easy. We did that in 25-30 minutes, really you don’t know prior coffee, which is like no prior experience. Let me know here on LinkedIn. Let me know on YouTube what you guys want to see next.

I got a bunch of plans. I am publishing a schedule. Hopefully this week that’s actually tied to another effort to update my website as a reminder. I have published The Ultimate Guide to eight of his reinvent 2019 a publishes every year. This is this year’s headed up on a cloud Guru.

I’ll put the link here in LinkedIn. So you guys can see that basically it goes through. What’s what at the show and what you should be looking for a next. Milestone are coming up in the next few weeks is some reserving seats for sessions. We’re going to be talking about that live on the screen when the time comes, but be prepared by now by reading the guide go in and start the sessions you’re interested in.

This is going to be amazing conference. I hopefully you following me on the streams leading up to the conference is going to give you even more of an edge at learn even more stuff. Thanks for joining me. As always. I will catch you guys on the next episode of this later this week.

Keep those comments coming up. I do review them and then add that to the content calendar or chocolate on the next a segment. So I will talk to you soon. Thanks for joining me early Monday. Have a great one. Good morning, everybody. How you doing? So just the view here.

Boom, there we go. Right on. All right. Let me just double check the levels. We are streaming live again on LinkedIn. It is apparently big hair Monday really have to do something with his We are continuing our March down to a tab us reinvent. We are watching this on YouTube after the fact, please comment below.

I will Circle back as I do with every one of these videos on demand address one of your questions are in the next stream. But the idea here is pretty straightforward pretty simple. We’re going to touch on areas of the AWS Cloud. They may not be familiar with the reason being we have a 69 days from this Monday right now up until when reinvent kicks off in December.

Yes, that’s a very very long way away. But there is a ton of different things to watch to learn to understand and comprehend to kind of get the most out of reinvent. I really want you to get the most out of room and I think it’s a fantastic conference.

I think everybody who goes has a blast em, and if you can learn a lot so we covered last time we covered AWS Lambda, which is a critical service that I’m sure we’re going to be actually bouncing a back and forth to a bunch of times and it’s just that important but some of the feedback I got talking to people was that it might have been a little too much because it’s a people maybe you weren’t used to at talking about programming.

They weren’t used to getting their hands dirty. diving in and doing stuff, you know, we set up something pretty sure for pretty simple and I think did the takeaway was that school we see and understand sort of how How this can be a benefit but what season do a little bit more.

Let’s cover some other area. So I thought hey, you know what today? We’re going to cover the command line. And you know, I am apparently you’re crazy Professor because every time I touch my hair it gets worse impressive feat. I know but we’re going to talk about the command line.

So I’m going to switch over to my screen at we’re going to make sure you’re chilling right one cool looking primarily on my display, but I’ll come back for key points at you guys here in a camera. We are going to give ourselves a little bit less time at today.

I what we’re going to do is I’m going to put some time up on this clock make sure it’s the right thing. We’re going to say. what’s a let’s go to 25 minutes after the hour. So 20 minutes on the clock. I need to add sound effects of a stream deck.

I should put sound effects into this to make it a little cooler. And that is what we set up last time. We set up an a Lambda function that helped us every time we dropped something into an S3 bucket and it fired off an event into the logs telling us what we put in and I’m so I think that was pretty straightforward.

I like I said, I got some feedback that led to today’s topic which is the command line. So if questions were going along please fired off in LinkedIn, I have it that browser set up so that I can see the quality of what’s going on. They’re going to double-check the stream quality here, which seems to be good sup.

We are going to talk about the command line interface. Let me adjust fly is a tool that you type in to wait for the command line This is present on pretty much every database managed. Am I at specifically the Amazon Linux am I? It’s a present in a bunch of default things that you find.

So Beanstalk at present on a lot of people containers its present. What is actually the tool that like to manipulate or work with AWS Services. Now, why would you want to do this when I see how I won’t because it’s pretty straightforward and simple and it’s a little less complicated than programming but there’s a really cool and interesting thing about the command line interface and the command line interface is actually a complete and near-perfect mirror of the application programming interface of the apis that run 8 so we saw in last week’s episode the last episode of the show.

We were looking at Lambda and we were doing some things within Lambda based on actions that happened within the AWS API my foot back to that console. So you see here when S3 we added a trigger that meant anytime anyone called the put API. So putting an object putting an object into at 3 and 8 p.m.

I was called to do that and then we reacted to that. Well the command line interface lets us call that API we can actually put an object into S3 from the account. If you want we can also do anything down. So the way the AWS API works is like a mirror image of the command line interface.

So I’ve got a couple examples that I wanted to walk through and to show you but if you want to see something done or me to stumble around and fail doing something, please fired off in the comments here on LinkedIn and we’ll tackle it but this is a standard solution you can install it so you can see here on Mac and Linux you can install it from python directly.

It does run in Python. If your don’t have that setup, you can use Homebrew on python Mac to install on Windows. You can install it through the installer. She just downloaded run the 64-bit or 32-bit. And once you have it installed the font size here, you are going to need to add some credential so you can have credentials every time you run a command.

It’s a pain in the butt. What you can do is actually create a credential file that keeps things I saved and that’s actually the default when you start up. I let me come back to this year. So configuration and credential files is going to save your access key and secret key for the account that you can figure in a profile.

So you don’t always have to add it. Now. If you’re running the CLI in the eighth of his clouds or from an ec2 instance your permissions get assigned that’s a lot easier to handle but we’ve done is I’ve already set up at this profile file so you can see here very fancy access key secret key and then you put your access key and secret key that you get for creating user.

I mean, you can set up your default regions and your default output. So that’s a one-time activity. You guys can figure that out of a great help files the to do that. Example of an AWS command to AWS triggers the seal I missed your calling as a service S3 and then CP copy just like it is on Linux just like it is on Mac copy this local file my video.

MP4 into this bucket S3 my bucket pretty straightforward. So a copy this to that. Very very easy that is a great example of something that works nice and simply right. So if we go to RS3, we have a road to reinvent bucket. Let me pull up my command line.

Make sure you guys can see this. So I’m going to switch programming over 200 or the streaming over to I share I’m going to turn off my logo that we go. I mean up the font size of it here. So if I just simply type clear that awrs, you see it pulls up the help right takes a second.

Then goes we’ll wait a minute. You want help I could do that. I could say give me some help and then you’ll see it’ll just start to automatically page in the command line. So AWS command line unified tool great and gives us the default parameters and how to set this up very very simple and we’re going to quit out of that pushed you to quit we’re going to copy that same command.

Where is a AWS S3 CP and I have a file on my desktop that I’m going to copy to S3 colon colon road to reinvent at and we’re going to flip over real quick. So I’ve got that cute up already have this file in here. We’re going to delete it.

Delete that file. Yes. Yes. The bucket is empty makes a little smoother demo. And now that we come back here. So AWS great invoking the command line tool S3. The service were talking to CP is short for copy cuz it lines up with Windows and Linux and Unix at we’re going to copy this file for my desktop.

So I it’s a ad for a course I did on mastering I walk to add the three. X3 name of the bucket Road Arena if I hit answer fingers crossed this should work. I think I have it configured correctly. And you see my firewalls actually and asked me to make sure I can allow that upload so desktop to Rotary event to my browser.

Hope you guys back to my browser. So here we have that bucket. If I simply click the refresh button on the bucket while we have copied a file to S3. Rocket science amazing super simple. There’s a ton of options are consumed you’re copying things into S3 at but very simple very basic hear.

What we’ve done is used in the command line to push a file into S3 now. We know from last time that could trigger a whole bunch of actions, right? So the reason why I’m showing you this is uploading something in S3. It’s an image we could have sent this to a number of other services to our process that image to do something with that image.

And if we send a document we could do the same if we sent a video we could do a bunch of stuff with having a really straightforward interface for people righteous command line. Just type this command and you’re good or copy this command in your good so you don’t have to have everything crazy complicated right? So I read an article this morning where someone was trying to create a serverless API for some internal usage and any interesting thing they had was there saying was coughing on my arm or leg just upload from if it’s just an internal team thing like you need somebody to transfer a file or the kickoff of workflow.

We just typed in one quick word or command and we were Off to the Races. So I can show you why this might be useful we’re going to search for translate. So translate. I always hesitate showing Google when I’m hot on a livestream, but always use for so translate very very simple, very straightforward take something from one language flip it into another language at with reasonably decent accuracy.

It’s it’s still machine translation, but it gets the point across so your service has a landing page like you’re looking at right now and explain the marketing positioning of its quick blurb natural and accurate language translation could have guessed that from the name Amazon translate, but there are a bunch of services there their names don’t line up what’s going on with the We just kill my notifications here with the with the service.

You normally see some sort of launch video or customer attestation benefits and then use cases right and customer references. It’s the same setup for every Target landing page and that’s actually really really useful but we want to hear is across the Stop Bar. So easy Amazon translate overview features pricing at pricing is important to double-check.

I don’t like running up a random bill. So we’re going to be in the freezer cuz I haven’t sent anything to translation this month and 2 million characters per month for 12 months. So I’m this is an account that set up still with the free tier. But even after that it’s only $15 per million characters.

So if we sent a few characters and I love when they do these fractions of a penny diseases have no idea 15 bucks per million characters, that’s a ton of stuff to throw through translate. So we’re good here. We’re going to be in a fraction. I we should be in the free tier.

We make it into a fractional charge. But what I really want is Resources are the top. You see the service name overview Futures prices resources that will always send you to if there’s training available but also the HTML and PDF versions of the documentation the developer guide now that I’m not a developer, but remember how we talked about the CLI.

The command line interface is a mirror of the API developer to use if we click on HTML we’re going to get to the web version and we’re actually going to flip over to the new look of the web version have cuz this snazzy we get how all this works, right? So we see her supported languages that we have a number of East Asian languages Germanic languages.

So we’re going to start with a source language of English at we’re going to flip that into maybe a romance language of French cuz at least I can give you a reasonable verification of that translation and but there’s been quite a few supported languages, which is really really cool and got to love how finish get to some classification but then Down here.

You have some things that don’t work. So simplified to traditional Chinese and vice-versa doesn’t work at Korean Hebrew will not work as a perineal region to Arabic or Hebrew and for the record in case you’re wondering why I call it finish it from a linguistic perspective finishes just fascinating everybody always ask but my last name is actually Dutch Dutch Canadian 50% Dutch for the record.

But yeah, we’re going to go English to French. But if we understand these cases were trying to translate some some words real real quick. And this is sometimes it’s faster than doing Google translate, but I think it’s a really interesting sort of concept and very simple service to work with from Amazon, right you’ve supported languages and we have language codes for that.

So for English if TN for French, it’s a far that’s really what we need to know. You could have translate automatically configure this if you want not a problem at we’re going to click on getting started and then you’ll see there’s a nice little trick here with getting started in the console so we could go through the web.

And try it and see what’s the temp out but we can really do is getting started with the console will see the command line. So AWS translate translate text. So you wonder why is the double translate but remember r a c l i setup is very simple and very straightforward AWS to trigger the CLI name of the service name of the action in the service.

So if RS3 with AWS S3 CP for copy for translate we’re going to AWS translate translate text is the name of the endpoint or calling with an API call. We’re actually making call for so what we’re going to do here at we’re going to admit the region where I have Source language target language and some texts.

So let’s flip back to our command line which feels like this is more technical than last week. But really it’s not right. So translate translate text and then I’m just going to double-check. I have this source code language ever goes Double Dash source golang Is English Double Dash target language code is going to be French text is Hello World fancy exciting stuff.

If you have questions, let me know hit me up on the stream here in LinkedIn and I am monitoring off the side. But if we send this so, let’s just review this command to make sure we’re Crystal Clear EOS to trigger. The CLI translate is the name of the service were dealing with Translate text is the call with actually making to the translate service.

We’re giving a source language of English a target language of French and we’re saying hello world and we and we get the response which if I hadn’t missed typed would have been correct. Let me send that. We’re hello doesn’t have a W-2 monster and you saw that why do you stop me? You should have stopped me like expelled you up front.

Where could I make mistakes? That’s a ridiculous mistake. I’m glad it was that kind of mistake to start with if we say hello at it’s going to send then turn around and tell us our translated, Texas Board Ramones, which is Flappy Bird word translation what you see with translation similar to natural language processing we were trying to figure out the meaning is the more texts.

You send it the better. So if we go, this is from the livestream to hello, this is from the livestream should have a better translation but live stream is going to mess it up because this is where we going to see where automatic translation generally sucks in French and a lot of the time they use English words for technical stuff and a lot of time they use a literal translations, but there’s an official list of French technology words are very few people use so we’ll see what pops up here translate English to French.

Hello. This is from the livestream we get this this is Joan on the switches. Let’s try that again. Translate translates text with the source language codes at the auto and the target language code. Set to Spanish. I don’t speak Spanish. But let’s see the difference. This is from the livestream so language auto to target language.

And your hola esto es de la transmision en Vivo live. So English, that’s it. Nice and simple pretty straightforward. Now you can send anything you want through to the live stream to the translator. So let’s get a little more complicated because once you’re in the command line, you’re in this entire ecosystem of other command line things.

What we’re going to do is we’re going to pull out a very simple thing back here. Just thinking on the fly at what I’m going to do is I’m just loading up a text editor in the background here and saving a file sample, but what I’ve done is created.

A file that has a bunch of texts that right. So cat is a cabinet. I think who knows cats and the contents of a file from the file to the command line just like it did here so there are two ways to use the CLI in Amazon. I just copied work off of the page the marketing page my words are working just as well as my hair is this morning and as you can tell disastrous, so what we’re going to do is actually use I’m a Json file.

So if I fire that up again and let me just open this So I’m going to change this file a little bit of yours translate likes text files to be in a sec format. So we are going to set up properly and I’m so again, I’m just maintaining the file in the background.

He likes them as Json documents. So that is a document with a little bit more format to it. I’m going to save this and I’ll show you have to start planning and I think he’s got two minutes flat. So but that’s alright sample desktop if we do this. So now what we’ve done you’ll see the difference here is there’s a bracket there is a key and a value in a source language and a code.

So what we’re going to do is we’re actually going to clear that out. We’re going to AWS translate at translate text. Would help if I could spell seal I input Jason and then in this case File. users sample, that should work. Because it did not find my user cuz I forgot one extra.

/ so the way this works is this is a local. So we’ve done a TBS translate translate were using a different input this time using CLI command line interface import Json file and you give a full path to the file starting with file colon slash slash than the full path on Max.

For the root start with that extra / if we do that we are getting a missing input target language code. So we did not specify in our sample language code. We wanted we have a source code, but we don’t have a Target. So I’m going to do that right now.

I’m going to add the target language. Are we go? target language code And in this case, I think I remember my codes. We’re going to double-check. We’re going to fire that command back. There are no perfect. So I sent it sad that same set. But in this case, I asked it to translate to Dutch and Alfred it along.

So the translation text many are on the CLI blah blah blah blah blah. You do not want to see me pronounce this word cuz I’ll probably spit up all over my land. In Dutch, we love to roll our G’s in our ages for some reason but here we go.

We’ve passed it a file, right and that’s worked well, but if we go back to our original, which is basically just sending a text directly what you can actually do and this may or may not work again. We’re trying and is pull that this is totally shot in the dark hair team.

So what you can do is figure out other ways to get text into there. And I think what I needed to do was Slash forum. a little Prime and another little Prime not working still concept pretty straightforward. You have a command line. We’re at a time here, but I wanted to highlight.

This is just a really simple and easy one. A really simple and easy one to do. When was very poignant in Spanish but this is a quick introduction to the AWS CLI. So the CLI is a direct and complete mirror of the API, which means if you’re not comfortable with programming you’re trying to learn each new service.

The command line is really helpful if you just want to do one thing as we saw in our Command to undo scroll on a pier at as we saw an archimandrite here to copy a file from our local system into S3 very very simple AWS for the command line interface S3 for the service CP is a shortcut for copy to make it line up with the rest of the operating system are local file into our destination bucket that worked like a charm.

We also playing around a little bit with the translation feature. So again here we have a WS translate and witches are so hated. Translate for are the service were calling the endpoint or calling his translate text to give it a source code in this case for laundry City Auto is it you figured out translate Target.

We did Spanish or French we did and we gave a text to give a text from configuration file Wilson, give a text directly to the command line that directly for the command line when you remember like I don’t on a Monday with crazy hair and things are going well.

Would you remember how to pipe things at in two places on the command line? It’s really simple and straightforward and you can then actually just pull from various files. Now, there are some limits around a translation in before we sign off. Let’s go to that real quick and just with any AWS service, especially the ones around natural language you are going to see that there are limits.

Now. The good news is is there always documented so we’re back door documentation here on the side guidelines and limits in this case character encoding always needs to be utf-8 which is Unicode generally at four languages at 6 need that’s how you keep all the diacritics the accents of the cool little things and there but here’s the key document size 5000x you need to send smaller chunks of text.

In fact, all of the examples as they like it here. So you translate a webpage. Here’s how you translate a large document. They start by taking the document and breaking it up into smaller pieces that get under the 5,000 bite limit that you can fire off a custom terminology and stuff within the service has a bunch of stuff that is in Amazon translate that we didn’t touch cuz we’re just looking for an example and put the key takeaway hairs at the seal is really handy once you set it up if you’re not in the eighth of his class if you’re running it locally on a laptop or an iMac or whatever.

You’ll need an access key and a secret key. If you’re running it in the AWS Cloud Your Role will dictate what you can do and then remembered AWS name of the service name of the endpoint in a bunch of options if the direct mirror of the programming interface, which makes life really easy and simple for a lot of stuff.

When is great way to learn and kind of play around and poke at the different of your services? And I know this is a little crazy. I mean it’s reflective of my hair. It’s Monday. It’s Monday. I’m going to be for me this also highlights the spirit the spirit of these.

Streams leading up to reinvent her really just casual learning something together making some mistakes. You saw me Miss type of bunch of stuff. It happens to all of us. That’s no reason not to learn just keep moving forward roll with it at learn from your mistakes and you could call person.

This morning we copy to file for the command line to a local eat S3 and we translated some text real simple really easy. We did that in 25-30 minutes, really you don’t know prior coffee, which is like no prior experience. Let me know here on LinkedIn. Let me know on YouTube what you guys want to see next.

I got a bunch of plans. I am publishing a schedule. Hopefully this week that’s actually tied to another effort to update my website as a reminder. I have published The Ultimate Guide to eight of his reinvent 2019 a publishes every year. This is this year’s headed up on a cloud Guru.

I’ll put the link here in LinkedIn. So you guys can see that basically it goes through. What’s what at the show and what you should be looking for a next. Milestone are coming up in the next few weeks is some reserving seats for sessions. We’re going to be talking about that live on the screen when the time comes, but be prepared by now by reading the guide go in and start the sessions you’re interested in.

This is going to be amazing conference. I hopefully you following me on the streams leading up to the conference is going to give you even more of an edge at learn even more stuff. Thanks for joining me. As always. I will catch you guys on the next episode of this later this week.

Keep those comments coming up. I do review them and then add that to the content calendar or chocolate on the next a segment. So I will talk to you soon. Thanks for joining me early Monday. Have a great one.

More Content