0

When i am trying to copy video objects(9GB .mp4 files) between buckets within same vpc of AWS, keep getting operation timed out after 10.02 seconds. My lambda function doesnt have a timeout specified , looks like this may be happening internally in the copy operation of s3

Here is the code from how to copy s3 object from one bucket to another using python boto3 i am using

 import boto3
 s3 = boto3.resource('s3')
 copy_source = {
      'Bucket': 'mybucket',
      'Key': 'mykey'
    }
 final_bucket = s3.Bucket('otherbucket')
 final_bucket.copy(copy_source, 'otherkey')

I tried using the following but this may not work, can any one have some idea please let me know

 config = Config(connect_timeout=5, retries={'max_attempts': 2})
 final_bucket = s3.Bucket('finalbucketname')
 final_bucket.copy(copy_source, 'otherbucket',config=config)

 Encountered a copy exception: __init__() got an unexpected keyword argument 'connect_timeout'
codeexplorer
  • 409
  • 1
  • 6
  • 19
  • 1
    It seems like your Boto can't connect to S3 endpoints. Has nothing to do with COPY operation itself. Can you read the source file (at least part of it) to begin with? – Sergey Kovalev May 15 '18 at 07:54
  • If your Lambda functions are running in a VPC, there are only two ways to send a request to S3: using the Internet via a NAT Gateway or NAT Instance, or an S3 VPC Endpoint. Which of these two things is available to the subnets with which your Lambda function is associated? – Michael - sqlbot May 15 '18 at 09:48

0 Answers0