# WebsiteConfigurationProperty

Specifies website configuration parameters for an Amazon S3 bucket.

- Source: Generated code
- Type last changed: v2.93.0 · 23 Aug 2023

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_s3 as s3 } from 'aws-cdk-lib';
const websiteConfigurationProperty: s3.CfnBucket.WebsiteConfigurationProperty = {
  errorDocument: 'errorDocument',
  indexDocument: 'indexDocument',
  redirectAllRequestsTo: {
    hostName: 'hostName',

    // the properties below are optional
    protocol: 'protocol',
  },
  routingRules: [{
    redirectRule: {
      hostName: 'hostName',
      httpRedirectCode: 'httpRedirectCode',
      protocol: 'protocol',
      replaceKeyPrefixWith: 'replaceKeyPrefixWith',
      replaceKeyWith: 'replaceKeyWith',
    },

    // the properties below are optional
    routingRuleCondition: {
      httpErrorCodeReturnedEquals: 'httpErrorCodeReturnedEquals',
      keyPrefixEquals: 'keyPrefixEquals',
    },
  }],
};
```

## Properties

- `errorDocument`: string — The name of the error document for the website.

- `indexDocument`: string — The name of the index document for the website.

- `redirectAllRequestsTo`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnBucket.RedirectAllRequestsToProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_s3.CfnBucket.RedirectAllRequestsToProperty.html) — The redirect behavior for every request to this bucket's website endpoint.

  > If you specify this property, you can't specify any other property.

- `routingRules`: [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnBucket.RoutingRuleProperty](/cdk/api/v2/docs/aws-cdk-lib.aws_s3.CfnBucket.RoutingRuleProperty.html)[] — Rules that define when a redirect is applied and the redirect behavior.
