Skip to content

Commit

Permalink
feat: allow public access to claims bucket (#82)
Browse files Browse the repository at this point in the history
Per the description here:
https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-control-block-public-access.html#access-control-block-public-access-options
- this PR enables public read access to the bucket. It allows the
indexing service to read claims by URL without any special handling for
these legacy claims.
  • Loading branch information
alanshaw authored Dec 13, 2024
1 parent bffff9d commit 32fba7e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion stacks/bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ import { Bucket as S3Bucket } from 'sst/constructs'
* @param {import('sst/constructs').StackContext} config
*/
export function Bucket ({ stack }) {
const claimsBucket = new S3Bucket(stack, 'claims-v1')
const claimsBucket = new S3Bucket(stack, 'claims-v1', {
cors: true,
cdk: {
bucket: {
blockPublicAccess: {
// do not allow public write access
blockPublicAcls: true,
ignorePublicAcls: true,
// allow public read access
blockPublicPolicy: false,
restrictPublicBuckets: false
}
}
}
})
return { claimsBucket }
}

0 comments on commit 32fba7e

Please sign in to comment.