Click here to Skip to main content
15,889,315 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello Guys how do i get the buckets list from amazon web services using javascript or c#..i have accessid and security id..i need to display the bucket names which are present in aws


please help??

What I have tried:

var s3 = new AWS.S3({
accessKeyId: '',
secretAccessKey: ''
});

help??
Posted
Updated 16-Jun-17 22:55pm
Comments
ZurdoDev 16-Jun-17 14:29pm    
I'd check the documentation.

1 solution

using (IAmazonS3 client = new AmazonS3Client(awsAccessID,awsSecretAccessKey , Amazon.RegionEndpoint.USWest2))
{


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 List of buckets in aws..
hope it helps..
Thanks..
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900