Input on AWS-driven form field

Table Of Contents

Advanced form-field solution architecture hosted by AWS

Hi fellow #AWS builders - question for you! I’m looking to build a serverless form-field email capture. I’ve drafted the included design, with the intended design and will be written in AWS #CDK (#Python). Albeit a bit overkill for its purpose, isn’t that the nature of a hobby project?! ;)

spaformarch

  1. Client enters the site, enters their email to be informed of upcoming events, etc. This is a SPA (single-page application) hosted by Amazon CloudFront, serving Amazon S3 as the origin. For those concerned, don’t worry, there is a CAPTCHA to ensure I don’t get spammed to the other side of the world.
  • The onClick event on the form execute’s POST to the API endpoint hosted within the API Gateway endpoint as defined in step
  • Once validated (TBD - API Key? Need security and obfuscation of the key), the event payload is sent to the queue. CORS ensures it’s being submitted through the originating site.
  1. The event source mapping defines the Lambda function to process messages in the queue. This may be unneeded due to perceived incoming load, but I’m all for simple (and cheap) fail-safes that will mitigate load.

  2. The Lambda function reads the batch, extracts the necessary information (it’s simple, the email address.. which will be validated on input and re-validated in the function).

  3. The function uses put_item() to place the item in the DynamoDB table with the necessary partition key (that serves a whole other conversation.. but likely a UUID) and a long-lived TTL. This is used simply for future reference to scrape and send those interested necessary info in the future.

  4. The function also calls Amazon SES w/ a trusted domain to ready the send of a confirmation of the request, etc. That is the extent of the request, it doesn’t need to look pretty per-say.

  5. SES ships the email from noreply@xyz.com from the trusted domain with the necessary details.

Is this the best way to approach this? Is there any AWS CDK patterns that you’re familiar with that you’re interested in sharing? Is there simpler hosted form-fields that I should be using (that reminds me of the old-days.. cgi-bin & #Perl anyone)?

Tags :
Share :

Related Posts

Programmatically backup your Amazon Route53 zones deployed via AWS CDK

Programmatically backup your Amazon Route53 zones deployed via AWS CDK

Programmatically backup your Amazon Route53 zones Table of Contents Overview Deployment Code Requirements Deployment Overview Deployment Diagram Outputs Amazon S3 Bucket Operating Cost Recap Overview Looking for an easy way to backup your Amazon Route53 records to Amazon S3 with proper lifecycle rules and retention? Look no further, as we cover how to deploy this solution using AWS CDK!

Read More
Deploying Google Lighthouse CI (LHCI) using AWS-CDK & Fargate

Deploying Google Lighthouse CI (LHCI) using AWS-CDK & Fargate

Deploying a highly available, persistent Google Lighthouse interface through AWS-CDK Table of Contents Prelude - the code Intro - What’s Lighthouse? Why accessibility matters What’s Section 508? Patient Interaction How do I ensure compliance? Deployment Requirements Initial Setup Read the Docs! Diagram Noted cleanup Outcome What did we build? 1. Operational Excellence 2. Security 3. Reliability 4. Performance Efficiency 5. Cost Optimization 6. Sustainability Prelude - Show me the code! The code is currently maintained on GitHub.

Read More
Using CloudFront origin groups to increase availability on SPA deployments

Using CloudFront origin groups to increase availability on SPA deployments

Table of Contents Overview Services utilized Existing deployment Existing deployment availability Adding high-availability Amazon S3 bucket (cross region) OAI - Origin Access Identity Don’t let DNS be your dependency in HA design Lambda@Edge can be mighty slow to de-replicate Honorable mentions Handling index.html redirection Redirects Security Conclusion Overview Adding automated failover for your SPA deployment that is deployed to an associated AWS region is a simple, cost-effective way to increase site availability! In this post, we’ll cover the sometimes forgotten parts of Amazon CloudFront, Lambda@Edge (and purpose-driven functionality) along with Amazon S3 as native origin’s within an origin group.

Read More