Skip to content

Instantly share code, notes, and snippets.

@akrabat akrabat/aws-tutorial-setup.md Secret
Last active May 24, 2019

Embed
What would you like to do?
Building Serverless PHP applications tutorial preparation

Building Serverless PHP applications tutorial

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.

Create an AWS account

Make sure you have done this AT LEAST 24 HOURS BEFORE THE TUTORIAL.

  1. Go to https://aws.amazon.com/
  2. Click Create a Free Account button
  3. Fill in form and click next
  4. On next form, select the Personal account type
  5. You need to enter card details on the next page
  6. Do the verification thing
  7. Select the Basic support plan as it's free!
  8. All done! You can now sign into the Console

Set up AWS and SAM CLI tools on your local computer

  1. Install the aws command line tool
    1. 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.
    2. Create IAM credentials:
      1. Navigate to https://console.aws.amazon.com/iam/home#/users.
      2. Click the Add user button
      3. Enter a user name: CliAdmin
      4. Select "Programmatic access" and press "Next: Permissions"
      5. Select "Attach existing policies directly"
      6. Select the checkbox next to the "AdministratorAccess" policy name
      7. Click the "Next: Tags" button
      8. Click the "Next: Review" button
      9. Click the "Create user" button
      10. Make a note of the Access key ID and the Secret access key for your CliAdmin IAM user.
    3. Configure the aws command line tool:
      1. 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.
  2. Install the sam command line tool
    1. Go to https://aws.amazon.com/serverless/sam/ and follow the instructions in the Install SAM CLI section for your operating system.
    2. When you're done, type sam --version in a terminal window to check that it works.

Other required tools

Composer

  1. Ensure you have PHP 7.3 working from your terminal windows. Type php --version to ensure that it works.
  2. Install Composer globally by following the instructions at https://getcomposer.org/download/. Type composer --version to check that it works.

jq

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 or sudo 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?

An HTTP Client

Personally, I like curl, but you can also use httpie, Postman or Paw, etc.

Optional: Docker

To run AWS lambda functions locally, you will need Docker installed. This is not strictly needed for the tutorial, but may make things quicker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.