AWS S3:使用.net SDK访问特定存储桶

时间:2022-09-25 18:48:38

The connection model I see in the AWS documentation for the .net SDK is: Connect to the root\site level --> Go to a bucket of your choice.

我在AWS文档中看到的.net SDK的连接模型是:连接到root \ site级别 - >转到您选择的存储桶。

As part of the initial connection to S3, I found no option to define the bucket you wish to land in. This causes a problem with users that only have access to specific buckets, but not to the root level.

作为与S3的初始连接的一部分,我发现没有选项来定义您希望登陆的存储桶。这会导致用户只能访问特定存储桶而不能访问根级别的问题。

It makes sense to me that this should be supported programatically, but the CreateAmazonS3Client method does not allow configuring a landing bucket. Does really any user who wants to access a specific S3 bucket using the .net SDK need to have root-level permissions?

我应该以编程方式支持这一点,但CreateAmazonS3Client方法不允许配置登陆存储桶。是否真的任何想要使用.net SDK访问特定S3存储桶的用户都需要拥有根级权限?

1 个解决方案

#1


0  

Does really any user who wants to access a specific S3 bucket using the .net SDK need to have root-level permissions?

是否真的任何想要使用.net SDK访问特定S3存储桶的用户都需要拥有根级权限?

No. IAM permissions can be used to restrict which buckets a user has access to.

不可以.IAM权限可用于限制用户有权访问哪些存储桶。

http://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html

As part of the initial connection to S3, I found no option to define the bucket you wish to land in.

作为与S3的初始连接的一部分,我发现没有选项来定义您想要登陆的铲斗。

S3 is not an FTP/etc. With the SDK you do not maintain an open connection. Each request you make returns a response from the AWS API.

S3不是FTP /等。使用SDK,您无法保持打开的连接。您发出的每个请求都会从AWS API返回响应。

Checkout the API documentation for the .NET sdk http://docs.aws.amazon.com/sdkfornet/latest/apidocs/Index.html

查看.NET sdk的API文档http://docs.aws.amazon.com/sdkfornet/latest/apidocs/Index.html

ListBuckets() // Lists all of the buckets owned by the authenticated user
ListObjects(String bucketname) // Lists the contents of a bucket

#1


0  

Does really any user who wants to access a specific S3 bucket using the .net SDK need to have root-level permissions?

是否真的任何想要使用.net SDK访问特定S3存储桶的用户都需要拥有根级权限?

No. IAM permissions can be used to restrict which buckets a user has access to.

不可以.IAM权限可用于限制用户有权访问哪些存储桶。

http://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html

As part of the initial connection to S3, I found no option to define the bucket you wish to land in.

作为与S3的初始连接的一部分,我发现没有选项来定义您想要登陆的铲斗。

S3 is not an FTP/etc. With the SDK you do not maintain an open connection. Each request you make returns a response from the AWS API.

S3不是FTP /等。使用SDK,您无法保持打开的连接。您发出的每个请求都会从AWS API返回响应。

Checkout the API documentation for the .NET sdk http://docs.aws.amazon.com/sdkfornet/latest/apidocs/Index.html

查看.NET sdk的API文档http://docs.aws.amazon.com/sdkfornet/latest/apidocs/Index.html

ListBuckets() // Lists all of the buckets owned by the authenticated user
ListObjects(String bucketname) // Lists the contents of a bucket