Skip to content

Improve AWS credential loading and configuration handling in BedrockProvider #5699

Merged
michaelneale merged 2 commits intoblock:mainfrom
fbalicchia:manage-aws-profile
Nov 25, 2025
Merged

Improve AWS credential loading and configuration handling in BedrockProvider #5699
michaelneale merged 2 commits intoblock:mainfrom
fbalicchia:manage-aws-profile

Conversation

@fbalicchia
Copy link
Contributor

This PR refactors the BedrockProvider::from_env implementation to make AWS configuration loading more robust and user-friendly, especially for environments using AWS SSO or multiple profiles.

Key Changes
• Replaced aws_config::load_from_env() with aws_config::defaults(BehaviorVersion::latest()) to support:
• AWS SSO logins (aws sso login --profile )
• Named profiles (AWS_PROFILE)
• Explicit region configuration (AWS_REGION)
• Added explicit handling for:
• AWS_PROFILE → sets the active AWS profile
• AWS_REGION → sets the AWS region dynamically

@fbalicchia
Copy link
Contributor Author

@DOsinga have you any update ?

Copy link
Collaborator

@michaelneale michaelneale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @fbalicchia - devilishly hard to test all the edge cases for bedrock implementations isn't it.

I had some nit/comments in review - but main thing is: have had issues before with it not really refreshing creds and then goose basically crashes/stops working until you close and open, is that likely to be an issue with this with the client at the BedrockProvider level? or will it load things when it needs?

If you think this is ok, then would just love small comments addressed (and also - do we need us-east-1 in there?) and lets get this in, and can see how it goes?

"us.anthropic.claude-3-7-sonnet-20250219-v1:0",
"us.anthropic.claude-opus-4-20250514-v1:0",
"us.anthropic.claude-opus-4-1-20250805-v1:0",
"anthropic.claude-sonnet-4-20250514-v1:0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

odd - it wouldn't work without the prefix here for me, but may be different setup with sso vs not?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No—this doesn’t depend on SSO here. It depends on which profile we want to use by default, whether the global profile or the inference profile. I’ll revert it

@michaelneale michaelneale self-assigned this Nov 21, 2025
fbalicchia added a commit to fbalicchia/goose that referenced this pull request Nov 21, 2025
Copy link
Collaborator

@michaelneale michaelneale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @fbalicchia can you click on the DCO check and sign your commits - then we can get it in. Thank you!

Signed-off-by: fbalicchia <fbalicchia@gmail.com>
Signed-off-by: fbalicchia <fbalicchia@gmail.com>
@fbalicchia
Copy link
Contributor Author

@michaelneale Done thanks

@michaelneale
Copy link
Collaborator

thank you @fbalicchia

@michaelneale michaelneale merged commit f6a2e2e into block:main Nov 25, 2025
16 checks passed
BlairAllan pushed a commit to BlairAllan/goose that referenced this pull request Nov 29, 2025
…rovider (block#5699)

Signed-off-by: fbalicchia <fbalicchia@gmail.com>
Signed-off-by: Blair Allan <Blairallan@icloud.com>
katzdave added a commit that referenced this pull request Dec 1, 2025
* 'main' of github.com:block/goose:
  blog: fixing img url (#5895)
  blog: MCPs for Developers (#5884)
  docs: Extension Manager MCP (#5883)
  Update cleanup marker logic for Fedora users. (#5868)
  Improve AWS credential loading and configuration handling in BedrockProvider  (#5699)
katzdave added a commit that referenced this pull request Dec 1, 2025
…nses-streaming

* 'main' of github.com:block/goose:
  Feat/automatic update installation (#5345)
  fix: Added "Merged consecutive assistant messages" to the acceptable issues for moim injection check (#5933)
  fix: anthropic provider model fetching (#5932)
  [MCP-UI] add CSP for images to proxy HTML (#5931)
  fix: correct typo in blog post (AIMDOEL -> AIMODEL) (#5902)
  feat: @goose in terminal (native terminal support) (#5887)
  docs: adding AI-friendly features (#5918)
  Blog/advent of ai announcement (#5917)
  Extension selector behind ALPHA flag (#5892)
  blog: typo fixes (#5896)
  blog: fixing img url (#5895)
  blog: MCPs for Developers (#5884)
  docs: Extension Manager MCP (#5883)
  Update cleanup marker logic for Fedora users. (#5868)
  Improve AWS credential loading and configuration handling in BedrockProvider  (#5699)
@fbalicchia fbalicchia deleted the manage-aws-profile branch December 11, 2025 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants