April 18, 2020
Alright, let's dive right in. I'm assuming you already have an AWS account. If not, you'll need to take care of creating an account for yourself in order to continue with this post.
Start by running
npm install aws-cli
or yarn add aws-cli
from the command line. This will install the AWS command line that's required in order to be able to deploy anything to AWS.Our next step is to create a new access key from IAM. From the AWS website, click on the 'My Account' dropdown in the navbar and then click on 'Security Credentials'.
Next, find the 'Access keys' dropdown and click it, then click 'Create New Access Key'.
You should see the following modal. You can choose if you want to download the key file or show the access key. We're about to save your key and ID to your aws credentials file on your machine so simply showing the values is fine, but downloading this file doesn't hurt and ensures you always have access to these values. Once you close the tab you're in, or get logged out due to inactivity, you'll no longer be able view your access key. If you lose it, it's gone forever.
Head over to your terminal and run
aws configure
.
You'll first be prompted to add your key ID so copy and paste that in. Next you'll need to paste in your secret access key (and don't worry, I'll be deleting the ones I've used straight after I'm done with this post). For the last 2 prompts, region name and output format, you can just go ahead and hit enter.Now, for those of you who don't know, your AWS key id and secret access key should be kept in a secure and safe placed and never shared online. If someone gets access to these, they can potentially gain access to whatever these values are attached to in AWS. The key id and access key I've used are solely demonstration purposes and will be deleted as soon as I've published this post. You may have noticed in an earlier screenshot I included that I covered and key ID that is being used for a personal project.
To confirm your region, output, key ID, and secret access key were set correctly, run the commands seen in the following screenshot and you should see a similar output:
Now you're all set. You can easily deploy to AWS using any number of their services. If you're new to AWS and looking for something get started with, I recommend trying to build your own Alexa skill and then deploying your lambda function.
...