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

fix(lambda-promtail): Remove s3 bucket ownership verification #15383

4 changes: 1 addition & 3 deletions tools/lambda-promtail/lambda-promtail/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,6 @@ func getLabels(record events.S3EventRecord) (map[string]string, error) {

labels["key"] = record.S3.Object.Key
labels["bucket"] = record.S3.Bucket.Name
labels["bucket_owner"] = record.S3.Bucket.OwnerIdentity.PrincipalID
milenpankov-bosch marked this conversation as resolved.
Show resolved Hide resolved
labels["bucket_region"] = record.AWSRegion
for key, p := range parsers {
if p.filenameRegex.MatchString(labels["key"]) {
Expand Down Expand Up @@ -292,10 +291,9 @@ func processS3Event(ctx context.Context, ev *events.S3Event, pc Client, log *log
&s3.GetObjectInput{
Bucket: aws.String(labels["bucket"]),
Key: aws.String(labels["key"]),
ExpectedBucketOwner: aws.String(labels["bucket_owner"]),
})
if err != nil {
return fmt.Errorf("failed to get object %s from bucket %s on account %s, %s", labels["key"], labels["bucket"], labels["bucket_owner"], err)
return fmt.Errorf("failed to get object %s from bucket %s on account %s, %s", labels["key"], labels["bucket"], err)
milenpankov-bosch marked this conversation as resolved.
Show resolved Hide resolved
}
err = parseS3Log(ctx, batch, labels, obj.Body, log)
if err != nil {
Expand Down
Loading