Skip to content

Commit

Permalink
Fix s3 bucket creation
Browse files Browse the repository at this point in the history
- aws changed some defaults
  • Loading branch information
nenadalm committed Nov 23, 2023
1 parent d4cfce5 commit 6e89083
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@topmonks/pulumi-aws",
"version": "3.1.2",
"version": "3.1.3",
"description": "Custom AWS Resources for Pulumi",
"keywords": [
"pulumi",
Expand Down Expand Up @@ -31,6 +31,7 @@
},
"scripts": {
"build": "tsc",
"package": "yarn run build && cp -R lambdas/code/* bin/lambdas",
"install-peers": "install-peers"
},
"pulumi": {
Expand Down
17 changes: 16 additions & 1 deletion website.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function createBucket(
indexDocument: "index.html",
errorDocument: "404.html"
};
return new aws.s3.Bucket(
const bucket = new aws.s3.Bucket(
`${domain}/bucket`,
{
bucket: domain,
Expand All @@ -142,6 +142,21 @@ function createBucket(
},
{ parent }
);
new aws.s3.BucketOwnershipControls(`${domain}/bucket-ownership-controls`, {
bucket: bucket.id,
rule: {
objectOwnership: "ObjectWriter"
}
});
new aws.s3.BucketPublicAccessBlock(`${domain}-bucket-pab`, {
bucket: bucket.id,
blockPublicAcls: false,
blockPublicPolicy: false,
ignorePublicAcls: false,
restrictPublicBuckets: false
});

return bucket;
}

/**
Expand Down

0 comments on commit 6e89083

Please sign in to comment.