Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update nx-monorepo to BucketV2 #1703

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions nx-monorepo/components/s3folder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<aws.s3.Bucket>;
readonly bucket: pulumi.Output<aws.s3.BucketV2>;
readonly websiteUrl: pulumi.Output<string>;

/**
Expand All @@ -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,
Expand All @@ -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({
Expand Down
Loading