Profile option on AmazonS3Client

0

The .NET client for AmazonS3Client has an option to pass 'Region' via its constructor. But I did not see an option for providing 'profile'. Is there a way of specifying profile?

已提問 2 年前檢視次數 470 次
1 個回答
2

Please refer to the documentation. You can specify a profile (either from the shared credentials file or from a custom file) by using the CredentialProfileStoreChain class and obtaining an AWSCredentials object:

var storeChain = new CredentialProfileStoreChain();
if (storeChain.TryGetAWSCredentials("some_profile", out var awsCredentials))
{
    // Use awsCredentials to create an Amazon S3 service client
    using var client = new AmazonS3Client(awsCredentials);
}
profile pictureAWS
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南