1. Packages
  2. Opsgenie
  3. API Docs
  4. CustomRole
Opsgenie v1.3.8 published on Monday, Jun 24, 2024 by Pulumi

opsgenie.CustomRole

Explore with Pulumi AI

opsgenie logo
Opsgenie v1.3.8 published on Monday, Jun 24, 2024 by Pulumi

    Manages custom user roles within Opsgenie.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as opsgenie from "@pulumi/opsgenie";
    
    const test = new opsgenie.CustomRole("test", {
        roleName: "genierole",
        extendedRole: "user",
        grantedRights: ["alert-delete"],
        disallowedRights: [
            "profile-edit",
            "contacts-edit",
        ],
    });
    
    import pulumi
    import pulumi_opsgenie as opsgenie
    
    test = opsgenie.CustomRole("test",
        role_name="genierole",
        extended_role="user",
        granted_rights=["alert-delete"],
        disallowed_rights=[
            "profile-edit",
            "contacts-edit",
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-opsgenie/sdk/go/opsgenie"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := opsgenie.NewCustomRole(ctx, "test", &opsgenie.CustomRoleArgs{
    			RoleName:     pulumi.String("genierole"),
    			ExtendedRole: pulumi.String("user"),
    			GrantedRights: pulumi.StringArray{
    				pulumi.String("alert-delete"),
    			},
    			DisallowedRights: pulumi.StringArray{
    				pulumi.String("profile-edit"),
    				pulumi.String("contacts-edit"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Opsgenie = Pulumi.Opsgenie;
    
    return await Deployment.RunAsync(() => 
    {
        var test = new Opsgenie.CustomRole("test", new()
        {
            RoleName = "genierole",
            ExtendedRole = "user",
            GrantedRights = new[]
            {
                "alert-delete",
            },
            DisallowedRights = new[]
            {
                "profile-edit",
                "contacts-edit",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.opsgenie.CustomRole;
    import com.pulumi.opsgenie.CustomRoleArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var test = new CustomRole("test", CustomRoleArgs.builder()
                .roleName("genierole")
                .extendedRole("user")
                .grantedRights("alert-delete")
                .disallowedRights(            
                    "profile-edit",
                    "contacts-edit")
                .build());
    
        }
    }
    
    resources:
      test:
        type: opsgenie:CustomRole
        properties:
          roleName: genierole
          extendedRole: user
          grantedRights:
            - alert-delete
          disallowedRights:
            - profile-edit
            - contacts-edit
    

    Create CustomRole Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new CustomRole(name: string, args: CustomRoleArgs, opts?: CustomResourceOptions);
    @overload
    def CustomRole(resource_name: str,
                   args: CustomRoleArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def CustomRole(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   role_name: Optional[str] = None,
                   disallowed_rights: Optional[Sequence[str]] = None,
                   extended_role: Optional[str] = None,
                   granted_rights: Optional[Sequence[str]] = None)
    func NewCustomRole(ctx *Context, name string, args CustomRoleArgs, opts ...ResourceOption) (*CustomRole, error)
    public CustomRole(string name, CustomRoleArgs args, CustomResourceOptions? opts = null)
    public CustomRole(String name, CustomRoleArgs args)
    public CustomRole(String name, CustomRoleArgs args, CustomResourceOptions options)
    
    type: opsgenie:CustomRole
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args CustomRoleArgs
    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 CustomRoleArgs
    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 CustomRoleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CustomRoleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CustomRoleArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var customRoleResource = new Opsgenie.CustomRole("customRoleResource", new()
    {
        RoleName = "string",
        DisallowedRights = new[]
        {
            "string",
        },
        ExtendedRole = "string",
        GrantedRights = new[]
        {
            "string",
        },
    });
    
    example, err := opsgenie.NewCustomRole(ctx, "customRoleResource", &opsgenie.CustomRoleArgs{
    	RoleName: pulumi.String("string"),
    	DisallowedRights: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	ExtendedRole: pulumi.String("string"),
    	GrantedRights: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var customRoleResource = new CustomRole("customRoleResource", CustomRoleArgs.builder()
        .roleName("string")
        .disallowedRights("string")
        .extendedRole("string")
        .grantedRights("string")
        .build());
    
    custom_role_resource = opsgenie.CustomRole("customRoleResource",
        role_name="string",
        disallowed_rights=["string"],
        extended_role="string",
        granted_rights=["string"])
    
    const customRoleResource = new opsgenie.CustomRole("customRoleResource", {
        roleName: "string",
        disallowedRights: ["string"],
        extendedRole: "string",
        grantedRights: ["string"],
    });
    
    type: opsgenie:CustomRole
    properties:
        disallowedRights:
            - string
        extendedRole: string
        grantedRights:
            - string
        roleName: string
    

    CustomRole 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 CustomRole resource accepts the following input properties:

    RoleName string
    Name of the custom role.
    DisallowedRights List<string>
    The rights this role cannot have. For allowed values please refer User Right Prerequisites
    ExtendedRole string
    The role from which this role has been derived. Allowed Values: "user", "observer", "stakeholder".
    GrantedRights List<string>
    The rights granted to this role. For allowed values please refer User Right Prerequisites
    RoleName string
    Name of the custom role.
    DisallowedRights []string
    The rights this role cannot have. For allowed values please refer User Right Prerequisites
    ExtendedRole string
    The role from which this role has been derived. Allowed Values: "user", "observer", "stakeholder".
    GrantedRights []string
    The rights granted to this role. For allowed values please refer User Right Prerequisites
    roleName String
    Name of the custom role.
    disallowedRights List<String>
    The rights this role cannot have. For allowed values please refer User Right Prerequisites
    extendedRole String
    The role from which this role has been derived. Allowed Values: "user", "observer", "stakeholder".
    grantedRights List<String>
    The rights granted to this role. For allowed values please refer User Right Prerequisites
    roleName string
    Name of the custom role.
    disallowedRights string[]
    The rights this role cannot have. For allowed values please refer User Right Prerequisites
    extendedRole string
    The role from which this role has been derived. Allowed Values: "user", "observer", "stakeholder".
    grantedRights string[]
    The rights granted to this role. For allowed values please refer User Right Prerequisites
    role_name str
    Name of the custom role.
    disallowed_rights Sequence[str]
    The rights this role cannot have. For allowed values please refer User Right Prerequisites
    extended_role str
    The role from which this role has been derived. Allowed Values: "user", "observer", "stakeholder".
    granted_rights Sequence[str]
    The rights granted to this role. For allowed values please refer User Right Prerequisites
    roleName String
    Name of the custom role.
    disallowedRights List<String>
    The rights this role cannot have. For allowed values please refer User Right Prerequisites
    extendedRole String
    The role from which this role has been derived. Allowed Values: "user", "observer", "stakeholder".
    grantedRights List<String>
    The rights granted to this role. For allowed values please refer User Right Prerequisites

    Outputs

    All input properties are implicitly available as output properties. Additionally, the CustomRole 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 CustomRole Resource

    Get an existing CustomRole 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?: CustomRoleState, opts?: CustomResourceOptions): CustomRole
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            disallowed_rights: Optional[Sequence[str]] = None,
            extended_role: Optional[str] = None,
            granted_rights: Optional[Sequence[str]] = None,
            role_name: Optional[str] = None) -> CustomRole
    func GetCustomRole(ctx *Context, name string, id IDInput, state *CustomRoleState, opts ...ResourceOption) (*CustomRole, error)
    public static CustomRole Get(string name, Input<string> id, CustomRoleState? state, CustomResourceOptions? opts = null)
    public static CustomRole get(String name, Output<String> id, CustomRoleState 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:
    DisallowedRights List<string>
    The rights this role cannot have. For allowed values please refer User Right Prerequisites
    ExtendedRole string
    The role from which this role has been derived. Allowed Values: "user", "observer", "stakeholder".
    GrantedRights List<string>
    The rights granted to this role. For allowed values please refer User Right Prerequisites
    RoleName string
    Name of the custom role.
    DisallowedRights []string
    The rights this role cannot have. For allowed values please refer User Right Prerequisites
    ExtendedRole string
    The role from which this role has been derived. Allowed Values: "user", "observer", "stakeholder".
    GrantedRights []string
    The rights granted to this role. For allowed values please refer User Right Prerequisites
    RoleName string
    Name of the custom role.
    disallowedRights List<String>
    The rights this role cannot have. For allowed values please refer User Right Prerequisites
    extendedRole String
    The role from which this role has been derived. Allowed Values: "user", "observer", "stakeholder".
    grantedRights List<String>
    The rights granted to this role. For allowed values please refer User Right Prerequisites
    roleName String
    Name of the custom role.
    disallowedRights string[]
    The rights this role cannot have. For allowed values please refer User Right Prerequisites
    extendedRole string
    The role from which this role has been derived. Allowed Values: "user", "observer", "stakeholder".
    grantedRights string[]
    The rights granted to this role. For allowed values please refer User Right Prerequisites
    roleName string
    Name of the custom role.
    disallowed_rights Sequence[str]
    The rights this role cannot have. For allowed values please refer User Right Prerequisites
    extended_role str
    The role from which this role has been derived. Allowed Values: "user", "observer", "stakeholder".
    granted_rights Sequence[str]
    The rights granted to this role. For allowed values please refer User Right Prerequisites
    role_name str
    Name of the custom role.
    disallowedRights List<String>
    The rights this role cannot have. For allowed values please refer User Right Prerequisites
    extendedRole String
    The role from which this role has been derived. Allowed Values: "user", "observer", "stakeholder".
    grantedRights List<String>
    The rights granted to this role. For allowed values please refer User Right Prerequisites
    roleName String
    Name of the custom role.

    Package Details

    Repository
    Opsgenie pulumi/pulumi-opsgenie
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the opsgenie Terraform Provider.
    opsgenie logo
    Opsgenie v1.3.8 published on Monday, Jun 24, 2024 by Pulumi