Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.19.0 published on Friday, Mar 18, 2022 by Pulumi

getGroups

This data source provides a list of RAM Groups in an Alibaba Cloud account according to the specified filters.

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var groupsDs = Output.Create(AliCloud.Ram.GetGroups.InvokeAsync(new AliCloud.Ram.GetGroupsArgs
        {
            NameRegex = "^group[0-9]*",
            OutputFile = "groups.txt",
            UserName = "user1",
        }));
        this.FirstGroupName = groupsDs.Apply(groupsDs => groupsDs.Groups?[0]?.Name);
    }

    [Output("firstGroupName")]
    public Output<string> FirstGroupName { get; set; }
}
package main

import (
	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/ram"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		groupsDs, err := ram.GetGroups(ctx, &ram.GetGroupsArgs{
			NameRegex:  pulumi.StringRef("^group[0-9]*"),
			OutputFile: pulumi.StringRef("groups.txt"),
			UserName:   pulumi.StringRef("user1"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("firstGroupName", groupsDs.Groups[0].Name)
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_alicloud as alicloud

groups_ds = alicloud.ram.get_groups(name_regex="^group[0-9]*",
    output_file="groups.txt",
    user_name="user1")
pulumi.export("firstGroupName", groups_ds.groups[0].name)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const groupsDs = pulumi.output(alicloud.ram.getGroups({
    nameRegex: "^group[0-9]*",
    outputFile: "groups.txt",
    userName: "user1",
}));

export const firstGroupName = groupsDs.groups[0].name;

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(name_regex: Optional[str] = None,
               output_file: Optional[str] = None,
               policy_name: Optional[str] = None,
               policy_type: Optional[str] = None,
               user_name: Optional[str] = None,
               opts: Optional[InvokeOptions] = None) -> GetGroupsResult
def get_groups_output(name_regex: Optional[pulumi.Input[str]] = None,
               output_file: Optional[pulumi.Input[str]] = None,
               policy_name: Optional[pulumi.Input[str]] = None,
               policy_type: Optional[pulumi.Input[str]] = None,
               user_name: 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:ram/getGroups:getGroups
  Arguments:
    # Arguments dictionary

The following arguments are supported:

NameRegex string

A regex string to filter the returned groups by their names.

OutputFile string
PolicyName string

Filter the results by a specific policy name. If you set this parameter without setting policy_type, it will be automatically set to System.

PolicyType string

Filter the results by a specific policy type. Valid items are Custom and System. If you set this parameter, you must set policy_name as well.

UserName string

Filter the results by a specific the user name.

NameRegex string

A regex string to filter the returned groups by their names.

OutputFile string
PolicyName string

Filter the results by a specific policy name. If you set this parameter without setting policy_type, it will be automatically set to System.

PolicyType string

Filter the results by a specific policy type. Valid items are Custom and System. If you set this parameter, you must set policy_name as well.

UserName string

Filter the results by a specific the user name.

nameRegex String

A regex string to filter the returned groups by their names.

outputFile String
policyName String

Filter the results by a specific policy name. If you set this parameter without setting policy_type, it will be automatically set to System.

policyType String

Filter the results by a specific policy type. Valid items are Custom and System. If you set this parameter, you must set policy_name as well.

userName String

Filter the results by a specific the user name.

nameRegex string

A regex string to filter the returned groups by their names.

outputFile string
policyName string

Filter the results by a specific policy name. If you set this parameter without setting policy_type, it will be automatically set to System.

policyType string

Filter the results by a specific policy type. Valid items are Custom and System. If you set this parameter, you must set policy_name as well.

userName string

Filter the results by a specific the user name.

name_regex str

A regex string to filter the returned groups by their names.

output_file str
policy_name str

Filter the results by a specific policy name. If you set this parameter without setting policy_type, it will be automatically set to System.

policy_type str

Filter the results by a specific policy type. Valid items are Custom and System. If you set this parameter, you must set policy_name as well.

user_name str

Filter the results by a specific the user name.

nameRegex String

A regex string to filter the returned groups by their names.

outputFile String
policyName String

Filter the results by a specific policy name. If you set this parameter without setting policy_type, it will be automatically set to System.

policyType String

Filter the results by a specific policy type. Valid items are Custom and System. If you set this parameter, you must set policy_name as well.

userName String

Filter the results by a specific the user name.

getGroups Result

The following output properties are available:

Groups List<Pulumi.AliCloud.Ram.Outputs.GetGroupsGroup>

A list of groups. Each element contains the following attributes:

Id string

The provider-assigned unique ID for this managed resource.

Names List<string>

A list of ram group names.

NameRegex string
OutputFile string
PolicyName string
PolicyType string
UserName string
Groups []GetGroupsGroup

A list of groups. Each element contains the following attributes:

Id string

The provider-assigned unique ID for this managed resource.

Names []string

A list of ram group names.

NameRegex string
OutputFile string
PolicyName string
PolicyType string
UserName string
groups ListGroupsGroup>

A list of groups. Each element contains the following attributes:

id String

The provider-assigned unique ID for this managed resource.

names List

A list of ram group names.

nameRegex String
outputFile String
policyName String
policyType String
userName String
groups GetGroupsGroup[]

A list of groups. Each element contains the following attributes:

id string

The provider-assigned unique ID for this managed resource.

names string[]

A list of ram group names.

nameRegex string
outputFile string
policyName string
policyType string
userName string
groups Sequence[GetGroupsGroup]

A list of groups. Each element contains the following attributes:

id str

The provider-assigned unique ID for this managed resource.

names Sequence[str]

A list of ram group names.

name_regex str
output_file str
policy_name str
policy_type str
user_name str
groups List

A list of groups. Each element contains the following attributes:

id String

The provider-assigned unique ID for this managed resource.

names List

A list of ram group names.

nameRegex String
outputFile String
policyName String
policyType String
userName String

Supporting Types

GetGroupsGroup

Comments string

Comments of the group.

Name string

Name of the group.

Comments string

Comments of the group.

Name string

Name of the group.

comments String

Comments of the group.

name String

Name of the group.

comments string

Comments of the group.

name string

Name of the group.

comments str

Comments of the group.

name str

Name of the group.

comments String

Comments of the group.

name String

Name of the group.

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.