private void PushLogToS3(string key, string log)
{
if (string.IsNullOrEmpty(Settings.ResultsBucket))
return;
try
{
WriteInfo("Pushing log to S3...");
using (var s3 = new Amazon.S3.AmazonS3Client(Credentials, RegionEndpoint))
{
s3.PutObjectAsync(new PutObjectRequest
{
BucketName = Settings.ResultsBucket,
Key = key,
ContentBody = log
}).Wait();
}
}
catch(Exception e)
{
WriteError("Error pushing logs to S3: {0}", e);
}
}