1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. securitycenter
  5. getGroups
Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi

alicloud.securitycenter.getGroups

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi

    This data source provides the Security Center Groups of the current Alibaba Cloud user.

    NOTE: Available in v1.133.0+.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const nameRegex = alicloud.securitycenter.getGroups({
        nameRegex: "^my-Group",
    });
    export const securityCenterGroups = nameRegex.then(nameRegex => nameRegex.groups?.[0]?.id);
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    name_regex = alicloud.securitycenter.get_groups(name_regex="^my-Group")
    pulumi.export("securityCenterGroups", name_regex.groups[0].id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/securitycenter"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		nameRegex, err := securitycenter.GetGroups(ctx, &securitycenter.GetGroupsArgs{
    			NameRegex: pulumi.StringRef("^my-Group"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("securityCenterGroups", nameRegex.Groups[0].Id)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var nameRegex = AliCloud.SecurityCenter.GetGroups.Invoke(new()
        {
            NameRegex = "^my-Group",
        });
    
        return new Dictionary<string, object?>
        {
            ["securityCenterGroups"] = nameRegex.Apply(getGroupsResult => getGroupsResult.Groups[0]?.Id),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.securitycenter.SecuritycenterFunctions;
    import com.pulumi.alicloud.securitycenter.inputs.GetGroupsArgs;
    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 nameRegex = SecuritycenterFunctions.getGroups(GetGroupsArgs.builder()
                .nameRegex("^my-Group")
                .build());
    
            ctx.export("securityCenterGroups", nameRegex.applyValue(getGroupsResult -> getGroupsResult.groups()[0].id()));
        }
    }
    
    variables:
      nameRegex:
        fn::invoke:
          Function: alicloud:securitycenter:getGroups
          Arguments:
            nameRegex: ^my-Group
    outputs:
      securityCenterGroups: ${nameRegex.groups[0].id}
    

    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(args: GetGroupsArgs, opts?: InvokeOptions): Promise<GetGroupsResult>
    function getGroupsOutput(args: GetGroupsOutputArgs, opts?: InvokeOptions): Output<GetGroupsResult>
    def get_groups(ids: Optional[Sequence[str]] = None,
                   name_regex: Optional[str] = None,
                   output_file: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetGroupsResult
    def get_groups_output(ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                   name_regex: Optional[pulumi.Input[str]] = None,
                   output_file: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetGroupsResult]
    func GetGroups(ctx *Context, args *GetGroupsArgs, opts ...InvokeOption) (*GetGroupsResult, error)
    func GetGroupsOutput(ctx *Context, args *GetGroupsOutputArgs, opts ...InvokeOption) GetGroupsResultOutput

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

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

    The following arguments are supported:

    Ids List<string>
    A list of Group IDs.
    NameRegex string
    A regex string to filter results by Group name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    Ids []string
    A list of Group IDs.
    NameRegex string
    A regex string to filter results by Group name.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of Group IDs.
    nameRegex String
    A regex string to filter results by Group name.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    ids string[]
    A list of Group IDs.
    nameRegex string
    A regex string to filter results by Group name.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    ids Sequence[str]
    A list of Group IDs.
    name_regex str
    A regex string to filter results by Group name.
    output_file str
    File name where to save data source results (after running pulumi preview).
    ids List<String>
    A list of Group IDs.
    nameRegex String
    A regex string to filter results by Group name.
    outputFile String
    File name where to save data source results (after running pulumi preview).

    getGroups Result

    The following output properties are available:

    Groups List<Pulumi.AliCloud.SecurityCenter.Outputs.GetGroupsGroup>
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids List<string>
    Names List<string>
    NameRegex string
    OutputFile string
    Groups []GetGroupsGroup
    Id string
    The provider-assigned unique ID for this managed resource.
    Ids []string
    Names []string
    NameRegex string
    OutputFile string
    groups List<GetGroupsGroup>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    nameRegex String
    outputFile String
    groups GetGroupsGroup[]
    id string
    The provider-assigned unique ID for this managed resource.
    ids string[]
    names string[]
    nameRegex string
    outputFile string
    groups Sequence[GetGroupsGroup]
    id str
    The provider-assigned unique ID for this managed resource.
    ids Sequence[str]
    names Sequence[str]
    name_regex str
    output_file str
    groups List<Property Map>
    id String
    The provider-assigned unique ID for this managed resource.
    ids List<String>
    names List<String>
    nameRegex String
    outputFile String

    Supporting Types

    GetGroupsGroup

    GroupFlag int
    GroupFlag, '0' mean default group(created by system), '1' means customer defined group.
    GroupId string
    The ID of Group.
    GroupName string
    The name of Group.
    Id string
    The ID of the Group(same as the group_id).
    GroupFlag int
    GroupFlag, '0' mean default group(created by system), '1' means customer defined group.
    GroupId string
    The ID of Group.
    GroupName string
    The name of Group.
    Id string
    The ID of the Group(same as the group_id).
    groupFlag Integer
    GroupFlag, '0' mean default group(created by system), '1' means customer defined group.
    groupId String
    The ID of Group.
    groupName String
    The name of Group.
    id String
    The ID of the Group(same as the group_id).
    groupFlag number
    GroupFlag, '0' mean default group(created by system), '1' means customer defined group.
    groupId string
    The ID of Group.
    groupName string
    The name of Group.
    id string
    The ID of the Group(same as the group_id).
    group_flag int
    GroupFlag, '0' mean default group(created by system), '1' means customer defined group.
    group_id str
    The ID of Group.
    group_name str
    The name of Group.
    id str
    The ID of the Group(same as the group_id).
    groupFlag Number
    GroupFlag, '0' mean default group(created by system), '1' means customer defined group.
    groupId String
    The ID of Group.
    groupName String
    The name of Group.
    id String
    The ID of the Group(same as the group_id).

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.54.0 published on Wednesday, Apr 24, 2024 by Pulumi