Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config option bucketPrefix for CloudFront origin path #92

Closed
wants to merge 2 commits into from

Conversation

darcy
Copy link
Contributor

@darcy darcy commented Jul 13, 2019

This is related to #24

Specifically, this adds support for an optional bucketPrefix option to be used for uploading the build into a directory in the S3 bucket. This is different than pathPrefix which is related to the actual build content and linking of pages therein.

In practical terms, this would relate to the directory path/origin path option in CloudFront.

More info here: https://aws.amazon.com/about-aws/whats-new/2014/12/16/amazon-cloudfront-now-allows-directory-path-as-origin-name/

bluehat974 pushed a commit to armis-paris/gatsby-plugin-s3 that referenced this pull request Jul 31, 2019
@acesaft
Copy link

acesaft commented Aug 7, 2019

is there any timeframe for when this is getting merged?

@bluehat974
Copy link

Could be useful to have it, as Gatsby added the theme concept
https://www.gatsbyjs.org/docs/themes/what-are-gatsby-themes/

We want to deploy Gatsby app using a common theme into multiple S3 subfolder.

@jariz Any ideas why this PR is bloqued?

@travisbloom
Copy link

I was doing some testing with this branch and I'm pretty sure that this behavior will break https://github.com/jariz/gatsby-plugin-s3/pull/92/files#diff-461a9672fe884beb7c4d6097795f4cbfR102

I suggest we change the regex to **/static/**

@darcy darcy force-pushed the feature/bucket-prefix branch from 7c5ee10 to 4992db0 Compare February 12, 2020 00:03
hlolli added a commit to hlolli/gatsby-plugin-s3 that referenced this pull request Mar 4, 2020
hlolli added a commit to hlolli/gatsby-plugin-s3 that referenced this pull request Mar 4, 2020
hlolli added a commit to hlolli/gatsby-plugin-s3 that referenced this pull request Mar 4, 2020
@jariz
Copy link
Collaborator

jariz commented Mar 4, 2020

Will merge this after I tested it with the new end to end testing from @JoshuaWalsh (#83)

@rossluebe
Copy link
Contributor

I'd like to help get this merged as I'm working on a project that has one S3 bucket with two Gatsby apps in different directories inside the bucket. I found this PR and saw that it was behind master. After I rebased it and tested it locally I found that this almost worked correctly but it was creating a nameless folder and putting the bucketPrefix folder inside that. I could create a new PR that is this PR ahead of master with my change. Please let me know if this is the wrong way to contribute, or if there is an issue with the code.

@mikhaelsantos
Copy link

Any ETA on when this can be merged. We are in need of this feature.

@YoshiWalsh
Copy link
Collaborator

I'm aiming to merge #83 some time next week. Jari wants to use #83 in order to test this PR before merging it.

So at a guess, some time in the next 2 weeks?

@LuisBrime
Copy link

Any news on this feature? Will it be merged sometime soon?

@thomaslefeuvre
Copy link

For people who are wanting to use this feature in order to serve multiple websites from the same bucket, perhaps consider using separate buckets for each Gatsby site?

You won't be charged more (S3 charges based on storage space used and data in/out) and you will be able to use the nice "website configuration" features of S3.

Another reason you might be wanting to put them in the same website is to serve different Gatsby apps at different paths of your website - if this is the case, you could still use separate S3 buckets and a CloudFront distribution with different origins configured.


I could be missing something, but I don't think this feature needs to be a dealbreaker for any the scenario I can think of. Hope this helps!

@rossluebe
Copy link
Contributor

@thomaslefeuvre my scenario (and likely others here) is two Gatsby apps that operate under different subdirectories of the same URL. The cloudfront/s3 architecture is tied together at the domain name, so both apps need to be in the same bucket.

@jariz
Copy link
Collaborator

jariz commented Jul 22, 2020

Continues in #134

@jariz jariz closed this Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.