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_model_invocation_logging_configuration role_arn attribute is required #39599

Open zachvida opened 1 month ago

zachvida commented 1 month ago

Terraform Core Version

1.6.4

AWS Provider Version

5.7.0

Affected Resource(s)

aws_bedrock_model_invocation_logging_configuration.logging_config

Expected Behavior

Plan and Apply should succedd with all required variables.

Actual Behavior

snippet passes plan however apply fails. As the cloudwatchconfig.rolearn is a required parameter on the logging configuration however the provider currently states cloudwatch_config.role_arn is optional

Relevant Error/Panic Output Snippet

with aws_bedrock_model_invocation_logging_configuration.logging_config
on bedrock.tf line 1, in resource "aws_bedrock_model_invocation_logging_configuration" "logging_config":
resource "aws_bedrock_model_invocation_logging_configuration" "logging_config" {
operation error Bedrock: PutModelInvocationLoggingConfiguration, 1 validation error(s) found.
- missing required field, PutModelInvocationLoggingConfigurationInput.LoggingConfig.CloudWatchConfig.RoleArn.

Terraform Configuration Files

resource "aws_bedrock_model_invocation_logging_configuration" "logging_config" {
  depends_on = [
    aws_s3_bucket_policy.bedrock_logging_bucket_policy
  ]

  logging_config {
    embedding_data_delivery_enabled = true
    image_data_delivery_enabled     = true
    text_data_delivery_enabled      = true
    s3_config {
      bucket_name = aws_s3_bucket.bedrock.id
      key_prefix  = "bedrock"
    }
    cloudwatch_config {
      log_group_name = aws_cloudwatch_log_group.bedrock.name
      large_data_delivery_s3_config {
        bucket_name = aws_s3_bucket.bedrock.id
        key_prefix = "large-data"
      }
    }
  }
}

Steps to Reproduce

terraform init terraform plan terraform apply -> FAILS

Debug Output

No response

Panic Output

No response

Important Factoids

role_arn is not option however terraform provider thinks it is.

References

https://docs.aws.amazon.com/bedrock/latest/APIReference/API_CloudWatchConfig.html states role arn for all cloudwatch configuration is a required parameter

Would you like to implement a fix?

No

github-actions[bot] commented 1 month ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue