Open YoshiWalsh opened 5 years ago
Good idea to create an issue for this!
I agree that we should handle infrastructure deployment through third party solutions and not reinvent the wheel, BUT I do think it'd be nice if this was automated a bit more rather than needing users to follow yet another guide.
In generally I want there to be less guides, because I think we can take much more friction out of the entire process.
Example: gatsby-plugin-s3 cdn
would create a distribution (which would simply deploy our premade terraform module) and if one exists already, invalidate it.
However, for now, writing the guide should be a good start.
We can always automate it more later on (I'm planning on doing the same for some of the existing recipes right now)
Definitely agree on the plugin not needing to be solely for S3 - yes, kinda ironic with a name like gatsby-plugin-s3
.
This is something we've already been discussing in a few different places. (#45, #46) I am making this thread to allow us a more organised place to talk about it.
I think there are 2 main questions to answer:
Should this plugin concern itself with the provisioning of infrastructure to host a site, or should it just focus on deploying a site within existing infrastructure.
Is the scope of this plugin just S3, or is it about hosting a static site on AWS? (E.g. is CloudFront functionality within scope)
Personally, my vision is this:
Infrastructure should be provisioned via Terraform, CloudFormation, or manually. I think that these tools are the best way to provision infrastructure, allowing for full customiseability and robust deployments. I think if this plugin tries to deploy infrastructure we are reinventing the wheel. However, I do think that providing guides/documentation on best practices for setting things up is a good fit for this project, even if we don't attempt to do everything for our users.
I'm planning on writing Terraform modules to make things easier, and maybe also CloudFormation templates. I'm busy for the next few weeks, but in about a month's time I should be able to work on these. I have some ideas for how to structure the modules to allow users with plenty of flexibility as to how they wish to set everything up.
As for the second question my opinion is that this plugin doesn't have to be limited to S3. I would love an option to have this plugin create a CloudFormation invalidation for me after each deployment. I'm sure there will be other similar enhancements that we can add in future.
Anyway, I think that the question about the purpose and scope of this plugin keeps coming up, so let's decide it and then we can align development with that.