First, it seems that this is wrong. Assuming a typo, but will point out anyway:
set upload_max_filesize = 5OM
That should be a 0
right?
set upload_max_filesize = 50M
It also seems like memory_limit
is empty in your post as well?
Anyway, past those settings you should also adjust max_execution_time
and max_input_time
so the upload itself does not timeout. Depends on speed and connection, but getting a proper grip on all of the above should allow you to upload 50MB files without too much issue.
We managed to overcome the "Failed to download authentication credentials" like this:
1) In account B (the one trying to access the remote bucket), look in the Elastic Beanstalk environments' settings for the instance role name it is using (configuration, instances (cog), Instance profile)
2) Still in account B, in the IAM manager, go to Roles and find the ec2 role from the previous step that EB is using for the instances, and attach an inline policy
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "BucketAccess",
"Effect": "Allow",
"Action": [
"s3:List*",
"s3:GetBucketLocation"
],
"Resource": [
"arn:aws:s3:::bucket-of-another-aws-account"
]
},
{
"Sid": "S3ObjectAccess",
"Effect": "Allow",
"Action": [
"s3:GetObject*",
"s3:List*"
],
"Resource": [
"arn:aws:s3:::bucket-of-another-aws-account/*"
]
}
]
}
3) on the target s3 bucket in Account A attach a policy (where 222222222222 is your account no of Account B)
{
"Version": "2012-10-17",
"Statement": {
"Sid": "AccountBAccess1",
"Effect": "Allow",
"Principal": {
"AWS": "222222222222"
},
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::bucket-of-another-aws-account",
"arn:aws:s3:::bucket-of-another-aws-account/*"
]
}
}
I know its a late answer to the OP (made me think of https://xkcd.com/979/ ) but I also could not find any concise or definitive answer in the docs online, and with more people moving to AWS and Elastic Beanstalk I hope this can be of use to others!
Best Answer
If you're using NGINX or other proxy server, it may be related to it's
client_max_body_size
directive. To fix it create folder.ebextensions
in app root, and a file.ebextensions/01_nginx.config
. Then tell build script to add this directive while building your environment, adding this to your created.ebextensions/01_nginx.config
:Commit your folder to git, if you're using it. Then
eb deploy
, cross fingers and try to upload your 6MB PDF.However, according to my experience, sometimes you have to completely rebuild entire environment to make it work.