Yes it has max 604800 seconds(7 days) max to exipre..
But
If You have to make public read for ACL and it will be given non expiring url...
obj = s3.bucket(ENV['S3_BUCKET_NAME']).object(object_name)
obj.write(:file => image_location)
obj.acl = :public_read
obj.public_url.to_s
Or you can use scheduler in cloud watch that will run on or before 604800 secs and renew the expiration...
Write a lambda with this
url = s3.generate_presigned_url(
ClientMethod='get_object',
Params={
'Bucket': 'bucket-name',
'Key': 'key-name'
},
ExpiresIn=604800
)
and run it in cloud watch scheduler on or before 7 days(10080)
aws events put-rule --schedule-expression "rate(10079 minute)" --name bef7day