gregcope / pastyAndChablis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pastyAndChablis

AWS Static website for a bit of fun ordering takeaway pizza!

  1. A static website with menu
  2. User submits a form of their Pizza order
  3. Order is emailed and saved in a DB
  4. User gets a response

Aim

In no real order

  • Set up a website without servers
  • Have a proper cert/domain name
  • CDN and origin config, secured to only answer CDN
  • Configured as Code
  • Learn all the deep details
  • Be secure, low cost and good observability
  • [NEW] Resilient to region or serice (in one region failure)

AWS Design

  • Cloudfront config, with correct TLS cert tied to a;
  • S3 Origin for static assets
  • Simple API Gateway secured to a single Lambda
  • AWS WAF V2 WebACL to protect the above APIGW with managed rules (e.g. XSS)
  • Lambda is secured to DynamoDB, Cloudwatch logs, SES only
  • [NEW] Deployed in more than one region
  • [NEW] Dynamo DB global tables replication
  • [NEW] R53 failover

Code logic

  • Form checks input
  • If valid sends an email, saves order to db
  • and sends HTML response to user

Cloudformation

These have been split into, cloudformation-static.yaml, cloudformation-app.yaml and cloudformation-waf.yaml, to make them more managable. They could be collapsed as both have some shared Parameters for example RootDomainName (not used yet, but expected to be added for API GW on a Custom Domain name).

AWS Simple Email Service verififcaiton

You need to verify both the sending domain and the reciepient (if different) to do this.

Assuming an R53 hosted domain for a domain and any inbox you have access to (for individual email)

  1. Login into the AWS console and goto your prefered region
  2. Go to the SES Home
  3. Under Identity Management, Choose to;
  4. Under Domains click Verify a New Domain and enter the Domain name, click Generate DKIM Settings and click Verify This Domain. Down the bottom click Use Route 53 Click the Domain Verificaiton Record and DKIM Settings and then Create Record Sets. Return and refresh and it should show as Verified
  5. Under the Email Addresses click Verify a New Email Address and enter the recpient (or sender) and click go. Access the inbox and look for the email from AWS, and click the link. Return and refresh and it should show as Verified

Notes

https://www.cs.oberlin.edu/~kuperman/help/vim/indenting.html

  • :set expandtab
  • :set autoindent

Resources

Static Websites with CF, CF and S3

API GW, Lamdba, SES

AWS WAF and WebACL

Python

Resilience / tweaks

About


Languages

Language:HTML 100.0%