OpenAxon / terraform-provider-identitynow

Terraform provider for IdentityNow cloud-based access management product
Mozilla Public License 2.0
11 stars 7 forks source link

Cannot create role #11

Closed locmai closed 1 year ago

locmai commented 1 year ago

Is there an existing issue for this?

Community Note

Terraform Version

1.2.6

IdentityNow Provider Version

0.3.2

Affected Resource(s)/Data Source(s)

identitynow_role

Terraform Configuration Files

resource "identitynow_role" "developer" {
  access_profile_ids = ["abc","xyz"]
  description = "testing"
}

Debug Output/Panic Output

023-03-11T01:13:59.859+0700 [DEBUG] provider.terraform-provider-identitynow_v0.3.2: 2023/03/11 01:13:59 Failed source creation response:{AccessProfileIds:[] ApprovalSchemes: DeniedCommentsRequired:<nil> Description: Disabled:<nil> DisplayName: ID: IdentityCount:0 Name: Owner: RequestCommentsRequired:<nil> Requestable:<nil> RevokeRequestApprovalSchemes: Selector:{AliasList:[] ComplexRoleCriterion:<nil> EntitlementIds:[] RuleID:<nil> SourceID:<nil> Type: ValueMap:[]}}
2023-03-11T01:13:59.859+0700 [DEBUG] provider.terraform-provider-identitynow_v0.3.2: 2023/03/11 01:13:59 unknown error, status code: 400

Expected Behaviour

New role should be created.

Actual Behaviour

The above error.

Steps to Reproduce

No response

References

Went through an investigation and it looks like IdentityNow no longer accept a list of String ID but instead a list of objects:

accessProfiles:
  - id: string
    type: string
   name: string

ref: https://developer.sailpoint.com/idn/api/beta/create-role/#create-a-role

locmai commented 1 year ago

The solution on top of my head is to correct the role structure for the create request. Will work on this soon.