- Newest
- Most votes
- Most comments
Have you made sure that the lambda resource policy allows the S3 to invoke the lambda. Please take a look at this document - https://docs.aws.amazon.com/lambda/latest/dg/with-s3.html
Hi,
Have a look at the following blog post https://aws.amazon.com/blogs/compute/using-dynamic-amazon-s3-event-handling-with-amazon-eventbridge/ that describes how to trigger a lambda function when a object is uploaded to a S3 bucket.
The following github repository https://github.com/geoffstratton/aws-lambda-transcribe-audio has a lambda function for audio transcription.
Good morning, Nuno_Q, thank you very much for answering, but I took a look at the documentation and saw the Event Bridge still doesn't work I put it there in the console as s3 Creat trigger, so that every time I create the event it works, but when I upload it, it won't, in respect to the code, when I run it, it's giving an empty s3 bucket, and I have objects there, look at the new code: import json from urllib.parse import unquote_plus import boto3 import uuid import os
def lambda_handler(event, context):
record = event['Records'][0] domenicoteste1 = record['s3']['bucket']['name'] s3object = record['s3']['object']['key'] file_obj = event["Records"][0] object = unquote_plus(str(file_obj["s3"]["object"]["key"])) s3Path = "s3://" + domenicoteste1 + "/" + s3object jobName = domenicoteste1 + '-' + str(uuid.uuid4()) client = boto3.client('transcribe') response = client.start_transcription_job( TranscriptionJobName=jobName, LanguageCode='pt-BR', MediaFormat='mp3', Media={ 'MediaFileUri': s3Path }, OutputBucketName= "outputeteste1" ) return { 'TranscriptionJobName': response['TranscriptionJob']['TranscriptionJobName'] }
o ERRO é: "errorMessage": "An error occurred (BadRequestException) when calling the StartTranscriptionJob operation: The URI that you provided doesn't point to an S3 object. Make sure that the object exists and try your re
Hi, Did you try adding a trigger from Lambda function configuration console?
Relevant content
- Accepted Answerasked 3 years ago
- asked 3 months ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated a year ago
Good morning, Indranil Banerjee , thank you very much for answering, but I took a look at the documentation and saw the Event Bridge still doesn't work I put it there in the console as s3 Creat trigger, so that every time I create the event it works, but when i upload it does not go. Is there a s3-specific custom Json function that I can put so that every s3 upload runs Lambda?
Hi Domenico - My link does not talk about Eventbridge at all. It is a simple S3 event source for lambda. There is a tutorial as well that shows you how to configure this - https://docs.aws.amazon.com/lambda/latest/dg/with-s3-example.html