1. Packages
  2. Sumologic Provider
  3. API Docs
  4. getRole
Sumo Logic v0.23.7 published on Thursday, Oct 24, 2024 by Pulumi

sumologic.getRole

Explore with Pulumi AI

sumologic logo
Sumo Logic v0.23.7 published on Thursday, Oct 24, 2024 by Pulumi

    Provides a way to retrieve Sumo Logic role details (id, names, etc) for a role.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as sumologic from "@pulumi/sumologic";
    
    const this = sumologic.getRole({
        name: "MyRole",
    });
    
    import pulumi
    import pulumi_sumologic as sumologic
    
    this = sumologic.get_role(name="MyRole")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-sumologic/sdk/go/sumologic"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := sumologic.LookupRole(ctx, &sumologic.LookupRoleArgs{
    			Name: pulumi.StringRef("MyRole"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using SumoLogic = Pulumi.SumoLogic;
    
    return await Deployment.RunAsync(() => 
    {
        var @this = SumoLogic.GetRole.Invoke(new()
        {
            Name = "MyRole",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.sumologic.SumologicFunctions;
    import com.pulumi.sumologic.inputs.GetRoleArgs;
    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) {
            final var this = SumologicFunctions.getRole(GetRoleArgs.builder()
                .name("MyRole")
                .build());
    
        }
    }
    
    variables:
      this:
        fn::invoke:
          Function: sumologic:getRole
          Arguments:
            name: MyRole
    
    import * as pulumi from "@pulumi/pulumi";
    import * as sumologic from "@pulumi/sumologic";
    
    const that = sumologic.getRole({
        id: "1234567890",
    });
    
    import pulumi
    import pulumi_sumologic as sumologic
    
    that = sumologic.get_role(id="1234567890")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-sumologic/sdk/go/sumologic"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := sumologic.LookupRole(ctx, &sumologic.LookupRoleArgs{
    			Id: pulumi.StringRef("1234567890"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using SumoLogic = Pulumi.SumoLogic;
    
    return await Deployment.RunAsync(() => 
    {
        var that = SumoLogic.GetRole.Invoke(new()
        {
            Id = "1234567890",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.sumologic.SumologicFunctions;
    import com.pulumi.sumologic.inputs.GetRoleArgs;
    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) {
            final var that = SumologicFunctions.getRole(GetRoleArgs.builder()
                .id("1234567890")
                .build());
    
        }
    }
    
    variables:
      that:
        fn::invoke:
          Function: sumologic:getRole
          Arguments:
            id: '1234567890'
    

    A role can be looked up by either id or name. One of those attributes needs to be specified.

    If both id and name have been specified, id takes precedence.

    Attributes reference

    The following attributes are exported:

    • id - The internal ID of the role. This can be used to create users having that role.
    • name - The name of the role.
    • description - The description of the role.
    • filter_predicate - The search filter to restrict access to specific logs.
    • capabilities - The list of capabilities associated with the role.

    Using getRole

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getRole(args: GetRoleArgs, opts?: InvokeOptions): Promise<GetRoleResult>
    function getRoleOutput(args: GetRoleOutputArgs, opts?: InvokeOptions): Output<GetRoleResult>
    def get_role(id: Optional[str] = None,
                 name: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetRoleResult
    def get_role_output(id: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetRoleResult]
    func LookupRole(ctx *Context, args *LookupRoleArgs, opts ...InvokeOption) (*LookupRoleResult, error)
    func LookupRoleOutput(ctx *Context, args *LookupRoleOutputArgs, opts ...InvokeOption) LookupRoleResultOutput

    > Note: This function is named LookupRole in the Go SDK.

    public static class GetRole 
    {
        public static Task<GetRoleResult> InvokeAsync(GetRoleArgs args, InvokeOptions? opts = null)
        public static Output<GetRoleResult> Invoke(GetRoleInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRoleResult> getRole(GetRoleArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: sumologic:index/getRole:getRole
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Id string
    Name string
    Id string
    Name string
    id String
    name String
    id string
    name string
    id str
    name str
    id String
    name String

    getRole Result

    The following output properties are available:

    Capabilities List<string>
    Description string
    FilterPredicate string
    Id string
    Name string
    Capabilities []string
    Description string
    FilterPredicate string
    Id string
    Name string
    capabilities List<String>
    description String
    filterPredicate String
    id String
    name String
    capabilities string[]
    description string
    filterPredicate string
    id string
    name string
    capabilities Sequence[str]
    description str
    filter_predicate str
    id str
    name str
    capabilities List<String>
    description String
    filterPredicate String
    id String
    name String

    Package Details

    Repository
    Sumo Logic pulumi/pulumi-sumologic
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the sumologic Terraform Provider.
    sumologic logo
    Sumo Logic v0.23.7 published on Thursday, Oct 24, 2024 by Pulumi