aws / aws-sdk-go-v2

AWS SDK for the Go programming language.
https://aws.github.io/aws-sdk-go-v2/docs/
Apache License 2.0
2.68k stars 650 forks source link

Go SDK: Guardrail wordsConfig required (should be optional) #2855

Closed dabounds closed 2 weeks ago

dabounds commented 1 month ago

When adding a BedrockGuardrail via Go/Terraform, the wordsConfig is listed as optional, but gives the following error when omitted:

Error: AWS SDK Go Service Operation Unsuccessful Calling Cloud Control API service UpdateResource operation returned: operation error CloudControl: UpdateResource https response error StatusCode: 400, RequestID: , api error ValiationException: Model valudation failed (#/WordPolicyConfig/WordsConfig: expected minimum item count: 1, found: 0)

RanVaknin commented 1 month ago

Hi @dabounds,

I understand that you are consuming the Go SDK through Terraform which is why you are getting this validation. When I tried using the SDK directly to interact with bedrock I got this error:

ValidationException: This Word policy must have at least one configuration.

Which makes sense. WordPolicyConfig expects at least one of it's params (ManagedWordListsConfig or WordsConfig) to be provided. Because its an either / or / both the service cannot model them as required fields and they have to be modeled as optional.

I see how this can be confusing though, as this should have been clarified via the documentation. If you wish to provide feedback to the AWS Bedrock team on adding clarifying information to that documentation page you can do that by clicking on the Feedback button in the top right corner.

Please let me know if there's anything else I can help you with.

Thanks, Ran~

github-actions[bot] commented 3 weeks ago

This issue has not received a response in 1 week. If you want to keep this issue open, please just leave a comment below and auto-close will be canceled.