1. Packages
  2. Aquasec
  3. API Docs
  4. getGroups
Aquasec v0.8.29 published on Monday, Jul 22, 2024 by Pulumiverse

aquasec.getGroups

Explore with Pulumi AI

aquasec logo
Aquasec v0.8.29 published on Monday, Jul 22, 2024 by Pulumiverse

    The data source aquasec.getGroups provides a method to query all groups within the Aqua CSPMgroup database. The fields returned from this query are detailed in the Schema section below.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aquasec from "@pulumi/aquasec";
    
    const groups = aquasec.getGroups({});
    export const firstGroupName = groups.then(groups => groups.groups?.[0]?.name);
    
    import pulumi
    import pulumi_aquasec as aquasec
    
    groups = aquasec.get_groups()
    pulumi.export("firstGroupName", groups.groups[0].name)
    
    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 {
    		groups, err := aquasec.GetGroups(ctx, nil, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("firstGroupName", groups.Groups[0].Name)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aquasec = Pulumi.Aquasec;
    
    return await Deployment.RunAsync(() => 
    {
        var groups = Aquasec.GetGroups.Invoke();
    
        return new Dictionary<string, object?>
        {
            ["firstGroupName"] = groups.Apply(getGroupsResult => getGroupsResult.Groups[0]?.Name),
        };
    });
    
    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 groups = AquasecFunctions.getGroups();
    
            ctx.export("firstGroupName", groups.applyValue(getGroupsResult -> getGroupsResult.groups()[0].name()));
        }
    }
    
    variables:
      groups:
        fn::invoke:
          Function: aquasec:getGroups
          Arguments: {}
    outputs:
      firstGroupName: ${groups.groups[0].name}
    

    Using getGroups

    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 getGroups(opts?: InvokeOptions): Promise<GetGroupsResult>
    function getGroupsOutput(opts?: InvokeOptions): Output<GetGroupsResult>
    def get_groups(opts: Optional[InvokeOptions] = None) -> GetGroupsResult
    def get_groups_output(opts: Optional[InvokeOptions] = None) -> Output[GetGroupsResult]
    func GetGroups(ctx *Context, opts ...InvokeOption) (*GetGroupsResult, error)
    func GetGroupsOutput(ctx *Context, opts ...InvokeOption) GetGroupsResultOutput

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

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

    getGroups Result

    The following output properties are available:

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

    Supporting Types

    GetGroupsGroup

    Created string
    The creation date of the group.
    GroupId string
    The ID of the created group.
    Name string
    The desired name of the group.
    Created string
    The creation date of the group.
    GroupId string
    The ID of the created group.
    Name string
    The desired name of the group.
    created String
    The creation date of the group.
    groupId String
    The ID of the created group.
    name String
    The desired name of the group.
    created string
    The creation date of the group.
    groupId string
    The ID of the created group.
    name string
    The desired name of the group.
    created str
    The creation date of the group.
    group_id str
    The ID of the created group.
    name str
    The desired name of the group.
    created String
    The creation date of the group.
    groupId String
    The ID of the created group.
    name String
    The desired name of the group.

    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.29 published on Monday, Jul 22, 2024 by Pulumiverse