Skip to content

Commit d4ba677

Browse files
authored
Update nx-monorepo to BucketV2 (#1703)
Re: pulumi/home#3631
1 parent 7119ac5 commit d4ba677

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

nx-monorepo/components/s3folder/index.ts

+8-7
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as aws from "@pulumi/aws";
22
import * as pulumi from "@pulumi/pulumi";
33

44
export class S3Folder extends pulumi.ComponentResource {
5-
readonly bucket: pulumi.Output<aws.s3.Bucket>;
5+
readonly bucket: pulumi.Output<aws.s3.BucketV2>;
66
readonly websiteUrl: pulumi.Output<string>;
77

88
/**
@@ -14,11 +14,12 @@ export class S3Folder extends pulumi.ComponentResource {
1414
super("pulumi:examples:S3Folder", bucketName, {}, opts);
1515

1616
// 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});
2223

2324
const publicAccessBlock = new aws.s3.BucketPublicAccessBlock("public-access-block", {
2425
bucket: siteBucket.id,
@@ -32,7 +33,7 @@ export class S3Folder extends pulumi.ComponentResource {
3233
}, { parent: this, dependsOn: publicAccessBlock }); // specify resource parent
3334

3435
this.bucket = pulumi.output(siteBucket);
35-
this.websiteUrl = siteBucket.websiteEndpoint;
36+
this.websiteUrl = siteBucketWebsite.websiteEndpoint;
3637

3738
// Register output properties for this component
3839
this.registerOutputs({

0 commit comments

Comments
 (0)