Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bedrock Agent and Bedrock Agent Runtime do not use service specific endpoint overrides environment variables #1252

Open
1 task
nateglims opened this issue Jan 31, 2025 · 2 comments
Labels
bug This issue is a bug. p2 This is a standard priority issue

Comments

@nateglims
Copy link

Describe the bug

When setting AWS_ENDPOINT_URL_BEDROCK_AGENT and/or AWS_ENDPOINT_URL_BEDROCK_AGENT_RUNTIME, the SDK continues using the default endpoint for the Bedrock Agent services. I have not tested other aws-sdk-rust crates.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

Using these env vars should override the endpoint used.

Current Behavior

The default endpoint is used.

Reproduction Steps

Set the variables:

export AWS_ENDPOINT_URL_BEDROCK_AGENT=https://localhost:8080/
export AWS_ENDPOINT_URL_BEDROCK_AGENT_RUNTIME=https://localhost:8080/

Configure the SDK without overriding the endpoint.

To show endpoint resolution, run with RUST_LOG="info,aws_smithy_runtime::client::orchestrator::endpoints=debug" cargo run

Crate attached.

repro.zip

Possible Solution

No response

Additional Information/Context

  • AWS_ENDPOINT_URL does override.
  • The AWS CLI and Boto3 both override as expected.

Version

❯ cargo tree | grep aws-
├── aws-config v1.5.15
│   ├── aws-credential-types v1.2.1
│   │   ├── aws-smithy-async v1.2.4
│   │   ├── aws-smithy-runtime-api v1.7.3
│   │   │   ├── aws-smithy-async v1.2.4 (*)
│   │   │   ├── aws-smithy-types v1.2.12
│   │   ├── aws-smithy-types v1.2.12 (*)
│   ├── aws-runtime v1.5.4
│   │   ├── aws-credential-types v1.2.1 (*)
│   │   ├── aws-sigv4 v1.2.7
│   │   │   ├── aws-credential-types v1.2.1 (*)
│   │   │   ├── aws-smithy-http v0.60.12
│   │   │   │   ├── aws-smithy-eventstream v0.60.6
│   │   │   │   │   ├── aws-smithy-types v1.2.12 (*)
│   │   │   │   ├── aws-smithy-runtime-api v1.7.3 (*)
│   │   │   │   ├── aws-smithy-types v1.2.12 (*)
│   │   │   ├── aws-smithy-runtime-api v1.7.3 (*)
│   │   │   ├── aws-smithy-types v1.2.12 (*)
│   │   ├── aws-smithy-async v1.2.4 (*)
│   │   ├── aws-smithy-http v0.60.12 (*)
│   │   ├── aws-smithy-runtime v1.7.7
│   │   │   ├── aws-smithy-async v1.2.4 (*)
│   │   │   ├── aws-smithy-http v0.60.12 (*)
│   │   │   ├── aws-smithy-runtime-api v1.7.3 (*)
│   │   │   ├── aws-smithy-types v1.2.12 (*)
│   │   ├── aws-smithy-runtime-api v1.7.3 (*)
│   │   ├── aws-smithy-types v1.2.12 (*)
│   │   ├── aws-types v1.3.4
│   │   │   ├── aws-credential-types v1.2.1 (*)
│   │   │   ├── aws-smithy-async v1.2.4 (*)
│   │   │   ├── aws-smithy-runtime-api v1.7.3 (*)
│   │   │   ├── aws-smithy-types v1.2.12 (*)
│   ├── aws-sdk-sso v1.57.0
│   │   ├── aws-credential-types v1.2.1 (*)
│   │   ├── aws-runtime v1.5.4 (*)
│   │   ├── aws-smithy-async v1.2.4 (*)
│   │   ├── aws-smithy-http v0.60.12 (*)
│   │   ├── aws-smithy-json v0.61.2
│   │   │   └── aws-smithy-types v1.2.12 (*)
│   │   ├── aws-smithy-runtime v1.7.7 (*)
│   │   ├── aws-smithy-runtime-api v1.7.3 (*)
│   │   ├── aws-smithy-types v1.2.12 (*)
│   │   ├── aws-types v1.3.4 (*)
│   ├── aws-sdk-ssooidc v1.58.0
│   │   ├── aws-credential-types v1.2.1 (*)
│   │   ├── aws-runtime v1.5.4 (*)
│   │   ├── aws-smithy-async v1.2.4 (*)
│   │   ├── aws-smithy-http v0.60.12 (*)
│   │   ├── aws-smithy-json v0.61.2 (*)
│   │   ├── aws-smithy-runtime v1.7.7 (*)
│   │   ├── aws-smithy-runtime-api v1.7.3 (*)
│   │   ├── aws-smithy-types v1.2.12 (*)
│   │   ├── aws-types v1.3.4 (*)
│   ├── aws-sdk-sts v1.58.0
│   │   ├── aws-credential-types v1.2.1 (*)
│   │   ├── aws-runtime v1.5.4 (*)
│   │   ├── aws-smithy-async v1.2.4 (*)
│   │   ├── aws-smithy-http v0.60.12 (*)
│   │   ├── aws-smithy-json v0.61.2 (*)
│   │   ├── aws-smithy-query v0.60.7
│   │   │   ├── aws-smithy-types v1.2.12 (*)
│   │   ├── aws-smithy-runtime v1.7.7 (*)
│   │   ├── aws-smithy-runtime-api v1.7.3 (*)
│   │   ├── aws-smithy-types v1.2.12 (*)
│   │   ├── aws-smithy-xml v0.60.9
│   │   ├── aws-types v1.3.4 (*)
│   ├── aws-smithy-async v1.2.4 (*)
│   ├── aws-smithy-http v0.60.12 (*)
│   ├── aws-smithy-json v0.61.2 (*)
│   ├── aws-smithy-runtime v1.7.7 (*)
│   ├── aws-smithy-runtime-api v1.7.3 (*)
│   ├── aws-smithy-types v1.2.12 (*)
│   ├── aws-types v1.3.4 (*)
├── aws-sdk-bedrockagent v1.76.0
│   ├── aws-credential-types v1.2.1 (*)
│   ├── aws-runtime v1.5.4 (*)
│   ├── aws-smithy-async v1.2.4 (*)
│   ├── aws-smithy-http v0.60.12 (*)
│   ├── aws-smithy-json v0.61.2 (*)
│   ├── aws-smithy-runtime v1.7.7 (*)
│   ├── aws-smithy-runtime-api v1.7.3 (*)
│   ├── aws-smithy-types v1.2.12 (*)
│   ├── aws-types v1.3.4 (*)
├── aws-sdk-bedrockagentruntime v1.76.0
│   ├── aws-credential-types v1.2.1 (*)
│   ├── aws-runtime v1.5.4 (*)
│   ├── aws-smithy-async v1.2.4 (*)
│   ├── aws-smithy-eventstream v0.60.6 (*)
│   ├── aws-smithy-http v0.60.12 (*)
│   ├── aws-smithy-json v0.61.2 (*)
│   ├── aws-smithy-runtime v1.7.7 (*)
│   ├── aws-smithy-runtime-api v1.7.3 (*)
│   ├── aws-smithy-types v1.2.12 (*)
│   ├── aws-types v1.3.4 (*)

Environment details (OS name and version, etc.)

MacOS, M2 Pro, 15.2 (24C101)

Logs

No response

@nateglims nateglims added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jan 31, 2025
@landonxjames
Copy link
Contributor

landonxjames commented Feb 3, 2025

The Rust SDK currently does not support setting service-specific endpoints via environment variables. We do support other programmatic ways of setting explicit endpoints which are documented here https://docs.aws.amazon.com/sdk-for-rust/latest/dg/endpoints.html

Edit: Ignore my previous message, I shouldn't be responding to issues that late at night. We should actually support this via this piece of generated code:

fn service_config_key<'a>(env: &'a str, profile: &'a str) -> aws_types::service_config::ServiceConfigKey<'a> {
::aws_types::service_config::ServiceConfigKey::builder()
.service_id("bedrock")
.env(env)
.profile(profile)
.build()
.expect("all field sets explicitly, can't fail")
}

If this isn't working it is a bug.

@landonxjames landonxjames added feature-request A feature should be added or improved. p2 This is a standard priority issue bug This issue is a bug. and removed bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. feature-request A feature should be added or improved. labels Feb 3, 2025
@nateglims
Copy link
Author

Thanks. FYI Bedrock is a distinct service from bedrock agents. I'm not sure if that one also has this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

2 participants