Generative AI workflows often require coordinated provisioning of compute, storage, networking, and data services to support model ingestion and inference. Managing these resources manually can be error-prone and difficult to scale across environments. Terraform enables you to define and manage this infrastructure as code, ensuring consistency and repeatability.
In this Cloud Lab, you’ll deploy a cloud-native generative AI solution on AWS structured around two pipelines: document ingestion and question answering. You’ll begin by provisioning an Amazon S3 bucket to store source documents and an Amazon RDS database to store vector embeddings. You’ll then create an Amazon Bedrock Knowledge Base to index, manage, and query this data.
To automate updates, you’ll deploy an AWS Lambda function that synchronizes the Knowledge Base whenever new files are uploaded to the S3 bucket. You’ll also expose an Amazon API Gateway endpoint that generates presigned URLs, enabling secure uploads of documents. For the question-answering pipeline, you’ll deploy another Lambda function to process user queries against the Knowledge Base and integrate an Amazon Bedrock Guardrail policy to ensure safe and responsible responses.
The architecture diagram below shows the provisioned infrastructure you’ll build in this Cloud Lab.