Skip to content
v2.274.0

WebsiteConfigurationProperty Struct ​

Specifies website configuration parameters for an Amazon S3 bucket.

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 ​

errorDocumentstringerror_documentstrerrorDocumentStringErrorDocumentstringErrorDocument*string#
The name of the error document for the website.
indexDocumentstringindex_documentstrindexDocumentStringIndexDocumentstringIndexDocument*string#
The name of the index document for the website.
redirectAllRequestsToIResolvable | CfnBucket.RedirectAllRequestsToPropertyredirect_all_requests_totyping.Union[IResolvable, RedirectAllRequestsToProperty]redirectAllRequestsToIResolvableRedirectAllRequestsToIResolvableRedirectAllRequestsTointerface{}#
The redirect behavior for every request to this bucket's website endpoint.

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

routingRulesIResolvable | IResolvable | CfnBucket.RoutingRuleProperty[]routing_rulestyping.Union[IResolvable, typing.List[typing.Union[IResolvable, RoutingRuleProperty]]]routingRulesIResolvableRoutingRulesIResolvableRoutingRulesinterface{}#
Rules that define when a redirect is applied and the redirect behavior.