feat(bedrockagent): add Managed Knowledge Base support (type=MANAGED)#48904
Open
DanyStinson wants to merge 3 commits into
Open
feat(bedrockagent): add Managed Knowledge Base support (type=MANAGED)#48904DanyStinson wants to merge 3 commits into
DanyStinson wants to merge 3 commits into
Conversation
Add support for Amazon Bedrock Managed Knowledge Bases to the aws_bedrockagent_knowledge_base and aws_bedrockagent_data_source resources. Managed Knowledge Bases (type=MANAGED) allow Amazon Bedrock to fully manage the vector store, embeddings, and indexing infrastructure. No storage_configuration is required. Changes: - aws_bedrockagent_knowledge_base: add managed_knowledge_base_configuration block with embedding_model_type (MANAGED/CUSTOM), embedding_model_arn, embedding_model_configuration, and server_side_encryption_configuration - aws_bedrockagent_data_source: add MANAGED_KNOWLEDGE_BASE_CONNECTOR type with connector_parameters (JSON), media_extraction_configuration (image/video/audio), and deletion_protection_configuration - Add acceptance test for Managed KB creation - Update documentation with examples for Managed KB and connectors (S3, SharePoint)
Contributor
Community GuidelinesThis comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀 Voting for Prioritization
Pull Request Authors
|
Contributor
|
✅ Thank you for correcting the previously detected issues! The maintainers appreciate your efforts to make the review process as smooth as possible. |
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.
PR Plan: Add Managed Knowledge Base support to
aws_bedrock_knowledge_baseOverview
Add support for
type = "MANAGED"to the existingaws_bedrock_knowledge_baseresource in thehashicorp/terraform-provider-awsprovider.API Shape (from AWS SDK)
EmbeddingModelConfigurationalready exists in the provider (used byvector_knowledge_base_configuration).Changes Required
1. Schema (
knowledge_base.go— Schema function)Add
managed_knowledge_base_configurationblock insideknowledge_base_configuration:2. Update ExactlyOneOf validator
Add
managed_knowledge_base_configurationto theExactlyOneOflist alongside kendra/sql/vector:3. Make
storage_configurationoptional for MANAGED typeThe
storage_configurationblock currently has noRequiredvalidator (it's already optional in the schema). The validation happens at the API level — if you send MANAGED type with no storage_configuration, the API accepts it. No schema change needed here; just ensure no custom validators reject it.4. Model structs
5. Update
knowledgeBaseConfigurationModel6. No flatten/expand code needed
The provider uses
fwflex.Flattenandfwflex.Expand(AutoFlex) which automatically maps between SDK types and Terraform model structs by name convention. Since our struct field names match the SDK field names, AutoFlex handles the serialization.7. Acceptance test
8. Documentation
Update
website/docs/r/bedrock_knowledge_base.html.markdownto add a MANAGED example.Files to modify
internal/service/bedrockagent/knowledge_base.go— schema + modelsinternal/service/bedrockagent/knowledge_base_test.go— acceptance testwebsite/docs/r/bedrock_knowledge_base.html.markdown— docsSDK dependency
The current provider uses
bedrockagent v1.57.0. Need to verify thatManagedKnowledgeBaseConfigurationandKnowledgeBaseTypeManagedexist in this version. If not, bump to the latest SDK version that includes them.Expected user experience
With custom embedding: