I successfully created the user, credentials, and bucket.
Now I need to provide access to this user.
Is there any way to get this CanonicalUser value from code?
The user IAM object provides only the values ββof ARN, Path, UserId, and UserName, but none of them are suitable for the provision.
using (var s3 = new Amazon.S3.AmazonS3Client("[user_key]", "[secret_user_key]", RegionEndpoint.GetBySystemName("eu-west-1"))) { var response = s3.GetACL("[bucket_id]"); var acl = response.AccessControlList; acl.AddGrant( new S3Grantee() { CanonicalUser = **???** }, new S3Permission(S3Permission.FULL_CONTROL) ); s3.PutACL( new PutACLRequest() { AccessControlList = acl, BucketName = "[bucket_id]" } ); }
source share