You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
maikeffi
changed the title
Error pulumi Go GCP error on Importing Nat
Error pulumi import : Go provider for GCP on Importing routerNat
Mar 18, 2021
maikeffi
changed the title
Error pulumi import : Go provider for GCP on Importing routerNat
Error during pulumi import : Go provider for GCP on Importing routerNat
Mar 18, 2021
Expected behavior
When trying to import RouterNat of GCP
pulumi import gcp:compute/routerNat:RouterNat
Import Completes successfully and a sample code of the imported resource is expected
But got the error below in
Current behavior
Below is the output log
Pulumi Version: v2.22.0
Go Version: go1.16
Go Compiler: gc
Architecture: amd64
Operating System: darwin
Panic: invalid Go source code:
package main
import (
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
"github.com/pulumi/pulumi-gcp/sdk/v4/go/gcp/compute"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := compute.NewRouterNat(ctx, "web_stg_nat", &compute.RouterNatArgs{
EnableEndpointIndependentMapping: pulumi.Bool(true),
IcmpIdleTimeoutSec: pulumi.Int(30),
Name: pulumi.String("web-stg-nat"),
NatIpAllocateOption: pulumi.String("MANUAL_ONLY"),
NatIps: interface{}{
nil,
pulumi.String("**************************************"),
},
Router: pulumi.String("web-stg-router"),
SourceSubnetworkIpRangesToNat: pulumi.String("ALL_SUBNETWORKS_ALL_IP_RANGES"),
TcpEstablishedIdleTimeoutSec: pulumi.Int(1200),
TcpTransitoryIdleTimeoutSec: pulumi.Int(30),
UdpIdleTimeoutSec: pulumi.Int(30),
}, pulumi.Protect(true))
if err != nil {
return err
}
return nil
})
}
goroutine 1 [running]:
runtime/debug.Stack(0xc0026caa90, 0x56259e0, 0xc0027daa08)
/usr/local/Cellar/go/1.16/libexec/src/runtime/debug/stack.go:24 +0x9f
main.panicHandler()
/private/tmp/pulumi-20210303-16507-1fj5hzn/pkg/cmd/pulumi/main.go:29 +0x76
panic(0x56259e0, 0xc0027daa08)
/usr/local/Cellar/go/1.16/libexec/src/runtime/panic.go:965 +0x1b9
github.com/pulumi/pulumi/pkg/v2/codegen/go.GenerateProgram(0xc002724640, 0x67b9b18, 0xc00241b200, 0x52fbce0, 0xc0022825b0, 0x1, 0x1)
/private/tmp/pulumi-20210303-16507-1fj5hzn/pkg/codegen/go/gen_program.go:92 +0x91f
main.generateImportedDefinitions.func1(0x5b9cd20, 0xc000b97260, 0xc002724640, 0xc0026cae00, 0x2)
/private/tmp/pulumi-20210303-16507-1fj5hzn/pkg/cmd/pulumi/import.go:238 +0x44
github.com/pulumi/pulumi/pkg/v2/codegen/importer.GenerateLanguageDefinitions(0x5b9cd20, 0xc000b97260, 0x5b9f460, 0xc001b03b90, 0xc0026cb050, 0xc0005e2060, 0x1, 0x1, 0xc000b97290, 0x3e, ...)
/private/tmp/pulumi-20210303-16507-1fj5hzn/pkg/codegen/importer/language.go:107 +0x5e9
main.generateImportedDefinitions(0x5b9cd20, 0xc000b97260, 0xc0008c5890, 0x3, 0xc00045d170, 0x13, 0xc00210acf0, 0x591aa58, 0xc000b97290, 0xc0004fd8c0, ...)
/private/tmp/pulumi-20210303-16507-1fj5hzn/pkg/cmd/pulumi/import.go:237 +0x5a5
main.newImportCmd.func1(0xc000b9f080, 0xc000b97200, 0x3, 0x3, 0x0, 0x0)
/private/tmp/pulumi-20210303-16507-1fj5hzn/pkg/cmd/pulumi/import.go:476 +0xe92
github.com/pulumi/pulumi/sdk/v2/go/common/util/cmdutil.RunResultFunc.func1(0xc000b9f080, 0xc000b97200, 0x3, 0x3)
/private/tmp/pulumi-20210303-16507-1fj5hzn/sdk/go/common/util/cmdutil/exit.go:112 +0x6b
github.com/spf13/cobra.(*Command).execute(0xc000b9f080, 0xc000b971d0, 0x3, 0x3, 0xc000b9f080, 0xc000b971d0)
/Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:846 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0xc000158840, 0xc000084740, 0x406dbc8, 0xc000000180)
/Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:950 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
/Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887
main.main()
/private/tmp/pulumi-20210303-16507-1fj5hzn/pkg/cmd/pulumi/main.go:48 +0x4d
Steps to reproduce
pulumi import gcp:compute/routerNat:RouterNat <path to gcp nat rounter with name>
Context (Environment)
We are trying to set up pulumi for an existing gcp environment .
Affected feature
pulumi import , Code generation
The text was updated successfully, but these errors were encountered: