Skip to content

Teardown

When you are done exploring the demo, destroy the infrastructure to stop all AWS charges. Because every resource is managed by Terraform
HashiCorp Terraform — infrastructure-as-code tool used to provision all AWS resources in this demo.
, a single command removes the entire stack — no manual console cleanup required.

From the root of the source repo, run:

Terminal
terraform destroy

Terraform displays a plan showing every resource it will remove, then prompts for confirmation:

Plan: 0 to add, 0 to change, 47 to destroy.
Do you really want to destroy all resources?
Terraform will destroy all your managed infrastructure, as shown above.
There is no undo. Only 'yes' will be accepted to confirm.
Enter a value: yes

Type yes to proceed. The destroy takes approximately 2–3 minutes.

Both S3 buckets in this project are configured with force_destroy = true in the Terraform configuration. This means Terraform automatically empties the buckets before deleting them — you do not need to manually remove objects first.

Bucket typeContents removedTerraform resource
Standard S3 bucketAll ingested article HTML files and metadataaws_s3_bucket
S3 Vectors bucket
A specialized S3 bucket type (aws_s3vectors_vector_bucket) that hosts vector indexes for similarity search.

All stored vectors and the vector index
A named index (aws_s3vectors_index) within a vector bucket defining dimension, distance metric, and data type.

aws_s3vectors_vector_bucket

Terraform destroys resources in reverse dependency order — it removes resources that depend on others first, then works down to foundational resources. You do not need to manage the order yourself.

ResourceWhat is lost
S3 bucketAll ingested article documents (HTML content and metadata)

S3 Vectors
Amazon S3 Vectors — a purpose-built vector storage capability within S3 that enables similarity search over embeddings without a separate vector database.
bucket + index

All embedding vectors — similarity search is no longer possible

Lambda
AWS Lambda — serverless compute. This project uses two functions: ingest (RSS → embed → store) and query (search → answer).
functions (ingest + query)

Compute capacity for ingestion and RAG queries
CloudWatch log groupsAll Lambda execution logs

API Gateway
Amazon API Gateway — a managed HTTP API service with JWT authorization, CORS, and throttling. Routes requests to the Query Lambda.
HTTP API

Public API endpoint and route configuration

Cognito
Amazon Cognito — a user authentication service providing user pools, JWT tokens, and group-based authorization.
user pool

All user accounts, passwords, and group memberships

Amplify
AWS Amplify — a managed hosting service for static web applications. Used to host the briefing UI SPA.
app

Hosted web UI and its HTTPS domain

EventBridge
Amazon EventBridge — a serverless event bus. Used here for the daily scheduled corpus ingest cron trigger.
schedule

Daily ingest cron trigger
IAM roles and policiesAll least-privilege permissions created for this stack

After the destroy completes, confirm nothing remains:

Terminal
terraform show

This should output an empty state:

No state.

You can also verify in the AWS console or CLI that the resources no longer exist:

Terminal
aws s3api list-buckets --query "Buckets[?contains(Name, 's3vec-rag')]"
aws lambda list-functions --query "Functions[?contains(FunctionName, 's3vec-rag')]"

Both commands should return empty arrays ([]).

Once all resources are destroyed, there are no ongoing AWS charges for this demo. The project uses only pay-per-use services — with no resources provisioned, your bill is zero.

If you want to keep some resources while removing others, use Terraform’s targeted destroy:

Terminal
# Remove only the Amplify app (stop hosting the UI)
terraform destroy -target=aws_amplify_app.this
# Remove only the EventBridge schedule (stop daily ingestion)
terraform destroy -target=aws_scheduler_schedule.ingest