1. Packages
  2. Athenz Provider
  3. API Docs
  4. getRoles
athenz 1.0.45 published on Tuesday, Apr 15, 2025 by athenz

athenz.getRoles

Explore with Pulumi AI

athenz logo
athenz 1.0.45 published on Tuesday, Apr 15, 2025 by athenz

    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 dictionary

    The following arguments are supported:

    Domain string
    • The Athenz domain name.
    Id string
    The ID of this resource.
    IncludeMembers bool
    If true - return list of members in the role.
    Roles List<GetRolesRole>
    TagKey string
    Query all roles that have a given tag*key.
    TagValue string
    • Query all roles that have a given tagkey AND tagvalue.
    Domain string
    • The Athenz domain name.
    Id string
    The ID of this resource.
    IncludeMembers bool
    If true - return list of members in the role.
    Roles []GetRolesRole
    TagKey string
    Query all roles that have a given tag*key.
    TagValue string
    • Query all roles that have a given tagkey AND tagvalue.
    domain String
    • The Athenz domain name.
    id String
    The ID of this resource.
    includeMembers Boolean
    If true - return list of members in the role.
    roles List<GetRolesRole>
    tagKey String
    Query all roles that have a given tag*key.
    tagValue String
    • Query all roles that have a given tagkey AND tagvalue.
    domain string
    • The Athenz domain name.
    id string
    The ID of this resource.
    includeMembers boolean
    If true - return list of members in the role.
    roles GetRolesRole[]
    tagKey string
    Query all roles that have a given tag*key.
    tagValue 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[GetRolesRole]
    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.
    includeMembers Boolean
    If true - return list of members in the role.
    roles List<Property Map>
    tagKey String
    Query all roles that have a given tag*key.
    tagValue 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.
    IncludeMembers bool
    If true - return list of members in the role.
    Roles List<GetRolesRole>
    TagKey string
    Query all roles that have a given tag*key.
    TagValue string
    • Query all roles that have a given tagkey AND tagvalue.
    Domain string
    • The Athenz domain name.
    Id string
    The ID of this resource.
    IncludeMembers bool
    If true - return list of members in the role.
    Roles []GetRolesRole
    TagKey string
    Query all roles that have a given tag*key.
    TagValue string
    • Query all roles that have a given tagkey AND tagvalue.
    domain String
    • The Athenz domain name.
    id String
    The ID of this resource.
    includeMembers Boolean
    If true - return list of members in the role.
    roles List<GetRolesRole>
    tagKey String
    Query all roles that have a given tag*key.
    tagValue String
    • Query all roles that have a given tagkey AND tagvalue.
    domain string
    • The Athenz domain name.
    id string
    The ID of this resource.
    includeMembers boolean
    If true - return list of members in the role.
    roles GetRolesRole[]
    tagKey string
    Query all roles that have a given tag*key.
    tagValue 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[GetRolesRole]
    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.
    includeMembers Boolean
    If true - return list of members in the role.
    roles List<Property Map>
    tagKey String
    Query all roles that have a given tag*key.
    tagValue String
    • Query all roles that have a given tagkey AND tagvalue.

    Supporting Types

    GetRolesRole

    Domain string
    Name string
    AuditEnabled bool
    DeleteProtection bool
    Description string
    LastReviewedDate string
    Last reviewed date for the role
    Members List<GetRolesRoleMember>
    Athenz principal to be added as members
    NotifyDetails string
    NotifyRoles string
    PrincipalDomainFilter string
    ReviewEnabled bool
    SelfRenew bool
    SelfRenewMins double
    SelfServe bool
    Settings GetRolesRoleSettings
    Advanced settings
    SignAlgorithm string
    Tags Dictionary<string, string>
    Trust string
    The domain, which this role is trusted to
    UserAuthorityExpiration string
    UserAuthorityFilter string
    Domain string
    Name string
    AuditEnabled bool
    DeleteProtection bool
    Description string
    LastReviewedDate string
    Last reviewed date for the role
    Members []GetRolesRoleMember
    Athenz principal to be added as members
    NotifyDetails string
    NotifyRoles string
    PrincipalDomainFilter string
    ReviewEnabled bool
    SelfRenew bool
    SelfRenewMins float64
    SelfServe bool
    Settings GetRolesRoleSettings
    Advanced settings
    SignAlgorithm string
    Tags map[string]string
    Trust string
    The domain, which this role is trusted to
    UserAuthorityExpiration string
    UserAuthorityFilter string
    domain String
    name String
    auditEnabled Boolean
    deleteProtection Boolean
    description String
    lastReviewedDate String
    Last reviewed date for the role
    members List<GetRolesRoleMember>
    Athenz principal to be added as members
    notifyDetails String
    notifyRoles String
    principalDomainFilter String
    reviewEnabled Boolean
    selfRenew Boolean
    selfRenewMins Double
    selfServe Boolean
    settings GetRolesRoleSettings
    Advanced settings
    signAlgorithm String
    tags Map<String,String>
    trust String
    The domain, which this role is trusted to
    userAuthorityExpiration String
    userAuthorityFilter String
    domain string
    name string
    auditEnabled boolean
    deleteProtection boolean
    description string
    lastReviewedDate string
    Last reviewed date for the role
    members GetRolesRoleMember[]
    Athenz principal to be added as members
    notifyDetails string
    notifyRoles string
    principalDomainFilter string
    reviewEnabled boolean
    selfRenew boolean
    selfRenewMins number
    selfServe boolean
    settings GetRolesRoleSettings
    Advanced settings
    signAlgorithm string
    tags {[key: string]: string}
    trust string
    The domain, which this role is trusted to
    userAuthorityExpiration string
    userAuthorityFilter string
    domain str
    name str
    audit_enabled bool
    delete_protection bool
    description str
    last_reviewed_date str
    Last reviewed date for the role
    members Sequence[GetRolesRoleMember]
    Athenz principal to be added as members
    notify_details str
    notify_roles str
    principal_domain_filter str
    review_enabled bool
    self_renew bool
    self_renew_mins float
    self_serve bool
    settings GetRolesRoleSettings
    Advanced settings
    sign_algorithm str
    tags Mapping[str, str]
    trust str
    The domain, which this role is trusted to
    user_authority_expiration str
    user_authority_filter str
    domain String
    name String
    auditEnabled Boolean
    deleteProtection Boolean
    description String
    lastReviewedDate String
    Last reviewed date for the role
    members List<Property Map>
    Athenz principal to be added as members
    notifyDetails String
    notifyRoles String
    principalDomainFilter String
    reviewEnabled Boolean
    selfRenew Boolean
    selfRenewMins Number
    selfServe Boolean
    settings Property Map
    Advanced settings
    signAlgorithm String
    tags Map<String>
    trust String
    The domain, which this role is trusted to
    userAuthorityExpiration String
    userAuthorityFilter 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 String
    expiration String
    review String

    GetRolesRoleSettings

    Package Details

    Repository
    athenz athenz/terraform-provider-athenz
    License
    Notes
    This Pulumi package is based on the athenz Terraform Provider.
    athenz logo
    athenz 1.0.45 published on Tuesday, Apr 15, 2025 by athenz