-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
copy_to and move_to on Aws::S3::Object don't work with access point ARNs #2482
Comments
Thanks for opening up an issue. I'm taking a look. As a general FYI, Resource models are unmaintained because they're buggy and code generated around hand-maintained definition file that in itself has limitations. Have you tried with the client API copy_object method? |
Additionally - you can pass This should work: object.move_to(bucket: bucket_arn, key: new_key) |
Please try the workarounds (client API with no resource model usage or passing bucket to |
Thanks for the fast response! @alextwoods I tried your suggestion but it then fails with:
I guess the Unfortunately I can't easily switch to the client API because the higher level library we use in a legacy project (https://github.com/sorentwo/carrierwave-aws) is build around the resource model. Again, thanks for you fast help. Feel free to close this issue. |
Actually, I think you can still use resource models for this, provided you initialize If this doesn't work, I would agree, either not use accesspoint with resource models or somehow find a way to use the official client API. Just a bit of background, S3 was insistent on making this a client side feature. Our Client APIs handle this behavior through our plugin system but the hand written resource API models do not handle these kinds of abstractions. You can see bucket.rb above as a monkey patch. |
Hi @mullermp, the bucket version also doesn't work:
Anyway, we have switched to a version without accesspoint now and everthing is working as expected. |
@roccoblues - Sorry that was still not working and that you had to switch to a version without accesspoint. When I test locally I the code that I suggested was working: bucket_arn = 'arn:aws:s3:us-west-2:123456789012:accesspoint/myendpoint'
key = 'foo'
new_key = 'bar'
object = Aws::S3::Object.new(bucket_arn, key, client: client)
object.exists?
object.move_to(bucket: bucket_arn, key: new_key) This results in the following SDK calls:
Do you have any more sample code or any other differences? |
Describe the bug
copy_to
andmove_to
onAws::S3::Object
don't work with access point ARNs.Gem name ('aws-sdk', 'aws-sdk-resources' or service gems like 'aws-sdk-s3') and its version
aws-sdk-s3
Version of Ruby, OS environment
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
To Reproduce (observed behavior)
Expected behavior
No ArgumentError should be raised and the
copy_to
/move_to
operation should succeed.The text was updated successfully, but these errors were encountered: