hundreds-judge-64203
05/21/2023, 4:07 PMinfrastructure
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 projectincalculable-parrot-23117
05/24/2023, 5:20 PM/
├─go.mod
├─main.go
└─Pulumi.yaml
Pulumi project as a subdirectory in an existing project.
/
├─go.mod
├─other.go
└─infrastructure/
├─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 tidy
. 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 pulumi
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-64203
05/25/2023, 5:13 PMinfrastructure/go.mod
for now as you suggested