getGroups

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

NOTE: Available since v1.0.0+.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.ram.RamFunctions;
import com.pulumi.alicloud.ram.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 groupsDs = RamFunctions.getGroups(GetGroupsArgs.builder()
.nameRegex("^group[0-9]*")
.outputFile("groups.txt")
.userName("user1")
.build());
ctx.export("firstGroupName", groupsDs.applyValue(getGroupsResult -> getGroupsResult.groups()[0].name()));
}
}

Return

A collection of values returned by getGroups.

Parameters

argument

A collection of arguments for invoking getGroups.


suspend fun getGroups(nameRegex: String? = null, outputFile: String? = null, policyName: String? = null, policyType: String? = null, userName: String? = null): GetGroupsResult

Return

A collection of values returned by getGroups.

See also

Parameters

nameRegex

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

outputFile

File name where to save data source results (after running pulumi preview).

policyName

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

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

Filter the results by a specific the user name.


suspend fun getGroups(argument: suspend GetGroupsPlainArgsBuilder.() -> Unit): GetGroupsResult

Return

A collection of values returned by getGroups.

See also

Parameters

argument

Builder for com.pulumi.alicloud.ram.kotlin.inputs.GetGroupsPlainArgs.