@@ -2,7 +2,7 @@ import * as aws from "@pulumi/aws";
2
2
import * as pulumi from "@pulumi/pulumi" ;
3
3
4
4
export class S3Folder extends pulumi . ComponentResource {
5
- readonly bucket : pulumi . Output < aws . s3 . Bucket > ;
5
+ readonly bucket : pulumi . Output < aws . s3 . BucketV2 > ;
6
6
readonly websiteUrl : pulumi . Output < string > ;
7
7
8
8
/**
@@ -14,11 +14,12 @@ export class S3Folder extends pulumi.ComponentResource {
14
14
super ( "pulumi:examples:S3Folder" , bucketName , { } , opts ) ;
15
15
16
16
// Create a bucket and expose a website index document
17
- const siteBucket = new aws . s3 . Bucket ( bucketName , {
18
- website : {
19
- indexDocument : "index.html" ,
20
- } ,
21
- } , { parent : this } ) ; // specify resource parent
17
+ const siteBucket = new aws . s3 . BucketV2 ( bucketName , { } , { parent : this } ) ; // specify resource parent
18
+
19
+ const siteBucketWebsite = new aws . s3 . BucketWebsiteConfigurationV2 ( bucketName , {
20
+ bucket : siteBucket . bucket ,
21
+ indexDocument : { suffix : "index.html" }
22
+ } , { parent : this } ) ;
22
23
23
24
const publicAccessBlock = new aws . s3 . BucketPublicAccessBlock ( "public-access-block" , {
24
25
bucket : siteBucket . id ,
@@ -32,7 +33,7 @@ export class S3Folder extends pulumi.ComponentResource {
32
33
} , { parent : this , dependsOn : publicAccessBlock } ) ; // specify resource parent
33
34
34
35
this . bucket = pulumi . output ( siteBucket ) ;
35
- this . websiteUrl = siteBucket . websiteEndpoint ;
36
+ this . websiteUrl = siteBucketWebsite . websiteEndpoint ;
36
37
37
38
// Register output properties for this component
38
39
this . registerOutputs ( {
0 commit comments