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

enhancement(aws provider): Use FIPS endpoints when configured to do so #18390

Merged
merged 1 commit into from
Aug 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/aws/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ pub async fn create_client_and_region<T: ClientBuilder>(
// error up front if later SDK calls will fail due to lack of region configuration
let region = resolve_region(region).await?;

let provider_config =
aws_config::provider_config::ProviderConfig::empty().with_region(Some(region.clone()));

// Build the configuration first.
let mut config_builder = SdkConfig::builder()
.credentials_cache(auth.credentials_cache().await?)
Expand All @@ -179,6 +182,12 @@ pub async fn create_client_and_region<T: ClientBuilder>(
config_builder = config_builder.endpoint_url(endpoint_override);
}

if let Some(use_fips) =
aws_config::default_provider::use_fips::use_fips_provider(&provider_config).await
{
config_builder = config_builder.use_fips(use_fips);
}

let config = config_builder.build();

let client =
Expand Down