---
title: "Discussion on \"How To Manage an Amazon Bedrock Agent Using Terraform\" | Hashnode"
description: "Discussion on \"How To Manage an Amazon Bedrock Agent Using Terraform\". Learn how to use the new Agents for Amazon Bedrock Terraform resources to manage an agent using a forex rate assistant as an example."
url: "https://hashnode.com/posts/how-to-manage-an-amazon-bedrock-agent-using-terraform/6631c56c95bfbcda61a25f54"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How To Manage an Amazon Bedrock Agent Using Terraform](https://blog.avangards.io/how-to-manage-an-amazon-bedrock-agent-using-terraform?utm_source=hashnode&utm_medium=feed)

Learn how to use the new Agents for Amazon Bedrock Terraform resources to manage an agent using a forex rate assistant as an example.

May 1, 2024 · 12 min read · blog.avangards.io  
Updated Jun 9, 2024  
Read the article

-   [#aws](https://hashnode.com/tag/aws)
-   [#terraform](https://hashnode.com/tag/terraform)
-   [#generative-ai](https://hashnode.com/tag/generative-ai)
-   [#amazon-bedrock](https://hashnode.com/tag/amazon-bedrock)
-   [#ai](https://hashnode.com/tag/ai)

## Written by

[Anthony Wat](https://hashnode.com/@acwwat)

@acwwat

  
[View profile](https://hashnode.com/@acwwat)

AWS Architect

Anthony Wat is a seasoned cloud and DevOps architect with deep expertise in software development, modernization, and automation. As a Principal Architect at Globalli, he specializes in AWS solutions, AI-driven development, and at-scale operations.

## Responses 2

Markdown supported · ⌘↵ to post

[Alejandro Barone](https://hashnode.com/@alejandrombc)

[Feb 22, 2025](https://hashnode.com/posts/how-to-manage-an-amazon-bedrock-agent-using-terraform/6631c56c95bfbcda61a25f54/comment/67b9587dfc9d2529ed153938)

Awesome!!, but how do you handle aliases and versioning with preparing?

Am having a problem when creating an alias in TF because it needs to be "prepared" to do so. Should I use some depends on my alias using the null resource? (or something like that)

[Anthony Wat](https://hashnode.com/@acwwat)

[Mar 2, 2025](https://hashnode.com/posts/how-to-manage-an-amazon-bedrock-agent-using-terraform/6631c56c95bfbcda61a25f54/comment/67b9587dfc9d2529ed153938#reply-67c4d9c06cb44d1271551e8a)

Thanks for your comment.

An alias must be (re-created) when there are changes that require preparing, so the agent resource and the null resource for preparing action group changes should be added to `depends_on` for the alias resource.

Furthermore, the alias must be re-created upon changes to the above. So you may need to use the `replace_triggered_by` meta-argument to force re-creation based on changes to the agent and the null resource's ID. I've not yet tried this myself but see if this works.

[Keith McDuffee](https://hashnode.com/@Gudlyf)

[May 23, 2024](https://hashnode.com/posts/how-to-manage-an-amazon-bedrock-agent-using-terraform/6631c56c95bfbcda61a25f54/comment/664f2cd60a7a9938def88fdc)

The `aws_bedrockagent_agent` now has a `prepare_agent` flag, so the null resource should be unnecessary now.

[Anthony Wat](https://hashnode.com/@acwwat)

[May 24, 2024](https://hashnode.com/posts/how-to-manage-an-amazon-bedrock-agent-using-terraform/6631c56c95bfbcda61a25f54/comment/664f2cd60a7a9938def88fdc#reply-664ff39d39de0109b16f86fc)

Thanks for your comment!

This new argument is only part of the solution, as changes to action groups still requires a PrepareAgent call. There is also a similar case with knowledge base attachments. Nonetheless it's a good idea to add the argument so there's one less dependency - I'll update the blog post and code example soon.

Hopefully I can get to adding similar arguments to the action group and KB resources, unless there are takers :)
