get-bucket-location

Returns the region the bucket resides in.

See also: GET Bucket Location.

Synopsis

get-bucket-location
  --bucket <value>
  [--cli-input-json <value>]

Options

--bucket (string)

--cli-input-json (string)

Operates a service or services based on the provided JSON string. If other arguments are provided on the command line, the CLI values override the JSON-provided values. You cannot pass arbitrary binary values using a JSON-provided value, because the string is taken literally.

Examples

The following command retrieves the location constraint for a bucket named “my-bucket”, if a constraint exists:

$ aws s3api get-bucket-location --bucket my-bucket

Output:

{
    "LocationConstraint": "us-west-2"
}

Output

LocationConstraint -> (string)