hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.87k stars 9.21k forks source link

[Bug]: aws_bedrock_guardrail_version resource producing inconsistent result #40015

Open pursachi opened 3 weeks ago

pursachi commented 3 weeks ago

Terraform Core Version

1.6.0

AWS Provider Version

5.74

Affected Resource(s)

aws_bedrock_guardrail_version

Expected Behavior

It should not show error if there is already a guardrail version available.

Actual Behavior

aws_bedrock_guardrail_version resource shows inconsistent result after apply. It creates a guardrail version in the first run, in the subsequent runs it errors out with the below error message:

Error: Provider produced inconsistent result after apply
<span>
When applying changes to aws_bedrockagent_agent, provider "provider[\"registry.terraform.io/hashicorp/aws\"]" produced an unexpected new value: .guardrail_configuration: was
cty.ListVal([]cty.Value{cty.ObjectVal(map[string]cty.Value{"guardrail_identifier":cty.StringVal("<guardrail_id>"),
"guardrail_version":cty.StringVal("3")})}), but now null.

Relevant Error/Panic Output Snippet

Error: Provider produced inconsistent result after apply
<span>
When applying changes to aws_bedrockagent_agent, provider "provider[\"registry.terraform.io/hashicorp/aws\"]" produced an unexpected new value: .guardrail_configuration: was
cty.ListVal([]cty.Value{cty.ObjectVal(map[string]cty.Value{"guardrail_identifier":cty.StringVal("<guardrail_id>"),
"guardrail_version":cty.StringVal("3")})}), but now null.

Terraform Configuration Files

resource "aws_bedrock_guardrail_version" "guardrail" {
  description   = lookup(var.bedrock_guardrails, "description", "Bedrock Guardrails")
  guardrail_arn = aws_bedrock_guardrail.guardrail.guardrail_arn
  skip_destroy  = true
}

Steps to Reproduce

  1. Create a basic bedrock guardrails, following instructions in https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/bedrock_guardrail
  2. Create a bedrock guardrail version
  3. Apply terraform configuration
  4. change some trivial settings like description etc
  5. re-apply the terraform config

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 3 weeks ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue