AWS SDK for .NET
In this article:
AWS SDK for .NET#
S3 access using aws-sdk-net#
To use AWS SDK for .NET (AWSSDK.core version 3.3.22.3 or later) with NGN Cloud object storage, go through the next steps:
Download credentials for your cloud account as a text file
.sh
.Init environment variables with cloud account credentials.
Create a .NET project and add packages AWSSDK.Core and AWSSDK.S3 from AWS documentation to it.
Add file
endpoints.json
to the project and setCopy to Output Directory: Copy always
to this file, or place it to buildout directory.endpoints.json
{ "endpoints": { "ngn/s3": { "endpoint": "s3.cloud.{region}.com.tr", "auth-region": "ngn" }, "ngn/ec2": { "endpoint": "monitoring.cloud.{region}.com.tr", "auth-region": "ngn" }, "ngn/monitoring": { "endpoint": "ec2.cloud.{region}.com.tr" } }, "partitions": [ { "defaults": { "protocols": [ "https" ], "signatureVersions": [ "v4" ] }, "dnsSuffix": "cloud.ngn.com.tr", "partition": "ngn", "partitionName": "NGN Cloud", "regionRegex": "^ngn$", "regions": { "ngn": { "description": "Main NGN Cloud region" } }, "services": { "ec2": { "defaults": { "hostname": "ec2.cloud.{region}.com.tr", "protocols": [ "http", "https" ] }, "endpoints": { "ngn": {} } }, "monitoring": { "defaults": { "hostname": "monitoring.cloud.{region}.com.tr", "protocols": [ "http", "https" ] }, "endpoints": { "ngn": {} } }, "s3": { "defaults": { "hostname": "s3.cloud.{region}.com.tr", "protocols": [ "http", "https" ], "signatureVersions": [ "s3", "s3v4" ] }, "endpoints": { "ngn": {} } } } } ], "version": 3 }
Add
aws
section toApp.config
file:<aws region="ngn"/>
Create api client:
var client = new AmazonS3Client();