I am trying to connect to AWS S3 bucket from AWS lambda.
I am using aws-sdk-s3 gem.
My code working fine on local machine. I was able to upload files to S3. But the same code giving timeout on lambda.
def client
Aws::S3::Client.new({
region: 'ap-south-1',
credentials: Aws::Credentials.new(
'',
''
)
})
end
def resource
Aws::S3::Resource.new(client: client)
end
def bucket
resource.bucket(bucket_name)
end
Should I do something more to make this code run on lambda?