GoogleCloudPlatform / terraformer

CLI tool to generate terraform files from existing infrastructure (reverse Terraform). Infrastructure to Code
Apache License 2.0
12.67k stars 1.65k forks source link

Okta Provider Not Up to Date (~> 4.11.0) #1936

Open lborruto opened 1 month ago

lborruto commented 1 month ago

I'm encountering issues with the Okta provider while using Terraformer to generate OAuth and SWA applications (only tested with those for now). The provider seems outdated, and the generated Terraform code is producing the following errors:

  1. OAuth Apps:

    • Error: Required attribute "type" not specified: An attribute named "type" is required.
    • This indicates that the "type" attribute is missing in the generated Terraform code, making it incompatible with the current Terraform Okta provider.
  2. SWA Apps:

    • Error: ""groups" is deprecated: Reason: "Groups associated with the application""
    • Error: ""users" is deprecated: Reason: "Users associated with the application""
    • The generated code includes deprecated attributes like "groups" and "users", which are no longer supported by the Terraform Okta provider.
  3. Plugin Error

    [ERROR] plugin.terraform-provider-okta_v4.11.0.exe: Response contains error diagnostic: tf_proto_version=5.4 tf_provider_addr=okta/okta tf_rpc=Configure @caller=github.com/hashicorp/terraform-plugin-go@v0.22.2/tfprotov5/internal/diag/diagnostics.go:58 diagnostic_attribute="" diagnostic_severity=ERROR diagnostic_summary="Value Conversion Error" tf_req_id=9a4c8afd-5903-1703-a7e0-c3904e9c3d53 @module=sdk.proto
    diagnostic_detail=
    | An unexpected error was encountered trying to build a value. This is always an error in the provider. Please report the following to the provider developer:
    |
    | Received null value, however the target type cannot handle null values. Use the corresponding `types` package type, a pointer type or a custom type that handles null values.
    |
    | Path:
    | Target Type: okta.FrameworkProviderData
    | Suggested `types` Type: basetypes.ObjectValue
    | Suggested Pointer Type: *okta.FrameworkProviderData
    timestamp="2024-10-15T10:39:29.892+0200"

Steps to Reproduce:

  1. Set up environment with OKTA_API_TOKEN, OKTA_ORG_NAME, and OKTA_BASE_URL.
  2. Run the following command to import Okta resources:
    terraformer import okta --resources=okta_app_swa
    terraformer import okta --resources=okta_app_oauth
  3. The generated .tf files produce the above errors when applied with Terraform.

Terraformer Version: v0.8.24
Terraform Version: 1.9.7
Okta Provider Version: 4.11.0

Could you please update the Terraformer Okta provider integration to support the current schema. Thanks, this tool is amazing!

brennoo commented 1 month ago

I could take this one

jgalluzzi commented 1 month ago

@brennoo what versions would you be changing to? I was looking to fix something else I just discovered with network_zones.

brennoo commented 1 month ago

@jgalluzzi mainly Okta SDK to V5; check the PR I raised, if it gets accepted I will keep updating the remaining resources

brennoo commented 1 month ago

@jgalluzzi I've updated network_zone, take a look

lborruto commented 1 day ago

Hey, would be really useful to also add the admin part of Okta.