Open
Description
Terraform Core Version
0.13.7
AWS Provider Version
5.76.0
Affected Resource(s)
- aws_bedrockagent_agent
Expected Behavior
The provider should accept the prompt_override_configuration block and create the Bedrock agent with the specified prompt configurations.
Actual Behavior
The provider produces an invalid plan with a type mismatch between the configuration and the planned value.
Relevant Error/Panic Output Snippet
resource "aws_bedrockagent_agent" "agent" {
prompt_override_configuration {
prompt_configurations = [{
base_prompt_template = "test"
inference_configuration = [{
max_length = 2048
stop_sequences = ["\n\nHuman:"]
temperature = 0
top_k = 250
top_p = 1
}]
parser_mode = "DEFAULT"
prompt_creation_mode = "OVERRIDDEN"
prompt_state = "ENABLED"
prompt_type = "POST_PROCESSING"
}]
}
}
Terraform Configuration Files
resource "aws_bedrockagent_agent" "agent" {
prompt_override_configuration {
prompt_configurations = [{
base_prompt_template = "test"
inference_configuration = [{
max_length = 2048
stop_sequences = ["\n\nHuman:"]
temperature = 0
top_k = 250
top_p = 1
}]
parser_mode = "DEFAULT"
prompt_creation_mode = "OVERRIDDEN"
prompt_state = "ENABLED"
prompt_type = "POST_PROCESSING"
}]
}
}
Steps to Reproduce
- Create a new directory and initialize Terraform:
mkdir bedrock-agent-test
cd bedrock-agent-test
terraform init
- Create a main.tf file with the following minimal configuration:
provider "aws" {
region = "us-east-1" # or your preferred region
}
resource "aws_iam_role" "agent_role" {
name = "bedrock-agent-test-role"
assume_role_policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
Action = "sts:AssumeRole"
Effect = "Allow"
Principal = {
Service = "bedrock.amazonaws.com"
}
}
]
})
}
resource "aws_bedrockagent_agent" "agent" {
agent_name = "test-agent"
agent_resource_role_arn = aws_iam_role.agent_role.arn
instruction = "You are a helpful assistant"
foundation_model = "anthropic.claude-v2"
prompt_override_configuration {
prompt_configurations = [{
base_prompt_template = "test"
inference_configuration = [{
max_length = 2048
stop_sequences = ["\n\nHuman:"]
temperature = 0
top_k = 250
top_p = 1
}]
parser_mode = "DEFAULT"
prompt_creation_mode = "OVERRIDDEN"
prompt_state = "ENABLED"
prompt_type = "POST_PROCESSING"
}]
}
}
- Run terraform commands:
terraform init
terraform plan
- Observe the error:
Error: Provider produced invalid plan
Provider "registry.terraform.io/hashicorp/aws" planned an invalid value for
aws_bedrockagent_agent.agent.prompt_override_configuration...
Environment Details
- Terraform Version: x.x.x (output of
terraform version
) - AWS Provider Version: x.x.x
- Operating System: Your OS
- AWS Region: Your Region
Prerequisites
- AWS account with appropriate permissions
- AWS credentials configured
- Bedrock service enabled in your AWS account
Debug Output
Error: Provider produced invalid plan
Provider "registry.terraform.io/hashicorp/aws" planned an invalid value for
aws_bedrockagent_agent.agent.prompt_override_configuration...
Metadata
Metadata
Assignees
Labels
No labels