AWS Builder Center
Weekend Annoying Task Challenge: VersionGuard

Weekend Annoying Task Challenge: VersionGuard

Stop Sharing the Wrong File Version: VersionGuard is a secure document version-management application that prevents people from accidentally sharing outdated files.

The Annoying Task

People regularly share outdated documents from email attachments, local download folders, or duplicate files with similar names.
A project plan, contract, presentation, or technical document may have been updated several times, but someone can still accidentally send Version 1 when Version 3 is the approved copy.
Most file-storage applications keep older versions, but they do not actively warn users before an outdated version is shared.
VersionGuard focuses on that specific moment: deciding which version is safe to share.

Vision & What the App Does

VersionGuard creates a controlled workspace for every document group.
A user signs in using Amazon Cognito and creates a document group such as Project Plan. Files uploaded to that group become numbered versions:
  • Version 1
  • Version 2
  • Version 3
  • And so on
Each version can include an optional note describing what changed.
The dashboard displays:
  • Total document groups
  • Total completed versions
  • Stale-version warnings
  • Older versions deliberately shared
  • Percentage of shares using the latest version
Each document group provides actions to:
  • Upload a new version
  • View version history
  • Share the latest version
  • Delete the workspace
The version history displays completed and pending uploads, version numbers, file names, upload dates, completion status, and version notes.

The Main Feature: Stale-Version Protection

When a user tries to share an older version, VersionGuard compares it with the latest completed version.
For example, if Version 1 is selected while Version 2 is available, the application displays a clear warning:
Version 2 is newer than the version you selected.
The user then has three choices:
  1. Use the latest version.
  1. Share the older version anyway.
  1. Cancel the action.
If the user intentionally shares the older version, they must provide a reason, such as:
  • “This version was approved by legal.”
  • “The client requested the previous version.”
  • “This version is required for audit purposes.”
This turns older-version sharing from an accidental action into a deliberate and auditable decision.

How You Built It

The application uses a React and Vite frontend with a TypeScript serverless backend deployed through AWS CDK v2.
The upload workflow is designed so that incomplete files cannot become the latest version:
  1. The browser calculates a SHA-256 checksum.
  1. The frontend requests a short-lived upload URL from the backend.
  1. The file is uploaded directly to private Amazon S3.
  1. The backend confirms that the object exists and has the expected size.
  1. Only then is the version marked as completed.
  1. Only completed versions can become the latest version or be shared.
Failed and interrupted uploads remain in a pending state and cannot affect sharing decisions.
The application also validates file names, rejects path traversal attempts, limits files to 25 MB, and ensures that every operation belongs to the authenticated user.

AWS Services Used / Architecture Overview

Amazon Cognito

Used for:
  • User registration
  • Email verification
  • Authentication
  • Cognito user identity management

API Gateway HTTP API

Provides the application API and protects routes using Cognito JWT authorization.

AWS Lambda

The TypeScript Lambda backend handles:
  • Document creation
  • Version creation
  • Upload URL generation
  • Upload confirmation
  • Version-history retrieval
  • Stale-version comparison
  • Temporary share-link generation
  • Ownership validation
  • Sharing metrics

Amazon DynamoDB

Stores:
  • Document groups
  • Version metadata
  • Version status
  • File names
  • Upload notes
  • Ownership information
  • Sharing metrics
  • Older-version sharing reasons

Amazon S3

Stores files in a private, encrypted bucket.
The bucket uses:
  • S3 Block Public Access
  • Private object access
  • Short-lived presigned download URLs
  • No permanent public file links
Share links expire after 15 minutes.

Amazon CloudWatch Logs

Used for backend diagnostics, upload confirmation tracking, API failures, and operational troubleshooting.

AWS CDK v2

Defines and deploys the AWS infrastructure as code, including Cognito, API Gateway, Lambda, DynamoDB, S3, IAM permissions, and CloudWatch resources.

Request Flow

User Browser
|
| Cognito sign-in
v
Amazon Cognito
|
| JWT-authenticated API request
v
API Gateway HTTP API
|
v
AWS Lambda
|----------------------|
| |
v v
DynamoDB Private S3 Bucket
(version metadata) (encrypted files)
The browser never receives AWS credentials and never accesses DynamoDB directly.

Security and Reliability

VersionGuard applies security checks at every document and version operation.
  • Every request validates the authenticated Cognito user ID.
  • Users can access only their own document groups.
  • S3 objects remain private.
  • Permanent public file links are not created.
  • Presigned download links expire after 15 minutes.
  • Files larger than 25 MB are rejected.
  • Invalid file names are rejected.
  • Path traversal attempts are blocked.
  • Pending uploads cannot be shared.
  • Incomplete uploads cannot become the latest version.
  • S3 public access is blocked.
  • Database access is handled only by the backend.

Demonstration Flow

A typical demonstration follows this sequence:
  1. Sign in with Cognito.
  1. Create a document group called Project Plan.
  1. Upload the first file as Version 1.
  1. Share the latest version.
  1. Upload a revised file as Version 2.
  1. Open Version History.
  1. Select Version 1 and choose Share.
  1. Display the stale-version warning.
  1. Choose Use Latest Version, or deliberately share Version 1 with a reason.
  1. Return to the dashboard and show the updated sharing metrics.
This demonstrates both normal sharing and intentional older-version sharing.

Why VersionGuard Is Different

VersionGuard is not just another file-storage application.
Its main purpose is to make the sharing decision safer.
It actively checks whether the selected version is still current, warns the user before generating a link, and records the reason when an older version is intentionally shared.
The application solves a small but common workplace problem with a focused workflow:
Make outdated file sharing visible, deliberate, and difficult to do by accident.

What I Learned

The biggest lesson was that version management is not only a storage problem. It is also a decision and workflow problem.
I learned that:
  • The latest attempted upload should not automatically be treated as the latest valid version.
  • Upload confirmation must happen before a file becomes shareable.
  • Presigned URLs can provide secure file access without exposing AWS credentials.
  • Authorization must be enforced in the backend for every document operation.
  • A warning is more useful when it gives the user clear choices.
  • Requiring a reason makes intentional exceptions auditable.
  • AWS CDK makes it easier to reproduce and manage the complete serverless architecture.

Future Improvements

Potential future enhancements include:
  • Team workspaces with role-based permissions
  • Document approval workflows
  • Email notifications when a new version is uploaded
  • Version comparison and change visualization
  • Malware scanning for uploaded files
  • Configurable file-retention policies
  • Organization-wide audit reports

Final Summary

VersionGuard is a secure AWS-powered document-sharing tool that helps people avoid sending outdated files by making version selection visible, intentional, and auditable.



Link to App & Repo








Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article