Try AWS Native preview for resources not in the classic version.
aws.s3.BucketWebsiteConfigurationV2
Explore with Pulumi AI
Try AWS Native preview for resources not in the classic version.
Provides an S3 bucket website configuration resource. For more information, see Hosting Websites on S3.
This resource cannot be used with S3 directory buckets.
Example Usage
With routing_rule
configured
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.s3.BucketWebsiteConfigurationV2("example", {
bucket: exampleAwsS3Bucket.id,
indexDocument: {
suffix: "index.html",
},
errorDocument: {
key: "error.html",
},
routingRules: [{
condition: {
keyPrefixEquals: "docs/",
},
redirect: {
replaceKeyPrefixWith: "documents/",
},
}],
});
import pulumi
import pulumi_aws as aws
example = aws.s3.BucketWebsiteConfigurationV2("example",
bucket=example_aws_s3_bucket["id"],
index_document={
"suffix": "index.html",
},
error_document={
"key": "error.html",
},
routing_rules=[{
"condition": {
"keyPrefixEquals": "docs/",
},
"redirect": {
"replaceKeyPrefixWith": "documents/",
},
}])
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/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(exampleAwsS3Bucket.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
})
}
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 = exampleAwsS3Bucket.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 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(exampleAwsS3Bucket.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());
}
}
resources:
example:
type: aws:s3:BucketWebsiteConfigurationV2
properties:
bucket: ${exampleAwsS3Bucket.id}
indexDocument:
suffix: index.html
errorDocument:
key: error.html
routingRules:
- condition:
keyPrefixEquals: docs/
redirect:
replaceKeyPrefixWith: documents/
With routing_rules
configured
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.s3.BucketWebsiteConfigurationV2("example", {
bucket: exampleAwsS3Bucket.id,
indexDocument: {
suffix: "index.html",
},
errorDocument: {
key: "error.html",
},
routingRuleDetails: `[{
"Condition": {
"KeyPrefixEquals": "docs/"
},
"Redirect": {
"ReplaceKeyPrefixWith": ""
}
}]
`,
});
import pulumi
import pulumi_aws as aws
example = aws.s3.BucketWebsiteConfigurationV2("example",
bucket=example_aws_s3_bucket["id"],
index_document={
"suffix": "index.html",
},
error_document={
"key": "error.html",
},
routing_rule_details="""[{
"Condition": {
"KeyPrefixEquals": "docs/"
},
"Redirect": {
"ReplaceKeyPrefixWith": ""
}
}]
""")
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/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(exampleAwsS3Bucket.Id),
IndexDocument: &s3.BucketWebsiteConfigurationV2IndexDocumentArgs{
Suffix: pulumi.String("index.html"),
},
ErrorDocument: &s3.BucketWebsiteConfigurationV2ErrorDocumentArgs{
Key: pulumi.String("error.html"),
},
RoutingRuleDetails: pulumi.String(`[{
"Condition": {
"KeyPrefixEquals": "docs/"
},
"Redirect": {
"ReplaceKeyPrefixWith": ""
}
}]
`),
})
if err != nil {
return err
}
return nil
})
}
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 = exampleAwsS3Bucket.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 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(exampleAwsS3Bucket.id())
.indexDocument(BucketWebsiteConfigurationV2IndexDocumentArgs.builder()
.suffix("index.html")
.build())
.errorDocument(BucketWebsiteConfigurationV2ErrorDocumentArgs.builder()
.key("error.html")
.build())
.routingRuleDetails("""
[{
"Condition": {
"KeyPrefixEquals": "docs/"
},
"Redirect": {
"ReplaceKeyPrefixWith": ""
}
}]
""")
.build());
}
}
resources:
example:
type: aws:s3:BucketWebsiteConfigurationV2
properties:
bucket: ${exampleAwsS3Bucket.id}
indexDocument:
suffix: index.html
errorDocument:
key: error.html
routingRuleDetails: |
[{
"Condition": {
"KeyPrefixEquals": "docs/"
},
"Redirect": {
"ReplaceKeyPrefixWith": ""
}
}]
Create BucketWebsiteConfigurationV2 Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new BucketWebsiteConfigurationV2(name: string, args: BucketWebsiteConfigurationV2Args, opts?: CustomResourceOptions);
@overload
def BucketWebsiteConfigurationV2(resource_name: str,
args: BucketWebsiteConfigurationV2Args,
opts: Optional[ResourceOptions] = None)
@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)
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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var bucketWebsiteConfigurationV2Resource = new Aws.S3.BucketWebsiteConfigurationV2("bucketWebsiteConfigurationV2Resource", new()
{
Bucket = "string",
ErrorDocument = new Aws.S3.Inputs.BucketWebsiteConfigurationV2ErrorDocumentArgs
{
Key = "string",
},
ExpectedBucketOwner = "string",
IndexDocument = new Aws.S3.Inputs.BucketWebsiteConfigurationV2IndexDocumentArgs
{
Suffix = "string",
},
RedirectAllRequestsTo = new Aws.S3.Inputs.BucketWebsiteConfigurationV2RedirectAllRequestsToArgs
{
HostName = "string",
Protocol = "string",
},
RoutingRuleDetails = "string",
RoutingRules = new[]
{
new Aws.S3.Inputs.BucketWebsiteConfigurationV2RoutingRuleArgs
{
Redirect = new Aws.S3.Inputs.BucketWebsiteConfigurationV2RoutingRuleRedirectArgs
{
HostName = "string",
HttpRedirectCode = "string",
Protocol = "string",
ReplaceKeyPrefixWith = "string",
ReplaceKeyWith = "string",
},
Condition = new Aws.S3.Inputs.BucketWebsiteConfigurationV2RoutingRuleConditionArgs
{
HttpErrorCodeReturnedEquals = "string",
KeyPrefixEquals = "string",
},
},
},
});
example, err := s3.NewBucketWebsiteConfigurationV2(ctx, "bucketWebsiteConfigurationV2Resource", &s3.BucketWebsiteConfigurationV2Args{
Bucket: pulumi.String("string"),
ErrorDocument: &s3.BucketWebsiteConfigurationV2ErrorDocumentArgs{
Key: pulumi.String("string"),
},
ExpectedBucketOwner: pulumi.String("string"),
IndexDocument: &s3.BucketWebsiteConfigurationV2IndexDocumentArgs{
Suffix: pulumi.String("string"),
},
RedirectAllRequestsTo: &s3.BucketWebsiteConfigurationV2RedirectAllRequestsToArgs{
HostName: pulumi.String("string"),
Protocol: pulumi.String("string"),
},
RoutingRuleDetails: pulumi.String("string"),
RoutingRules: s3.BucketWebsiteConfigurationV2RoutingRuleArray{
&s3.BucketWebsiteConfigurationV2RoutingRuleArgs{
Redirect: &s3.BucketWebsiteConfigurationV2RoutingRuleRedirectArgs{
HostName: pulumi.String("string"),
HttpRedirectCode: pulumi.String("string"),
Protocol: pulumi.String("string"),
ReplaceKeyPrefixWith: pulumi.String("string"),
ReplaceKeyWith: pulumi.String("string"),
},
Condition: &s3.BucketWebsiteConfigurationV2RoutingRuleConditionArgs{
HttpErrorCodeReturnedEquals: pulumi.String("string"),
KeyPrefixEquals: pulumi.String("string"),
},
},
},
})
var bucketWebsiteConfigurationV2Resource = new BucketWebsiteConfigurationV2("bucketWebsiteConfigurationV2Resource", BucketWebsiteConfigurationV2Args.builder()
.bucket("string")
.errorDocument(BucketWebsiteConfigurationV2ErrorDocumentArgs.builder()
.key("string")
.build())
.expectedBucketOwner("string")
.indexDocument(BucketWebsiteConfigurationV2IndexDocumentArgs.builder()
.suffix("string")
.build())
.redirectAllRequestsTo(BucketWebsiteConfigurationV2RedirectAllRequestsToArgs.builder()
.hostName("string")
.protocol("string")
.build())
.routingRuleDetails("string")
.routingRules(BucketWebsiteConfigurationV2RoutingRuleArgs.builder()
.redirect(BucketWebsiteConfigurationV2RoutingRuleRedirectArgs.builder()
.hostName("string")
.httpRedirectCode("string")
.protocol("string")
.replaceKeyPrefixWith("string")
.replaceKeyWith("string")
.build())
.condition(BucketWebsiteConfigurationV2RoutingRuleConditionArgs.builder()
.httpErrorCodeReturnedEquals("string")
.keyPrefixEquals("string")
.build())
.build())
.build());
bucket_website_configuration_v2_resource = aws.s3.BucketWebsiteConfigurationV2("bucketWebsiteConfigurationV2Resource",
bucket="string",
error_document={
"key": "string",
},
expected_bucket_owner="string",
index_document={
"suffix": "string",
},
redirect_all_requests_to={
"hostName": "string",
"protocol": "string",
},
routing_rule_details="string",
routing_rules=[{
"redirect": {
"hostName": "string",
"httpRedirectCode": "string",
"protocol": "string",
"replaceKeyPrefixWith": "string",
"replaceKeyWith": "string",
},
"condition": {
"httpErrorCodeReturnedEquals": "string",
"keyPrefixEquals": "string",
},
}])
const bucketWebsiteConfigurationV2Resource = new aws.s3.BucketWebsiteConfigurationV2("bucketWebsiteConfigurationV2Resource", {
bucket: "string",
errorDocument: {
key: "string",
},
expectedBucketOwner: "string",
indexDocument: {
suffix: "string",
},
redirectAllRequestsTo: {
hostName: "string",
protocol: "string",
},
routingRuleDetails: "string",
routingRules: [{
redirect: {
hostName: "string",
httpRedirectCode: "string",
protocol: "string",
replaceKeyPrefixWith: "string",
replaceKeyWith: "string",
},
condition: {
httpErrorCodeReturnedEquals: "string",
keyPrefixEquals: "string",
},
}],
});
type: aws:s3:BucketWebsiteConfigurationV2
properties:
bucket: string
errorDocument:
key: string
expectedBucketOwner: string
indexDocument:
suffix: string
redirectAllRequestsTo:
hostName: string
protocol: string
routingRuleDetails: string
routingRules:
- condition:
httpErrorCodeReturnedEquals: string
keyPrefixEquals: string
redirect:
hostName: string
httpRedirectCode: string
protocol: string
replaceKeyPrefixWith: string
replaceKeyWith: string
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.
- Error
Document BucketWebsite Configuration V2Error Document - Name of the error document for the website. See below.
- Expected
Bucket stringOwner - Account ID of the expected bucket owner.
- Index
Document BucketWebsite Configuration V2Index Document - Name of the index document for the website. See below.
- Redirect
All BucketRequests To Website Configuration V2Redirect All Requests To - Redirect behavior for every request to this bucket's website endpoint. See below. Conflicts with
error_document
,index_document
, androuting_rule
. - Routing
Rule stringDetails - 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> - List of rules that define when a redirect is applied and the redirect behavior. See below.
- Bucket string
- Name of the bucket.
- Error
Document BucketWebsite Configuration V2Error Document Args - Name of the error document for the website. See below.
- Expected
Bucket stringOwner - Account ID of the expected bucket owner.
- Index
Document BucketWebsite Configuration V2Index Document Args - Name of the index document for the website. See below.
- Redirect
All BucketRequests To Website Configuration V2Redirect All Requests To Args - Redirect behavior for every request to this bucket's website endpoint. See below. Conflicts with
error_document
,index_document
, androuting_rule
. - Routing
Rule stringDetails - 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. See below.
- bucket String
- Name of the bucket.
- error
Document BucketWebsite Configuration V2Error Document - Name of the error document for the website. See below.
- expected
Bucket StringOwner - Account ID of the expected bucket owner.
- index
Document BucketWebsite Configuration V2Index Document - Name of the index document for the website. See below.
- redirect
All BucketRequests To Website Configuration V2Redirect All Requests To - Redirect behavior for every request to this bucket's website endpoint. See below. Conflicts with
error_document
,index_document
, androuting_rule
. - routing
Rule StringDetails - 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> - List of rules that define when a redirect is applied and the redirect behavior. See below.
- bucket string
- Name of the bucket.
- error
Document BucketWebsite Configuration V2Error Document - Name of the error document for the website. See below.
- expected
Bucket stringOwner - Account ID of the expected bucket owner.
- index
Document BucketWebsite Configuration V2Index Document - Name of the index document for the website. See below.
- redirect
All BucketRequests To Website Configuration V2Redirect All Requests To - Redirect behavior for every request to this bucket's website endpoint. See below. Conflicts with
error_document
,index_document
, androuting_rule
. - routing
Rule stringDetails - 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[] - List of rules that define when a redirect is applied and the redirect behavior. See below.
- bucket str
- Name of the bucket.
- error_
document BucketWebsite Configuration V2Error Document Args - Name of the error document for the website. See below.
- expected_
bucket_ strowner - Account ID of the expected bucket owner.
- index_
document BucketWebsite Configuration V2Index Document Args - Name of the index document for the website. See below.
- redirect_
all_ Bucketrequests_ to Website Configuration V2Redirect All Requests To Args - Redirect behavior for every request to this bucket's website endpoint. See below. Conflicts with
error_document
,index_document
, androuting_rule
. - routing_
rule_ strdetails - 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. See below.
- bucket String
- Name of the bucket.
- error
Document Property Map - Name of the error document for the website. See below.
- expected
Bucket StringOwner - Account ID of the expected bucket owner.
- index
Document Property Map - Name of the index document for the website. See below.
- redirect
All Property MapRequests To - Redirect behavior for every request to this bucket's website endpoint. See below. Conflicts with
error_document
,index_document
, androuting_rule
. - routing
Rule StringDetails - 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. 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.
- Website
Domain string - Domain of the website endpoint. This is used to create Route 53 alias records.
- Website
Endpoint string - Website endpoint.
- Id string
- The provider-assigned unique ID for this managed resource.
- Website
Domain string - Domain of the website endpoint. This is used to create Route 53 alias records.
- Website
Endpoint string - Website endpoint.
- id String
- The provider-assigned unique ID for this managed resource.
- website
Domain String - Domain of the website endpoint. This is used to create Route 53 alias records.
- website
Endpoint String - Website endpoint.
- id string
- The provider-assigned unique ID for this managed resource.
- website
Domain string - Domain of the website endpoint. This is used to create Route 53 alias records.
- website
Endpoint 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.
- website
Domain String - Domain of the website endpoint. This is used to create Route 53 alias records.
- website
Endpoint 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.
- Bucket string
- Name of the bucket.
- Error
Document BucketWebsite Configuration V2Error Document - Name of the error document for the website. See below.
- Expected
Bucket stringOwner - Account ID of the expected bucket owner.
- Index
Document BucketWebsite Configuration V2Index Document - Name of the index document for the website. See below.
- Redirect
All BucketRequests To Website Configuration V2Redirect All Requests To - Redirect behavior for every request to this bucket's website endpoint. See below. Conflicts with
error_document
,index_document
, androuting_rule
. - Routing
Rule stringDetails - 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> - List of rules that define when a redirect is applied and the redirect behavior. See below.
- Website
Domain string - Domain of the website endpoint. This is used to create Route 53 alias records.
- Website
Endpoint string - Website endpoint.
- Bucket string
- Name of the bucket.
- Error
Document BucketWebsite Configuration V2Error Document Args - Name of the error document for the website. See below.
- Expected
Bucket stringOwner - Account ID of the expected bucket owner.
- Index
Document BucketWebsite Configuration V2Index Document Args - Name of the index document for the website. See below.
- Redirect
All BucketRequests To Website Configuration V2Redirect All Requests To Args - Redirect behavior for every request to this bucket's website endpoint. See below. Conflicts with
error_document
,index_document
, androuting_rule
. - Routing
Rule stringDetails - 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. See below.
- Website
Domain string - Domain of the website endpoint. This is used to create Route 53 alias records.
- Website
Endpoint string - Website endpoint.
- bucket String
- Name of the bucket.
- error
Document BucketWebsite Configuration V2Error Document - Name of the error document for the website. See below.
- expected
Bucket StringOwner - Account ID of the expected bucket owner.
- index
Document BucketWebsite Configuration V2Index Document - Name of the index document for the website. See below.
- redirect
All BucketRequests To Website Configuration V2Redirect All Requests To - Redirect behavior for every request to this bucket's website endpoint. See below. Conflicts with
error_document
,index_document
, androuting_rule
. - routing
Rule StringDetails - 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> - List of rules that define when a redirect is applied and the redirect behavior. See below.
- website
Domain String - Domain of the website endpoint. This is used to create Route 53 alias records.
- website
Endpoint String - Website endpoint.
- bucket string
- Name of the bucket.
- error
Document BucketWebsite Configuration V2Error Document - Name of the error document for the website. See below.
- expected
Bucket stringOwner - Account ID of the expected bucket owner.
- index
Document BucketWebsite Configuration V2Index Document - Name of the index document for the website. See below.
- redirect
All BucketRequests To Website Configuration V2Redirect All Requests To - Redirect behavior for every request to this bucket's website endpoint. See below. Conflicts with
error_document
,index_document
, androuting_rule
. - routing
Rule stringDetails - 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[] - List of rules that define when a redirect is applied and the redirect behavior. See below.
- website
Domain string - Domain of the website endpoint. This is used to create Route 53 alias records.
- website
Endpoint string - Website endpoint.
- bucket str
- Name of the bucket.
- error_
document BucketWebsite Configuration V2Error Document Args - Name of the error document for the website. See below.
- expected_
bucket_ strowner - Account ID of the expected bucket owner.
- index_
document BucketWebsite Configuration V2Index Document Args - Name of the index document for the website. See below.
- redirect_
all_ Bucketrequests_ to Website Configuration V2Redirect All Requests To Args - Redirect behavior for every request to this bucket's website endpoint. See below. Conflicts with
error_document
,index_document
, androuting_rule
. - routing_
rule_ strdetails - 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. 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.
- error
Document Property Map - Name of the error document for the website. See below.
- expected
Bucket StringOwner - Account ID of the expected bucket owner.
- index
Document Property Map - Name of the index document for the website. See below.
- redirect
All Property MapRequests To - Redirect behavior for every request to this bucket's website endpoint. See below. Conflicts with
error_document
,index_document
, androuting_rule
. - routing
Rule StringDetails - 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. See below.
- website
Domain String - Domain of the website endpoint. This is used to create Route 53 alias records.
- website
Endpoint String - Website endpoint.
Supporting Types
BucketWebsiteConfigurationV2ErrorDocument, BucketWebsiteConfigurationV2ErrorDocumentArgs
- 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, BucketWebsiteConfigurationV2IndexDocumentArgs
- 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 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
- 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
- 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
- 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
- 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
- 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, BucketWebsiteConfigurationV2RedirectAllRequestsToArgs
BucketWebsiteConfigurationV2RoutingRule, BucketWebsiteConfigurationV2RoutingRuleArgs
- Redirect
Bucket
Website Configuration V2Routing Rule Redirect - Configuration block for redirect information. See below.
- Condition
Bucket
Website Configuration V2Routing Rule Condition - Configuration block for describing a condition that must be met for the specified redirect to apply. See below.
- Redirect
Bucket
Website Configuration V2Routing Rule Redirect - Configuration block for redirect information. See below.
- Condition
Bucket
Website Configuration V2Routing Rule Condition - Configuration block for describing a condition that must be met for the specified redirect to apply. See below.
- redirect
Bucket
Website Configuration V2Routing Rule Redirect - Configuration block for redirect information. See below.
- condition
Bucket
Website Configuration V2Routing Rule Condition - Configuration block for describing a condition that must be met for the specified redirect to apply. See below.
- redirect
Bucket
Website Configuration V2Routing Rule Redirect - Configuration block for redirect information. See below.
- condition
Bucket
Website Configuration V2Routing Rule Condition - Configuration block for describing a condition that must be met for the specified redirect to apply. See below.
- redirect
Bucket
Website Configuration V2Routing Rule Redirect - Configuration block for redirect information. See below.
- condition
Bucket
Website Configuration V2Routing Rule Condition - 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, BucketWebsiteConfigurationV2RoutingRuleConditionArgs
- Http
Error stringCode Returned Equals - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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 - 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, BucketWebsiteConfigurationV2RoutingRuleRedirectArgs
- Host
Name string - Host name to use in the redirect request.
- Http
Redirect stringCode - 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 - 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 - Specific object key to use in the redirect request. For example, redirect request to
error.html
.
- Host
Name string - Host name to use in the redirect request.
- Http
Redirect stringCode - 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 - 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 - Specific object key to use in the redirect request. For example, redirect request to
error.html
.
- host
Name String - Host name to use in the redirect request.
- http
Redirect StringCode - 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 - 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 - Specific object key to use in the redirect request. For example, redirect request to
error.html
.
- host
Name string - Host name to use in the redirect request.
- http
Redirect stringCode - 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 - 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 - 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_ strcode - 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 - 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 - Specific object key to use in the redirect request. For example, redirect request to
error.html
.
- host
Name String - Host name to use in the redirect request.
- http
Redirect StringCode - 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 - 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 - Specific object key to use in the redirect request. For example, redirect request to
error.html
.
Import
If the owner (account ID) of the source bucket differs from the account used to configure the AWS Provider, import using the bucket
and expected_bucket_owner
separated by a comma (,
):
Using pulumi import
to import S3 bucket website configuration using the bucket
or using the bucket
and expected_bucket_owner
separated by a comma (,
). For example:
If the owner (account ID) of the source bucket is the same account used to configure the AWS Provider, import using the bucket
:
$ 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, import using the bucket
and expected_bucket_owner
separated by a comma (,
):
$ pulumi import aws:s3/bucketWebsiteConfigurationV2:BucketWebsiteConfigurationV2 example bucket-name,123456789012
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
aws
Terraform Provider.
Try AWS Native preview for resources not in the classic version.