AWS Deployment Guide — GOALS Click "Save as PDF" → Select destination "Save as PDF" → Enable "Background graphics"

Technical Documentation · Internal Use Only

AWS Deployment
Guide

GOALS: The Definition of Determination

Prepared For Sharif Dyson · SPLURJJ Ecosystem
Document Type Static Site · AWS S3 + CloudFront + Square
Version v2.0 · April 2026
Sections 16 Sections Including Payment & Commerce
Classification Internal · Technical Team Only

Table of Contents

01 Overview

Architecture Overview

The GOALS website is a static site — HTML, CSS, JavaScript, and images. No backend server is required for content delivery. The AWS stack below delivers it globally at high speed with HTTPS, for approximately $2–6 per month.

Request Flow — Visitor to Content
🌍VisitorBrowser request
🌐Route 53DNS routing
CloudFrontCDN + HTTPS
🪣S3 BucketYour files
💳Square SDKCard tokenization
⚙️API GatewaySecure endpoint
λLambdaPayment processor
💰Square APICharge + deposit
AWS ServicePurposeEst. Monthly Cost
Amazon S3Stores and serves all HTML, CSS, JS, and image files~$0.02/mo
Amazon CloudFrontGlobal CDN — caches files at 400+ edge locations worldwide~$1–5/mo
AWS Certificate ManagerFree SSL/TLS certificate for HTTPS on your custom domainFree
Amazon Route 53DNS management — connects your domain to CloudFront~$0.50/mo
AWS LambdaServer-side Square payment processing~Free
API GatewayHTTPS endpoint for Lambda payment handler~Free

Total estimated AWS cost: $2–6/month for a fully hosted, global, HTTPS-enabled website with enterprise-grade CDN delivery and a serverless payment backend.

02 Before You Start

Prerequisites & Requirements

Before deploying, confirm you have the following ready. Missing any of these will block progress.

AWS Account — Active account at aws.amazon.com. Use an IAM user with S3, CloudFront, ACM, Route 53, Lambda, and API Gateway permissions — not root account access.
Square Developer Account — Free account at developer.squareup.com with an Application created. Have your Application ID, Location ID, and Access Token ready.
Custom Domain — Your domain name (e.g. goalsbook.com) registered and accessible via Route 53 or external registrar (GoDaddy, Namecheap, etc.).
Website Files — All project files: index.html, book.html, author.html, contact.html, order.html, admin.html, css/, images/, lambda/process-payment.js.
AWS CLI (Optional) — AWS Command Line Interface for faster file uploads. Download at aws.amazon.com/cli.
Node.js — Required to install Square SDK for Lambda deployment: nodejs.org/en/download.

Important: SSL certificates for CloudFront must be created in the US East (N. Virginia) — us-east-1 region. This is an AWS requirement regardless of where your bucket is located.

03 Step 1

Create Your S3 Bucket

S3 is where all your website files live. Think of it as a cloud folder that AWS serves to visitors globally.

1

Go to console.aws.amazon.com → Search for S3 → Click "Create bucket"

2

Bucket name: Enter your exact domain name (e.g. goalsbook.com). The bucket name must match your domain exactly.

3

Block Public Access: Uncheck "Block all public access" — check the acknowledgment box. This allows CloudFront to access your files.

4

Click "Create bucket", then go to Permissions → Bucket Policy and paste:

{
  "Version": "2012-10-17",
  "Statement": [{
    "Sid": "PublicReadGetObject",
    "Effect": "Allow",
    "Principal": "*",
    "Action": "s3:GetObject",
    "Resource": "arn:aws:s3:::YOUR-BUCKET-NAME/*"
  }]
}
Section 04 · Step 2
04 Step 2

Upload Your Website Files

A

Via AWS Console: Open your bucket → Click Upload → Add all .html files → Add css/ folder → Add images/ folder → Click Upload.

B

Via AWS CLI (faster): Navigate to your project folder in terminal and run:

# Sync entire project to S3
aws s3 sync . s3://goalsbook.com --delete
Section 05 · Step 3
05 Step 3

Enable S3 Static Website Hosting

1

In your S3 bucket → Properties tab → scroll to Static website hosting → click Edit

2

Select Enable → Index document: index.html → Error document: index.html

3

Save changes → Copy the Bucket website endpoint URL shown (you'll need it for CloudFront)

Section 06 · Step 4
06 Step 4

Create Your SSL Certificate (Free HTTPS)

Critical: Switch your AWS region to US East (N. Virginia) — us-east-1 before proceeding. This is required for CloudFront SSL certificates.

1

AWS Console → search Certificate ManagerRequest a certificateRequest a public certificate

2

Add domain: goalsbook.com → Click Add another name → add www.goalsbook.com

3

Validation method: DNS validation → Click Request

4

If using Route 53: Click "Create records in Route 53" (automatic). Otherwise add the CNAME record to your registrar manually.

5

Wait 5–30 minutes for status to change to Issued

Section 07 · Step 5
07 Step 5

Create CloudFront Distribution

1

AWS Console → CloudFrontCreate distribution

2

Origin domain: Paste your S3 website endpoint URL (from Step 3) — paste manually, do not use dropdown

3

Viewer protocol policy: Redirect HTTP to HTTPS

4

Alternate domain names: Add goalsbook.com and www.goalsbook.com

5

Custom SSL certificate: Select the certificate from Step 4

6

Default root object: index.html → Click Create distribution (takes 5–15 min)

7

Copy your CloudFront Domain Name (e.g. d1234abcdef.cloudfront.net) for the next step

Section 08 · Step 6
08 Step 6

Connect Your Domain (DNS)

If using Route 53: Route 53 → Hosted zones → your domain → Create record → Type A → Alias ON → Alias to CloudFront distribution → select your distribution. Repeat for www.

If using external registrar (GoDaddy, Namecheap): Add CNAME record: Name = www, Value = your CloudFront domain. For root domain, add an ALIAS/ANAME record pointing to CloudFront.

DNS propagation can take 15 minutes to 48 hours. Use dnschecker.org to verify propagation status.

Section 09 · Step 7
09 Step 7

Test & Verify Your Deployment

Visit https://goalsbook.com — homepage loads with book cover visible
Browser shows a padlock 🔒 (HTTPS working)
Navigate all 5 pages: Home, Book, Author, Contact, Order
Test on mobile — responsive layout works correctly
Visit http:// version — automatically redirects to HTTPS
Images load correctly — book cover, author headshot, GOALS logo

All checks passing? Your site is live on AWS. Proceed to Section 13 for Square payment integration.

10 Maintenance

Updating the Website

When site files change, follow this two-step process to push updates live.

1

Upload updated files to S3 via Console or CLI:

aws s3 sync . s3://goalsbook.com --delete
2

Invalidate the CloudFront cache (required — otherwise visitors see old version):

aws cloudfront create-invalidation \
  --distribution-id YOUR_DISTRIBUTION_ID \
  --paths "/*"

Invalidations take 1–3 minutes to propagate. First 1,000 paths/month are free.

Section 11
11 Pricing

AWS Cost Estimate

ServiceWhat You Pay ForEst. Monthly Cost
S3 StorageStoring ~5MB of files< $0.01
CloudFront1,000–10,000 visitors/month$1–5
Route 531 hosted zone$0.50
ACM CertificateSSL cert for HTTPSFree
Lambda + API GatewayPayment processing calls~Free
Section 12
12 Troubleshooting

Troubleshooting

!
Site shows "Access Denied" or blank page

Check S3 bucket policy is correctly set. Confirm "Block all public access" is OFF. Confirm index.html is set as default root object in CloudFront.

!
Old content showing after update

Create a CloudFront invalidation for /*. Wait 1–3 minutes, then hard refresh your browser (Ctrl+Shift+R / Cmd+Shift+R).

!
HTTPS not working / certificate error

Confirm ACM certificate was created in us-east-1. Confirm status is Issued (not Pending) before attaching to CloudFront.

!
Domain not pointing to site

DNS changes take up to 48 hours. Use dnschecker.org to verify propagation. Confirm CloudFront alternate domain names include both root and www versions.

13 Payment & Commerce

Square Payment Gateway Integration

Accept real credit card payments, process charges securely server-side, and deposit funds directly to your bank account — all using Square at 2.9% + $0.30 per online transaction with no monthly fee.

Why Square? No monthly fees, no setup fees, no contract. For a $19.99 paperback sale, Square keeps ~$0.88 — you receive ~$19.11. Funds deposit to your bank next business day.

Step A Create Your Square Developer Account

1

Go to developer.squareup.com → Sign in or create a free account

2

Click + New Application → Name it "GOALS Book Website"

3

Go to Credentials tab — copy these three values:

# Square Credentials (save these securely)
Application ID:   sq0idb-XXXXXXXXXXXXXXXXXXXXXXXX   ← used in browser (public)
Access Token:     EAAAl-XXXXXXXXXXXXXXXXXXXXXXXX   ← Lambda ONLY (secret!)
Location ID:      LXXXXXXXXXXXXXXXXX              ← from Locations tab

CRITICAL SECURITY RULE: The Access Token must NEVER appear in your HTML, CSS, or JavaScript files. It lives ONLY inside your AWS Lambda environment variables. The Application ID is safe to put in the browser.

Step B Configure order.html

Open order.html and find the CONFIGURATION block at the top of the script section. Replace the placeholder values:

// order.html — CONFIGURATION block
const SQUARE_APP_ID      = 'sq0idb-YOUR_ACTUAL_APP_ID';
const SQUARE_LOCATION_ID = 'LXXXXXXXXXXXXXXXXX';
const LAMBDA_ENDPOINT    = 'https://abc123.execute-api.us-east-1.amazonaws.com/process-payment';

Switch the Square SDK script from sandbox to production:

<!-- SANDBOX (testing — current): -->
<script src="https://sandbox.web.squarecdn.com/v1/square.js"></script>

<!-- PRODUCTION (switch to this when live): -->
<script src="https://web.squarecdn.com/v1/square.js"></script>

Step C Deploy the Lambda Payment Processor

1

Install Square SDK and package for Lambda:

mkdir goals-payment-lambda && cd goals-payment-lambda
cp /path/to/lambda/process-payment.js ./index.js
npm init -y
npm install square
zip -r function.zip index.js node_modules/
2

AWS Console → LambdaCreate function with these settings:

Function name:   goals-process-payment
Runtime:         Node.js 20.x
Memory:          256 MB
Timeout:         15 seconds
Handler:         index.handler
3

Upload function.zip → Go to Configuration → Environment variables and add:

SQUARE_ACCESS_TOKEN  = EAAAl-YOUR_SECRET_ACCESS_TOKEN
SQUARE_LOCATION_ID   = LXXXXXXXXXXXXXXXXX
SQUARE_ENVIRONMENT   = sandbox      ← change to 'production' when live
ALLOWED_ORIGIN       = https://yourdomain.com

Step D Create API Gateway (HTTP API)

1

AWS Console → API GatewayCreate API → Choose HTTP API

2

Add Integration → Lambda → select goals-process-payment → Route: POST /process-payment

3

Configure CORS:

Allow origins:   https://yourdomain.com
Allow methods:   POST, OPTIONS
Allow headers:   Content-Type
4

Deploy → Copy the Invoke URL — paste this as LAMBDA_ENDPOINT in order.html:

https://abc1defg23.execute-api.us-east-1.amazonaws.com/process-payment

Step E Test With Square Sandbox

# Square Sandbox Test Cards
Visa (success):       4111 1111 1111 1111   Exp: any future · CVV: any 3 digits
Mastercard (success): 5105 1051 0510 5100   Exp: any future · CVV: any 3 digits
Card declined:        4000 0000 0000 0002
Insufficient funds:   4000 0000 0000 9995

Step F Go Live (Switch to Production)

1

In Square Developer Dashboard → switch app to Production mode → copy production Access Token and Application ID

2

Update Lambda env vars: SQUARE_ACCESS_TOKEN = production token, SQUARE_ENVIRONMENT = production

3

In order.html: update SQUARE_APP_ID to production ID, switch SDK script to web.squarecdn.com, delete sandbox notice div

4

Re-upload and invalidate cache:

aws s3 cp order.html s3://your-bucket-name/order.html
aws cloudfront create-invalidation --distribution-id YOUR_CF_ID --paths "/order.html"

Bank Deposits: Set up your bank account in Square Dashboard → Account & Settings → Bank Accounts. Square deposits funds next business day. You'll receive an email breakdown of each deposit.

14 Admin & Order Tracking

Order Tracking & Admin Dashboard

Every completed purchase automatically saves a full order record to the database. The Admin Dashboard at admin.html gives you a live view of all orders, buyers, revenue, and fulfillment status from any browser.

Accessing the Dashboard

1

Navigate to: https://yourdomain.com/admin.html

2

Password updated to Goals2026!SD — already changed in admin.html and uploaded to S3. ✅

Dashboard Features

FeatureWhat It Shows
OverviewTotal revenue, books sold, order count, average order value — live
Sales by FormatHardcover vs Paperback bar graph
Orders by StatusPending / Paid / Shipped / Delivered breakdown
All Orders TableSearchable, filterable by status and format
Order Detail ModalFull buyer info, shipping address, Square payment ID, receipt link
Fulfillment ToolsUpdate order status, add tracking number, internal notes
Customers ViewEvery buyer: name, email, orders, books, total spent, city
CSV ExportDownload all orders as a spreadsheet for accounting/shipping

Order Data Captured Per Purchase (25 Fields)

# Every order record stores:
order_number        → GOALS-123456 (auto-generated)
first_name / last_name → Buyer name
email               → Buyer email (Square receipt sent here)
phone               → Buyer phone (optional)
format              → Hardcover or Paperback
quantity            → Number of copies ordered
unit_price          → Price per copy
total_amount        → Total charged (unit × qty)
signed_copy         → none / signed / personalized
personalization     → Inscription text
order_notes         → Buyer additional notes
address_line1/city/state/zip/country → Full shipping address
status              → pending / paid / processing / shipped / delivered / cancelled
payment_status      → pending / completed / failed / refunded
square_payment_id   → Square transaction ID
square_receipt_url  → Link to buyer's Square receipt
tracking_number     → Shipping tracking (added by you after shipping)
fulfillment_notes   → Internal notes
shipped_at          → Timestamp when marked shipped

Security: For production, restrict admin.html access by IP whitelist via S3 bucket policy, or implement AWS Cognito authentication. Do not share the admin URL publicly.

15 Full Cost Estimate

Full System Cost Estimate

Combined AWS infrastructure costs plus Square payment processing fees per transaction.

ServiceCostNotes
S3 Storage~$0.03/moSite files (~5MB) at $0.023/GB
CloudFront CDN~$0.50–$2/moFirst 1TB free, then $0.085/GB
Route 53 DNS$0.50/moPer hosted zone
ACM SSL CertificateFREEFree with CloudFront
Lambda (payment processor)~FREEFirst 1M requests/mo free. 1,000 orders ≈ $0.002
API Gateway~FREEFirst 1M calls/mo free (HTTP API)
AWS TOTAL / MONTH~$1–$3At low to moderate traffic
Square — Paperback ($19.99)~$0.88/sale2.9% + $0.30 = $0.88 → you keep $19.11
Square — Hardcover ($34.99)~$1.31/sale2.9% + $0.30 = $1.31 → you keep $33.68
100 Paperback Sales$1,911 to you$1,999 revenue − $88 Square fees

Bottom line: Your entire website infrastructure costs approximately $1–$3 per month. For every 100 paperbacks sold at $19.99, you deposit $1,911 to your bank. No Amazon cut. No Barnes & Noble cut. No middlemen.

16 Go Live

Launch Checklist

Complete every item below before going live. Check each box as you confirm it is done. Do not launch until all 12 items are checked.

Square account created — developer.squareup.com, application created, all three credentials copied (App ID, Location ID, Access Token)
Bank account linked in Square Dashboard → Account & Settings → Bank Accounts
Lambda deployed with production Square Access Token in environment variables, timeout 15s, memory 256MB
API Gateway configured — CORS enabled for your domain, POST /process-payment route active, Invoke URL copied
order.html updated — production Square App ID entered, production SDK URL active, Lambda endpoint entered, sandbox notice div removed
S3 bucket created with correct bucket policy, all site files uploaded including images/ and css/ folders
CloudFront distribution live — HTTPS working, origin pointing to S3 endpoint, default root object set to index.html
Custom domain connected via Route 53 or external registrar — DNS propagated, SSL certificate shows Issued
Admin password updated — changed to Goals2026!SD in admin.html ✅
Test purchase completed — real card charged successfully, confirmation shown, order appears in admin.html, Square Dashboard shows transaction, bank deposit pending
All pages tested on desktop and mobile — Home, Book, Author, Contact, Order, Admin all load and function correctly
Square email receipts confirmed — buyer receives automatic receipt email from Square after successful purchase

You're ready to launch. Once every box above is checked, the GOALS website is live, payments are processing, and every order is tracked automatically. Funds deposit to your bank the next business day. Check admin.html daily during launch week to monitor orders and mark shipments as you fulfill them.

Support Resources

AWS Support: console.aws.amazon.com/support Square Support: squareup.com/help AWS Docs: docs.aws.amazon.com Square Docs: developer.squareup.com/docs