From e19243fb05f2f65705892258aae1a1becb4040fe Mon Sep 17 00:00:00 2001 From: Stephen Wakely Date: Tue, 5 Sep 2023 23:10:25 +0100 Subject: [PATCH] chore: feature gate aws-core features (#18482) feature gate aws_core features Signed-off-by: Stephen Wakely --- src/sinks/elasticsearch/service.rs | 1 + src/sinks/prometheus/remote_write.rs | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sinks/elasticsearch/service.rs b/src/sinks/elasticsearch/service.rs index eccc4323cda77..909b5a35acd0b 100644 --- a/src/sinks/elasticsearch/service.rs +++ b/src/sinks/elasticsearch/service.rs @@ -139,6 +139,7 @@ impl HttpRequestBuilder { Auth::Basic(auth) => { auth.apply(&mut request); } + #[cfg(feature = "aws-core")] Auth::Aws { credentials_provider: provider, region, diff --git a/src/sinks/prometheus/remote_write.rs b/src/sinks/prometheus/remote_write.rs index ada95e473e120..043254630b63e 100644 --- a/src/sinks/prometheus/remote_write.rs +++ b/src/sinks/prometheus/remote_write.rs @@ -2,7 +2,9 @@ use std::io::Read; use std::sync::Arc; use std::task; +#[cfg(feature = "aws-core")] use aws_credential_types::provider::SharedCredentialsProvider; +#[cfg(feature = "aws-core")] use aws_types::region::Region; use bytes::{Bytes, BytesMut}; use futures::{future::BoxFuture, stream, FutureExt, SinkExt}; @@ -399,7 +401,7 @@ impl HttpRequestBuilder { builder = builder.header("X-Scope-OrgID", tenant_id); } - let mut request = builder.body(body.into()).unwrap(); + let mut request: Request = builder.body(body.into()).unwrap(); if let Some(auth) = &self.auth { match auth { Auth::Basic(http_auth) => http_auth.apply(&mut request),