From af4fee9ece5923222dedb0a12d14ea00be21d3b4 Mon Sep 17 00:00:00 2001 From: Anton Tayanovskyy Date: Thu, 19 Sep 2024 15:51:03 -0400 Subject: [PATCH] Update nx-monorepo to BucketV2 --- nx-monorepo/components/s3folder/index.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/nx-monorepo/components/s3folder/index.ts b/nx-monorepo/components/s3folder/index.ts index f5c1ce818..f0399c420 100644 --- a/nx-monorepo/components/s3folder/index.ts +++ b/nx-monorepo/components/s3folder/index.ts @@ -2,7 +2,7 @@ import * as aws from "@pulumi/aws"; import * as pulumi from "@pulumi/pulumi"; export class S3Folder extends pulumi.ComponentResource { - readonly bucket: pulumi.Output; + readonly bucket: pulumi.Output; readonly websiteUrl: pulumi.Output; /** @@ -14,11 +14,12 @@ export class S3Folder extends pulumi.ComponentResource { super("pulumi:examples:S3Folder", bucketName, {}, opts); // Create a bucket and expose a website index document - const siteBucket = new aws.s3.Bucket(bucketName, { - website: { - indexDocument: "index.html", - }, - }, { parent: this }); // specify resource parent + const siteBucket = new aws.s3.BucketV2(bucketName, {}, { parent: this }); // specify resource parent + + const siteBucketWebsite = new aws.s3.BucketWebsiteConfigurationV2(bucketName, { + bucket: siteBucket.bucket, + indexDocument: {suffix: "index.html"} + }, { parent: this}); const publicAccessBlock = new aws.s3.BucketPublicAccessBlock("public-access-block", { bucket: siteBucket.id, @@ -32,7 +33,7 @@ export class S3Folder extends pulumi.ComponentResource { }, { parent: this, dependsOn: publicAccessBlock }); // specify resource parent this.bucket = pulumi.output(siteBucket); - this.websiteUrl = siteBucket.websiteEndpoint; + this.websiteUrl = siteBucketWebsite.websiteEndpoint; // Register output properties for this component this.registerOutputs({