Skip to main content

Detailed Architecture

This page describes the key architectural flows within VAMS, including authentication, data indexing, file upload, pipeline execution, and the configuration propagation system.

Authentication Flow

VAMS supports multiple authentication providers: Amazon Cognito (with optional SAML federation), external OAuth identity providers, and API keys. Regardless of the provider, all requests pass through the same custom Lambda authorizer.

Authorization Tiers

The Casbin policy engine enforces two authorization tiers within every Lambda handler:

TierScopeWhat It ControlsCasbin Method
Tier 1API RouteCan this role call this endpoint?enforceAPI(event)
Tier 2Data EntityCan this user access this specific resource?enforce(event, item)

Both tiers must allow for the request to succeed. Tier 1 is evaluated using api and web object type constraints. Tier 2 is evaluated against entity-type constraints (database, asset, pipeline, workflow, etc.).

Object Type Annotation

Before calling Tier 2 enforcement, handlers must annotate the data object with its object__type field (e.g., item['object__type'] = 'asset'). Failing to set this field causes the authorization check to silently deny access.

Supported Authentication Providers

ProviderConfigurationUse Case
Amazon Cognito (native)authProvider.useCognito.enabled = trueDefault. Managed user pool with password auth.
Amazon Cognito + SAMLauthProvider.useCognito.useSaml = trueEnterprise SSO via SAML federation.
External OAuth IDPauthProvider.useExternalOAuthIdp.enabled = trueThird-party identity providers (Okta, Azure AD, etc.).
API KeysAlways availableMachine-to-machine authentication. Keys stored as SHA-256 hashes.

Data Indexing Flow

Data Queue Architecture

VAMS maintains search indexes in Amazon OpenSearch that mirror data from Amazon DynamoDB. The indexing pipeline uses Amazon DynamoDB Streams, Amazon SNS, and Amazon SQS to decouple producers from consumers.

Dual Index Architecture

VAMS uses a dual-index architecture with separate file index and asset index in Amazon OpenSearch. The file index stores per-file metadata, attributes, and S3 information. The asset index stores per-asset metadata, version information, tags, and relationship flags. Both indexes use flat_object fields for dynamic metadata and attributes to prevent field explosion.

File Upload Flow

File uploads to VAMS use Amazon S3 presigned URLs for direct browser-to-S3 transfers. After upload, Amazon S3 event notifications trigger automatic indexing and optional workflow execution.

Upload Process Details

  1. The web application requests a presigned URL from the upload API endpoint, providing file metadata (name, size, content type).
  2. The Lambda handler validates the file against blocked extension and MIME type lists, then generates an Amazon S3 presigned URL.
  3. The browser uploads the file directly to Amazon S3 using the presigned URL (supporting multipart for large files).
  4. Amazon S3 emits an ObjectCreated event to the bucket-specific Amazon SNS topic.
  5. The Amazon SNS topic fans out to an Amazon SQS queue subscribed by the bucket sync Lambda.
  6. The bucket sync Lambda creates or updates file records in Amazon DynamoDB and optionally queues workflow auto-execution.

Pipeline Execution Flow

VAMS supports three pipeline execution types: Lambda (synchronous or asynchronous invocation), SQS (asynchronous message delivery), and EventBridge (asynchronous event delivery). All pipeline types are orchestrated through AWS Step Functions.

Pipeline S3 Output Paths

Each pipeline step in a workflow receives designated Amazon S3 output paths from the workflow state machine:

Path VariableTarget BucketPurpose
outputS3AssetFilesPathAsset bucketFile-level outputs including .previewFile.* thumbnails (versioned)
outputS3AssetPreviewPathAsset bucketAsset-level preview images only (versioned)
outputS3AssetMetadataPathAsset bucketMetadata files produced by the pipeline (versioned)
inputOutputS3AssetAuxiliaryFilesPathAuxiliary bucketTemporary working files or non-versioned viewer data

Available Pipelines

PipelineComputeDescription
3D Basic ConversionAWS Batch (Fargate)Convert 3D file formats
CAD/Mesh Metadata ExtractionAWS Batch (Fargate)Extract metadata from CAD and mesh files
Point Cloud Potree ViewerAWS Batch (Fargate)Generate Potree octree data for point cloud visualization
3D Preview ThumbnailAWS Batch (Fargate)Generate GIF/JPG/PNG preview thumbnails for 3D files
Gaussian Splatting (Splat Toolbox)AWS Batch (Fargate)Generate Gaussian splat reconstructions
GenAI Metadata 3D LabelingAWS Batch (Fargate)AI-powered metadata labeling using Amazon Bedrock and Amazon Rekognition
Model Optimization (ModelOps)AWS Batch (Fargate)Optimize 3D models for web delivery
RapidPipeline (ECS)AWS Batch (Fargate)RapidPipeline integration via Amazon ECS
RapidPipeline (EKS)Amazon EKSRapidPipeline integration via Amazon EKS
Isaac Lab TrainingAWS Batch (GPU)NVIDIA Isaac Lab simulation training

Configuration Flow

VAMS uses a three-stage configuration system that flows from CDK deployment configuration through Amazon DynamoDB to the frontend at runtime.

Configuration Resolution Order

Configuration values resolve through a four-tier fallback chain:

  1. CDK context (-c key=value on command line)
  2. config.json file (infra/config/config.json)
  3. Environment variables
  4. Hardcoded defaults (in getConfig())

Feature Flags

Feature FlagDescription
GOVCLOUDAWS GovCloud deployment mode
ALLOWUNSAFEEVALAllow unsafe-eval in Content Security Policy
LOCATIONSERVICESAmazon Location Service enabled
ALBDEPLOYApplication Load Balancer deployment mode
CLOUDFRONTDEPLOYAmazon CloudFront deployment mode
NOOPENSEARCHAmazon OpenSearch disabled
AUTHPROVIDER_COGNITOAmazon Cognito authentication provider
AUTHPROVIDER_COGNITO_SAMLAmazon Cognito with SAML federation
AUTHPROVIDER_EXTERNALOAUTHIDPExternal OAuth identity provider

Nested Stack Dependency Chain

The following diagram shows the complete dependency ordering between VAMS nested stacks.

Environment Variable Injection

All Lambda functions receive their configuration through environment variables injected by CDK Lambda builder functions. This ensures no resource names are hardcoded in application code.

Common Environment Variables (All Lambdas)

VariableSourcePurpose
AUTH_TABLE_NAMEauthEntitiesStorageTableAuthentication entities table
CONSTRAINTS_TABLE_NAMEconstraintsStorageTablePermission constraints table
USER_ROLES_TABLE_NAMEuserRolesStorageTableUser-role mappings table
ROLES_TABLE_NAMErolesStorageTableRole definitions table
COGNITO_AUTH_ENABLEDComputed from configWhether Amazon Cognito auth is active
AUDIT_LOG_AUTHENTICATIONCloudWatch Log GroupAuthentication audit events
AUDIT_LOG_AUTHORIZATIONCloudWatch Log GroupAuthorization audit events
AUDIT_LOG_FILEUPLOADCloudWatch Log GroupFile upload audit events
AUDIT_LOG_FILEDOWNLOADCloudWatch Log GroupFile download audit events
AUDIT_LOG_FILEDOWNLOAD_STREAMEDCloudWatch Log GroupStreamed download audit events
AUDIT_LOG_AUTHOTHERCloudWatch Log GroupOther auth audit events
AUDIT_LOG_AUTHCHANGESCloudWatch Log GroupAuth changes audit events
AUDIT_LOG_ACTIONSCloudWatch Log GroupGeneral action audit events
AUDIT_LOG_ERRORSCloudWatch Log GroupError audit events
Lambda Builder Pattern

Every Lambda function is constructed by a builder function in infra/lib/lambdaBuilder/. Each builder follows a strict pattern: create function, grant Amazon DynamoDB permissions, then call four required security helpers (kmsKeyLambdaPermissionAddToResourcePolicy, setupSecurityAndLoggingEnvironmentAndPermissions, globalLambdaEnvironmentsAndPermissions, suppressCdkNagErrorsByGrantReadWrite).

Next Steps