In order to get the most out of this Building Serverless PHP applications tutorial, please ensure you have an AWS account and have set up the aws
, sam
and composer
, jq
, make
command line tools along with an HTTP client as detailed here.
You will find it easiest if you create a new AWS personal account. The work you do in this tutorial will mostly fall within the free tier and if there are any costs, it should be no more than a dollar or two, if you delete everything when you are finished with it.
Make sure you have done this AT LEAST 24 HOURS BEFORE THE TUTORIAL.
- Go to https://aws.amazon.com/
- Click Create a Free Account button
- Fill in form and click next
- On next form, select the Personal account type
- You need to enter card details on the next page
- Do the verification thing
- Select the Basic support plan as it's free!
- All done! You can now sign into the Console
- Install the aws command line tool
- Go to the Installing the AWS CLI page and follow the instructions for your operating system. When you're done, type
aws --version
in a terminal window to check that it works. - Create IAM credentials:
- Navigate to https://console.aws.amazon.com/iam/home#/users.
- Click the Add user button
- Enter a user name:
CliAdmin
- Select "Programmatic access" and press "Next: Permissions"
- Select "Attach existing policies directly"
- Select the checkbox next to the "AdministratorAccess" policy name
- Click the "Next: Tags" button
- Click the "Next: Review" button
- Click the "Create user" button
- Make a note of the Access key ID and the Secret access key for your CliAdmin IAM user.
- Configure the aws command line tool:
- Type
aws configure
in your terminal window and press enter.- Enter the Access key ID for your CliAdmin IAM user for "AWS Access Key ID" and press enter.
- Enter the Secret access key for your CliAdmin IAM user for "AWS Secret Access Key" and press enter
- Enter
eu-west-2
for "Default region name" and press enter. - Enter
json
for "Default output format" and press enter.
- Type
- Go to the Installing the AWS CLI page and follow the instructions for your operating system. When you're done, type
- Install the sam command line tool
- Go to https://aws.amazon.com/serverless/sam/ and follow the instructions in the Install SAM CLI section for your operating system.
- When you're done, type
sam --version
in a terminal window to check that it works.
- Ensure you have PHP 7.3 working from your terminal windows. Type
php --version
to ensure that it works. - Install Composer globally by following the instructions at https://getcomposer.org/download/. Type
composer --version
to check that it works.
Install jq for pretty printing JSON output amongst other useful things.
###Make
Install a GNU make
.
- On Linux, this is probably done by running
sudo apt-get install build-essential
orsudo yum install make
. - On Mac, this is probably done by running
xcode-select --install
or installing Xcode from the App Store. - On Windows, I have no idea... WSL or chocolatey maybe?
Personally, I like curl
, but you can also use httpie, Postman or Paw, etc.
To run AWS lambda functions locally, you will need Docker installed. This is not strictly needed for the tutorial, but may make things quicker.