Skip to content

Instantly share code, notes, and snippets.

@rwblair
Created July 30, 2018 21:19
Show Gist options
  • Save rwblair/5a37a080a79f37ed1de2ba9fef81a021 to your computer and use it in GitHub Desktop.
Save rwblair/5a37a080a79f37ed1de2ba9fef81a021 to your computer and use it in GitHub Desktop.
~/projects/s3-test $ aws s3api list-object-versions --bucket 907245365968-test | grep VersionId
"VersionId": "7gJ1tHgIOA7DHI4zMCF2WGIKwWheVson",
"VersionId": "396V1OKMHM0QBnRBSoL8Rh5EdhVoYg63",
~/projects/s3-test $ curl https://s3.amazonaws.com/907245365968-test/a.txt?versionId=7gJ1tHgIOA7DHI4zMCF2WGIKwWheVson
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>A5D078F3B89ED356</RequestId><HostId>wG6NFU3MLIq6XwNM53fmvCjyZZY+LeSWz1zj3fQrKFAT9uNgATnFWEtOzaoteZwn4HuX+8bV0uY=</HostId></Error>
~/projects/s3-test $ aws s3api put-object-acl --bucket 907245365968-test --key a.txt --acl public-read --version-id 7gJ1tHgIOA7DHI4zMCF2WGIKwWheVson
~/projects/s3-test $ curl https://s3.amazonaws.com/907245365968-test/a.txt?versionId=7gJ1tHgIOA7DHI4zMCF2WGIKwWheVson
a.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment