pulumi / pulumi-okta

An Okta Pulumi resource package, providing multi-language access to Okta
Apache License 2.0
9 stars 2 forks source link

okta.idp.Oidc creation fails #649

Closed michaeldop closed 3 months ago

michaeldop commented 3 months ago

Describe what happened

Trying to create an okta.idp.Oidc resource results in a panic. I believe this is due to not mapping the schema field, pkceRequired, highlighted here https://github.com/pulumi/pulumi-okta/pull/594#issuecomment-2063855596.

The stack trace points to this line https://github.com/okta/terraform-provider-okta/blob/v4.8.1/okta/resource_okta_idp_oidc.go#L232

Sample program

new okta.idp.Oidc('idp', {
  issuerUrl: 'https://login.test.com/oauth2/default',
  authorizationUrl: 'https://login.test.com/oauth2/default/v1/authorize',
  authorizationBinding: 'HTTP-REDIRECT',
  jwksUrl: 'https://login.test.com/oauth2/default/v1/keys',
  jwksBinding: 'HTTP-REDIRECT',
  tokenUrl: 'https://login.test.com/oauth2/default/v1/token',
  tokenBinding: 'HTTP-POST',
  userInfoUrl: 'https://login.test.com/oauth2/default/v1/userinfo',
  userInfoBinding: 'HTTP-REDIRECT',
  name: 'Test IDP',
  clientId: '123456789',
  clientSecret: '*******************',
  issuerMode: 'DYNAMIC',
  scopes: ['openid', 'profile', 'email'],
});

Log output

 panic: value has no attribute of that name
    goroutine 275 [running]:
    github.com/hashicorp/go-cty/cty.Value.GetAttr({{{0x2e02bc8?, 0xc0007ad8a0?}}, {0x27844a0?, 0xc000ee7470?}}, {0x2ac512f, 0xd})
        /home/runner/go/pkg/mod/github.com/hashicorp/go-cty@v1.4.1-0.20200414143053-d3edf31b6320/cty/value_ops.go:700 +0x2f1
    github.com/okta/terraform-provider-okta/okta.buildIdPOidc(0x441e108?)
        /home/runner/work/pulumi-okta/pulumi-okta/upstream/okta/resource_okta_idp_oidc.go:232 +0x23d
    github.com/okta/terraform-provider-okta/okta.resourceIdpCreate({0x2e02530, 0xc0003f4d20}, 0x0?, {0x28f0700?, 0xc000b98000})
        /home/runner/work/pulumi-okta/pulumi-okta/upstream/okta/resource_okta_idp_oidc.go:130 +0x7b
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).create(0xc0002ecc40, {0x2e02488, 0xc000ee6810}, 0xd?, {0x28f0700, 0xc000b98000})
        /home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/v2@v2.0.0-20240229143312-4f60ee4e2975/helper/schema/resource.go:783 +0x11b
    github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema.(*Resource).Apply(0xc0002ecc40, {0x2e02488, 0xc000ee6810}, 0x0, 0xc000a6f880, {0x28f0700, 0xc000b98000})
        /home/runner/go/pkg/mod/github.com/pulumi/terraform-plugin-sdk/v2@v2.0.0-20240229143312-4f60ee4e2975/helper/schema/resource.go:914 +0xa89
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfshim/sdk-v2.v2Provider.Apply({0xc000056f00?, {0x0?, 0x29d5360?, 0x1?}}, {0x2e02488, 0xc000ee6810}, {0x2ac4dae, 0xd}, {0x0, 0x0}, ...)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.82.1-0.20240521215029-81c1dfbd579a/pkg/tfshim/sdk-v2/provider.go:131 +0x176
    github.com/pulumi/pulumi-terraform-bridge/v3/pkg/tfbridge.(*Provider).Create(0xc000015980, {0x2e02488?, 0xc000ee63f0?}, 0xc000e2b9a0)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/v3@v3.82.1-0.20240521215029-81c1dfbd579a/pkg/tfbridge/provider.go:1109 +0x87e
    github.com/pulumi/pulumi-terraform-bridge/x/muxer.(*muxer).Create.func1({0x2e16d20?, 0xc000015980?})
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/x/muxer@v0.0.8/muxer.go:375 +0x30
    github.com/pulumi/pulumi-terraform-bridge/x/muxer.resourceMethod[...](0xc0009dec60?, 0x40, 0xc000a816c0?)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/x/muxer@v0.0.8/muxer.go:334 +0xb5
    github.com/pulumi/pulumi-terraform-bridge/x/muxer.(*muxer).Create(0x0?, {0x2e02488?, 0xc000ee63f0?}, 0x40?)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi-terraform-bridge/x/muxer@v0.0.8/muxer.go:374 +0x65
    github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Create_Handler.func1({0x2e02488, 0xc000ee63f0}, {0x29416e0?, 0xc000e2b9a0})
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.116.1/proto/go/provider_grpc.pb.go:593 +0x72
    github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc.OpenTracingServerInterceptor.func1({0x2e02488, 0xc000ee60c0}, {0x29416e0, 0xc000e2b9a0}, 0xc000be1e20, 0xc0006ed9f8)
        /home/runner/go/pkg/mod/github.com/grpc-ecosystem/grpc-opentracing@v0.0.0-20180507213350-8e809c8a8645/go/otgrpc/server.go:57 +0x3d0
    github.com/pulumi/pulumi/sdk/v3/proto/go._ResourceProvider_Create_Handler({0x2a3f1c0?, 0xc0009dec60}, {0x2e02488, 0xc000ee60c0}, 0xc000881080, 0xc0002604a0)
        /home/runner/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.116.1/proto/go/provider_grpc.pb.go:595 +0x135
    google.golang.org/grpc.(*Server).processUnaryRPC(0xc000596000, {0x2e02488, 0xc000ee6030}, {0x2e0d8e0, 0xc00028e600}, 0xc000edcea0, 0xc0001acc30, 0x3e25a00, 0x0)
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.63.2/server.go:1369 +0xe23
    google.golang.org/grpc.(*Server).handleStream(0xc000596000, {0x2e0d8e0, 0xc00028e600}, 0xc000edcea0)
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.63.2/server.go:1780 +0x1016
    google.golang.org/grpc.(*Server).serveStreams.func2.1()
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.63.2/server.go:1019 +0x8b
    created by google.golang.org/grpc.(*Server).serveStreams.func2 in goroutine 83
        /home/runner/go/pkg/mod/google.golang.org/grpc@v1.63.2/server.go:1030 +0x135

Affected Resource(s)

okta.idp.Oidc

Output of pulumi about

❯ pulumi about
CLI          
Version      3.120.0
Go Version   go1.22.4
Go Compiler  gc

Plugins
KIND      NAME    VERSION
resource  aws     6.40.0
language  nodejs  unknown
resource  okta    4.8.2

Host     
OS       darwin
Version  14.5
Arch     x86_64

This project is written in nodejs: executable='/Users/michaeldop/.nvm/versions/node/v20.14.0/bin/node' version='v20.14.0'

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

VenelinMartinov commented 3 months ago

Hi @michaeldop, thanks for reporting! This is a pretty bad experience and we'll have a look at it as soon as possible.

guineveresaenger commented 3 months ago

This was fixed upstream in https://github.com/okta/terraform-provider-okta/pull/1984. We'll be upgrading this provider shortly and this issue should be resolved.

michaeldop commented 3 months ago

Thank you for the quick turn around, v4.9.0 is working great!