-
-
Notifications
You must be signed in to change notification settings - Fork 449
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
Deploying to existing infrastructure #642
Comments
There's no input yet to specify to build the Lambda bundle but not deploy to AWS. Perhaps a workaround is to set invalid AWS keys, I think it still may output the handlers to the .serverless-nextjs generated directory. However I think S3 assets are uploaded directly, there's no build artifact in that folder, so you would have to figure out that based on .next directory contents. Feel free to add a new input to do this and I'll be happy to review it. |
Thanks for this @dphang, I'll go back to the code and see what we can do. Are there any plans to support this feature, in any case? Thanks! |
I haven't planned to make a change yet, but it does seem straightforward enough to disable the actual deployment step to AWS (separate build from the deployment) if you just want the build outputs (contents of the We'd have to add the S3 assets there too that would have been uploaded in that case. Then you can just use the content of this directory and you'd have to deploy it yourself to Lambda/CloudFront/S3.
async default(
inputs: ServerlessComponentInputs = {}
): Promise<DeploymentResult> {
if (inputs.build !== false) {
await this.build(inputs);
}
return this.deploy(inputs);
}
I think this could help make this component more provider-agnostic in the future by clearly separating build vs. deploy responsibilities. |
Thanks, @dphang, decoupling the asset creation from the actual deployment sounds like a great strategy, and it would surely make this component a lot more viable for people who want to deploy using different tools or providers. I'll see what I can make of these suggestions and I'll get back to you should any more questions arise. Meanwhile, I'm glad this was labelled as "enhancement", and I hope this will become a feature soon! |
Yea, makes sense. Short term we can make those small refactor to better decouple build and deploy step. So you can deploy the build outputs to AWS yourself. I can work on the change in the next weeks. Long term I think it makes sense to further decouple the cloud providers from this process (right now AWS is heavily coupled into the core logic). But this is non-trivial to do so I expect it can take some months. So we could have something like this:
Then, we could adopt a plugin architecture to build and deploy for specific platforms:
It will make it easier to support other platforms (Lambda, Cloudflare, GCP, Azure). |
I've added a new input |
@dphang Thanks for the very quick turnaround! We are planning to start using this in the short term. |
Hi @dphang, We were able to test this release and successfully deploy our Next.js app to existing infrastructure. However, we have noticed that the Serverless artifacts are still being generated. While this is not a deal-breaker in any shape or form, it might be something for you to take a look at just to keep things clean. Thanks! |
@finferflu which serverless artifacts are you talking about, the |
@dphang sorry for the delay, yes, I'm talking about the |
Hi,
I can't seem to find anything that relates to this in the documentation, however, I'd like to deploy my application to existing infrastructure. Is there any way to package the application so that it's ready for deployment, but without creating all the resources via Serverless?
Thank you.
The text was updated successfully, but these errors were encountered: