aws logo
AWS Classic v5.41.0, May 15 23

aws.s3.BucketWebsiteConfigurationV2

Explore with Pulumi AI

Provides an S3 bucket website configuration resource. For more information, see Hosting Websites on S3.

Example Usage

With routing_rule configured

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.S3.BucketWebsiteConfigurationV2("example", new()
    {
        Bucket = aws_s3_bucket.Example.Id,
        IndexDocument = new Aws.S3.Inputs.BucketWebsiteConfigurationV2IndexDocumentArgs
        {
            Suffix = "index.html",
        },
        ErrorDocument = new Aws.S3.Inputs.BucketWebsiteConfigurationV2ErrorDocumentArgs
        {
            Key = "error.html",
        },
        RoutingRules = new[]
        {
            new Aws.S3.Inputs.BucketWebsiteConfigurationV2RoutingRuleArgs
            {
                Condition = new Aws.S3.Inputs.BucketWebsiteConfigurationV2RoutingRuleConditionArgs
                {
                    KeyPrefixEquals = "docs/",
                },
                Redirect = new Aws.S3.Inputs.BucketWebsiteConfigurationV2RoutingRuleRedirectArgs
                {
                    ReplaceKeyPrefixWith = "documents/",
                },
            },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/s3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := s3.NewBucketWebsiteConfigurationV2(ctx, "example", &s3.BucketWebsiteConfigurationV2Args{
			Bucket: pulumi.Any(aws_s3_bucket.Example.Id),
			IndexDocument: &s3.BucketWebsiteConfigurationV2IndexDocumentArgs{
				Suffix: pulumi.String("index.html"),
			},
			ErrorDocument: &s3.BucketWebsiteConfigurationV2ErrorDocumentArgs{
				Key: pulumi.String("error.html"),
			},
			RoutingRules: s3.BucketWebsiteConfigurationV2RoutingRuleArray{
				&s3.BucketWebsiteConfigurationV2RoutingRuleArgs{
					Condition: &s3.BucketWebsiteConfigurationV2RoutingRuleConditionArgs{
						KeyPrefixEquals: pulumi.String("docs/"),
					},
					Redirect: &s3.BucketWebsiteConfigurationV2RoutingRuleRedirectArgs{
						ReplaceKeyPrefixWith: pulumi.String("documents/"),
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.BucketWebsiteConfigurationV2;
import com.pulumi.aws.s3.BucketWebsiteConfigurationV2Args;
import com.pulumi.aws.s3.inputs.BucketWebsiteConfigurationV2IndexDocumentArgs;
import com.pulumi.aws.s3.inputs.BucketWebsiteConfigurationV2ErrorDocumentArgs;
import com.pulumi.aws.s3.inputs.BucketWebsiteConfigurationV2RoutingRuleArgs;
import com.pulumi.aws.s3.inputs.BucketWebsiteConfigurationV2RoutingRuleConditionArgs;
import com.pulumi.aws.s3.inputs.BucketWebsiteConfigurationV2RoutingRuleRedirectArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new BucketWebsiteConfigurationV2("example", BucketWebsiteConfigurationV2Args.builder()        
            .bucket(aws_s3_bucket.example().id())
            .indexDocument(BucketWebsiteConfigurationV2IndexDocumentArgs.builder()
                .suffix("index.html")
                .build())
            .errorDocument(BucketWebsiteConfigurationV2ErrorDocumentArgs.builder()
                .key("error.html")
                .build())
            .routingRules(BucketWebsiteConfigurationV2RoutingRuleArgs.builder()
                .condition(BucketWebsiteConfigurationV2RoutingRuleConditionArgs.builder()
                    .keyPrefixEquals("docs/")
                    .build())
                .redirect(BucketWebsiteConfigurationV2RoutingRuleRedirectArgs.builder()
                    .replaceKeyPrefixWith("documents/")
                    .build())
                .build())
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example = aws.s3.BucketWebsiteConfigurationV2("example",
    bucket=aws_s3_bucket["example"]["id"],
    index_document=aws.s3.BucketWebsiteConfigurationV2IndexDocumentArgs(
        suffix="index.html",
    ),
    error_document=aws.s3.BucketWebsiteConfigurationV2ErrorDocumentArgs(
        key="error.html",
    ),
    routing_rules=[aws.s3.BucketWebsiteConfigurationV2RoutingRuleArgs(
        condition=aws.s3.BucketWebsiteConfigurationV2RoutingRuleConditionArgs(
            key_prefix_equals="docs/",
        ),
        redirect=aws.s3.BucketWebsiteConfigurationV2RoutingRuleRedirectArgs(
            replace_key_prefix_with="documents/",
        ),
    )])
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.s3.BucketWebsiteConfigurationV2("example", {
    bucket: aws_s3_bucket.example.id,
    indexDocument: {
        suffix: "index.html",
    },
    errorDocument: {
        key: "error.html",
    },
    routingRules: [{
        condition: {
            keyPrefixEquals: "docs/",
        },
        redirect: {
            replaceKeyPrefixWith: "documents/",
        },
    }],
});
resources:
  example:
    type: aws:s3:BucketWebsiteConfigurationV2
    properties:
      bucket: ${aws_s3_bucket.example.id}
      indexDocument:
        suffix: index.html
      errorDocument:
        key: error.html
      routingRules:
        - condition:
            keyPrefixEquals: docs/
          redirect:
            replaceKeyPrefixWith: documents/

With routing_rules configured

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.S3.BucketWebsiteConfigurationV2("example", new()
    {
        Bucket = aws_s3_bucket.Example.Id,
        IndexDocument = new Aws.S3.Inputs.BucketWebsiteConfigurationV2IndexDocumentArgs
        {
            Suffix = "index.html",
        },
        ErrorDocument = new Aws.S3.Inputs.BucketWebsiteConfigurationV2ErrorDocumentArgs
        {
            Key = "error.html",
        },
        RoutingRuleDetails = @"[{
    ""Condition"": {
        ""KeyPrefixEquals"": ""docs/""
    },
    ""Redirect"": {
        ""ReplaceKeyPrefixWith"": """"
    }
}]
",
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/s3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := s3.NewBucketWebsiteConfigurationV2(ctx, "example", &s3.BucketWebsiteConfigurationV2Args{
			Bucket: pulumi.Any(aws_s3_bucket.Example.Id),
			IndexDocument: &s3.BucketWebsiteConfigurationV2IndexDocumentArgs{
				Suffix: pulumi.String("index.html"),
			},
			ErrorDocument: &s3.BucketWebsiteConfigurationV2ErrorDocumentArgs{
				Key: pulumi.String("error.html"),
			},
			RoutingRuleDetails: pulumi.String("[{\n    \"Condition\": {\n        \"KeyPrefixEquals\": \"docs/\"\n    },\n    \"Redirect\": {\n        \"ReplaceKeyPrefixWith\": \"\"\n    }\n}]\n"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.BucketWebsiteConfigurationV2;
import com.pulumi.aws.s3.BucketWebsiteConfigurationV2Args;
import com.pulumi.aws.s3.inputs.BucketWebsiteConfigurationV2IndexDocumentArgs;
import com.pulumi.aws.s3.inputs.BucketWebsiteConfigurationV2ErrorDocumentArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new BucketWebsiteConfigurationV2("example", BucketWebsiteConfigurationV2Args.builder()        
            .bucket(aws_s3_bucket.example().id())
            .indexDocument(BucketWebsiteConfigurationV2IndexDocumentArgs.builder()
                .suffix("index.html")
                .build())
            .errorDocument(BucketWebsiteConfigurationV2ErrorDocumentArgs.builder()
                .key("error.html")
                .build())
            .routingRuleDetails("""
[{
    "Condition": {
        "KeyPrefixEquals": "docs/"
    },
    "Redirect": {
        "ReplaceKeyPrefixWith": ""
    }
}]
            """)
            .build());

    }
}
import pulumi
import pulumi_aws as aws

example = aws.s3.BucketWebsiteConfigurationV2("example",
    bucket=aws_s3_bucket["example"]["id"],
    index_document=aws.s3.BucketWebsiteConfigurationV2IndexDocumentArgs(
        suffix="index.html",
    ),
    error_document=aws.s3.BucketWebsiteConfigurationV2ErrorDocumentArgs(
        key="error.html",
    ),
    routing_rule_details="""[{
    "Condition": {
        "KeyPrefixEquals": "docs/"
    },
    "Redirect": {
        "ReplaceKeyPrefixWith": ""
    }
}]
""")
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.s3.BucketWebsiteConfigurationV2("example", {
    bucket: aws_s3_bucket.example.id,
    indexDocument: {
        suffix: "index.html",
    },
    errorDocument: {
        key: "error.html",
    },
    routingRuleDetails: `[{
    "Condition": {
        "KeyPrefixEquals": "docs/"
    },
    "Redirect": {
        "ReplaceKeyPrefixWith": ""
    }
}]
`,
});
resources:
  example:
    type: aws:s3:BucketWebsiteConfigurationV2
    properties:
      bucket: ${aws_s3_bucket.example.id}
      indexDocument:
        suffix: index.html
      errorDocument:
        key: error.html
      routingRuleDetails: |
        [{
            "Condition": {
                "KeyPrefixEquals": "docs/"
            },
            "Redirect": {
                "ReplaceKeyPrefixWith": ""
            }
        }]        

Create BucketWebsiteConfigurationV2 Resource

new BucketWebsiteConfigurationV2(name: string, args: BucketWebsiteConfigurationV2Args, opts?: CustomResourceOptions);
@overload
def BucketWebsiteConfigurationV2(resource_name: str,
                                 opts: Optional[ResourceOptions] = None,
                                 bucket: Optional[str] = None,
                                 error_document: Optional[BucketWebsiteConfigurationV2ErrorDocumentArgs] = None,
                                 expected_bucket_owner: Optional[str] = None,
                                 index_document: Optional[BucketWebsiteConfigurationV2IndexDocumentArgs] = None,
                                 redirect_all_requests_to: Optional[BucketWebsiteConfigurationV2RedirectAllRequestsToArgs] = None,
                                 routing_rule_details: Optional[str] = None,
                                 routing_rules: Optional[Sequence[BucketWebsiteConfigurationV2RoutingRuleArgs]] = None)
@overload
def BucketWebsiteConfigurationV2(resource_name: str,
                                 args: BucketWebsiteConfigurationV2Args,
                                 opts: Optional[ResourceOptions] = None)
func NewBucketWebsiteConfigurationV2(ctx *Context, name string, args BucketWebsiteConfigurationV2Args, opts ...ResourceOption) (*BucketWebsiteConfigurationV2, error)
public BucketWebsiteConfigurationV2(string name, BucketWebsiteConfigurationV2Args args, CustomResourceOptions? opts = null)
public BucketWebsiteConfigurationV2(String name, BucketWebsiteConfigurationV2Args args)
public BucketWebsiteConfigurationV2(String name, BucketWebsiteConfigurationV2Args args, CustomResourceOptions options)
type: aws:s3:BucketWebsiteConfigurationV2
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args BucketWebsiteConfigurationV2Args
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args BucketWebsiteConfigurationV2Args
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args BucketWebsiteConfigurationV2Args
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args BucketWebsiteConfigurationV2Args
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args BucketWebsiteConfigurationV2Args
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

BucketWebsiteConfigurationV2 Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The BucketWebsiteConfigurationV2 resource accepts the following input properties:

Bucket string

Name of the bucket.

ErrorDocument BucketWebsiteConfigurationV2ErrorDocumentArgs

Name of the error document for the website. See below.

ExpectedBucketOwner string

Account ID of the expected bucket owner.

IndexDocument BucketWebsiteConfigurationV2IndexDocumentArgs

Name of the index document for the website. See below.

RedirectAllRequestsTo BucketWebsiteConfigurationV2RedirectAllRequestsToArgs

Redirect behavior for every request to this bucket's website endpoint. See below. Conflicts with error_document, index_document, and routing_rule.

RoutingRuleDetails string

JSON array containing routing rules describing redirect behavior and when redirects are applied. Use this parameter when your routing rules contain empty String values ("") as seen in the example above.

RoutingRules List<BucketWebsiteConfigurationV2RoutingRuleArgs>

List of rules that define when a redirect is applied and the redirect behavior. See below.

Bucket string

Name of the bucket.

ErrorDocument BucketWebsiteConfigurationV2ErrorDocumentArgs

Name of the error document for the website. See below.

ExpectedBucketOwner string

Account ID of the expected bucket owner.

IndexDocument BucketWebsiteConfigurationV2IndexDocumentArgs

Name of the index document for the website. See below.

RedirectAllRequestsTo BucketWebsiteConfigurationV2RedirectAllRequestsToArgs

Redirect behavior for every request to this bucket's website endpoint. See below. Conflicts with error_document, index_document, and routing_rule.

RoutingRuleDetails string

JSON array containing routing rules describing redirect behavior and when redirects are applied. Use this parameter when your routing rules contain empty String values ("") as seen in the example above.

RoutingRules []BucketWebsiteConfigurationV2RoutingRuleArgs

List of rules that define when a redirect is applied and the redirect behavior. See below.

bucket String

Name of the bucket.

errorDocument BucketWebsiteConfigurationV2ErrorDocumentArgs

Name of the error document for the website. See below.

expectedBucketOwner String

Account ID of the expected bucket owner.

indexDocument BucketWebsiteConfigurationV2IndexDocumentArgs

Name of the index document for the website. See below.

redirectAllRequestsTo BucketWebsiteConfigurationV2RedirectAllRequestsToArgs

Redirect behavior for every request to this bucket's website endpoint. See below. Conflicts with error_document, index_document, and routing_rule.

routingRuleDetails String

JSON array containing routing rules describing redirect behavior and when redirects are applied. Use this parameter when your routing rules contain empty String values ("") as seen in the example above.

routingRules List<BucketWebsiteConfigurationV2RoutingRuleArgs>

List of rules that define when a redirect is applied and the redirect behavior. See below.

bucket string

Name of the bucket.

errorDocument BucketWebsiteConfigurationV2ErrorDocumentArgs

Name of the error document for the website. See below.

expectedBucketOwner string

Account ID of the expected bucket owner.

indexDocument BucketWebsiteConfigurationV2IndexDocumentArgs

Name of the index document for the website. See below.

redirectAllRequestsTo BucketWebsiteConfigurationV2RedirectAllRequestsToArgs

Redirect behavior for every request to this bucket's website endpoint. See below. Conflicts with error_document, index_document, and routing_rule.

routingRuleDetails string

JSON array containing routing rules describing redirect behavior and when redirects are applied. Use this parameter when your routing rules contain empty String values ("") as seen in the example above.

routingRules BucketWebsiteConfigurationV2RoutingRuleArgs[]

List of rules that define when a redirect is applied and the redirect behavior. See below.

bucket str

Name of the bucket.

error_document BucketWebsiteConfigurationV2ErrorDocumentArgs

Name of the error document for the website. See below.

expected_bucket_owner str

Account ID of the expected bucket owner.

index_document BucketWebsiteConfigurationV2IndexDocumentArgs

Name of the index document for the website. See below.

redirect_all_requests_to BucketWebsiteConfigurationV2RedirectAllRequestsToArgs

Redirect behavior for every request to this bucket's website endpoint. See below. Conflicts with error_document, index_document, and routing_rule.

routing_rule_details str

JSON array containing routing rules describing redirect behavior and when redirects are applied. Use this parameter when your routing rules contain empty String values ("") as seen in the example above.

routing_rules Sequence[BucketWebsiteConfigurationV2RoutingRuleArgs]

List of rules that define when a redirect is applied and the redirect behavior. See below.

bucket String

Name of the bucket.

errorDocument Property Map

Name of the error document for the website. See below.

expectedBucketOwner String

Account ID of the expected bucket owner.

indexDocument Property Map

Name of the index document for the website. See below.

redirectAllRequestsTo Property Map

Redirect behavior for every request to this bucket's website endpoint. See below. Conflicts with error_document, index_document, and routing_rule.

routingRuleDetails String

JSON array containing routing rules describing redirect behavior and when redirects are applied. Use this parameter when your routing rules contain empty String values ("") as seen in the example above.

routingRules List<Property Map>

List of rules that define when a redirect is applied and the redirect behavior. See below.

Outputs

All input properties are implicitly available as output properties. Additionally, the BucketWebsiteConfigurationV2 resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

WebsiteDomain string

Domain of the website endpoint. This is used to create Route 53 alias records.

WebsiteEndpoint string

Website endpoint.

Id string

The provider-assigned unique ID for this managed resource.

WebsiteDomain string

Domain of the website endpoint. This is used to create Route 53 alias records.

WebsiteEndpoint string

Website endpoint.

id String

The provider-assigned unique ID for this managed resource.

websiteDomain String

Domain of the website endpoint. This is used to create Route 53 alias records.

websiteEndpoint String

Website endpoint.

id string

The provider-assigned unique ID for this managed resource.

websiteDomain string

Domain of the website endpoint. This is used to create Route 53 alias records.

websiteEndpoint string

Website endpoint.

id str

The provider-assigned unique ID for this managed resource.

website_domain str

Domain of the website endpoint. This is used to create Route 53 alias records.

website_endpoint str

Website endpoint.

id String

The provider-assigned unique ID for this managed resource.

websiteDomain String

Domain of the website endpoint. This is used to create Route 53 alias records.

websiteEndpoint String

Website endpoint.

Look up Existing BucketWebsiteConfigurationV2 Resource

Get an existing BucketWebsiteConfigurationV2 resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: BucketWebsiteConfigurationV2State, opts?: CustomResourceOptions): BucketWebsiteConfigurationV2
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        bucket: Optional[str] = None,
        error_document: Optional[BucketWebsiteConfigurationV2ErrorDocumentArgs] = None,
        expected_bucket_owner: Optional[str] = None,
        index_document: Optional[BucketWebsiteConfigurationV2IndexDocumentArgs] = None,
        redirect_all_requests_to: Optional[BucketWebsiteConfigurationV2RedirectAllRequestsToArgs] = None,
        routing_rule_details: Optional[str] = None,
        routing_rules: Optional[Sequence[BucketWebsiteConfigurationV2RoutingRuleArgs]] = None,
        website_domain: Optional[str] = None,
        website_endpoint: Optional[str] = None) -> BucketWebsiteConfigurationV2
func GetBucketWebsiteConfigurationV2(ctx *Context, name string, id IDInput, state *BucketWebsiteConfigurationV2State, opts ...ResourceOption) (*BucketWebsiteConfigurationV2, error)
public static BucketWebsiteConfigurationV2 Get(string name, Input<string> id, BucketWebsiteConfigurationV2State? state, CustomResourceOptions? opts = null)
public static BucketWebsiteConfigurationV2 get(String name, Output<String> id, BucketWebsiteConfigurationV2State state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Bucket string

Name of the bucket.

ErrorDocument BucketWebsiteConfigurationV2ErrorDocumentArgs

Name of the error document for the website. See below.

ExpectedBucketOwner string

Account ID of the expected bucket owner.

IndexDocument BucketWebsiteConfigurationV2IndexDocumentArgs

Name of the index document for the website. See below.

RedirectAllRequestsTo BucketWebsiteConfigurationV2RedirectAllRequestsToArgs

Redirect behavior for every request to this bucket's website endpoint. See below. Conflicts with error_document, index_document, and routing_rule.

RoutingRuleDetails string

JSON array containing routing rules describing redirect behavior and when redirects are applied. Use this parameter when your routing rules contain empty String values ("") as seen in the example above.

RoutingRules List<BucketWebsiteConfigurationV2RoutingRuleArgs>

List of rules that define when a redirect is applied and the redirect behavior. See below.

WebsiteDomain string

Domain of the website endpoint. This is used to create Route 53 alias records.

WebsiteEndpoint string

Website endpoint.

Bucket string

Name of the bucket.

ErrorDocument BucketWebsiteConfigurationV2ErrorDocumentArgs

Name of the error document for the website. See below.

ExpectedBucketOwner string

Account ID of the expected bucket owner.

IndexDocument BucketWebsiteConfigurationV2IndexDocumentArgs

Name of the index document for the website. See below.

RedirectAllRequestsTo BucketWebsiteConfigurationV2RedirectAllRequestsToArgs

Redirect behavior for every request to this bucket's website endpoint. See below. Conflicts with error_document, index_document, and routing_rule.

RoutingRuleDetails string

JSON array containing routing rules describing redirect behavior and when redirects are applied. Use this parameter when your routing rules contain empty String values ("") as seen in the example above.

RoutingRules []BucketWebsiteConfigurationV2RoutingRuleArgs

List of rules that define when a redirect is applied and the redirect behavior. See below.

WebsiteDomain string

Domain of the website endpoint. This is used to create Route 53 alias records.

WebsiteEndpoint string

Website endpoint.

bucket String

Name of the bucket.

errorDocument BucketWebsiteConfigurationV2ErrorDocumentArgs

Name of the error document for the website. See below.

expectedBucketOwner String

Account ID of the expected bucket owner.

indexDocument BucketWebsiteConfigurationV2IndexDocumentArgs

Name of the index document for the website. See below.

redirectAllRequestsTo BucketWebsiteConfigurationV2RedirectAllRequestsToArgs

Redirect behavior for every request to this bucket's website endpoint. See below. Conflicts with error_document, index_document, and routing_rule.

routingRuleDetails String

JSON array containing routing rules describing redirect behavior and when redirects are applied. Use this parameter when your routing rules contain empty String values ("") as seen in the example above.

routingRules List<BucketWebsiteConfigurationV2RoutingRuleArgs>

List of rules that define when a redirect is applied and the redirect behavior. See below.

websiteDomain String

Domain of the website endpoint. This is used to create Route 53 alias records.

websiteEndpoint String

Website endpoint.

bucket string

Name of the bucket.

errorDocument BucketWebsiteConfigurationV2ErrorDocumentArgs

Name of the error document for the website. See below.

expectedBucketOwner string

Account ID of the expected bucket owner.

indexDocument BucketWebsiteConfigurationV2IndexDocumentArgs

Name of the index document for the website. See below.

redirectAllRequestsTo BucketWebsiteConfigurationV2RedirectAllRequestsToArgs

Redirect behavior for every request to this bucket's website endpoint. See below. Conflicts with error_document, index_document, and routing_rule.

routingRuleDetails string

JSON array containing routing rules describing redirect behavior and when redirects are applied. Use this parameter when your routing rules contain empty String values ("") as seen in the example above.

routingRules BucketWebsiteConfigurationV2RoutingRuleArgs[]

List of rules that define when a redirect is applied and the redirect behavior. See below.

websiteDomain string

Domain of the website endpoint. This is used to create Route 53 alias records.

websiteEndpoint string

Website endpoint.

bucket str

Name of the bucket.

error_document BucketWebsiteConfigurationV2ErrorDocumentArgs

Name of the error document for the website. See below.

expected_bucket_owner str

Account ID of the expected bucket owner.

index_document BucketWebsiteConfigurationV2IndexDocumentArgs

Name of the index document for the website. See below.

redirect_all_requests_to BucketWebsiteConfigurationV2RedirectAllRequestsToArgs

Redirect behavior for every request to this bucket's website endpoint. See below. Conflicts with error_document, index_document, and routing_rule.

routing_rule_details str

JSON array containing routing rules describing redirect behavior and when redirects are applied. Use this parameter when your routing rules contain empty String values ("") as seen in the example above.

routing_rules Sequence[BucketWebsiteConfigurationV2RoutingRuleArgs]

List of rules that define when a redirect is applied and the redirect behavior. See below.

website_domain str

Domain of the website endpoint. This is used to create Route 53 alias records.

website_endpoint str

Website endpoint.

bucket String

Name of the bucket.

errorDocument Property Map

Name of the error document for the website. See below.

expectedBucketOwner String

Account ID of the expected bucket owner.

indexDocument Property Map

Name of the index document for the website. See below.

redirectAllRequestsTo Property Map

Redirect behavior for every request to this bucket's website endpoint. See below. Conflicts with error_document, index_document, and routing_rule.

routingRuleDetails String

JSON array containing routing rules describing redirect behavior and when redirects are applied. Use this parameter when your routing rules contain empty String values ("") as seen in the example above.

routingRules List<Property Map>

List of rules that define when a redirect is applied and the redirect behavior. See below.

websiteDomain String

Domain of the website endpoint. This is used to create Route 53 alias records.

websiteEndpoint String

Website endpoint.

Supporting Types

BucketWebsiteConfigurationV2ErrorDocument

Key string

Object key name to use when a 4XX class error occurs.

Key string

Object key name to use when a 4XX class error occurs.

key String

Object key name to use when a 4XX class error occurs.

key string

Object key name to use when a 4XX class error occurs.

key str

Object key name to use when a 4XX class error occurs.

key String

Object key name to use when a 4XX class error occurs.

BucketWebsiteConfigurationV2IndexDocument

Suffix string

Suffix that is appended to a request that is for a directory on the website endpoint. For example, if the suffix is index.html and you make a request to samplebucket/images/, the data that is returned will be for the object with the key name images/index.html. The suffix must not be empty and must not include a slash character.

Suffix string

Suffix that is appended to a request that is for a directory on the website endpoint. For example, if the suffix is index.html and you make a request to samplebucket/images/, the data that is returned will be for the object with the key name images/index.html. The suffix must not be empty and must not include a slash character.

suffix String

Suffix that is appended to a request that is for a directory on the website endpoint. For example, if the suffix is index.html and you make a request to samplebucket/images/, the data that is returned will be for the object with the key name images/index.html. The suffix must not be empty and must not include a slash character.

suffix string

Suffix that is appended to a request that is for a directory on the website endpoint. For example, if the suffix is index.html and you make a request to samplebucket/images/, the data that is returned will be for the object with the key name images/index.html. The suffix must not be empty and must not include a slash character.

suffix str

Suffix that is appended to a request that is for a directory on the website endpoint. For example, if the suffix is index.html and you make a request to samplebucket/images/, the data that is returned will be for the object with the key name images/index.html. The suffix must not be empty and must not include a slash character.

suffix String

Suffix that is appended to a request that is for a directory on the website endpoint. For example, if the suffix is index.html and you make a request to samplebucket/images/, the data that is returned will be for the object with the key name images/index.html. The suffix must not be empty and must not include a slash character.

BucketWebsiteConfigurationV2RedirectAllRequestsTo

HostName string

Name of the host where requests are redirected.

Protocol string

Protocol to use when redirecting requests. The default is the protocol that is used in the original request. Valid values: http, https.

HostName string

Name of the host where requests are redirected.

Protocol string

Protocol to use when redirecting requests. The default is the protocol that is used in the original request. Valid values: http, https.

hostName String

Name of the host where requests are redirected.

protocol String

Protocol to use when redirecting requests. The default is the protocol that is used in the original request. Valid values: http, https.

hostName string

Name of the host where requests are redirected.

protocol string

Protocol to use when redirecting requests. The default is the protocol that is used in the original request. Valid values: http, https.

host_name str

Name of the host where requests are redirected.

protocol str

Protocol to use when redirecting requests. The default is the protocol that is used in the original request. Valid values: http, https.

hostName String

Name of the host where requests are redirected.

protocol String

Protocol to use when redirecting requests. The default is the protocol that is used in the original request. Valid values: http, https.

BucketWebsiteConfigurationV2RoutingRule

Redirect BucketWebsiteConfigurationV2RoutingRuleRedirect

Configuration block for redirect information. See below.

Condition BucketWebsiteConfigurationV2RoutingRuleCondition

Configuration block for describing a condition that must be met for the specified redirect to apply. See below.

Redirect BucketWebsiteConfigurationV2RoutingRuleRedirect

Configuration block for redirect information. See below.

Condition BucketWebsiteConfigurationV2RoutingRuleCondition

Configuration block for describing a condition that must be met for the specified redirect to apply. See below.

redirect BucketWebsiteConfigurationV2RoutingRuleRedirect

Configuration block for redirect information. See below.

condition BucketWebsiteConfigurationV2RoutingRuleCondition

Configuration block for describing a condition that must be met for the specified redirect to apply. See below.

redirect BucketWebsiteConfigurationV2RoutingRuleRedirect

Configuration block for redirect information. See below.

condition BucketWebsiteConfigurationV2RoutingRuleCondition

Configuration block for describing a condition that must be met for the specified redirect to apply. See below.

redirect BucketWebsiteConfigurationV2RoutingRuleRedirect

Configuration block for redirect information. See below.

condition BucketWebsiteConfigurationV2RoutingRuleCondition

Configuration block for describing a condition that must be met for the specified redirect to apply. See below.

redirect Property Map

Configuration block for redirect information. See below.

condition Property Map

Configuration block for describing a condition that must be met for the specified redirect to apply. See below.

BucketWebsiteConfigurationV2RoutingRuleCondition

HttpErrorCodeReturnedEquals string

HTTP error code when the redirect is applied. If specified with key_prefix_equals, then both must be true for the redirect to be applied.

KeyPrefixEquals string

Object key name prefix when the redirect is applied. If specified with http_error_code_returned_equals, then both must be true for the redirect to be applied.

HttpErrorCodeReturnedEquals string

HTTP error code when the redirect is applied. If specified with key_prefix_equals, then both must be true for the redirect to be applied.

KeyPrefixEquals string

Object key name prefix when the redirect is applied. If specified with http_error_code_returned_equals, then both must be true for the redirect to be applied.

httpErrorCodeReturnedEquals String

HTTP error code when the redirect is applied. If specified with key_prefix_equals, then both must be true for the redirect to be applied.

keyPrefixEquals String

Object key name prefix when the redirect is applied. If specified with http_error_code_returned_equals, then both must be true for the redirect to be applied.

httpErrorCodeReturnedEquals string

HTTP error code when the redirect is applied. If specified with key_prefix_equals, then both must be true for the redirect to be applied.

keyPrefixEquals string

Object key name prefix when the redirect is applied. If specified with http_error_code_returned_equals, then both must be true for the redirect to be applied.

http_error_code_returned_equals str

HTTP error code when the redirect is applied. If specified with key_prefix_equals, then both must be true for the redirect to be applied.

key_prefix_equals str

Object key name prefix when the redirect is applied. If specified with http_error_code_returned_equals, then both must be true for the redirect to be applied.

httpErrorCodeReturnedEquals String

HTTP error code when the redirect is applied. If specified with key_prefix_equals, then both must be true for the redirect to be applied.

keyPrefixEquals String

Object key name prefix when the redirect is applied. If specified with http_error_code_returned_equals, then both must be true for the redirect to be applied.

BucketWebsiteConfigurationV2RoutingRuleRedirect

HostName string

Host name to use in the redirect request.

HttpRedirectCode string

HTTP redirect code to use on the response.

Protocol string

Protocol to use when redirecting requests. The default is the protocol that is used in the original request. Valid values: http, https.

ReplaceKeyPrefixWith string

Object key prefix to use in the redirect request. For example, to redirect requests for all pages with prefix docs/ (objects in the docs/ folder) to documents/, you can set a condition block with key_prefix_equals set to docs/ and in the redirect set replace_key_prefix_with to /documents.

ReplaceKeyWith string

Specific object key to use in the redirect request. For example, redirect request to error.html.

HostName string

Host name to use in the redirect request.

HttpRedirectCode string

HTTP redirect code to use on the response.

Protocol string

Protocol to use when redirecting requests. The default is the protocol that is used in the original request. Valid values: http, https.

ReplaceKeyPrefixWith string

Object key prefix to use in the redirect request. For example, to redirect requests for all pages with prefix docs/ (objects in the docs/ folder) to documents/, you can set a condition block with key_prefix_equals set to docs/ and in the redirect set replace_key_prefix_with to /documents.

ReplaceKeyWith string

Specific object key to use in the redirect request. For example, redirect request to error.html.

hostName String

Host name to use in the redirect request.

httpRedirectCode String

HTTP redirect code to use on the response.

protocol String

Protocol to use when redirecting requests. The default is the protocol that is used in the original request. Valid values: http, https.

replaceKeyPrefixWith String

Object key prefix to use in the redirect request. For example, to redirect requests for all pages with prefix docs/ (objects in the docs/ folder) to documents/, you can set a condition block with key_prefix_equals set to docs/ and in the redirect set replace_key_prefix_with to /documents.

replaceKeyWith String

Specific object key to use in the redirect request. For example, redirect request to error.html.

hostName string

Host name to use in the redirect request.

httpRedirectCode string

HTTP redirect code to use on the response.

protocol string

Protocol to use when redirecting requests. The default is the protocol that is used in the original request. Valid values: http, https.

replaceKeyPrefixWith string

Object key prefix to use in the redirect request. For example, to redirect requests for all pages with prefix docs/ (objects in the docs/ folder) to documents/, you can set a condition block with key_prefix_equals set to docs/ and in the redirect set replace_key_prefix_with to /documents.

replaceKeyWith string

Specific object key to use in the redirect request. For example, redirect request to error.html.

host_name str

Host name to use in the redirect request.

http_redirect_code str

HTTP redirect code to use on the response.

protocol str

Protocol to use when redirecting requests. The default is the protocol that is used in the original request. Valid values: http, https.

replace_key_prefix_with str

Object key prefix to use in the redirect request. For example, to redirect requests for all pages with prefix docs/ (objects in the docs/ folder) to documents/, you can set a condition block with key_prefix_equals set to docs/ and in the redirect set replace_key_prefix_with to /documents.

replace_key_with str

Specific object key to use in the redirect request. For example, redirect request to error.html.

hostName String

Host name to use in the redirect request.

httpRedirectCode String

HTTP redirect code to use on the response.

protocol String

Protocol to use when redirecting requests. The default is the protocol that is used in the original request. Valid values: http, https.

replaceKeyPrefixWith String

Object key prefix to use in the redirect request. For example, to redirect requests for all pages with prefix docs/ (objects in the docs/ folder) to documents/, you can set a condition block with key_prefix_equals set to docs/ and in the redirect set replace_key_prefix_with to /documents.

replaceKeyWith String

Specific object key to use in the redirect request. For example, redirect request to error.html.

Import

S3 bucket website configuration can be imported in one of two ways. If the owner (account ID) of the source bucket is the same account used to configure the AWS Provider, the S3 bucket website configuration resource should be imported using the bucket e.g.,

 $ pulumi import aws:s3/bucketWebsiteConfigurationV2:BucketWebsiteConfigurationV2 example bucket-name

If the owner (account ID) of the source bucket differs from the account used to configure the AWS Provider, the S3 bucket website configuration resource should be imported using the bucket and expected_bucket_owner separated by a comma (,) e.g.,

 $ pulumi import aws:s3/bucketWebsiteConfigurationV2:BucketWebsiteConfigurationV2 example bucket-name,123456789012

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.