AWS SDK for .NET Documentation
GetBucketLocation Method (request)
AmazonAmazon.S3AmazonS3ClientGetBucketLocation(GetBucketLocationRequest) Did this page help you?   Yes   No    Tell us about it...
Returns the location of a specified bucket.
Declaration Syntax
C#
public GetBucketLocationResponse GetBucketLocation(
	GetBucketLocationRequest request
)
Parameters
request (GetBucketLocationRequest)
The GetBucketLocationRequest that defines the parameters of the operation.
Return Value
Returns a GetBucketLocationResponse from S3.
Remarks
The information returned can be used to determine the bucket's geographical location. To determine the location of a bucket, you must be the bucket owner.
Examples

This example shows how to retrieve the location of a bucket.

CopyGetBucketLocation sample
// Create a client
AmazonS3Client client = new AmazonS3Client();

// Construct request
GetBucketLocationRequest request = new GetBucketLocationRequest
{
    BucketName = "SampleBucket"
};

// Issue call
GetBucketLocationResponse response = client.GetBucketLocation(request);

// View response data
Console.WriteLine("Bucket location - {0}", response.Location);
Exceptions

Assembly: AWSSDK (Module: AWSSDK) Version: 1.5.60.0 (1.5.60.0)