onelogin

v0.3.0 published on Wednesday, Jun 1, 2022 by Pulumi

Privilege

Manage Privilege resources.

This resource allows you to create and configure Privilege.

Example Usage

Strict Ordering

using Pulumi;
using Onelogin = Pulumi.Onelogin;

class MyStack : Stack
{
    public MyStack()
    {
        var superAdmin = new Onelogin.Privilege("superAdmin", new Onelogin.PrivilegeArgs
        {
            Description = "description",
            Privileges = 
            {
                new Onelogin.Inputs.PrivilegePrivilegeArgs
                {
                    Statements = 
                    {
                        new Onelogin.Inputs.PrivilegePrivilegeStatementArgs
                        {
                            Action = 
                            {
                                "apps:List",
                            },
                            Effect = "Allow",
                            Scope = 
                            {
                                "*",
                            },
                        },
                        new Onelogin.Inputs.PrivilegePrivilegeStatementArgs
                        {
                            Action = 
                            {
                                "users:List",
                                "users:Update",
                            },
                            Effect = "Allow",
                            Scope = 
                            {
                                "users/123",
                                "users/345",
                            },
                        },
                    },
                },
            },
            RoleIds = 
            {
                987,
                654,
            },
            UserIds = 
            {
                123,
                345,
            },
        });
    }

}
package main

import (
	"github.com/pulumi/pulumi-onelogin/sdk/go/onelogin"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := onelogin.NewPrivilege(ctx, "superAdmin", &onelogin.PrivilegeArgs{
			Description: pulumi.String("description"),
			Privileges: PrivilegePrivilegeArray{
				&PrivilegePrivilegeArgs{
					Statements: PrivilegePrivilegeStatementArray{
						&PrivilegePrivilegeStatementArgs{
							Action: []string{
								"apps:List",
							},
							Effect: pulumi.String("Allow"),
							Scope: []string{
								"*",
							},
						},
						&PrivilegePrivilegeStatementArgs{
							Action: []string{
								"users:List",
								"users:Update",
							},
							Effect: pulumi.String("Allow"),
							Scope: []string{
								"users/123",
								"users/345",
							},
						},
					},
				},
			},
			RoleIds: pulumi.IntArray{
				pulumi.Int(987),
				pulumi.Int(654),
			},
			UserIds: pulumi.IntArray{
				pulumi.Int(123),
				pulumi.Int(345),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_onelogin as onelogin

super_admin = onelogin.Privilege("superAdmin",
    description="description",
    privileges=[onelogin.PrivilegePrivilegeArgs(
        statements=[
            onelogin.PrivilegePrivilegeStatementArgs(
                action=["apps:List"],
                effect="Allow",
                scope=["*"],
            ),
            onelogin.PrivilegePrivilegeStatementArgs(
                action=[
                    "users:List",
                    "users:Update",
                ],
                effect="Allow",
                scope=[
                    "users/123",
                    "users/345",
                ],
            ),
        ],
    )],
    role_ids=[
        987,
        654,
    ],
    user_ids=[
        123,
        345,
    ])
import * as pulumi from "@pulumi/pulumi";
import * as onelogin from "@pulumi/onelogin";

const superAdmin = new onelogin.Privilege("super_admin", {
    description: "description",
    privileges: [{
        statements: [
            {
                actions: ["apps:List"],
                effect: "Allow",
                scopes: ["*"],
            },
            {
                actions: [
                    "users:List",
                    "users:Update",
                ],
                effect: "Allow",
                scopes: [
                    "users/123",
                    "users/345",
                ],
            },
        ],
    }],
    roleIds: [
        987,
        654,
    ],
    userIds: [
        123,
        345,
    ],
});

Coming soon!

Create Privilege Resource

new Privilege(name: string, args: PrivilegeArgs, opts?: CustomResourceOptions);
@overload
def Privilege(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              description: Optional[str] = None,
              name: Optional[str] = None,
              privileges: Optional[Sequence[PrivilegePrivilegeArgs]] = None,
              role_ids: Optional[Sequence[int]] = None,
              user_ids: Optional[Sequence[int]] = None)
@overload
def Privilege(resource_name: str,
              args: PrivilegeArgs,
              opts: Optional[ResourceOptions] = None)
func NewPrivilege(ctx *Context, name string, args PrivilegeArgs, opts ...ResourceOption) (*Privilege, error)
public Privilege(string name, PrivilegeArgs args, CustomResourceOptions? opts = null)
public Privilege(String name, PrivilegeArgs args)
public Privilege(String name, PrivilegeArgs args, CustomResourceOptions options)
type: onelogin:Privilege
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args PrivilegeArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args PrivilegeArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args PrivilegeArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args PrivilegeArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args PrivilegeArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Privilege Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The Privilege resource accepts the following input properties:

Privileges List<PrivilegePrivilegeArgs>

A list of statements that describe what the privilege grants access to.

Description string

Description for the Privilege.

Name string

The name of the privilege.

RoleIds List<int>

A list of role IDs for whom the role applies.

UserIds List<int>

A list of user IDs for whom the privilege applies.

Privileges []PrivilegePrivilegeArgs

A list of statements that describe what the privilege grants access to.

Description string

Description for the Privilege.

Name string

The name of the privilege.

RoleIds []int

A list of role IDs for whom the role applies.

UserIds []int

A list of user IDs for whom the privilege applies.

privileges List<PrivilegePrivilegeArgs>

A list of statements that describe what the privilege grants access to.

description String

Description for the Privilege.

name String

The name of the privilege.

roleIds List<Integer>

A list of role IDs for whom the role applies.

userIds List<Integer>

A list of user IDs for whom the privilege applies.

privileges PrivilegePrivilegeArgs[]

A list of statements that describe what the privilege grants access to.

description string

Description for the Privilege.

name string

The name of the privilege.

roleIds number[]

A list of role IDs for whom the role applies.

userIds number[]

A list of user IDs for whom the privilege applies.

privileges Sequence[PrivilegePrivilegeArgs]

A list of statements that describe what the privilege grants access to.

description str

Description for the Privilege.

name str

The name of the privilege.

role_ids Sequence[int]

A list of role IDs for whom the role applies.

user_ids Sequence[int]

A list of user IDs for whom the privilege applies.

privileges List<Property Map>

A list of statements that describe what the privilege grants access to.

description String

Description for the Privilege.

name String

The name of the privilege.

roleIds List<Number>

A list of role IDs for whom the role applies.

userIds List<Number>

A list of user IDs for whom the privilege applies.

Outputs

All input properties are implicitly available as output properties. Additionally, the Privilege resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing Privilege Resource

Get an existing Privilege resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: PrivilegeState, opts?: CustomResourceOptions): Privilege
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        name: Optional[str] = None,
        privileges: Optional[Sequence[PrivilegePrivilegeArgs]] = None,
        role_ids: Optional[Sequence[int]] = None,
        user_ids: Optional[Sequence[int]] = None) -> Privilege
func GetPrivilege(ctx *Context, name string, id IDInput, state *PrivilegeState, opts ...ResourceOption) (*Privilege, error)
public static Privilege Get(string name, Input<string> id, PrivilegeState? state, CustomResourceOptions? opts = null)
public static Privilege get(String name, Output<String> id, PrivilegeState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Description string

Description for the Privilege.

Name string

The name of the privilege.

Privileges List<PrivilegePrivilegeArgs>

A list of statements that describe what the privilege grants access to.

RoleIds List<int>

A list of role IDs for whom the role applies.

UserIds List<int>

A list of user IDs for whom the privilege applies.

Description string

Description for the Privilege.

Name string

The name of the privilege.

Privileges []PrivilegePrivilegeArgs

A list of statements that describe what the privilege grants access to.

RoleIds []int

A list of role IDs for whom the role applies.

UserIds []int

A list of user IDs for whom the privilege applies.

description String

Description for the Privilege.

name String

The name of the privilege.

privileges List<PrivilegePrivilegeArgs>

A list of statements that describe what the privilege grants access to.

roleIds List<Integer>

A list of role IDs for whom the role applies.

userIds List<Integer>

A list of user IDs for whom the privilege applies.

description string

Description for the Privilege.

name string

The name of the privilege.

privileges PrivilegePrivilegeArgs[]

A list of statements that describe what the privilege grants access to.

roleIds number[]

A list of role IDs for whom the role applies.

userIds number[]

A list of user IDs for whom the privilege applies.

description str

Description for the Privilege.

name str

The name of the privilege.

privileges Sequence[PrivilegePrivilegeArgs]

A list of statements that describe what the privilege grants access to.

role_ids Sequence[int]

A list of role IDs for whom the role applies.

user_ids Sequence[int]

A list of user IDs for whom the privilege applies.

description String

Description for the Privilege.

name String

The name of the privilege.

privileges List<Property Map>

A list of statements that describe what the privilege grants access to.

roleIds List<Number>

A list of role IDs for whom the role applies.

userIds List<Number>

A list of user IDs for whom the privilege applies.

Supporting Types

PrivilegePrivilege

Statements List<PrivilegePrivilegeStatement>

At least one statement is required. Statements describe the effect granted to a resource type. In this case it allow's the privilege holder to lisst apps and users.

Version string
Statements []PrivilegePrivilegeStatement

At least one statement is required. Statements describe the effect granted to a resource type. In this case it allow's the privilege holder to lisst apps and users.

Version string
statements List<PrivilegePrivilegeStatement>

At least one statement is required. Statements describe the effect granted to a resource type. In this case it allow's the privilege holder to lisst apps and users.

version String
statements PrivilegePrivilegeStatement[]

At least one statement is required. Statements describe the effect granted to a resource type. In this case it allow's the privilege holder to lisst apps and users.

version string
statements Sequence[PrivilegePrivilegeStatement]

At least one statement is required. Statements describe the effect granted to a resource type. In this case it allow's the privilege holder to lisst apps and users.

version str
statements List<Property Map>

At least one statement is required. Statements describe the effect granted to a resource type. In this case it allow's the privilege holder to lisst apps and users.

version String

PrivilegePrivilegeStatement

Actions List<string>

List of actions the privilege holder can do. Must be one of those listed in the docs

Effect string

The effect the privilege grants for the resource. Must be "Allow".

Scopes List<string>

Target the privileged action against specific resources with the scope. In this case, the privilege only grants update access to users 123 and 345.

Actions []string

List of actions the privilege holder can do. Must be one of those listed in the docs

Effect string

The effect the privilege grants for the resource. Must be "Allow".

Scopes []string

Target the privileged action against specific resources with the scope. In this case, the privilege only grants update access to users 123 and 345.

actions List<String>

List of actions the privilege holder can do. Must be one of those listed in the docs

effect String

The effect the privilege grants for the resource. Must be "Allow".

scopes List<String>

Target the privileged action against specific resources with the scope. In this case, the privilege only grants update access to users 123 and 345.

actions string[]

List of actions the privilege holder can do. Must be one of those listed in the docs

effect string

The effect the privilege grants for the resource. Must be "Allow".

scopes string[]

Target the privileged action against specific resources with the scope. In this case, the privilege only grants update access to users 123 and 345.

actions Sequence[str]

List of actions the privilege holder can do. Must be one of those listed in the docs

effect str

The effect the privilege grants for the resource. Must be "Allow".

scopes Sequence[str]

Target the privileged action against specific resources with the scope. In this case, the privilege only grants update access to users 123 and 345.

actions List<String>

List of actions the privilege holder can do. Must be one of those listed in the docs

effect String

The effect the privilege grants for the resource. Must be "Allow".

scopes List<String>

Target the privileged action against specific resources with the scope. In this case, the privilege only grants update access to users 123 and 345.

Import

A privilege can be imported using the OneLogin Privilege ID.

 $ pulumi import onelogin:index/privilege:Privilege super_admin <privilege id>

Package Details

Repository
https://github.com/pulumi/pulumi-onelogin
License
Apache-2.0
Notes

This Pulumi package is based on the onelogin Terraform Provider.