Jamie-BitFlight / aws-lambda-blog

AWS Lambda serverless blogging platform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Powered by Amazon Web Services

LambdaBlogPlatform

serverless blogging platform built with AWS

Table of Contents

About

alt tag AWS Lambda Blog Platform is a complete blogging solution that uses the following Amazon Web Services for operation

  • API Gateway
  • Lambda
  • DynamoDB
  • S3
  • Cloudfront
  • SES

It runs completely serverless - free of any inflexible hardware infrastructure. The whole system running as a team of small misroservices means that the running expenses are without any overhead even at the smallest scale.

Installation prerequisites

Installation

  • download this repo, unzip and cd to project folder
  • run npm install
  • Create a new user in IAM
  • [IAM -> Users -> Add User -> Access type -> check Programmatic access]
  • On the last step click on "Download .csv file" and save the file in project folder
  • Add permissions to the user
  • [IAM -> Users -> your_user -> Permissions -> Add inline policy -> Custom policy]
  • Copy the following JSON and give your inline policy a name
{
   "Version": "2012-10-17",
   "Statement": [
       {
           "Sid": "Stmt1481118325000",
           "Effect": "Allow",
           "Action": [
               "iam:CreatePolicy",
               "iam:CreateRole",
               "iam:GetPolicy",
               "iam:GetRole",
               "iam:AttachUserPolicy",
               "iam:AttachRolePolicy",
               "iam:PassRole",
               "route53:ListHostedZones",
               "acm:ListCertificates"
           ],
           "Resource": [
               "*"
           ]
       }
   ]
}
  • (install script will add other permisions that are necessary for installation)
  • run node install.js
  • wizard will take you through the process of installation
  • if everything went smooth you should see your page after CloudFront changes resolve (usually takes around 15 minutes)

Advanced installation

  • download this repo, unzip and cd to project folder
  • run npm install
  • Create a new user in IAM (you will put this user name into install_config.js later)
  • [IAM -> Users -> Add User -> Access type -> check Programmatic access]
  • Copy account keys for the user and make a json file that looks like this: user_access_keys
{
   "accessKeyId": "AK************", 
   "secretAccessKey": "BX**********************", 
   "region": "eu-west-1"
}
  • add a new inline policy to the user
  • [IAM -> Users -> your_user -> Permissions -> Add inline policy -> Custom policy -> Select -> Copy JSON below and enter a policy name
{
 "Version": "2012-10-17",
 "Statement": [
     {
         "Sid": "Stmt1481118325000",
         "Effect": "Allow",
         "Action": [
             "iam:CreatePolicy",
             "iam:CreateRole",
             "iam:GetPolicy",
             "iam:GetRole",
             "iam:AttachUserPolicy",
             "iam:AttachRolePolicy",
             "iam:PassRole"
         ],
         "Resource": [
             "*"
         ]
     }
 ]
}

-> Attach policy]

  • (install script will add other permisions that are necessary for installation)
  • Copy and save Hosted Zone ID for your domain alt tag
  • copy this certificate ARN - and paste it into install_config.js alt tag
  • get your recaptcha key (you can edit this later in API Gateway)
  • copy install/install_config_template.js to install/install_config.js
  • change values in install/install_config.js
  • run node install.js
  • if everything went smooth you should see your page after CloudFront changes resolve (usually takes around 15 minutes)

About

AWS Lambda serverless blogging platform

License:MIT License


Languages

Language:JavaScript 55.5%Language:CSS 25.7%Language:HTML 18.8%