Package com.pulumi.aws.s3
Class BucketWebsiteConfigurationV2
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.s3.BucketWebsiteConfigurationV2
-
@Deprecated public class BucketWebsiteConfigurationV2 extends com.pulumi.resources.CustomResourceDeprecated.aws.s3/bucketwebsiteconfigurationv2.BucketWebsiteConfigurationV2 has been deprecated in favor of aws.s3/bucketwebsiteconfiguration.BucketWebsiteConfigurationProvides an S3 bucket website configuration resource. For more information, see [Hosting Websites on S3](https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html). > This resource cannot be used with S3 directory buckets. ## Example Usage ### With `routingRule` configured
### With `routingRules` configuredpackage generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.s3.BucketWebsiteConfiguration; import com.pulumi.aws.s3.BucketWebsiteConfigurationArgs; import com.pulumi.aws.s3.inputs.BucketWebsiteConfigurationIndexDocumentArgs; import com.pulumi.aws.s3.inputs.BucketWebsiteConfigurationErrorDocumentArgs; import com.pulumi.aws.s3.inputs.BucketWebsiteConfigurationRoutingRuleArgs; import com.pulumi.aws.s3.inputs.BucketWebsiteConfigurationRoutingRuleConditionArgs; import com.pulumi.aws.s3.inputs.BucketWebsiteConfigurationRoutingRuleRedirectArgs; import java.util.ArrayList; import java.util.Arrays; 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 BucketWebsiteConfiguration("example", BucketWebsiteConfigurationArgs.builder() .indexDocument(BucketWebsiteConfigurationIndexDocumentArgs.builder() .suffix("index.html") .build()) .errorDocument(BucketWebsiteConfigurationErrorDocumentArgs.builder() .key("error.html") .build()) .routingRules(BucketWebsiteConfigurationRoutingRuleArgs.builder() .condition(BucketWebsiteConfigurationRoutingRuleConditionArgs.builder() .keyPrefixEquals("docs/") .build()) .redirect(BucketWebsiteConfigurationRoutingRuleRedirectArgs.builder() .replaceKeyPrefixWith("documents/") .build()) .build()) .bucket(exampleAwsS3Bucket.id()) .build()); } }
## Import ### Identity Schema #### Required * `bucket` (String) S3 bucket name. #### Optional * `accountId` (String) AWS Account where this resource is managed. * `region` (String) Region where this resource is managed. If the owner (account ID) of the source bucket differs from the account used to configure the AWS Provider, import using the `bucket` and `expectedBucketOwner` separated by a comma (`,`): **Using `pulumi import` to import** S3 bucket website configuration using the `bucket` or using the `bucket` and `expectedBucketOwner` 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`: ```sh $ 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 `expectedBucketOwner` separated by a comma (`,`): ```sh $ pulumi import aws:s3/bucketWebsiteConfigurationV2:BucketWebsiteConfigurationV2 example bucket-name,123456789012 ```package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.aws.s3.BucketWebsiteConfiguration; import com.pulumi.aws.s3.BucketWebsiteConfigurationArgs; import com.pulumi.aws.s3.inputs.BucketWebsiteConfigurationIndexDocumentArgs; import com.pulumi.aws.s3.inputs.BucketWebsiteConfigurationErrorDocumentArgs; import java.util.ArrayList; import java.util.Arrays; 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 BucketWebsiteConfiguration("example", BucketWebsiteConfigurationArgs.builder() .indexDocument(BucketWebsiteConfigurationIndexDocumentArgs.builder() .suffix("index.html") .build()) .errorDocument(BucketWebsiteConfigurationErrorDocumentArgs.builder() .key("error.html") .build()) .bucket(exampleAwsS3Bucket.id()) .routingRuleDetails(""" [{ \"Condition\": { \"KeyPrefixEquals\": \"docs/\" }, \"Redirect\": { \"ReplaceKeyPrefixWith\": \"\" } }] """) .build()); } }
-
-
Constructor Summary
Constructors Constructor Description BucketWebsiteConfigurationV2(java.lang.String name)Deprecated.BucketWebsiteConfigurationV2(java.lang.String name, BucketWebsiteConfigurationV2Args args)Deprecated.BucketWebsiteConfigurationV2(java.lang.String name, BucketWebsiteConfigurationV2Args args, com.pulumi.resources.CustomResourceOptions options)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description com.pulumi.core.Output<java.lang.String>bucket()Deprecated.com.pulumi.core.Output<java.util.Optional<BucketWebsiteConfigurationV2ErrorDocument>>errorDocument()Deprecated.com.pulumi.core.Output<java.util.Optional<java.lang.String>>expectedBucketOwner()Deprecated.static BucketWebsiteConfigurationV2get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, BucketWebsiteConfigurationV2State state, com.pulumi.resources.CustomResourceOptions options)Deprecated.Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.util.Optional<BucketWebsiteConfigurationV2IndexDocument>>indexDocument()Deprecated.com.pulumi.core.Output<java.util.Optional<BucketWebsiteConfigurationV2RedirectAllRequestsTo>>redirectAllRequestsTo()Deprecated.com.pulumi.core.Output<java.lang.String>region()Deprecated.com.pulumi.core.Output<java.lang.String>routingRuleDetails()Deprecated.com.pulumi.core.Output<java.util.List<BucketWebsiteConfigurationV2RoutingRule>>routingRules()Deprecated.com.pulumi.core.Output<java.lang.String>websiteDomain()Deprecated.com.pulumi.core.Output<java.lang.String>websiteEndpoint()Deprecated.
-
-
-
Constructor Detail
-
BucketWebsiteConfigurationV2
public BucketWebsiteConfigurationV2(java.lang.String name)
Deprecated.- Parameters:
name- The _unique_ name of the resulting resource.
-
BucketWebsiteConfigurationV2
public BucketWebsiteConfigurationV2(java.lang.String name, BucketWebsiteConfigurationV2Args args)Deprecated.- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
BucketWebsiteConfigurationV2
public BucketWebsiteConfigurationV2(java.lang.String name, BucketWebsiteConfigurationV2Args args, @Nullable com.pulumi.resources.CustomResourceOptions options)Deprecated.- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.options- A bag of options that control this resource's behavior.
-
-
Method Detail
-
bucket
public com.pulumi.core.Output<java.lang.String> bucket()
Deprecated.- Returns:
- Name of the bucket.
-
errorDocument
public com.pulumi.core.Output<java.util.Optional<BucketWebsiteConfigurationV2ErrorDocument>> errorDocument()
Deprecated.- Returns:
- Name of the error document for the website. See below.
-
expectedBucketOwner
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> expectedBucketOwner()
Deprecated.- Returns:
- Account ID of the expected bucket owner.
-
indexDocument
public com.pulumi.core.Output<java.util.Optional<BucketWebsiteConfigurationV2IndexDocument>> indexDocument()
Deprecated.- Returns:
- Name of the index document for the website. See below.
-
redirectAllRequestsTo
public com.pulumi.core.Output<java.util.Optional<BucketWebsiteConfigurationV2RedirectAllRequestsTo>> redirectAllRequestsTo()
Deprecated.- Returns:
- Redirect behavior for every request to this bucket's website endpoint. See below. Conflicts with `errorDocument`, `indexDocument`, and `routingRule`.
-
region
public com.pulumi.core.Output<java.lang.String> region()
Deprecated.- Returns:
- Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
-
routingRuleDetails
public com.pulumi.core.Output<java.lang.String> routingRuleDetails()
Deprecated.- Returns:
- JSON array containing [routing rules](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-websiteconfiguration-routingrules.html) 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
public com.pulumi.core.Output<java.util.List<BucketWebsiteConfigurationV2RoutingRule>> routingRules()
Deprecated.- Returns:
- List of rules that define when a redirect is applied and the redirect behavior. See below.
-
websiteDomain
public com.pulumi.core.Output<java.lang.String> websiteDomain()
Deprecated.- Returns:
- Domain of the website endpoint. This is used to create Route 53 alias records.
-
websiteEndpoint
public com.pulumi.core.Output<java.lang.String> websiteEndpoint()
Deprecated.- Returns:
- Website endpoint.
-
get
public static BucketWebsiteConfigurationV2 get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable BucketWebsiteConfigurationV2State state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Deprecated.Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name- The _unique_ name of the resulting resource.id- The _unique_ provider ID of the resource to lookup.state-options- Optional settings to control the behavior of the CustomResource.
-
-