Alibaba Cloud
getGroups
This data source provides the Security Center Groups of the current Alibaba Cloud user.
NOTE: Available in v1.133.0+.
Example Usage
using Pulumi;
using AliCloud = Pulumi.AliCloud;
class MyStack : Stack
{
public MyStack()
{
var nameRegex = Output.Create(AliCloud.SecurityCenter.GetGroups.InvokeAsync(new AliCloud.SecurityCenter.GetGroupsArgs
{
NameRegex = "^my-Group",
}));
this.SecurityCenterGroups = nameRegex.Apply(nameRegex => nameRegex.Groups?[0]?.Id);
}
[Output("securityCenterGroups")]
public Output<string> SecurityCenterGroups { get; set; }
}
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
})
}
Coming soon!
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)
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);
Coming soon!
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
- Ids []string
A list of Group IDs.
- Name
Regex string A regex string to filter results by Group name.
- Output
File string
- ids
List
A list of Group IDs.
- name
Regex String A regex string to filter results by Group name.
- output
File String
- ids string[]
A list of Group IDs.
- name
Regex string A regex string to filter results by Group name.
- output
File string
- ids Sequence[str]
A list of Group IDs.
- name_
regex str A regex string to filter results by Group name.
- output_
file str
- ids
List
A list of Group IDs.
- name
Regex String A regex string to filter results by Group name.
- output
File String
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
Groups Group> - id String
The provider-assigned unique ID for this managed resource.
- ids
List
- names
List
- 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
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
- https://github.com/pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
alicloud
Terraform Provider.