CyberArk Terraform provider

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CyberArk Terraform provider

L1 Bithead

Hello,

 

Did anyone already struggle with cyberark terraform provider and found the way to add members with custom roles to safe using terraform ?

 

Thanks

6 REPLIES 6

L2 Linker

Yes, the common way to add members with custom, granular permissions is to use a specific set of boolean flags available in the resource definition. Instead of relying on the simplified permission_level string, you explicitly define each permission you need using dedicated arguments within the safe member resource block.

L1 Bithead

Thanks for this information but this is not described anywhere in the doc (Docs overview | cyberark/cyberark | Terraform | Terraform Registry or GitHub - cyberark/terraform-provider-cyberark).

 

What are the argument to set this permissions and where to find any documentation regarding this ?

 

Thanks

L4 Transporter

Hi @Fabien B​ 

 

Since several community members answered your question, could you kindly share if any of these solutions resolved your issue?

If so, could you please mark the appropriate answer as "Select as Best" to assist other community members.

If the issue is still relevant, I would advise raising a ticket with our support team for further assistance.

 

Thank you,

Shaked

L1 Bithead

Hi @Shaked Zack​, unfortunately the answer received is not answering my question.

 

Thanks

L6 Presenter

Hello,

 

The current implementation of the Terraform Provider does not support boolean permission flags. You are correct in your assumption that the 4 simplified permission levels are all that is available right now.

 

This can be determined by looking at the code for the resource objects, like this one for the Safe: resource_safe_object.go. Lines 91-93 highlight the limitation:

 

"permission_level": schema.StringAttribute{

Description: "Membership Permission Level. Currently supported inputs: full, read, approver, manager.",

Required:  true,

 

I cannot find boolean flag support anywhere in the code for this resource or any others. This means that creating a custom resource would be required to implement this functionality. Alternatively, there may be an older version of the provider available that uses these boolean flags (based on anecdotal evidence). You would still need a resource that supports those flags in that case.

L0 Member

Hi, I was struggling with the correct syntax for the idsec_pcloud_safe_member resource nested custom permissions sets so just posting this here in case it helps anyone else with the same issue.

 

Something like this example should work in your main.tf:

 

resource "idsec_pcloud_safe_member" "caaudit_read_only" {

for_each = merge(idsec_pcloud_safe.causer_safes, idsec_pcloud_safe.caadmin_safes)

safe_id = each.value.safe_id

member_name = idsec_identity_role.caaudit.role_name

member_type = "Role"

 

permission_set = "custom"

 

permissions = {

list_accounts = true

view_safe_members = true

view_audit_log = true

}

}

 

https://github.com/cyberark/terraform-provider-idsec/blob/main/docs/resources/pcloud_safe_member.md

 

Cheers

 

P.S. Thanks to Marques Deane

  • 168 Views
  • 6 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!