Search code examples
javaamazon-web-servicesamazon-s3emr

Run EMR job with output results in another AWS account S3 bucket


I'm trying to run an EMR job in java where the input files are in the S3 bucket for one account and the output results are written to an S3 bucket for a different account. I understand you can give read/write permissions from one account to the other, but how would specify that the input and output are in different directories?

For example, you might specify the input path as "s3://{bucket-name}/{input-folder}/" and output path as "s3://{bucket-name}/{output-folder}/". How would you specify a bucket in another account?


Solution

  • Ok, I figured it out.

    The reason you can't/don't need to reference an S3 bucket in another account is because S3 buckets are uniquely named. I didn't realize this. Thus, uploading to another account's s3 bucket is as simple as making sure they give you S3 write permissions and uploading the file as you would normally to your own bucket.