hi <@U01JVDKASAC>, hopefully a quick one - say for...
# help
k
hi @Frank, hopefully a quick one - say for ex, I want to expose the bucket (where the notes are stored) as a static site - what would be the construct using sst StaticSite? essentially looking for a construct to expose a S3 bucket via a CF distribution. I dont have a “path” per se as I want the contents (say publicly accessible images) of the S3 bucket to be exposed via a custom domain..
t
StaticSite current cannot do this afaik. How are you creating / managing the s3 bucket?
What you can do is drop down into CDK and use their CF distribution construct to create a distribution pointing to the bucket: https://docs.aws.amazon.com/cdk/api/latest/docs/aws-cloudfront-readme.html#from-an-s3-bucket
k
via the stack.. so in this case, I would like to expose the s3 bucket that was created to store the notes via a CF
ok, so the StaticSite has no implementation of this?
t
Yeah staticsite is for creating an s3 bucket + cf distribution from files you build locally
k
ok, so let me try this then.. new cloudfront.Distribution(this, ‘myDist’, { defaultBehavior: { origin: new origins.S3Origin(bucket) }, });
i suppose I have to now use CDK to create the cert etc to feed it to CF distrib as StaticSite construct cannot be used then, right?
it will be great if we can expand StaticSite to use S3 as a source at some point 🙂
f
Gotcha. Yeah StaticSite is more for hosting websites. In this case, I think it’d makes sense if we added a prop to the
Bucket
construct to achieve this 🤔