okta / terraform-provider-okta

A Terraform provider to manage Okta resources, enabling infrastructure-as-code provisioning and management of users, groups, applications, and other Okta objects.
https://registry.terraform.io/providers/okta/okta
Mozilla Public License 2.0
258 stars 209 forks source link

Attempt to add support for permission_conditions #2077

Open exitcode0 opened 2 months ago

exitcode0 commented 2 months ago

fixes: #1571

I'm still learning GoLang and thus this PR was heavily aided by Generative AI

I've not written any tests as yet I would like to get some feedback on what i've done thus far before I write tests for behavior that is incorrect

resource "okta_admin_role_custom" "limited_readonly" {
  label       = "limited readOnly"
  description = "readOnly access to apps, groups, and a subset of user profile attributes"
  permissions = [
    "okta.users.read",
    "okta.groups.read",
    "okta.apps.read",
    ]

  permission_conditions {
    permission = "okta:ResourceAttribute/User/Profile"
    include = ["city", "state", "zipCode"]
    exclude = ["secondEmail", "mobilePhone", "primaryPhone", "postalAddress"]
  }
}
exitcode0 commented 2 months ago

@duytiennguyen-okta any chance I could trouble you for a code review on this one?