Overview
Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance. Customers of all sizes and industries can use Amazon S3 to store and protect any amount of data for a range of use cases, such as data lakes, websites, mobile applications, backup and restore, archive, enterprise applications, IoT devices, and big data analytics. Amazon S3 provides management features so that you can optimize, organize, and configure access to your data to meet your specific business, organizational, and compliance requirements.
Connection
- Protocol: AWS SDK.
- Parameters:
- Access Key- (Required)
Access key of the Amazon S3 server.
Secret Key - (Required)
Secret Key of the Amazon S3 server.
Region - (Required)
Region of the Amazon S3 server.
- Access Key- (Required)
Trigger
- Amazon S3 Schedule Pull Documents:
public static async Task<List<S3Object>> GetFile(AmazonS3Option option, string bucketName, string folder){
var s3Client = GetS3Client(option);
var request = new ListObjectsV2Request
{
BucketName = bucketName,
Prefix = folder,
Delimiter = "/"
};
var response = await s3Client.ListObjectsV2Async(request);
return response.S3Objects;
}
Action
- Amazon S3 Send Documents: https://docs.aws.amazon.com/sdkfornet/v3/apidocs/items/S3/TTransferUtility.html
public static async Task Upload(AmazonS3Option option, string bucketName, string key, byte[] content){
var s3Client = GetS3Client(option);
var fileTransferUtility = new TransferUtility(s3Client);
await fileTransferUtility.UploadAsync(new MemoryStream(content), bucketName, key);
}