1. Packages
  2. Akeyless Provider
  3. API Docs
  4. getRole
akeyless 1.9.0 published on Monday, Apr 14, 2025 by akeyless-community

akeyless.getRole

Explore with Pulumi AI

akeyless 1.9.0 published on Monday, Apr 14, 2025 by akeyless-community

Role data source

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as akeyless from "@pulumi/akeyless";

const demo_role = akeyless.getRole({
    name: "terraform/demo-role",
});
Copy
import pulumi
import pulumi_akeyless as akeyless

demo_role = akeyless.get_role(name="terraform/demo-role")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/akeyless/akeyless"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := akeyless.LookupRole(ctx, &akeyless.LookupRoleArgs{
			Name: "terraform/demo-role",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Akeyless = Pulumi.Akeyless;

return await Deployment.RunAsync(() => 
{
    var demo_role = Akeyless.GetRole.Invoke(new()
    {
        Name = "terraform/demo-role",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.akeyless.AkeylessFunctions;
import com.pulumi.akeyless.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 demo-role = AkeylessFunctions.getRole(GetRoleArgs.builder()
            .name("terraform/demo-role")
            .build());

    }
}
Copy
variables:
  demo-role:
    fn::invoke:
      function: akeyless:getRole
      arguments:
        name: terraform/demo-role
Copy

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>
Copy
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]
Copy
func LookupRole(ctx *Context, args *LookupRoleArgs, opts ...InvokeOption) (*LookupRoleResult, error)
func LookupRoleOutput(ctx *Context, args *LookupRoleOutputArgs, opts ...InvokeOption) LookupRoleResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetRoleResult> getRole(GetRoleArgs args, InvokeOptions options)
public static Output<GetRoleResult> getRole(GetRoleArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: akeyless:index/getRole:getRole
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
The Role name
Id string
The ID of this resource.
Name This property is required. string
The Role name
Id string
The ID of this resource.
name This property is required. String
The Role name
id String
The ID of this resource.
name This property is required. string
The Role name
id string
The ID of this resource.
name This property is required. str
The Role name
id str
The ID of this resource.
name This property is required. String
The Role name
id String
The ID of this resource.

getRole Result

The following output properties are available:

AssocAuthMethodWithRules string
Id string
The ID of this resource.
Name string
The Role name
AssocAuthMethodWithRules string
Id string
The ID of this resource.
Name string
The Role name
assocAuthMethodWithRules String
id String
The ID of this resource.
name String
The Role name
assocAuthMethodWithRules string
id string
The ID of this resource.
name string
The Role name
assoc_auth_method_with_rules str
id str
The ID of this resource.
name str
The Role name
assocAuthMethodWithRules String
id String
The ID of this resource.
name String
The Role name

Package Details

Repository
akeyless akeyless-community/terraform-provider-akeyless
License
Notes
This Pulumi package is based on the akeyless Terraform Provider.
akeyless 1.9.0 published on Monday, Apr 14, 2025 by akeyless-community