From 395e7a08a935ca4fb54110d1238fa969c1fb0998 Mon Sep 17 00:00:00 2001 From: John Sonnenschein Date: Tue, 20 May 2025 06:07:06 -0700 Subject: [PATCH 1/2] feat(aws_s3 source): separate s3 and sqs auth --- src/sources/aws_s3/mod.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/sources/aws_s3/mod.rs b/src/sources/aws_s3/mod.rs index f0b89d1629477..54189b5cbaa96 100644 --- a/src/sources/aws_s3/mod.rs +++ b/src/sources/aws_s3/mod.rs @@ -103,6 +103,15 @@ pub struct AwsS3Config { #[serde(default)] auth: AwsAuthentication, + + /// AWS Authentication for only the S3 client. + /// + /// This is used when the S3 client needs to use different credentials than the SQS client. + /// This is useful when eg, the S3 bucket is in a different account than the SQS queue. + #[configurable(derived)] + #[serde(default)] + s3_auth: Option, + /// Multiline aggregation configuration. /// /// If not specified, multiline aggregation is disabled. @@ -242,11 +251,16 @@ impl AwsS3Config { let region = self.region.region(); let endpoint = self.region.endpoint(); + let auth = match self.s3_auth { + Some(ref auth) => auth, + None => &self.auth, + }; + let s3_client = create_client::( &S3ClientBuilder { force_path_style: Some(self.force_path_style), }, - &self.auth, + auth, region.clone(), endpoint.clone(), proxy, From 6158e6b52682c4b1a6eb90fcb2361c7665cd3035 Mon Sep 17 00:00:00 2001 From: John Sonnenschein Date: Tue, 20 May 2025 06:13:50 -0700 Subject: [PATCH 2/2] changelog fragement --- changelog.d/23079_aws_s3_auth.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelog.d/23079_aws_s3_auth.md diff --git a/changelog.d/23079_aws_s3_auth.md b/changelog.d/23079_aws_s3_auth.md new file mode 100644 index 0000000000000..e57b4e15ffd80 --- /dev/null +++ b/changelog.d/23079_aws_s3_auth.md @@ -0,0 +1,3 @@ +added `s3_auth` option to specify AWS auth configuration for S3 when different than SQS + +authors: sonnens