4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

AWS Bedrock Knowledge Bases の VectorStore として Aurora Serverless V2(ACU:0) を使ってみた

Last updated at Posted at 2025-06-13

はじめに

こんにちは.

の続きです.

これまで VectorStore として使ったことがあるのは OpenSearch だけだったので,
Aurora も使ってみたいと思い試してみました.

OpenSearch はいいお値段するので,
Aurora Serverless V2 の ACU を 0 にして動かすことはできるのでしょうか?
ここも見ていきたいと思います.

なお, 今回の構成も下記を使用してサクッと実現していきます.

構成

User ---> Bedrock Agent ---> Knowledge Bases ---> Aurora Serverless V2
                                   └── S3

AWS リソースの作成・設定

$ git clone https://github.com/dev-kawano-y/study-aws-bedrock-agent-aurora-kb.git
$ cd study-aws-bedrock-agent-aurora-kb
$ npm ci
AWS リソースの作成
$ cd infrastructures
$ npx cdk deploy study-aws-bedrock-agent-aurora-kb-InfrastructuresStack --profile ...

上記 cdk deploy は 1028.48s かかりました.

スクリーンショット 2025-06-13 17.00.27.png
リソースが作成されたら Knowledge Bases とデータソースを同期してください.
※ Amazon Bedrock コンソール > ナレッジベース > [ナレッジベースを選択] > データソース > 同期

動作確認

スクリーンショット 2025-06-13 17.02.14.png
問題なさそうですね.

作成される Aurora の確認

スクリーンショット 2025-06-13 17.06.54.png
Writer, Reader が作成されました. ちょっと試したかっただけなので豪勢です.

スクリーンショット 2025-06-13 17.15.31.png
Aurora PostgreSQL, エンジンバージョンは 15.5 でした.

スクリーンショット 2025-06-13 17.10.30.png
最小 ACU は 0.5 でした.

AmazonAuroraVectorStore is an L3 resource that creates a VPC with 3 subnets (public, private with NAT Gateway, private without NAT Gateway) and Amazon Aurora Serverless V2 Cluster. The cluster has 1 writer/reader instance with latest supported PostgreSQL version (currently it is 15.5) and having the following cofiguration: min capacity 0.5, max capacity 4.

の記載通りですね.

ACU 0 にしてみる

スクリーンショット 2025-06-13 17.16.40.png
まず, 15.5 では一時停止がサポートされておらず ACU 0 にできないため 17.4 に上げます.

スクリーンショット 2025-06-13 17.17.19.png
17.4 への更新が完了したら, ACU を下記の通り変更してお財布に優しくします.

  • 最小 ACU を 0.5 → 0
  • 最大 ACU を 4 → 1

スクリーンショット 2025-06-13 17.52.04.png

Serverless v2 (0~1 ACU)

変更完了しました.

ACU 0 時の動作確認

スクリーンショット 2025-06-13 17.53.55.png

問題なさそうですね.

AWS リソースの削除

$ npx cdk destroy study-aws-bedrock-agent-aurora-kb-InfrastructuresStack --profile ...

最後に

Aurora Serverless V2 の ACU を 0 にしても動かすことができました.
なるべくコストを抑えてちょっと試したい時などにいいかもしれません.

なお, 今回ご紹介したコードでは ACU の変更はできなさそうでした.
そのため, ACU 0 な Aurora Serverless V2 と関連リソースを別途作成し,
fromExistingAuroraVectorStore を使用して VectorStore の作成ができるはずなのでこちらのほうが良いと思います.

4
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?