athenz 1.0.45 published on Tuesday, Apr 15, 2025 by athenz
athenz.getRoles
Explore with Pulumi AI
athenz.getRoles This Data Source you can get the list of all roles in a domain with an optional flag to include members
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as athenz from "@pulumi/athenz";
const config = new pulumi.Config();
const tagKey = config.require("tagKey");
const tagValue = config.require("tagValue");
const selected = athenz.getRoles({
    domain: "some_domain",
    tagKey: tagKey,
    tagValue: tagValue,
    includeMembers: false,
});
import pulumi
import pulumi_athenz as athenz
config = pulumi.Config()
tag_key = config.require("tagKey")
tag_value = config.require("tagValue")
selected = athenz.get_roles(domain="some_domain",
    tag_key=tag_key,
    tag_value=tag_value,
    include_members=False)
package main
import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/athenz/athenz"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		cfg := config.New(ctx, "")
		tagKey := cfg.Require("tagKey")
		tagValue := cfg.Require("tagValue")
		_, err := athenz.GetRoles(ctx, &athenz.GetRolesArgs{
			Domain:         "some_domain",
			TagKey:         pulumi.StringRef(tagKey),
			TagValue:       pulumi.StringRef(tagValue),
			IncludeMembers: pulumi.BoolRef(false),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Athenz = Pulumi.Athenz;
return await Deployment.RunAsync(() => 
{
    var config = new Config();
    var tagKey = config.Require("tagKey");
    var tagValue = config.Require("tagValue");
    var selected = Athenz.GetRoles.Invoke(new()
    {
        Domain = "some_domain",
        TagKey = tagKey,
        TagValue = tagValue,
        IncludeMembers = false,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.athenz.AthenzFunctions;
import com.pulumi.athenz.inputs.GetRolesArgs;
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 config = ctx.config();
        final var tagKey = config.get("tagKey");
        final var tagValue = config.get("tagValue");
        final var selected = AthenzFunctions.getRoles(GetRolesArgs.builder()
            .domain("some_domain")
            .tagKey(tagKey)
            .tagValue(tagValue)
            .includeMembers(false)
            .build());
    }
}
configuration:
  tagKey:
    type: string
  tagValue:
    type: string
variables:
  selected:
    fn::invoke:
      function: athenz:getRoles
      arguments:
        domain: some_domain
        tagKey: ${tagKey}
        tagValue: ${tagValue}
        includeMembers: false
Using getRoles
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 getRoles(args: GetRolesArgs, opts?: InvokeOptions): Promise<GetRolesResult>
function getRolesOutput(args: GetRolesOutputArgs, opts?: InvokeOptions): Output<GetRolesResult>def get_roles(domain: Optional[str] = None,
              id: Optional[str] = None,
              include_members: Optional[bool] = None,
              roles: Optional[Sequence[GetRolesRole]] = None,
              tag_key: Optional[str] = None,
              tag_value: Optional[str] = None,
              opts: Optional[InvokeOptions] = None) -> GetRolesResult
def get_roles_output(domain: Optional[pulumi.Input[str]] = None,
              id: Optional[pulumi.Input[str]] = None,
              include_members: Optional[pulumi.Input[bool]] = None,
              roles: Optional[pulumi.Input[Sequence[pulumi.Input[GetRolesRoleArgs]]]] = None,
              tag_key: Optional[pulumi.Input[str]] = None,
              tag_value: Optional[pulumi.Input[str]] = None,
              opts: Optional[InvokeOptions] = None) -> Output[GetRolesResult]func GetRoles(ctx *Context, args *GetRolesArgs, opts ...InvokeOption) (*GetRolesResult, error)
func GetRolesOutput(ctx *Context, args *GetRolesOutputArgs, opts ...InvokeOption) GetRolesResultOutput> Note: This function is named GetRoles in the Go SDK.
public static class GetRoles 
{
    public static Task<GetRolesResult> InvokeAsync(GetRolesArgs args, InvokeOptions? opts = null)
    public static Output<GetRolesResult> Invoke(GetRolesInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetRolesResult> getRoles(GetRolesArgs args, InvokeOptions options)
public static Output<GetRolesResult> getRoles(GetRolesArgs args, InvokeOptions options)
fn::invoke:
  function: athenz:index/getRoles:getRoles
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Domain string
 - The Athenz domain name.
 
- Id string
 - The ID of this resource.
 - Include
Members bool - If true - return list of members in the role.
 - Roles
List<Get
Roles Role>  - Tag
Key string - Query all roles that have a given tag*key.
 - Tag
Value string - Query all roles that have a given tagkey AND tagvalue.
 
- Domain string
 - The Athenz domain name.
 
- Id string
 - The ID of this resource.
 - Include
Members bool - If true - return list of members in the role.
 - Roles
[]Get
Roles Role  - Tag
Key string - Query all roles that have a given tag*key.
 - Tag
Value string - Query all roles that have a given tagkey AND tagvalue.
 
- domain String
 - The Athenz domain name.
 
- id String
 - The ID of this resource.
 - include
Members Boolean - If true - return list of members in the role.
 - roles
List<Get
Roles Role>  - tag
Key String - Query all roles that have a given tag*key.
 - tag
Value String - Query all roles that have a given tagkey AND tagvalue.
 
- domain string
 - The Athenz domain name.
 
- id string
 - The ID of this resource.
 - include
Members boolean - If true - return list of members in the role.
 - roles
Get
Roles Role[]  - tag
Key string - Query all roles that have a given tag*key.
 - tag
Value string - Query all roles that have a given tagkey AND tagvalue.
 
- domain str
 - The Athenz domain name.
 
- id str
 - The ID of this resource.
 - include_
members bool - If true - return list of members in the role.
 - roles
Sequence[Get
Roles Role]  - tag_
key str - Query all roles that have a given tag*key.
 - tag_
value str - Query all roles that have a given tagkey AND tagvalue.
 
- domain String
 - The Athenz domain name.
 
- id String
 - The ID of this resource.
 - include
Members Boolean - If true - return list of members in the role.
 - roles List<Property Map>
 - tag
Key String - Query all roles that have a given tag*key.
 - tag
Value String - Query all roles that have a given tagkey AND tagvalue.
 
getRoles Result
The following output properties are available:
- Domain string
 - The Athenz domain name.
 
- Id string
 - The ID of this resource.
 - Include
Members bool - If true - return list of members in the role.
 - Roles
List<Get
Roles Role>  - Tag
Key string - Query all roles that have a given tag*key.
 - Tag
Value string - Query all roles that have a given tagkey AND tagvalue.
 
- Domain string
 - The Athenz domain name.
 
- Id string
 - The ID of this resource.
 - Include
Members bool - If true - return list of members in the role.
 - Roles
[]Get
Roles Role  - Tag
Key string - Query all roles that have a given tag*key.
 - Tag
Value string - Query all roles that have a given tagkey AND tagvalue.
 
- domain String
 - The Athenz domain name.
 
- id String
 - The ID of this resource.
 - include
Members Boolean - If true - return list of members in the role.
 - roles
List<Get
Roles Role>  - tag
Key String - Query all roles that have a given tag*key.
 - tag
Value String - Query all roles that have a given tagkey AND tagvalue.
 
- domain string
 - The Athenz domain name.
 
- id string
 - The ID of this resource.
 - include
Members boolean - If true - return list of members in the role.
 - roles
Get
Roles Role[]  - tag
Key string - Query all roles that have a given tag*key.
 - tag
Value string - Query all roles that have a given tagkey AND tagvalue.
 
- domain str
 - The Athenz domain name.
 
- id str
 - The ID of this resource.
 - include_
members bool - If true - return list of members in the role.
 - roles
Sequence[Get
Roles Role]  - tag_
key str - Query all roles that have a given tag*key.
 - tag_
value str - Query all roles that have a given tagkey AND tagvalue.
 
- domain String
 - The Athenz domain name.
 
- id String
 - The ID of this resource.
 - include
Members Boolean - If true - return list of members in the role.
 - roles List<Property Map>
 - tag
Key String - Query all roles that have a given tag*key.
 - tag
Value String - Query all roles that have a given tagkey AND tagvalue.
 
Supporting Types
GetRolesRole  
- Domain string
 - Name string
 - Audit
Enabled bool - Delete
Protection bool - Description string
 - Last
Reviewed stringDate  - Last reviewed date for the role
 - Members
List<Get
Roles Role Member>  - Athenz principal to be added as members
 - Notify
Details string - Notify
Roles string - Principal
Domain stringFilter  - Review
Enabled bool - Self
Renew bool - Self
Renew doubleMins  - Self
Serve bool - Settings
Get
Roles Role Settings  - Advanced settings
 - Sign
Algorithm string - Dictionary<string, string>
 - Trust string
 - The domain, which this role is trusted to
 - string
 - string
 
- Domain string
 - Name string
 - Audit
Enabled bool - Delete
Protection bool - Description string
 - Last
Reviewed stringDate  - Last reviewed date for the role
 - Members
[]Get
Roles Role Member  - Athenz principal to be added as members
 - Notify
Details string - Notify
Roles string - Principal
Domain stringFilter  - Review
Enabled bool - Self
Renew bool - Self
Renew float64Mins  - Self
Serve bool - Settings
Get
Roles Role Settings  - Advanced settings
 - Sign
Algorithm string - map[string]string
 - Trust string
 - The domain, which this role is trusted to
 - string
 - string
 
- domain String
 - name String
 - audit
Enabled Boolean - delete
Protection Boolean - description String
 - last
Reviewed StringDate  - Last reviewed date for the role
 - members
List<Get
Roles Role Member>  - Athenz principal to be added as members
 - notify
Details String - notify
Roles String - principal
Domain StringFilter  - review
Enabled Boolean - self
Renew Boolean - self
Renew DoubleMins  - self
Serve Boolean - settings
Get
Roles Role Settings  - Advanced settings
 - sign
Algorithm String - Map<String,String>
 - trust String
 - The domain, which this role is trusted to
 - String
 - String
 
- domain string
 - name string
 - audit
Enabled boolean - delete
Protection boolean - description string
 - last
Reviewed stringDate  - Last reviewed date for the role
 - members
Get
Roles Role Member[]  - Athenz principal to be added as members
 - notify
Details string - notify
Roles string - principal
Domain stringFilter  - review
Enabled boolean - self
Renew boolean - self
Renew numberMins  - self
Serve boolean - settings
Get
Roles Role Settings  - Advanced settings
 - sign
Algorithm string - {[key: string]: string}
 - trust string
 - The domain, which this role is trusted to
 - string
 - string
 
- domain str
 - name str
 - audit_
enabled bool - delete_
protection bool - description str
 - last_
reviewed_ strdate  - Last reviewed date for the role
 - members
Sequence[Get
Roles Role Member]  - Athenz principal to be added as members
 - notify_
details str - notify_
roles str - principal_
domain_ strfilter  - review_
enabled bool - self_
renew bool - self_
renew_ floatmins  - self_
serve bool - settings
Get
Roles Role Settings  - Advanced settings
 - sign_
algorithm str - Mapping[str, str]
 - trust str
 - The domain, which this role is trusted to
 - str
 - str
 
- domain String
 - name String
 - audit
Enabled Boolean - delete
Protection Boolean - description String
 - last
Reviewed StringDate  - Last reviewed date for the role
 - members List<Property Map>
 - Athenz principal to be added as members
 - notify
Details String - notify
Roles String - principal
Domain StringFilter  - review
Enabled Boolean - self
Renew Boolean - self
Renew NumberMins  - self
Serve Boolean - settings Property Map
 - Advanced settings
 - sign
Algorithm String - Map<String>
 - trust String
 - The domain, which this role is trusted to
 - String
 - String
 
GetRolesRoleMember   
- Name string
 - Expiration string
 - Review string
 
- Name string
 - Expiration string
 - Review string
 
- name String
 - expiration String
 - review String
 
- name string
 - expiration string
 - review string
 
- name str
 - expiration str
 - review str
 
- name String
 - expiration String
 - review String
 
GetRolesRoleSettings   
- Cert
Expiry doubleMins  - Group
Expiry doubleDays  - Group
Review doubleDays  - Max
Members double - Service
Expiry doubleDays  - Service
Review doubleDays  - Token
Expiry doubleMins  - User
Expiry doubleDays  - User
Review doubleDays  
- Cert
Expiry float64Mins  - Group
Expiry float64Days  - Group
Review float64Days  - Max
Members float64 - Service
Expiry float64Days  - Service
Review float64Days  - Token
Expiry float64Mins  - User
Expiry float64Days  - User
Review float64Days  
- cert
Expiry DoubleMins  - group
Expiry DoubleDays  - group
Review DoubleDays  - max
Members Double - service
Expiry DoubleDays  - service
Review DoubleDays  - token
Expiry DoubleMins  - user
Expiry DoubleDays  - user
Review DoubleDays  
- cert
Expiry numberMins  - group
Expiry numberDays  - group
Review numberDays  - max
Members number - service
Expiry numberDays  - service
Review numberDays  - token
Expiry numberMins  - user
Expiry numberDays  - user
Review numberDays  
- cert_
expiry_ floatmins  - group_
expiry_ floatdays  - group_
review_ floatdays  - max_
members float - service_
expiry_ floatdays  - service_
review_ floatdays  - token_
expiry_ floatmins  - user_
expiry_ floatdays  - user_
review_ floatdays  
- cert
Expiry NumberMins  - group
Expiry NumberDays  - group
Review NumberDays  - max
Members Number - service
Expiry NumberDays  - service
Review NumberDays  - token
Expiry NumberMins  - user
Expiry NumberDays  - user
Review NumberDays  
Package Details
- Repository
 - athenz athenz/terraform-provider-athenz
 - License
 - Notes
 - This Pulumi package is based on the 
athenzTerraform Provider.