2 réponses
- Le plus récent
- Le plus de votes
- La plupart des commentaires
0
Hello
you could do something like
make all uploaded files public
aws s3 sync . s3://my-bucket/path --acl public-read
the cp command also allows the use of the --acl and it may use other values like public-read-write or bucket-owner-full-control
aws s3 cp s3://mybucket/test.txt s3://mybucket/test2.txt --acl public-read-write
https://docs.aws.amazon.com/cli/latest/userguide/cli-services-s3-commands.html
https://docs.aws.amazon.com/cli/latest/reference/s3/cp.html#examples
hope this helps
RT
répondu il y a 5 ans
0
Thanks, I found I missed AWS_DEFAULT_REGION=cn-north-1, that made it returns Invalid Token
I solved my problem by:
1 Added AWS_DEFAULT_REGION before run my command
2 Allowed S3:PubObjectAcl to my role:
{
"Sid": "Stmt2",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws-cn:iam::AccountB-ID:role/MyPutObjectRole"
},
"Action": ["s3:PutObject","s3:PutObjectAcl"],
"Resource": "arn:aws-cn:s3:::MyPublicBucket/*"
}
3 use:
aws s3 cp xxx.txt s3://myPublicBucket --acl public-read
répondu il y a 5 ans
Contenus pertinents
- demandé il y a un an
- demandé il y a 6 mois
- demandé il y a un an
- AWS OFFICIELA mis à jour il y a 2 ans
- AWS OFFICIELA mis à jour il y a un an