feat(static-site): allow optional S3 bucket prefix for static site origin - #28
Conversation
Script47
commented
Mar 13, 2026
Any other names you can think of? |
Good catch 👍 Renamed |
Script47
commented
Mar 19, 2026
I've been mulling this change over for the last couple of days and have concluded that the real benefit of this change will be seen if you're able to reuse S3 buckets. Currently, the module always creates the S3 bucket but if you could pass it an existing bucket alongside the
|
e236168 to
29e930aComparenacholiya
commented
Mar 19, 2026
Great suggestion 👍 This makes a lot of sense, especially for reusing a single S3 bucket across multiple sites. I’ll work on adding support for using an existing bucket alongside origin_path. |
nacholiya
commented
Mar 19, 2026
Added support for using an existing S3 bucket via |
Script47
commented
Mar 19, 2026
I’d approach it like this:
To me, this is more idiomatic as it provides a single source for the bucket name and an explicit, toggleable flag to control the behaviour. Of course, you'll need to tweak the logic elsewhere too. |
nacholiya
commented
Mar 19, 2026
That makes sense 👍 Using I’ll refactor the implementation accordingly. |
nacholiya
commented
Mar 19, 2026
Updated variable description to clarify behavior with |
Uh oh!
There was an error while loading. Please reload this page.
Summary
Adds support for an optional bucket_prefix variable to allow serving static site content from a specific prefix inside the S3 bucket.
Changes
Added bucket_prefix variable
Updated CloudFront origin configuration to support prefix using origin_path
Backward Compatibility
If bucket_prefix is empty (default), the module behaves exactly as before and serves content from the root of the bucket.
Related Issue
Fixes#12