<ProgramFilesX64>\Microsoft SDKs\Azure\.NET SDK\v2.9\bin\plugins\Diagnostics\Newtonsoft.Json.dll Amazon.Lambda.S3Events AWSSDK.Core AWSSDK.S3 Amazon Amazon.Auth.AccessControlPolicy Amazon.Auth.AccessControlPolicy.ActionIdentifiers Amazon.Internal Amazon.Lambda.S3Events Amazon.MissingTypes Amazon.Runtime Amazon.Runtime.CredentialManagement Amazon.Runtime.CredentialManagement.Internal Amazon.Runtime.EventStreams Amazon.Runtime.EventStreams.Internal Amazon.Runtime.Internal Amazon.Runtime.Internal.Auth Amazon.Runtime.Internal.Settings Amazon.Runtime.Internal.Transform Amazon.Runtime.Internal.Util Amazon.Runtime.SharedInterfaces Amazon.Runtime.SharedInterfaces.Internal Amazon.S3 Amazon.S3.Encryption Amazon.S3.Encryption.Internal Amazon.S3.Internal Amazon.S3.IO Amazon.S3.Model Amazon.S3.Model.Internal.MarshallTransformations Amazon.S3.Transfer Amazon.S3.Util Amazon.Util Amazon.Util.Internal Amazon.Util.Internal.PlatformServices Newtonsoft.Json Newtonsoft.Json.Converters Newtonsoft.Json.Linq Newtonsoft.Json.Schema Newtonsoft.Json.Serialization System System.Diagnostics System.Diagnostics.Tracing System.IO.Compression ThirdParty.BouncyCastle.Asn1 ThirdParty.BouncyCastle.Asn1.Utilities ThirdParty.BouncyCastle.Math ThirdParty.BouncyCastle.OpenSsl ThirdParty.BouncyCastle.Utilities.IO.Pem ThirdParty.Ionic.Zlib ThirdParty.Json.LitJson ThirdParty.MD5 void Main() { var sourcePath = @"S:\Development\Cube Killers\Deidentified DI Import Files\Wake - Deidentified"; var files = Directory.GetFiles(sourcePath, "wfu*.*"); var uploads = files.Select(f => { var s3Name = Regex.Replace(Path.GetFileNameWithoutExtension(f).Replace("_", "/"), @"^(.*)/[\d]{8}$", "${1}"); var subdir = string.Join("/", s3Name.Split('/').TakeAllButLast()); var keyName = s3Name.Split('/').Last(); return new { fullName = f, fileName = Path.GetFileNameWithoutExtension(f), s3Name, subdir, keyName }; }); uploads.Dump("Uploads"); var accessKeyID = Util.GetPassword("aws.sdt-tlamb.accessid"); var secretKey = Util.GetPassword("aws.sdt-tlamb.secretid"); var bucketName = "sdt-glue-hackweek"; var client = new AmazonS3Client(accessKeyID, secretKey, RegionEndpoint.USEast1); var oldFiles = bucketName.AWSListBucket(client).S3Objects.Where(f => f.Key.StartsWith("wfu/")).ToList(); oldFiles.ForEach(f => client.DeleteObject(bucketName, f.Key)); bucketName.AWSListBucket(client).S3Objects.Dump("Before"); uploads.ToList().ForEach(u => u.fullName.AWSUploadAsync(client, bucketName, u.keyName, u.s3Name)); bucketName.AWSListBucket(client).S3Objects.Dump("After"); } // Define other methods and classes here