CDK Go package includes

0

Folks, given the following seemingly normal project setup, cdk-deploy all fails, it is unable to locate the files.

./our_company.go:

package main
func main() {
   SomeStack(app, "SomeStack", &StackProps{})
}

./somestack.go:

package main
func SomeStack(scope constructs.Construct, id string, props *StackProps) awscdk.Stack {}

No issues in Goland, its a simple main package with functions spread across files.

cdk fails:

$ cdk deploy -all
./our_company.go:1262:2: undefined: SomeStack
V
preguntada hace 3 meses109 visualizaciones
1 Respuesta
1
  • Ensure both our_company.go and somestack.go are in the same directory.
  • Running go build might provide additional context or a more detailed error message, helping you understand why the CDK thinks SomeStack is undefined. When you run the go build or go run commands, make sure to include all relevant files. For example:
go build our_company.go somestack.go
go run .

If this has answered your question or was helpful, accepting the answer would be greatly appreciated. Thank you!

profile picture
EXPERTO
respondido hace 3 meses

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas