Alibaba Cloud

Pulumi Official
Package maintained by Pulumi
v3.27.0 published on Monday, Aug 8, 2022 by Pulumi

getGroups

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

NOTE: Available in v1.138.0+.

NOTE: Cloud SSO Only Support cn-shanghai And us-west-1 Region

Example Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var ids = Output.Create(AliCloud.CloudSso.GetGroups.InvokeAsync(new AliCloud.CloudSso.GetGroupsArgs
        {
            DirectoryId = "example_value",
            Ids = 
            {
                "example_value-1",
                "example_value-2",
            },
        }));
        this.CloudSsoGroupId1 = ids.Apply(ids => ids.Groups?[0]?.Id);
        var nameRegex = Output.Create(AliCloud.CloudSso.GetGroups.InvokeAsync(new AliCloud.CloudSso.GetGroupsArgs
        {
            DirectoryId = "example_value",
            NameRegex = "^my-Group",
        }));
        this.CloudSsoGroupId2 = nameRegex.Apply(nameRegex => nameRegex.Groups?[0]?.Id);
    }

    [Output("cloudSsoGroupId1")]
    public Output<string> CloudSsoGroupId1 { get; set; }
    [Output("cloudSsoGroupId2")]
    public Output<string> CloudSsoGroupId2 { get; set; }
}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		ids, err := cloudsso.GetGroups(ctx, &cloudsso.GetGroupsArgs{
			DirectoryId: "example_value",
			Ids: []string{
				"example_value-1",
				"example_value-2",
			},
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("cloudSsoGroupId1", ids.Groups[0].Id)
		nameRegex, err := cloudsso.GetGroups(ctx, &cloudsso.GetGroupsArgs{
			DirectoryId: "example_value",
			NameRegex:   pulumi.StringRef("^my-Group"),
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("cloudSsoGroupId2", nameRegex.Groups[0].Id)
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.cloudsso.CloudssoFunctions;
import com.pulumi.alicloud.apigateway.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 ids = CloudssoFunctions.getGroups(GetGroupsArgs.builder()
            .directoryId("example_value")
            .ids(            
                "example_value-1",
                "example_value-2")
            .build());

        ctx.export("cloudSsoGroupId1", ids.applyValue(getGroupsResult -> getGroupsResult.groups()[0].id()));
        final var nameRegex = CloudssoFunctions.getGroups(GetGroupsArgs.builder()
            .directoryId("example_value")
            .nameRegex("^my-Group")
            .build());

        ctx.export("cloudSsoGroupId2", nameRegex.applyValue(getGroupsResult -> getGroupsResult.groups()[0].id()));
    }
}
import pulumi
import pulumi_alicloud as alicloud

ids = alicloud.cloudsso.get_groups(directory_id="example_value",
    ids=[
        "example_value-1",
        "example_value-2",
    ])
pulumi.export("cloudSsoGroupId1", ids.groups[0].id)
name_regex = alicloud.cloudsso.get_groups(directory_id="example_value",
    name_regex="^my-Group")
pulumi.export("cloudSsoGroupId2", name_regex.groups[0].id)
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const ids = alicloud.cloudsso.getGroups({
    directoryId: "example_value",
    ids: [
        "example_value-1",
        "example_value-2",
    ],
});
export const cloudSsoGroupId1 = ids.then(ids => ids.groups?[0]?.id);
const nameRegex = alicloud.cloudsso.getGroups({
    directoryId: "example_value",
    nameRegex: "^my-Group",
});
export const cloudSsoGroupId2 = nameRegex.then(nameRegex => nameRegex.groups?[0]?.id);
variables:
  ids:
    Fn::Invoke:
      Function: alicloud:cloudsso:getGroups
      Arguments:
        directoryId: example_value
        ids:
          - example_value-1
          - example_value-2
  nameRegex:
    Fn::Invoke:
      Function: alicloud:cloudsso:getGroups
      Arguments:
        directoryId: example_value
        nameRegex: ^my-Group
outputs:
  cloudSsoGroupId1: ${ids.groups[0].id}
  cloudSsoGroupId2: ${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(directory_id: Optional[str] = None,
               ids: Optional[Sequence[str]] = None,
               name_regex: Optional[str] = None,
               output_file: Optional[str] = None,
               provision_type: Optional[str] = None,
               opts: Optional[InvokeOptions] = None) -> GetGroupsResult
def get_groups_output(directory_id: Optional[pulumi.Input[str]] = None,
               ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
               name_regex: Optional[pulumi.Input[str]] = None,
               output_file: Optional[pulumi.Input[str]] = None,
               provision_type: 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:cloudsso/getGroups:getGroups
  Arguments:
    # Arguments dictionary

The following arguments are supported:

DirectoryId string

The ID of the Directory.

Ids List<string>

A list of Group IDs.

NameRegex string

A regex string to filter results by Group name.

OutputFile string
ProvisionType string

The Provision Type of the Group. Valid values: Manual, Synchronized.

DirectoryId string

The ID of the Directory.

Ids []string

A list of Group IDs.

NameRegex string

A regex string to filter results by Group name.

OutputFile string
ProvisionType string

The Provision Type of the Group. Valid values: Manual, Synchronized.

directoryId String

The ID of the Directory.

ids List<String>

A list of Group IDs.

nameRegex String

A regex string to filter results by Group name.

outputFile String
provisionType String

The Provision Type of the Group. Valid values: Manual, Synchronized.

directoryId string

The ID of the Directory.

ids string[]

A list of Group IDs.

nameRegex string

A regex string to filter results by Group name.

outputFile string
provisionType string

The Provision Type of the Group. Valid values: Manual, Synchronized.

directory_id str

The ID of the Directory.

ids Sequence[str]

A list of Group IDs.

name_regex str

A regex string to filter results by Group name.

output_file str
provision_type str

The Provision Type of the Group. Valid values: Manual, Synchronized.

directoryId String

The ID of the Directory.

ids List<String>

A list of Group IDs.

nameRegex String

A regex string to filter results by Group name.

outputFile String
provisionType String

The Provision Type of the Group. Valid values: Manual, Synchronized.

getGroups Result

The following output properties are available:

DirectoryId string
Groups List<Pulumi.AliCloud.CloudSso.Outputs.GetGroupsGroup>
Id string

The provider-assigned unique ID for this managed resource.

Ids List<string>
Names List<string>
NameRegex string
OutputFile string
ProvisionType string
DirectoryId string
Groups []GetGroupsGroup
Id string

The provider-assigned unique ID for this managed resource.

Ids []string
Names []string
NameRegex string
OutputFile string
ProvisionType string
directoryId 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
provisionType String
directoryId string
groups GetGroupsGroup[]
id string

The provider-assigned unique ID for this managed resource.

ids string[]
names string[]
nameRegex string
outputFile string
provisionType string
directory_id str
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
provision_type str
directoryId String
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
provisionType String

Supporting Types

GetGroupsGroup

CreateTime string

The Created Time of the Directory.

Description string

The Description of the Directory.

DirectoryId string

The ID of the Directory.

GroupId string

The Group ID of the group.

GroupName string

The Name of the group.

Id string

The ID of the Group.

ProvisionType string

The Provision Type of the Group. Valid values: Manual, Synchronized.

CreateTime string

The Created Time of the Directory.

Description string

The Description of the Directory.

DirectoryId string

The ID of the Directory.

GroupId string

The Group ID of the group.

GroupName string

The Name of the group.

Id string

The ID of the Group.

ProvisionType string

The Provision Type of the Group. Valid values: Manual, Synchronized.

createTime String

The Created Time of the Directory.

description String

The Description of the Directory.

directoryId String

The ID of the Directory.

groupId String

The Group ID of the group.

groupName String

The Name of the group.

id String

The ID of the Group.

provisionType String

The Provision Type of the Group. Valid values: Manual, Synchronized.

createTime string

The Created Time of the Directory.

description string

The Description of the Directory.

directoryId string

The ID of the Directory.

groupId string

The Group ID of the group.

groupName string

The Name of the group.

id string

The ID of the Group.

provisionType string

The Provision Type of the Group. Valid values: Manual, Synchronized.

create_time str

The Created Time of the Directory.

description str

The Description of the Directory.

directory_id str

The ID of the Directory.

group_id str

The Group ID of the group.

group_name str

The Name of the group.

id str

The ID of the Group.

provision_type str

The Provision Type of the Group. Valid values: Manual, Synchronized.

createTime String

The Created Time of the Directory.

description String

The Description of the Directory.

directoryId String

The ID of the Directory.

groupId String

The Group ID of the group.

groupName String

The Name of the group.

id String

The ID of the Group.

provisionType String

The Provision Type of the Group. Valid values: Manual, Synchronized.

Package Details

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

This Pulumi package is based on the alicloud Terraform Provider.