hundreds-judge-6420305/21/2023, 4:07 PM
and created a new pulumi project in that but that also creates a go.mod file and then I run into the issue of having a nested module. In my case, the go.mod file for my application code lives in the root of the project
incalculable-parrot-2311705/24/2023, 5:20 PM
Pulumi project as a subdirectory in an existing project.
/ ├─go.mod ├─main.go └─Pulumi.yaml
If you have an existing Go project with its own go.mod, you can delete infrastructure/go.mod and run
/ ├─go.mod ├─other.go └─infrastructure/ ├─main.go └─Pulumi.yaml
. Go will inspect your code and update go.mod with any missing dependencies like the Pulumi SDK. It's also allowed to keep the infrastructure/go.mod and treat it as a submodule. That requires some more knowledge of Go submodules. Typically, there shouldn't be any issues, but you have to make sure to run
go mod tidy
inside the infrastructure directory, not outside. One advantage of doing this is that dependencies for your infrastructure (Pulumi and friends) do not become dependencies of your application.
hundreds-judge-6420305/25/2023, 5:13 PM
for now as you suggested