aws-cdk-lib.aws_s3.CfnBucket.WebsiteConfigurationProperty

interface WebsiteConfigurationProperty

LanguageType name
.NETAmazon.CDK.AWS.S3.CfnBucket.WebsiteConfigurationProperty
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awss3#CfnBucket_WebsiteConfigurationProperty
Javasoftware.amazon.awscdk.services.s3.CfnBucket.WebsiteConfigurationProperty
Pythonaws_cdk.aws_s3.CfnBucket.WebsiteConfigurationProperty
TypeScript aws-cdk-lib » aws_s3 » CfnBucket » WebsiteConfigurationProperty

Specifies website configuration parameters for an Amazon S3 bucket.

Example

// 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

NameTypeDescription
errorDocument?stringThe name of the error document for the website.
indexDocument?stringThe name of the index document for the website.
redirectAllRequestsTo?IResolvable | RedirectAllRequestsToPropertyThe redirect behavior for every request to this bucket's website endpoint.
routingRules?IResolvable | IResolvable | RoutingRuleProperty[]Rules that define when a redirect is applied and the redirect behavior.

errorDocument?

Type: string (optional)

The name of the error document for the website.


indexDocument?

Type: string (optional)

The name of the index document for the website.


redirectAllRequestsTo?

Type: IResolvable | RedirectAllRequestsToProperty (optional)

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?

Type: IResolvable | IResolvable | RoutingRuleProperty[] (optional)

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