feat(static-site): allow optional S3 bucket prefix for static site origin#28
feat(static-site): allow optional S3 bucket prefix for static site origin#28nacholiya wants to merge 5 commits intoScript47:masterfrom
Conversation
|
Any other names you can think of? |
|
Good catch 👍 Renamed |
|
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
29e930a
Compare
|
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. |
|
Added support for using an existing S3 bucket via |
|
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. |
|
That makes sense 👍 Using I’ll refactor the implementation accordingly. |
|
Updated variable description to clarify behavior with |
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