fix: name_prefix, tag propagation, external role support, MCP example#172
Open
Sagargupta16 wants to merge 4 commits intoaws-ia:mainfrom
Open
fix: name_prefix, tag propagation, external role support, MCP example#172Sagargupta16 wants to merge 4 commits intoaws-ia:mainfrom
Sagargupta16 wants to merge 4 commits intoaws-ia:mainfrom
Conversation
The `name_prefix` variable was defined but never used for resource names in main.tf. Resources always used `random_string.solution_prefix.result` regardless of what `name_prefix` was set to. Introduce `local.solution_prefix` that uses `name_prefix` when provided, falling back to the random string when null. Update all resource names in main.tf and IAM role prefix in iam.tf to use this local. Change `name_prefix` default from "BedrockAgents" to null so the random prefix is generated by default (preserving existing behavior for users who don't set name_prefix). Closes aws-ia#170
…al roles When passing `agent_resource_role_arn` from another resource (e.g., `aws_iam_role.bedrock_agent_role.arn`), the value is not known until apply time. This causes Terraform to fail with: "The count value depends on resource attributes that cannot be determined until apply" Add a `create_agent_role` boolean variable (default: true) that users set to false when providing an external role ARN. This replaces the null-check on `agent_resource_role_arn` in count expressions, which resolves the apply-time dependency. Ref: https://developer.hashicorp.com/terraform/language/meta-arguments/count#values-not-known-during-planning Closes aws-ia#169
AWS provider `default_tags` only apply to `aws_*` resources, not to
`awscc_*` (CloudControl) resources used by this module for agents,
aliases, knowledge bases, and guardrails.
Add merged tag locals that combine the base `tags` variable with
resource-specific tag variables. This ensures tags set in `var.tags`
propagate to all resources, while resource-specific overrides still
take precedence.
Update `var.tags` default from null to {} and improve description to
explain the tag merging behavior.
Closes aws-ia#168
Ref: https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-configuration-block
Add example showing how to create a Bedrock agent with MCP (Model Context Protocol) tool integration via Lambda-based action groups. Includes: - Terraform configuration for agent + action group - Documentation explaining MCP + Bedrock architecture - Links to official MCP spec and AWS MCP server implementations - Usage example with name_prefix and tags MCP enables standardized tool integration for AI agents. Bedrock agents can leverage MCP through Lambda functions that translate between Bedrock's action group format and MCP tool calls. Ref: https://modelcontextprotocol.io/ Ref: https://github.com/awslabs/mcp Addresses aws-ia#106
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Four fixes in one PR (can split if preferred):
Fix
name_prefixnot affecting resource names (name_prefix for module doesn't affect random prefix #170)name_prefixvariable existed but was ignored — resources always usedrandom_string.solution_prefixlocal.solution_prefixthat usesname_prefixwhen set, falling back to random string"BedrockAgents"tonull(preserving random prefix behavior for existing users)Fix
create_agent_rolefor external role support (Can't reuse already created role #169)agent_resource_role_arnfrom another resource, the ARN isn't known at plan timecreate_agent_roleboolean (default: true) to replace null-check in count expressionsPropagate default tags to
awscc_*resources (Default tags are being ignored, subresources are not getting tags applied. #168)default_tagsonly apply toaws_*resources, notawscc_*(CloudControl)var.tagswith resource-specific tag variablesvar.tagsnow propagates to agents, aliases, knowledge bases, and custom modelsAdd MCP integration example (MCP Support #106)
examples/agent-with-mcp/showing Bedrock agent + MCP tools via Lambda action groupWhy
These are 4 of the top-reported issues, all currently unassigned:
References