Enable container service before creating GKE cluster
MODIFY
gcp-go-gke/main.go
gcp-go-gke/main.go
@@ -12,6 +12,13 @@ import (
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
+ containerService, err := projects.NewService(ctx, "project", &projects.ServiceArgs{
+ Service: pulumi.String("container.googleapis.com"),
+ })
+ if err != nil {
+ return err
+ }
+
engineVersions, err := container.GetEngineVersions(ctx, &container.GetEngineVersionsArgs{})
if err != nil {
return err
@@ -31,7 +38,7 @@ func main() {
pulumi.String("https://www.googleapis.com/auth/monitoring"),
},
},
- })
+ }, pulumi.DependsOn([]pulumi.Resource{containerService}))
if err != nil {
return err
}

Enable container service before creating GKE cluster (#899)