hostirosti edited a comment on pull request #4080:
URL: https://github.com/apache/beam/pull/4080#issuecomment-726375395


   @jack749 Do you know how writing to multiple buckets in different regions 
can be configured? Details about the issue I'm running into: 
https://issues.apache.org/jira/browse/BEAM-11257#
   
   What I'd like to do is something like this:
   ```
   public void processElement(ProcessContext c) {
   
   AwsOptions options = c.getPipelineOptions().as(AwsOptions.class);
   
   ... 
   
   options.setAwsCredentialsProvider(<bucket01_auth>);
   
   options.setAwsRegion(<bucket01_region>);
   
   ...
   
   ResourceId resourceId = FileSystems.matchNewResource(<bucket01_filename>, 
false);
   try (WritableByteChannel out = FileSystems.create(resourceId, 
MimeTypes.TEXT))
   
   { out.write(contents); }
   ...
   
   options.setAwsCredentialsProvider(<bucket02_auth>);
   
   options.setAwsRegion(<bucket02_region>);
   resourceId = FileSystems.matchNewResource(<bucket02_filename>, false);
   try (WritableByteChannel out = FileSystems.create(resourceId, 
MimeTypes.TEXT)) { out.write(contents); }
   
   }
   ```


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to