1. Packages
  2. OpenStack
  3. API Docs
  4. identity
  5. getRole
OpenStack v4.0.0 published on Tuesday, May 21, 2024 by Pulumi

openstack.identity.getRole

Explore with Pulumi AI

openstack logo
OpenStack v4.0.0 published on Tuesday, May 21, 2024 by Pulumi

    Use this data source to get the ID of an OpenStack role.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as openstack from "@pulumi/openstack";
    
    const admin = openstack.identity.getRole({
        name: "admin",
    });
    
    import pulumi
    import pulumi_openstack as openstack
    
    admin = openstack.identity.get_role(name="admin")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-openstack/sdk/v4/go/openstack/identity"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := identity.LookupRole(ctx, &identity.LookupRoleArgs{
    			Name: "admin",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using OpenStack = Pulumi.OpenStack;
    
    return await Deployment.RunAsync(() => 
    {
        var admin = OpenStack.Identity.GetRole.Invoke(new()
        {
            Name = "admin",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.openstack.identity.IdentityFunctions;
    import com.pulumi.openstack.identity.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 admin = IdentityFunctions.getRole(GetRoleArgs.builder()
                .name("admin")
                .build());
    
        }
    }
    
    variables:
      admin:
        fn::invoke:
          Function: openstack:identity:getRole
          Arguments:
            name: admin
    

    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(domain_id: Optional[str] = None,
                 name: Optional[str] = None,
                 region: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetRoleResult
    def get_role_output(domain_id: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 region: 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: openstack:identity/getRole:getRole
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the role.
    DomainId string
    The domain the role belongs to.
    Region string
    The region in which to obtain the V3 Keystone client. If omitted, the region argument of the provider is used.
    Name string
    The name of the role.
    DomainId string
    The domain the role belongs to.
    Region string
    The region in which to obtain the V3 Keystone client. If omitted, the region argument of the provider is used.
    name String
    The name of the role.
    domainId String
    The domain the role belongs to.
    region String
    The region in which to obtain the V3 Keystone client. If omitted, the region argument of the provider is used.
    name string
    The name of the role.
    domainId string
    The domain the role belongs to.
    region string
    The region in which to obtain the V3 Keystone client. If omitted, the region argument of the provider is used.
    name str
    The name of the role.
    domain_id str
    The domain the role belongs to.
    region str
    The region in which to obtain the V3 Keystone client. If omitted, the region argument of the provider is used.
    name String
    The name of the role.
    domainId String
    The domain the role belongs to.
    region String
    The region in which to obtain the V3 Keystone client. If omitted, the region argument of the provider is used.

    getRole Result

    The following output properties are available:

    DomainId string
    See Argument Reference above.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    See Argument Reference above.
    Region string
    See Argument Reference above.
    DomainId string
    See Argument Reference above.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    See Argument Reference above.
    Region string
    See Argument Reference above.
    domainId String
    See Argument Reference above.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    See Argument Reference above.
    region String
    See Argument Reference above.
    domainId string
    See Argument Reference above.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    See Argument Reference above.
    region string
    See Argument Reference above.
    domain_id str
    See Argument Reference above.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    See Argument Reference above.
    region str
    See Argument Reference above.
    domainId String
    See Argument Reference above.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    See Argument Reference above.
    region String
    See Argument Reference above.

    Package Details

    Repository
    OpenStack pulumi/pulumi-openstack
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the openstack Terraform Provider.
    openstack logo
    OpenStack v4.0.0 published on Tuesday, May 21, 2024 by Pulumi