in src/main/java/software/amazon/qldb/tutorial/ExportJournal.java [326:349]
public static ExportJournalToS3Result createExport(String name, Date startTime, Date endTime, String bucket,
String prefix, S3EncryptionConfiguration s3EncryptionConfiguration,
String roleArn) {
log.info("Let's create a journal export for ledger with name: {}...", name);
S3ExportConfiguration s3ExportConfiguration = new S3ExportConfiguration().withBucket(bucket).withPrefix(prefix)
.withEncryptionConfiguration(s3EncryptionConfiguration);
ExportJournalToS3Request request = new ExportJournalToS3Request()
.withName(name)
.withInclusiveStartTime(startTime)
.withExclusiveEndTime(endTime)
.withS3ExportConfiguration(s3ExportConfiguration)
.withRoleArn(roleArn);
try {
ExportJournalToS3Result result = client.exportJournalToS3(request);
log.info("Requested QLDB to export contents of the journal.");
return result;
} catch (InvalidParameterException ipe) {
log.error("The eventually consistent behavior of the IAM service may cause this export"
+ " to fail its first attempts, please retry.");
throw ipe;
}
}