Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi
alicloud.securitycenter.getGroups
Explore with Pulumi AI
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.
- Name
Regex string - A regex string to filter results by Group name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- Ids []string
- A list of Group IDs.
- Name
Regex string - A regex string to filter results by Group name.
- Output
File string - File name where to save data source results (after running
pulumi preview
).
- ids List<String>
- A list of Group IDs.
- name
Regex String - A regex string to filter results by Group name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
- ids string[]
- A list of Group IDs.
- name
Regex string - A regex string to filter results by Group name.
- output
File 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.
- name
Regex String - A regex string to filter results by Group name.
- output
File String - File name where to save data source results (after running
pulumi preview
).
getGroups Result
The following output properties are available:
- Groups
List<Pulumi.
Ali Cloud. Security Center. Outputs. Get Groups Group> - Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Names List<string>
- Name
Regex string - Output
File string
- Groups
[]Get
Groups Group - Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- Name
Regex string - Output
File string
- groups
List<Get
Groups Group> - id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- name
Regex String - output
File String
- groups
Get
Groups Group[] - id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- name
Regex string - output
File string
- groups
Sequence[Get
Groups Group] - 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>
- name
Regex String - output
File String
Supporting Types
GetGroupsGroup
- 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).
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.