aws.s3.BucketWebsiteConfigurationV2
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 Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.S3.BucketWebsiteConfigurationV2("example", new()
{
Bucket = aws_s3_bucket.Example.Bucket,
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.Bucket),
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().bucket())
.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"]["bucket"],
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.bucket,
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.bucket}
indexDocument:
suffix: index.html
errorDocument:
key: error.html
routingRules:
- condition:
keyPrefixEquals: docs/
redirect:
replaceKeyPrefixWith: documents/
With routing_rules
configured
using System.Collections.Generic;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var example = new Aws.S3.BucketWebsiteConfigurationV2("example", new()
{
Bucket = aws_s3_bucket.Example.Bucket,
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 (
"fmt"
"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.Bucket),
IndexDocument: &s3.BucketWebsiteConfigurationV2IndexDocumentArgs{
Suffix: pulumi.String("index.html"),
},
ErrorDocument: &s3.BucketWebsiteConfigurationV2ErrorDocumentArgs{
Key: pulumi.String("error.html"),
},
RoutingRuleDetails: pulumi.String(fmt.Sprintf(`[{
"Condition": {
"KeyPrefixEquals": "docs/"
},
"Redirect": {
"ReplaceKeyPrefixWith": ""
}
}]
`)),
})
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().bucket())
.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"]["bucket"],
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.bucket,
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.bucket}
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
The name of the bucket.
- Error
Document BucketWebsite Configuration V2Error Document Args The name of the error document for the website detailed below.
- Expected
Bucket stringOwner The account ID of the expected bucket owner.
- Index
Document BucketWebsite Configuration V2Index Document Args The name of the index document for the website detailed below.
- Redirect
All BucketRequests To Website Configuration V2Redirect All Requests To Args The redirect behavior for every request to this bucket's website endpoint detailed below. Conflicts with
error_document
,index_document
, androuting_rule
.- Routing
Rule stringDetails A 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 List<BucketWebsite Configuration V2Routing Rule Args> List of rules that define when a redirect is applied and the redirect behavior detailed below.
- Bucket string
The name of the bucket.
- Error
Document BucketWebsite Configuration V2Error Document Args The name of the error document for the website detailed below.
- Expected
Bucket stringOwner The account ID of the expected bucket owner.
- Index
Document BucketWebsite Configuration V2Index Document Args The name of the index document for the website detailed below.
- Redirect
All BucketRequests To Website Configuration V2Redirect All Requests To Args The redirect behavior for every request to this bucket's website endpoint detailed below. Conflicts with
error_document
,index_document
, androuting_rule
.- Routing
Rule stringDetails A 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 []BucketWebsite Configuration V2Routing Rule Args List of rules that define when a redirect is applied and the redirect behavior detailed below.
- bucket String
The name of the bucket.
- error
Document BucketWebsite Configuration V2Error Document Args The name of the error document for the website detailed below.
- expected
Bucket StringOwner The account ID of the expected bucket owner.
- index
Document BucketWebsite Configuration V2Index Document Args The name of the index document for the website detailed below.
- redirect
All BucketRequests To Website Configuration V2Redirect All Requests To Args The redirect behavior for every request to this bucket's website endpoint detailed below. Conflicts with
error_document
,index_document
, androuting_rule
.- routing
Rule StringDetails A 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 List<BucketWebsite Configuration V2Routing Rule Args> List of rules that define when a redirect is applied and the redirect behavior detailed below.
- bucket string
The name of the bucket.
- error
Document BucketWebsite Configuration V2Error Document Args The name of the error document for the website detailed below.
- expected
Bucket stringOwner The account ID of the expected bucket owner.
- index
Document BucketWebsite Configuration V2Index Document Args The name of the index document for the website detailed below.
- redirect
All BucketRequests To Website Configuration V2Redirect All Requests To Args The redirect behavior for every request to this bucket's website endpoint detailed below. Conflicts with
error_document
,index_document
, androuting_rule
.- routing
Rule stringDetails A 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 BucketWebsite Configuration V2Routing Rule Args[] List of rules that define when a redirect is applied and the redirect behavior detailed below.
- bucket str
The name of the bucket.
- error_
document BucketWebsite Configuration V2Error Document Args The name of the error document for the website detailed below.
- expected_
bucket_ strowner The account ID of the expected bucket owner.
- index_
document BucketWebsite Configuration V2Index Document Args The name of the index document for the website detailed below.
- redirect_
all_ Bucketrequests_ to Website Configuration V2Redirect All Requests To Args The redirect behavior for every request to this bucket's website endpoint detailed below. Conflicts with
error_document
,index_document
, androuting_rule
.- routing_
rule_ strdetails A 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[BucketWebsite Configuration V2Routing Rule Args] List of rules that define when a redirect is applied and the redirect behavior detailed below.
- bucket String
The name of the bucket.
- error
Document Property Map The name of the error document for the website detailed below.
- expected
Bucket StringOwner The account ID of the expected bucket owner.
- index
Document Property Map The name of the index document for the website detailed below.
- redirect
All Property MapRequests To The redirect behavior for every request to this bucket's website endpoint detailed below. Conflicts with
error_document
,index_document
, androuting_rule
.- routing
Rule StringDetails A 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 List<Property Map> List of rules that define when a redirect is applied and the redirect behavior detailed 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.
- Website
Domain string The domain of the website endpoint. This is used to create Route 53 alias records.
- Website
Endpoint string The website endpoint.
- Id string
The provider-assigned unique ID for this managed resource.
- Website
Domain string The domain of the website endpoint. This is used to create Route 53 alias records.
- Website
Endpoint string The website endpoint.
- id String
The provider-assigned unique ID for this managed resource.
- website
Domain String The domain of the website endpoint. This is used to create Route 53 alias records.
- website
Endpoint String The website endpoint.
- id string
The provider-assigned unique ID for this managed resource.
- website
Domain string The domain of the website endpoint. This is used to create Route 53 alias records.
- website
Endpoint string The website endpoint.
- id str
The provider-assigned unique ID for this managed resource.
- website_
domain str The domain of the website endpoint. This is used to create Route 53 alias records.
- website_
endpoint str The website endpoint.
- id String
The provider-assigned unique ID for this managed resource.
- website
Domain String The domain of the website endpoint. This is used to create Route 53 alias records.
- website
Endpoint String The 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.
- Bucket string
The name of the bucket.
- Error
Document BucketWebsite Configuration V2Error Document Args The name of the error document for the website detailed below.
- Expected
Bucket stringOwner The account ID of the expected bucket owner.
- Index
Document BucketWebsite Configuration V2Index Document Args The name of the index document for the website detailed below.
- Redirect
All BucketRequests To Website Configuration V2Redirect All Requests To Args The redirect behavior for every request to this bucket's website endpoint detailed below. Conflicts with
error_document
,index_document
, androuting_rule
.- Routing
Rule stringDetails A 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 List<BucketWebsite Configuration V2Routing Rule Args> List of rules that define when a redirect is applied and the redirect behavior detailed below.
- Website
Domain string The domain of the website endpoint. This is used to create Route 53 alias records.
- Website
Endpoint string The website endpoint.
- Bucket string
The name of the bucket.
- Error
Document BucketWebsite Configuration V2Error Document Args The name of the error document for the website detailed below.
- Expected
Bucket stringOwner The account ID of the expected bucket owner.
- Index
Document BucketWebsite Configuration V2Index Document Args The name of the index document for the website detailed below.
- Redirect
All BucketRequests To Website Configuration V2Redirect All Requests To Args The redirect behavior for every request to this bucket's website endpoint detailed below. Conflicts with
error_document
,index_document
, androuting_rule
.- Routing
Rule stringDetails A 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 []BucketWebsite Configuration V2Routing Rule Args List of rules that define when a redirect is applied and the redirect behavior detailed below.
- Website
Domain string The domain of the website endpoint. This is used to create Route 53 alias records.
- Website
Endpoint string The website endpoint.
- bucket String
The name of the bucket.
- error
Document BucketWebsite Configuration V2Error Document Args The name of the error document for the website detailed below.
- expected
Bucket StringOwner The account ID of the expected bucket owner.
- index
Document BucketWebsite Configuration V2Index Document Args The name of the index document for the website detailed below.
- redirect
All BucketRequests To Website Configuration V2Redirect All Requests To Args The redirect behavior for every request to this bucket's website endpoint detailed below. Conflicts with
error_document
,index_document
, androuting_rule
.- routing
Rule StringDetails A 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 List<BucketWebsite Configuration V2Routing Rule Args> List of rules that define when a redirect is applied and the redirect behavior detailed below.
- website
Domain String The domain of the website endpoint. This is used to create Route 53 alias records.
- website
Endpoint String The website endpoint.
- bucket string
The name of the bucket.
- error
Document BucketWebsite Configuration V2Error Document Args The name of the error document for the website detailed below.
- expected
Bucket stringOwner The account ID of the expected bucket owner.
- index
Document BucketWebsite Configuration V2Index Document Args The name of the index document for the website detailed below.
- redirect
All BucketRequests To Website Configuration V2Redirect All Requests To Args The redirect behavior for every request to this bucket's website endpoint detailed below. Conflicts with
error_document
,index_document
, androuting_rule
.- routing
Rule stringDetails A 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 BucketWebsite Configuration V2Routing Rule Args[] List of rules that define when a redirect is applied and the redirect behavior detailed below.
- website
Domain string The domain of the website endpoint. This is used to create Route 53 alias records.
- website
Endpoint string The website endpoint.
- bucket str
The name of the bucket.
- error_
document BucketWebsite Configuration V2Error Document Args The name of the error document for the website detailed below.
- expected_
bucket_ strowner The account ID of the expected bucket owner.
- index_
document BucketWebsite Configuration V2Index Document Args The name of the index document for the website detailed below.
- redirect_
all_ Bucketrequests_ to Website Configuration V2Redirect All Requests To Args The redirect behavior for every request to this bucket's website endpoint detailed below. Conflicts with
error_document
,index_document
, androuting_rule
.- routing_
rule_ strdetails A 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[BucketWebsite Configuration V2Routing Rule Args] List of rules that define when a redirect is applied and the redirect behavior detailed below.
- website_
domain str The domain of the website endpoint. This is used to create Route 53 alias records.
- website_
endpoint str The website endpoint.
- bucket String
The name of the bucket.
- error
Document Property Map The name of the error document for the website detailed below.
- expected
Bucket StringOwner The account ID of the expected bucket owner.
- index
Document Property Map The name of the index document for the website detailed below.
- redirect
All Property MapRequests To The redirect behavior for every request to this bucket's website endpoint detailed below. Conflicts with
error_document
,index_document
, androuting_rule
.- routing
Rule StringDetails A 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 List<Property Map> List of rules that define when a redirect is applied and the redirect behavior detailed below.
- website
Domain String The domain of the website endpoint. This is used to create Route 53 alias records.
- website
Endpoint String The website endpoint.
Supporting Types
BucketWebsiteConfigurationV2ErrorDocument
- Key string
The object key name to use when a 4XX class error occurs.
- Key string
The object key name to use when a 4XX class error occurs.
- key String
The object key name to use when a 4XX class error occurs.
- key string
The object key name to use when a 4XX class error occurs.
- key str
The object key name to use when a 4XX class error occurs.
- key String
The object key name to use when a 4XX class error occurs.
BucketWebsiteConfigurationV2IndexDocument
- Suffix string
A 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 tosamplebucket/images/
, the data that is returned will be for the object with the key nameimages/index.html
. The suffix must not be empty and must not include a slash character.
- Suffix string
A 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 tosamplebucket/images/
, the data that is returned will be for the object with the key nameimages/index.html
. The suffix must not be empty and must not include a slash character.
- suffix String
A 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 tosamplebucket/images/
, the data that is returned will be for the object with the key nameimages/index.html
. The suffix must not be empty and must not include a slash character.
- suffix string
A 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 tosamplebucket/images/
, the data that is returned will be for the object with the key nameimages/index.html
. The suffix must not be empty and must not include a slash character.
- suffix str
A 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 tosamplebucket/images/
, the data that is returned will be for the object with the key nameimages/index.html
. The suffix must not be empty and must not include a slash character.
- suffix String
A 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 tosamplebucket/images/
, the data that is returned will be for the object with the key nameimages/index.html
. The suffix must not be empty and must not include a slash character.
BucketWebsiteConfigurationV2RedirectAllRequestsTo
BucketWebsiteConfigurationV2RoutingRule
- Redirect
Bucket
Website Configuration V2Routing Rule Redirect A configuration block for redirect information detailed below.
- Condition
Bucket
Website Configuration V2Routing Rule Condition A configuration block for describing a condition that must be met for the specified redirect to apply detailed below.
- Redirect
Bucket
Website Configuration V2Routing Rule Redirect A configuration block for redirect information detailed below.
- Condition
Bucket
Website Configuration V2Routing Rule Condition A configuration block for describing a condition that must be met for the specified redirect to apply detailed below.
- redirect
Bucket
Website Configuration V2Routing Rule Redirect A configuration block for redirect information detailed below.
- condition
Bucket
Website Configuration V2Routing Rule Condition A configuration block for describing a condition that must be met for the specified redirect to apply detailed below.
- redirect
Bucket
Website Configuration V2Routing Rule Redirect A configuration block for redirect information detailed below.
- condition
Bucket
Website Configuration V2Routing Rule Condition A configuration block for describing a condition that must be met for the specified redirect to apply detailed below.
- redirect
Bucket
Website Configuration V2Routing Rule Redirect A configuration block for redirect information detailed below.
- condition
Bucket
Website Configuration V2Routing Rule Condition A configuration block for describing a condition that must be met for the specified redirect to apply detailed below.
- redirect Property Map
A configuration block for redirect information detailed below.
- condition Property Map
A configuration block for describing a condition that must be met for the specified redirect to apply detailed below.
BucketWebsiteConfigurationV2RoutingRuleCondition
- Http
Error stringCode Returned Equals The 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 stringEquals The 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 stringCode Returned Equals The 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 stringEquals The 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 StringCode Returned Equals The 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 StringEquals The 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 stringCode Returned Equals The 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 stringEquals The 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_ strcode_ returned_ equals The 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_ strequals The 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 StringCode Returned Equals The 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 StringEquals The 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
- Host
Name string The host name to use in the redirect request.
- Http
Redirect stringCode The 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
.- Replace
Key stringPrefix With The object key prefix to use in the redirect request. For example, to redirect requests for all pages with prefix
docs/
(objects in thedocs/
folder) todocuments/
, you can set acondition
block withkey_prefix_equals
set todocs/
and in theredirect
setreplace_key_prefix_with
to/documents
.- Replace
Key stringWith The specific object key to use in the redirect request. For example, redirect request to
error.html
.
- Host
Name string The host name to use in the redirect request.
- Http
Redirect stringCode The 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
.- Replace
Key stringPrefix With The object key prefix to use in the redirect request. For example, to redirect requests for all pages with prefix
docs/
(objects in thedocs/
folder) todocuments/
, you can set acondition
block withkey_prefix_equals
set todocs/
and in theredirect
setreplace_key_prefix_with
to/documents
.- Replace
Key stringWith The specific object key to use in the redirect request. For example, redirect request to
error.html
.
- host
Name String The host name to use in the redirect request.
- http
Redirect StringCode The 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
.- replace
Key StringPrefix With The object key prefix to use in the redirect request. For example, to redirect requests for all pages with prefix
docs/
(objects in thedocs/
folder) todocuments/
, you can set acondition
block withkey_prefix_equals
set todocs/
and in theredirect
setreplace_key_prefix_with
to/documents
.- replace
Key StringWith The specific object key to use in the redirect request. For example, redirect request to
error.html
.
- host
Name string The host name to use in the redirect request.
- http
Redirect stringCode The 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
.- replace
Key stringPrefix With The object key prefix to use in the redirect request. For example, to redirect requests for all pages with prefix
docs/
(objects in thedocs/
folder) todocuments/
, you can set acondition
block withkey_prefix_equals
set todocs/
and in theredirect
setreplace_key_prefix_with
to/documents
.- replace
Key stringWith The specific object key to use in the redirect request. For example, redirect request to
error.html
.
- host_
name str The host name to use in the redirect request.
- http_
redirect_ strcode The 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_ strprefix_ with The object key prefix to use in the redirect request. For example, to redirect requests for all pages with prefix
docs/
(objects in thedocs/
folder) todocuments/
, you can set acondition
block withkey_prefix_equals
set todocs/
and in theredirect
setreplace_key_prefix_with
to/documents
.- replace_
key_ strwith The specific object key to use in the redirect request. For example, redirect request to
error.html
.
- host
Name String The host name to use in the redirect request.
- http
Redirect StringCode The 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
.- replace
Key StringPrefix With The object key prefix to use in the redirect request. For example, to redirect requests for all pages with prefix
docs/
(objects in thedocs/
folder) todocuments/
, you can set acondition
block withkey_prefix_equals
set todocs/
and in theredirect
setreplace_key_prefix_with
to/documents
.- replace
Key StringWith The 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.