DEV Community

Brisbane Web Developer
Brisbane Web Developer

Posted on

Avoid an extra message from not using Amazon Bedrock when running the fabric command

Summary

I noticed that the recent fabric (v1.4.219, while I was writing this) displays an extra output when:

  • You run the command
  • You have the file $HOME/.aws/credentials
  • Your AWS credential does not have the permission for Amazon Bedrock (as I do not use it).
fabric -L
---
Bedrock failed to list foundation models: operation error Bedrock: ListFoundationModels, https response error StatusCode: 403, RequestID: 12345678-1234-1234-1234-123412341234, AccessDeniedException: User: arn:aws:iam::123412341234:user/example is not authorized to perform: bedrock:ListFoundationModels because no identity-based policy allows the bedrock:ListFoundationModels action

Available models:

Ollama

        [1]     ...
        [2]     ...
(Omitting)

Enter fullscreen mode Exit fullscreen mode

Workaround

I cloned their Git Repository, asked GitHub Copilot + ChatGPT 4.1 why the extra unexpected message, and figured that it refers to an environment variable AWS_SHARED_CREDENTIALS_FILE so that if I set something, the current code sees as you have a legitimate AWS credential, thereby avoiding the output:

$HOME/.config/fabric/.env
---
(Omitting)
AWS_SHARED_CREDENTIALS_FILE=.
Enter fullscreen mode Exit fullscreen mode

Top comments (0)