Skip to content

AWS Reference Implementation

Enterprise GenAI Platform on AWS: Two Validated Use Cases

Amazon Bedrock | Amazon EKS | API Gateway | Amazon Cognito | RAG

Project Background & Objective

This reference architecture builds on my AWS cloud architecture experience and explores secure, reusable infrastructure for enterprise generative AI workloads.

The objective was to move beyond standalone model invocation and explore how AI capabilities could be integrated into an enterprise application environment, with emphasis on private networking, workload identity, authentication, and a reusable application pattern.

The lending domain was selected as an illustrative use case to demonstrate both Retrieval-Augmented Generation (RAG) and general-purpose foundation-model inference.

Project type: Reference Architecture | Technical POC

Architecture and Design

Browser requests pass through the Next.js frontend and Backend for Frontend (BFF), then through scoped API authorization and private VPC connectivity to FastAPI workloads on private EKS nodes.

Validated AWS GenAI POC request flow: browser to Next.js frontend and BFF, Cognito login, scoped API Gateway, private VPC Link and internal NLB, FastAPI on private EKS, and Amazon Bedrock inference or Knowledge Base retrieval backed by S3 Vectors and policy documents in S3
  1. 01

    Sign in

    The Next.js BFF handles Cognito OAuth 2.0 Authorization Code with PKCE and maintains an encrypted, HTTP-only session.

  2. 02

    Forward request

    The browser calls the BFF, which forwards the session access token to API Gateway.

  3. 03

    Authorize

    API Gateway validates the Cognito token and the scope required by the selected use case.

  4. 04

    Connect privately

    VPC Link V2 routes API traffic to an internal NLB and the FastAPI service on private EKS nodes.

  5. 05

    Run use case

    FastAPI validates the request and invokes the matching application workflow.

  6. 06

    Generate or retrieve

    Bedrock Converse generates responses; Policy Q&A first retrieves relevant Knowledge Base passages.

Architectural Decisions
DecisionEngineering rationale
Next.js frontend and BFFHandle the OAuth code exchange, encrypted browser session, and server-side API forwarding.
Cognito + API Gateway scopesAuthenticate users and enforce distinct OAuth scopes at the API boundary.
VPC Link V2 + internal NLBConnect API Gateway privately to the Kubernetes-managed application service.
Private EKS + Pod IdentityRun the FastAPI workload without embedding long-lived AWS credentials in containers.
Bedrock Converse + Knowledge BasesShare model inference while supporting retrieval-backed policy answers.
Amazon S3 VectorsProvide the vector store used by the Bedrock Knowledge Base in the lab.
GitHub Actions validationRun repository checks and secret scanning; the workflow does not deploy AWS infrastructure.
Single-replica lab workloadKeep the temporary POC cost-conscious; this is not an availability design.

Two Implemented and Validated Use Cases

Foundation-model inference

Application Summary

Accepts validated, synthetic financial application data and uses Amazon Bedrock Converse to produce a natural-language summary. Pydantic request models validate fields such as income, debt, missed payments, requested amount, and optional credit score.

This is not an automated lending decision or credit-scoring system.

Retrieval-augmented generation

Lending Policy Q&A

Retrieves up to five passages from a Bedrock Knowledge Base, then uses Bedrock Converse to answer questions with source references. The workflow instructs the model to treat retrieved passages as untrusted reference data and acknowledge when evidence is insufficient.

Citation correctness and claim-level grounding are not independently verified.

POC Validation Evidence

  • Anonymous requests to protected API Gateway endpoints were rejected with HTTP 401.
  • Authenticated Application Summary and Policy Q&A requests returned HTTP 200 in the lab.
  • Policy Q&A returned generated answers with source references from the sample policy knowledge base.
  • Both use cases ran through API Gateway, VPC Link V2, the internal NLB, private EKS, and the relevant Bedrock service.
  • OAuth scope isolation between protected use cases was validated using machine-client tests. The Cognito User Pool was recreated afterward; the existing validation was considered sufficient for this POC, so the test was not repeated.
  • These are functional POC checks, not a formal security assessment, performance benchmark, or AI quality certification.

Key Architecture Decisions

DecisionEngineering rationale
Next.js frontend and BFFHandle the OAuth code exchange, encrypted browser session, and server-side API forwarding.
Cognito + API Gateway scopesAuthenticate users and enforce distinct OAuth scopes at the API boundary.
VPC Link V2 + internal NLBConnect API Gateway privately to the Kubernetes-managed application service.
Private EKS + Pod IdentityRun the FastAPI workload without embedding long-lived AWS credentials in containers.
Bedrock Converse + Knowledge BasesShare model inference while supporting retrieval-backed policy answers.
Amazon S3 VectorsProvide the vector store used by the Bedrock Knowledge Base in the lab.
GitHub Actions validationRun repository checks and secret scanning; the workflow does not deploy AWS infrastructure.
Single-replica lab workloadKeep the temporary POC cost-conscious; this is not an availability design.

Implementation Status

POC complete

Implemented and exercised in a temporary AWS lab

  • Application Summary and Lending Policy Q&A implemented as separate API use cases
  • Cognito login and per-use-case OAuth scope enforcement validated in the lab
  • Private API Gateway → VPC Link V2 → internal NLB → EKS request path exercised
  • Bedrock Converse and Knowledge Base retrieval exercised by the use cases
  • Python test suite and repository validation workflow included in the source repository
  • Terraform modules and Kubernetes manifests document the lab infrastructure

Planned, not implemented

Production-hardening roadmap

  • Application-level authorization, tenant-aware RAG, and document access controls
  • Tighter network boundaries and TLS for private integrations
  • Multiple replicas, autoscaling, and recovery mechanisms
  • Operational observability, tracing, alerts, and cost attribution
  • AI governance, guardrails, and stronger prompt-injection defenses
  • Retrieval, groundedness, and citation evaluation
  • Container, frontend, and infrastructure delivery checks

The lab used a single application replica, a 29-second API Gateway integration timeout, and an HTTP private integration to the NLB. The AWS application infrastructure was decommissioned after validation to limit cost; this page describes the implemented reference, not a currently running service or production-ready lending system.

For implementation details, including the source code and deployment guidance, see the AWS Enterprise GenAI Platform repository on GitHub.

Planning a secure AI platform?

Let's discuss your AWS architecture, AI infrastructure, security and production-readiness requirements.