1. Packages
  2. Aquasec
  3. API Docs
  4. getRoles
Aquasec v0.8.27 published on Monday, Jan 29, 2024 by Pulumiverse

aquasec.getRoles

Explore with Pulumi AI

aquasec logo
Aquasec v0.8.27 published on Monday, Jan 29, 2024 by Pulumiverse

    The data source aquasec.getRoles provides a method to query all roles within the Aqua account managementrole database. The fields returned from this query are detailed in the Schema section below.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aquasec = Pulumi.Aquasec;
    
    return await Deployment.RunAsync(() => 
    {
        var roles = Aquasec.GetRoles.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["firstUserName"] = roles.Apply(getRolesResult => getRolesResult.Roles[0]),
        };
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-aquasec/sdk/go/aquasec"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		roles, err := aquasec.GetRoles(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstUserName", roles.Roles[0])
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aquasec.AquasecFunctions;
    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 roles = AquasecFunctions.getRoles();
    
            ctx.export("firstUserName", roles.applyValue(getRolesResult -> getRolesResult.roles()[0]));
        }
    }
    
    import pulumi
    import pulumi_aquasec as aquasec
    
    roles = aquasec.get_roles()
    pulumi.export("firstUserName", roles.roles[0])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aquasec from "@pulumi/aquasec";
    
    const roles = aquasec.getRoles({});
    export const firstUserName = roles.then(roles => roles.roles?.[0]);
    
    variables:
      roles:
        fn::invoke:
          Function: aquasec:getRoles
          Arguments: {}
    outputs:
      # Output the first role
      firstUserName: ${roles.roles[0]}
    

    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(opts?: InvokeOptions): Promise<GetRolesResult>
    function getRolesOutput(opts?: InvokeOptions): Output<GetRolesResult>
    def get_roles(opts: Optional[InvokeOptions] = None) -> GetRolesResult
    def get_roles_output(opts: Optional[InvokeOptions] = None) -> Output[GetRolesResult]
    func GetRoles(ctx *Context, opts ...InvokeOption) (*GetRolesResult, error)
    func GetRolesOutput(ctx *Context, opts ...InvokeOption) GetRolesResultOutput

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

    public static class GetRoles 
    {
        public static Task<GetRolesResult> InvokeAsync(InvokeOptions? opts = null)
        public static Output<GetRolesResult> Invoke(InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetRolesResult> getRoles(InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aquasec:index/getRoles:getRoles
      arguments:
        # arguments dictionary

    getRoles Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Roles List<Pulumiverse.Aquasec.Outputs.GetRolesRole>
    Id string
    The provider-assigned unique ID for this managed resource.
    Roles []GetRolesRole
    id String
    The provider-assigned unique ID for this managed resource.
    roles List<GetRolesRole>
    id string
    The provider-assigned unique ID for this managed resource.
    roles GetRolesRole[]
    id str
    The provider-assigned unique ID for this managed resource.
    roles Sequence[GetRolesRole]
    id String
    The provider-assigned unique ID for this managed resource.
    roles List<Property Map>

    Supporting Types

    GetRolesRole

    Description string
    Name string
    Permission string
    Scopes List<string>
    UpdatedAt string
    Description string
    Name string
    Permission string
    Scopes []string
    UpdatedAt string
    description String
    name String
    permission String
    scopes List<String>
    updatedAt String
    description string
    name string
    permission string
    scopes string[]
    updatedAt string
    description str
    name str
    permission str
    scopes Sequence[str]
    updated_at str
    description String
    name String
    permission String
    scopes List<String>
    updatedAt String

    Package Details

    Repository
    aquasec pulumiverse/pulumi-aquasec
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the aquasec Terraform Provider.
    aquasec logo
    Aquasec v0.8.27 published on Monday, Jan 29, 2024 by Pulumiverse