Terraform and AWS Provider Version
Terraform v1.12.1
hashicorp/aws v6.44.0 (also reproduced on v6.43.0)
Affected Resource(s) or Data Source(s)
aws_bedrockagentcore_memory_strategy
Expected Behavior
Setting type = "CUSTOM" with a configuration block containing type = "SEMANTIC_OVERRIDE" (or USER_PREFERENCE_OVERRIDE / SUMMARY_OVERRIDE) should create a "built-in with overrides" memory strategy, as documented in the AgentCore Memory custom strategy docs.
Actual Behavior
terraform plan fails with a "Value Conversion Error" on configuration[0].type:
Error: : Value Conversion Error
with aws_bedrockagentcore_memory_strategy.semantic[0],
on main.tf line XX, in resource "aws_bedrockagentcore_memory_strategy" "semantic":
Cause: An unexpected error was encountered trying to build a value. This is
always an error in the provider. Please report the following to the provider
developer:
Received null value, however the target type cannot handle null values. Use
the corresponding `types` package type, a pointer type or a custom type that
handles null values.
Path: configuration[0].type
Target Type: types.OverrideType
Suggested `types` Type:
types.StringEnum[github.com/aws/aws-sdk-go-v2/service/bedrockagentcorecontrol/types.OverrideType]
Suggested Pointer Type: *types.OverrideType
The error occurs during plan — no API call is made.
Relevant Error/Panic Output
Sample Terraform Configuration
Click to expand configuration
resource "aws_bedrockagentcore_memory_strategy" "semantic" {
count = 1
name = "my_semantic_facts"
memory_id = aws_bedrockagentcore_memory.this.id
memory_execution_role_arn = aws_iam_role.memory_role.arn
type = "CUSTOM"
description = "Semantic with project-scoping override"
namespaces = ["facts/{actorId}/{sessionId}/"]
configuration {
type = "SEMANTIC_OVERRIDE"
extraction {
append_to_prompt = "Extract only facts specific to this project."
model_id = "anthropic.claude-haiku-4-5-20251001-v1:0"
}
consolidation {
append_to_prompt = "Consolidate only project-specific facts."
model_id = "anthropic.claude-haiku-4-5-20251001-v1:0"
}
}
}
The same error occurs for USER_PREFERENCE_OVERRIDE and SUMMARY_OVERRIDE configuration types.
Steps to Reproduce
- Create an
aws_bedrockagentcore_memory resource
- Create an
aws_bedrockagentcore_memory_strategy with type = "CUSTOM" and a configuration block containing any valid override type string
- Run
terraform plan
Debug Logging
Click to expand log output
GenAI / LLM Assisted Development
n/a
Important Facts and References
Root Cause Analysis
Based on the error message, the provider's internal schema defines configuration.type using a non-nullable Go type (types.OverrideType — a StringEnum backed by bedrockagentcorecontrol/types.OverrideType). When Terraform's framework passes the configured string value through the schema layer, it appears to arrive as null at the point where it's converted to the target Go type.
The error message itself suggests the fix:
Suggested Pointer Type: *types.OverrideType
The field should be declared as a pointer type (*types.OverrideType) or use the types package equivalent that handles null values, so the framework can properly marshal the user-provided string into the enum.
Workaround
Use the built-in strategy types (SEMANTIC, USER_PREFERENCE, SUMMARIZATION) without a configuration block. This works but does not allow customizing extraction/consolidation prompts.
Additional Context
- The
configuration block is accepted by the schema (no "unsupported block" error), confirming the provider recognizes it as a valid attribute.
- The error is purely in the provider's value conversion layer — it never reaches the AWS API.
- The AWS docs and CDK constructs both support override strategies, confirming the API supports this functionality.
- Reproduced on both v6.43.0 and v6.44.0.
Would you like to implement a fix?
No
Terraform and AWS Provider Version
Affected Resource(s) or Data Source(s)
aws_bedrockagentcore_memory_strategyExpected Behavior
Setting
type = "CUSTOM"with aconfigurationblock containingtype = "SEMANTIC_OVERRIDE"(orUSER_PREFERENCE_OVERRIDE/SUMMARY_OVERRIDE) should create a "built-in with overrides" memory strategy, as documented in the AgentCore Memory custom strategy docs.Actual Behavior
terraform planfails with a "Value Conversion Error" onconfiguration[0].type:The error occurs during plan — no API call is made.
Relevant Error/Panic Output
Sample Terraform Configuration
Click to expand configuration
The same error occurs for USER_PREFERENCE_OVERRIDE and SUMMARY_OVERRIDE configuration types.
Steps to Reproduce
aws_bedrockagentcore_memoryresourceaws_bedrockagentcore_memory_strategywithtype = "CUSTOM"and aconfigurationblock containing any valid override type stringterraform planDebug Logging
Click to expand log output
GenAI / LLM Assisted Development
n/a
Important Facts and References
Root Cause Analysis
Based on the error message, the provider's internal schema defines
configuration.typeusing a non-nullable Go type (types.OverrideType— aStringEnumbacked bybedrockagentcorecontrol/types.OverrideType). When Terraform's framework passes the configured string value through the schema layer, it appears to arrive asnullat the point where it's converted to the target Go type.The error message itself suggests the fix:
The field should be declared as a pointer type (
*types.OverrideType) or use thetypespackage equivalent that handles null values, so the framework can properly marshal the user-provided string into the enum.Workaround
Use the built-in strategy types (
SEMANTIC,USER_PREFERENCE,SUMMARIZATION) without aconfigurationblock. This works but does not allow customizing extraction/consolidation prompts.Additional Context
configurationblock is accepted by the schema (no "unsupported block" error), confirming the provider recognizes it as a valid attribute.Would you like to implement a fix?
No