In this section we will spend sometime setting up our environments before getting started.
- Clone this repo
- Sign in to your AWS Account
- Install the AWS CLI and auth via the command line
- Install serverless globally
- Open this project in the code editor of your choice
- Join DevopsRepresent slack workspace
Clone this repo. You're going to make it your own and make edits. It's yours to keep and play around.
Choose a directory where you'd like to clone this repo to (it could even just be your desktop)
Run the following in your command line
git clone git@github.com:DevOps-Represent/simple-lambda-alert-notification.git
If you don't have a github account, please download the zip by going to the github link, clicking on the green Code
dropdown button and selecting the Download ZIP
link.
If you don't already have one, you'll have to set up a personal AWS account. If you don't have one, having an AWS account is key if you intend on continuing your AWS learning journey after this workshop.
-
If you DO have an account, log in (preferably not as root and you've set up a user via IAM that has permissions to deploy resources).
- Create an IAM user or use the root user.
- Set up a access key ID and secret by following instructions HERE. Keep this access key and secret handy. We will need that while calling the secure API.
- Login with the new IAM user or use the root user
- In the navigation bar on the upper right, choose your user name, and then choose My Security Credentials.
- Expand the Access keys (access key ID and secret access key) section.
- To create an access key, choose Create New Access Key.
-
If you DONT have an account, go HERE to create one, you'll need a credit card - Don't worry no cost will be incurred during this workshop (~$1 will be taken out of your account on initial sign-up but this will be automatically refunded by AWS).
As we're running commands via the command line that will allow you to deploy AWS resources, you need to authenticate to your personal AWS via the command line.
Here's install instructions for all operating systems: How to install the AWS CLI 2
NOTE you'll need to get some details from the AWS web console that'll need to be copy and pasted for this to work AWS instructions on how to configure your command line
It'll look something like this:
aws configure
If you have multiple AWS accounts, configure with a profile name
aws configure --profile <profile-name>
Then following the prompts you need to provide:
- AWS Access Key ID
- AWS Secret Access Key
- Default region name (for Australia, choose
ap-southeast-2
) - Default output format (you can just choose nothing)
- Run
node -v
to check if you have node installed. - Run
npm -v
to check if you have npm installed. - Run
yarn -v
to check if you have yarn installed.
if you have everything installed then go to the Install serverless globally, otherwise keep reading through.
- To install node and npm go to https://nodejs.org/en/download/.
- To install yarn, execute
npm install --global yarn
We are deploying the lambda using serverless. To install serverless via npm simply run npm install -g serverless
.
We are going to make a new lambda and create alarms. To do this, it's best to use a code editor.
There's lots of free versions, here's a few to pick from if you don't already have one:
Here is an even longer list.
We'll be sending you a link to your email.