Dọn dẹp tài nguyên

Clean Up

Quan trọng: Hãy xóa tất cả tài nguyên đã tạo trong hands-on labs để tránh phát sinh chi phí ngoài ý muốn.

Xóa các tài nguyên theo thứ tự ngược lại (tài nguyên tạo sau xóa trước):

1. Lab 5 - Monitoring

  • Xóa CloudWatch Dashboard: CloudWatchDashboards → Chọn GenAI-MonitoringDelete
  • Xóa Log Group: CloudWatchLog groups → Chọn /aws/bedrock/model-invocationsDelete
  • Disable model invocation logging: BedrockSettingsModel invocation loggingDisable

2. Lab 4 - Agentic Workflow

  • Xóa Bedrock Agent: BedrockAgents → Chọn workshop-product-agentDelete
  • Xóa Lambda Function: LambdaFunctions → Chọn workshop-agent-toolDelete
  • Xóa IAM roles được tạo cho Agent và Lambda

3. Lab 3 - Guardrails

  • Xóa Guardrail: BedrockGuardrails → Chọn workshop-guardrailDelete

4. Lab 2 - RAG Pipeline

  • Xóa Knowledge Base: BedrockKnowledge bases → Chọn workshop-knowledge-baseDelete
    • Chọn xóa cả vector store (OpenSearch Serverless collection)
  • Xóa S3 bucket:
# Xóa tất cả objects trong bucket
aws s3 rm s3://workshop-rag-kb-$(aws sts get-caller-identity --query Account --output text) --recursive

# Xóa bucket
aws s3 rb s3://workshop-rag-kb-$(aws sts get-caller-identity --query Account --output text)
  • Xóa IAM roles được tạo cho Knowledge Base

5. Lab 1 - Invoke FM

  • Xóa file output: del output.json invoke_bedrock.py bedrock-overview.txt rag-overview.txt
  • Không cần xóa gì trên AWS (on-demand invocation không tạo persistent resources)

6. Kiểm tra chi phí

  1. Truy cập AWS Cost Explorer
  2. Kiểm tra chi phí phát sinh từ Bedrock, OpenSearch Serverless, Lambda, S3
  3. Đảm bảo không còn resources đang chạy

Sử dụng AWS Cost Explorer hoặc Billing Dashboard để verify rằng không còn chi phí phát sinh sau khi cleanup.