How aws-solutions-library-samples/guidance-for-media-provenance-with-c2pa-on-aws works
Project type and purpose
• This is a full-stack, serverless-first + containerized demo that:
• Uses AWS CDK (TypeScript) to deploy nested CloudFormation stacks
• Host a React/TypeScript webapp via AWS Amplify (or S3+CloudFront)
• Exposes C2PA CLI workloads packaged in Docker containers via two options:
– AWS Fargate service
– AWS Lambda function
• Provides a GraphQL API (AppSync) with Cognito authentication
File structure
• packages/infra
• NestedStacks/Amplify → front-end hosting
• NestedStacks/AppSync (+ uiLambdaMiddleware) → GraphQL API & Lambda resolvers
• NestedStacks/Authentication → Cognito UserPool & IdentityPool
• NestedStacks/C2pa/Fargate → ECS Fargate service running C2PA CLI
• NestedStacks/C2pa/Lambda → Lambda container function running C2PA CLI
• NestedStacks/C2pa/SecretsManager → X.509 certs & keys storage
• NestedStacks/Network & Storage → VPC, subnets, S3 buckets
• packages/webapp
• React/Vite SPA, GraphQL queries/mutations, Amplify config
• Auth and API wrapper code under src/api
• Pages for media & fMP4 asset management using C2PA
• Root
• pnpm workspace config, GitHub Actions workflows, CDK bootstrap/deploy scripts
Extract key insights from the README
• Two C2PA processing pipelines (Fargate vs. Lambda) wrap the CLI in Docker and expose REST endpoints
• Webapp uses Cognito to log in, then calls AppSync GraphQL to orchestrate uploads & processing
• SecretsManager stores the digital certificate & private key used by the C2PA tool
• AWS CDK synthesizes and deploys the entire infra; outputs are used by the webapp
a. Local Developer / CI/CD
• GitHub Actions / local pnpm & CDK CLI
b. Frontend Hosting
• AWS Amplify (or S3 + CloudFront)
• React SPA in users’ browsers
c. Authentication & API
• AWS Cognito (User Pool & Identity Pool)
• AWS AppSync (GraphQL endpoint)
• Lambda “uiLambdaMiddleware” for custom resolver logic
d. C2PA Processing
• AWS Fargate service running Docker-packaged C2PA CLI
• AWS Lambda function (container image) running the same tool
e. Data & Secrets
• S3 buckets for asset uploads & manifest storage
• AWS SecretsManager for C2PA cert & key
f. Networking
• VPC, subnets, ALB (for Fargate)
g. IaC Layer
• AWS CDK Nested Stacks grouping all resources
Relationships and interactions
1. User’s browser → Amplify/CloudFront → React SPA
2. SPA → Cognito (auth flows)
3. SPA → AppSync GraphQL API (queries, mutations)
4. AppSync resolvers → Lambda “uiLambdaMiddleware”
5. Middleware → either Fargate API or Lambda function to run C2PA CLI
6. Processing container/function:
• Retrieves cert/key from SecretsManager
• Reads/writes media & sidecar files in S3
• Returns signed manifest
7. SPA displays results & may call additional AppSync operations
Architectural patterns & design principles
• Serverless-first: Cognito, AppSync, Lambda
• Containerized microservice: C2PA CLI on Fargate & in Lambda
• IaC modularity: CDK nested stacks for clear separation
• Monorepo with pnpm workspace for infra and webapp