awslabs/aws-sdk-rust

Environment and shared profile config for ignoring endpoint urls is not respected for service specific config

aajtodd opened this issue · 5 comments

Describe the bug

AWS_IGNORE_CONFIGURED_ENDPOINT_URLS and ignore_configured_endpoint_urls are used to disable endpoint urls via environment and shared profile config.

We seem to respect them for the global config when using config loader but not for service specific env/keys (example)

Expected Behavior

Service specific environment should also take these settings into account when loading from SdkConfig.

Current Behavior

Service clients still use environment settings.

Reproduction Steps

let aws_config = aws_config::defaults(aws_config::BehaviorVersion::latest()).load().await;
let sts = aws_sdk_sts::Client::new(&aws_config);
let result = sts.get_caller_identity().send().await;
println!("resolved ident: {:#?}", result);
export AWS_ENDPOINT_URL_STS=http://127.0.0.1:4566
export AWS_IGNORE_CONFIGURED_ENDPOINT_URLS=true
export AWS_PROFILE=my-profile
RUST_LOG=trace cargo run

Possible Solution

No response

Additional Information/Context

No response

Version

`aws-config: 1.5.6` and latest service clients (sts `1.43.0` at this time).

Environment details (OS name and version, etc.)

all

Logs

No response

related issue: #1193

NOTE the SEP has this to say:

SDKs MUST read a parameter using the standard parameter resolution logic (idiomatic client configuration, environment variable, and shared configuration file) boolean option to disable the feature. The client configuration and shared configuration profile value MUST be named ignore_configured_endpoint_urls, and the environment variable AWS_IGNORE_CONFIGURED_ENDPOINT_URLS.

This would indicate SdkConfig should also have an option for programmatically disabling endpoint URL detection via environment/shared profiles. This would also be how we change codegen From<SdkConfig> implementation to look at that field and decide whether to look at the service specific env/profile keys.

We only implemented support for ignoring these at the config loader level .

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

This has been fixed and staged for release. Will go out when we next release smithy-rs

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.