Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

okta_resource_set crashes with devices added #1936

Open
mattdavis-okta opened this issue Mar 19, 2024 · 1 comment
Open

okta_resource_set crashes with devices added #1936

mattdavis-okta opened this issue Mar 19, 2024 · 1 comment
Labels
bug triaged Triaged into internal Jira

Comments

@mattdavis-okta
Copy link

mattdavis-okta commented Mar 19, 2024

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v1.7.5
on darwin_arm64
+ provider registry.terraform.io/okta/okta v4.8.0

Affected Resource(s)

Terraform Configuration Files

terraform {
  required_providers {
    okta = {
      source  = "okta/okta"
      version = "~> 4.8.0"
    }
  }
}


provider "okta" {
    scopes = ["okta.roles.manage", "okta.roles.read", "okta.groups.manage"]
}

locals {
  org_url = "https://example-preview.oktapreview.com"
}

resource "okta_resource_set" "test" {
  label       = "UsersAppsAndGroups"
  description = "All the users, app and groups"
  resources   = [
    format("%s/api/v1/users", local.org_url),
    format("%s/api/v1/apps", local.org_url),
    format("%s/api/v1/groups", local.org_url),
    format("%s/api/v1/devices", local.org_url)
  ]
}

Debug Output

Panic Output

https://gist.github.com/mattdavis-okta/e5fb56f0d5b35449a4f9d30a5cafc9ff

Expected Behavior

Resource set created all apps, all users, all groups, all devices

Can this be done in the actual API call?

Not tried

Actual Behavior

Resource set is created but Terraform panics: │ Error: Plugin did not respond

Steps to Reproduce

Create a resource set with the example given: https://registry.terraform.io/providers/okta/okta/latest/docs/resources/resource_set

locals {
  org_url = "https://mycompany.okta.com"
}

resource "okta_resource_set" "test" {
  label       = "UsersAppsAndGroups"
  description = "All the users, app and groups"
  resources   = [
    format("%s/api/v1/users", local.org_url),
    format("%s/api/v1/apps", local.org_url),
    format("%s/api/v1/groups", local.org_url)
  ]
}
  1. terraform apply

  2. add the devices resources

locals {
  org_url = "https://mycompany.okta.com"
}

resource "okta_resource_set" "test" {
  label       = "UsersAppsAndGroups"
  description = "All the users, app and groups"
  resources   = [
    format("%s/api/v1/users", local.org_url),
    format("%s/api/v1/apps", local.org_url),
    format("%s/api/v1/groups", local.org_url),
    format("%s/api/v1/devices", local.org_url)
  ]
}

Important Factoids

This is being run against an Okta preview org.
It works fine when the device line is removed.
Updating devices via the UI afterwards and then running terraform will also panic.

  • #0000
@duytiennguyen-okta duytiennguyen-okta added the triaged Triaged into internal Jira label Mar 26, 2024
@duytiennguyen-okta
Copy link
Contributor

OKTA internal reference https://oktainc.atlassian.net/browse/OKTA-712688

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug triaged Triaged into internal Jira
Projects
None yet
Development

No branches or pull requests

2 participants