How to get buckets count in aws ( Amazon Web Services ) using C# in ASP.Net

Last Reply 10 days ago By Babloo18v

Posted 11 days ago

Guys how do i know how many buckets are there in amazon web services..?? Using c# i have access id , secret key , i need to get the list of buckets in aws 

 

please help??

You are viewing reply posted by: Babloo18v 10 days ago.
Posted 10 days ago

 

using (IAmazonS3 client = new AmazonS3Client(awsAccessKeyID,awsSecretAccessKEy, Amazon.RegionEndpoint.USEast1))
{
    ListBucketsResponse response = client.ListBuckets();
    List<S3Bucket> buckets = response.Buckets;
    foreach (S3Bucket bucket in buckets)
    {
         Console.WriteLine("Found bucket name {0} created at {1}", bucket.BucketName, bucket.CreationDate);
    }                    
}

This returns the buckets list in aws..

We can check how many buckets are present in aws...

Hope it helps.

I agree, here is the link: https://www.e-iceblue.com/Introduce/spire-office-for-net-free.html?aff_id=108