Skip to content

S3  >  Operations  >  get_bucket_website

get_bucket_website

Operation

get_bucket_website async

get_bucket_website(request: GetBucketWebsiteInput | GetBucketWebsiteInputDict, /, *, plugins: list[Plugin] | None = None) -> GetBucketWebsiteOutput
get_bucket_website(*, plugins: list[Plugin] | None = None, **kwargs: Unpack[GetBucketWebsiteInputDict]) -> GetBucketWebsiteOutput
Note

This operation is not supported for directory buckets.

Returns the website configuration for a bucket. To host website on Amazon S3, you can configure a bucket as website by adding a website configuration. For more information about hosting websites, see Hosting Websites on Amazon S3.

This GET action requires the S3:GetBucketWebsite permission. By default, only the bucket owner can read the bucket website configuration. However, bucket owners can allow other users to read the website configuration by writing a bucket policy granting them the S3:GetBucketWebsite permission.

The following operations are related to GetBucketWebsite:

Warning

You must URL encode any signed header values that contain spaces. For example, if your header value is my file.txt, containing two spaces after my, you must URL encode this value to my%20%20file.txt.

Parameters:

Name Type Description Default
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
GetBucketWebsiteOutput

An instance of GetBucketWebsiteOutput.

Input

Pass the input fields as keyword arguments, or pass a model or dictionary as the first positional argument. Pass plugins separately as a keyword argument.

Model

GetBucketWebsiteInput dataclass

Bases: _SerdeShape

Dataclass for GetBucketWebsiteInput structure.

Attributes
bucket class-attribute instance-attribute
bucket: str | None = ...

The bucket name for which to get the website configuration.

expected_bucket_owner class-attribute instance-attribute
expected_bucket_owner: str | None = ...

The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

Dictionaries

GetBucketWebsiteInputDict

Bases: TypedDict

Dictionary form of GetBucketWebsiteInput.

Attributes
bucket instance-attribute
bucket: Required[str]

The bucket name for which to get the website configuration.

expected_bucket_owner instance-attribute
expected_bucket_owner: str | None

The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

Output

GetBucketWebsiteOutput dataclass

Bases: _SerdeShape

Dataclass for GetBucketWebsiteOutput structure.

Attributes

error_document class-attribute instance-attribute
error_document: ErrorDocument | None = ...

The object key name of the website error document to use for 4XX class errors.

index_document class-attribute instance-attribute
index_document: IndexDocument | None = ...

The name of the index document for the website (for example index.html).

redirect_all_requests_to class-attribute instance-attribute
redirect_all_requests_to: RedirectAllRequestsTo | None = ...

Specifies the redirect behavior of all requests to a website endpoint of an Amazon S3 bucket.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.

routing_rules class-attribute instance-attribute
routing_rules: list[RoutingRule] | None = ...

Rules that define when a redirect is applied and the redirect behavior.