title: Delete Objects from S3 Buckets after 30 minutes not working
body: <p>I have seen this post: <a href="https://stackoverflow.com/questions/40904782/is-it-possible-to-automatically-delete-objects-older-than-10-minutes-in-aws-s3">amazon web services - Is it possible to automatically delete objects older than 10 minutes in AWS S3? - Stack Overflow</a></p>
  
  <p>It says to delete after 10 minues and which is working fine for me using Amazon SQS but we have a limit of max 15 minutes. Now I am trying using Step Functions.</p>
  
  <p>I created a State Machine to trigger a Lambda function with a wait time of 1800 seconds and in task state I gave Lambda ARN, see below Lambda:</p>
  
  <pre><code>import json
  import boto3
  
  def lambda_handler(event, context):
  
  for record in event['Records']:
  v = json.loads(record['body'])
  for rec in v["Records"]:
  
      bucketName = rec["s3"]["bucket"]["name"]
      objectKey = rec["s3"]["object"]["key"]
      #print("bucket is " + bucketName + " and object is " + objectKey )
  
      sss = boto3.resource("s3")
      obj = sss.Object(bucketName, objectKey)
      obj.delete()
  
   return {
  'statusCode': 200,
  'body': json.dumps('Delete Completed.')
  }
  </code></pre>
  
  <p>I have enabled CloudTrail and added S3 bucket in bucket option and other bucket in storage option. Then I created CloudWatch Event for Object Level Monitoring to trigger step function which I created in first Step. </p>
  
  <p>Now issue is with Lambda, It is not able to fetch events from Step Function about bucket name and object. Can anyone help here?</p>