Skip to content

Commit 02c1b4c

Browse files
authored
enhancement(aws provider): Use FIPS endpoints when configured to do so (vectordotdev#18390)
This uses the default provider for FIPS which checks environment variables and configuration files for this setting. Part of: vectordotdev#18382 Signed-off-by: Jesse Szwedko <[email protected]>
1 parent dd8a0ef commit 02c1b4c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/aws/mod.rs

+9
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ pub async fn create_client_and_region<T: ClientBuilder>(
168168
// error up front if later SDK calls will fail due to lack of region configuration
169169
let region = resolve_region(region).await?;
170170

171+
let provider_config =
172+
aws_config::provider_config::ProviderConfig::empty().with_region(Some(region.clone()));
173+
171174
// Build the configuration first.
172175
let mut config_builder = SdkConfig::builder()
173176
.credentials_cache(auth.credentials_cache().await?)
@@ -179,6 +182,12 @@ pub async fn create_client_and_region<T: ClientBuilder>(
179182
config_builder = config_builder.endpoint_url(endpoint_override);
180183
}
181184

185+
if let Some(use_fips) =
186+
aws_config::default_provider::use_fips::use_fips_provider(&provider_config).await
187+
{
188+
config_builder = config_builder.use_fips(use_fips);
189+
}
190+
182191
let config = config_builder.build();
183192

184193
let client =

0 commit comments

Comments
 (0)