1

I am working on an AWS Elastic Beanstalk app that uploads files to an AWS S3 bucket. The Beanstalk app is a .NET Core Web API app, I've followed this guide (http://docs.aws.amazon.com/sdk-for-net/v3/developer-guide/net-dg-config-netcore.html) and have a credentials file on disk for local development with my shared access key and secret. These are the key and secret of the user that I created an S3 bucket with. That user has full access to S3 through IAM. In local development, the application uploads to S3 without a hiccup.

When I deployed the app to the Elastic Beanstalk platform, upload to S3 doesn't work in the elastic beanstalk environment. Local version is still fine. I deployed the app to AWS Elastic Beanstalk using the AWS Toolkit for visual studio and specified that the app should have S3 full access during the creation process. I have since gone into the instance's role config and verified that it does in fact have S3 full access as a permission. I get an exception that the server terminated the connection abnormally after a timeout when attempting the upload. Is there a step or configuration piece I'm missing? Is there a way I can specify the same shared access key and secret I use locally on the beanstalk app so I can test it? I haven't found a way to give it any credentials from a file or the like.

Thanks, Sam

Sam Ellis
  • 781
  • 2
  • 6
  • 15
  • That's not a permissions error, it's a network error. Is the instance in a private VPC subnet? – Mark B Feb 15 '17 at 23:55
  • No it's not in a private subnet. I point at permissions only because I got this same error earlier when I was using a different account locally than the account I created the S3 bucket with. But it does seems like permissions has nothing to do with it, I must have some other configuration askew. – Sam Ellis Feb 16 '17 at 01:26

1 Answers1

1

For anybody that comes looking with a similar issue. It turned out that my S3 bucket and EB app were in separate regions and this made it so there was a network issue between the two.

Sam Ellis
  • 781
  • 2
  • 6
  • 15
  • 2
    but you can't set a region on an s3 bucket. They have a global region. How do you fix this? – trees_are_great Nov 25 '20 at 13:27
  • 1
    You absolutely set a region on an S3 bucket. They are globally accessible because the bucket (also used as DNS) names are unique so when you reference them from the CLI you can do so without specifying the region: https://stackoverflow.com/questions/36754094/are-s3-buckets-region-specific AWS' own documentation also states this: Amazon S3 creates buckets in a Region that you specify. https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingBucket.html – Sam Ellis Feb 03 '22 at 23:31
  • I stand corrected. Thanks! – trees_are_great Feb 04 '22 at 11:43