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 aws-js-s3-folder-component to BucketV2 #1682

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion aws-js-s3-folder-component/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ with `***`.
Type Name Status Info
+ pulumi:pulumi:Stack aws-js-s3-folder-component-website-component-testing created
+ └─ examples:S3Folder pulumi-static-site created
+ ├─ aws:s3:Bucket pulumi-static-site created
+ ├─ aws:s3:BucketV2 pulumi-static-site created
+ ├─ aws:s3:BucketPolicy bucketPolicy created
+ ├─ aws:s3:BucketObject favicon.png created
+ └─ aws:s3:BucketObject index.html created
Expand Down
15 changes: 9 additions & 6 deletions aws-js-s3-folder-component/s3folder.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ class S3Folder extends pulumi.ComponentResource {
super("pulumi:examples:S3Folder", bucketName, {}, opts); // Register this component with name pulumi:examples:S3Folder

// Create a bucket and expose a website index document
let siteBucket = new aws.s3.Bucket(bucketName, {
website: {
indexDocument: "index.html",
let siteBucket = new aws.s3.BucketV2(bucketName, {}, { parent: this }); // specify resource parent

let websiteConfig = new aws.s3.BucketWebsiteConfigurationV2("s3-website-bucket-config", {
bucket: siteBucket.id,
indexDocument: {
suffix: "index.html",
},
}, { parent: this }); // specify resource parent
}, { parent: this });

const publicAccessBlock = new aws.s3.BucketPublicAccessBlock("public-access-block", {
bucket: siteBucket.id,
blockPublicAcls: false,
Expand All @@ -39,7 +42,7 @@ class S3Folder extends pulumi.ComponentResource {
}, { parent: this, dependsOn: publicAccessBlock }); // specify resource parent

this.bucketName = siteBucket.bucket;
this.websiteUrl = siteBucket.websiteEndpoint;
this.websiteUrl = websiteConfig.websiteEndpoint;

// Register output properties for this component
this.registerOutputs({
Expand Down
Loading