Skip to content

[Question] Splitting tf-next build #245

@jd-carroll

Description

@jd-carroll

First off, thank you for pulling this together! This tool is exactly the type of resource I was looking for and saved me hours/days of time. However... I do not use Terraform. And I generally feel that there is too much happening in the tf-next build command.

Why would it not make sense to support a pattern that looks something like:

  • $ next build
  • $ tf-next build-manifest // defines all of the static/dynamic routes and assets
  • $ tf-next package // creates the zip artifacts for lambda functions
  • $ tf-next bundle-tf -- or -- $ tf-next bundle-cdk ... // outputs what tf-next build current outputs
    Note: part of this will be me figuring out how to help contribute any changes

The basic idea being, let Next be responsible for building the initial assets. Even if this requires custom config in the next.config.js file (this is exactly what next build is best at). Then assemble all of the artifacts from that build into a single manifest which describes all of the possible routes. The last two steps could either be separate or combined but they would be responsible for creating something deployable to the cloud.

The code which creates that deployment could have adaptors for different clouds (e.g. AWS vs Azure) and separate adaptors for separate infra packages (e.g. Terraform vs CDK).

Thoguhts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionQuestion about usage of the library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions