Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi
alicloud.cloudsso.getGroups
Explore with Pulumi AI
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
Andus-west-1
Region
Example Usage
Basic Usage
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);
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)
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
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
return await Deployment.RunAsync(() =>
{
var ids = AliCloud.CloudSso.GetGroups.Invoke(new()
{
DirectoryId = "example_value",
Ids = new[]
{
"example_value-1",
"example_value-2",
},
});
var nameRegex = AliCloud.CloudSso.GetGroups.Invoke(new()
{
DirectoryId = "example_value",
NameRegex = "^my-Group",
});
return new Dictionary<string, object?>
{
["cloudSsoGroupId1"] = ids.Apply(getGroupsResult => getGroupsResult.Groups[0]?.Id),
["cloudSsoGroupId2"] = 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.cloudsso.CloudssoFunctions;
import com.pulumi.alicloud.cloudsso.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()));
}
}
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:
- Directory
Id string - The ID of the Directory.
- 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
). - Provision
Type string - The ProvisionType of the Group. Valid values:
Manual
,Synchronized
.
- Directory
Id string - The ID of the Directory.
- 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
). - Provision
Type string - The ProvisionType of the Group. Valid values:
Manual
,Synchronized
.
- directory
Id String - The ID of the Directory.
- 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
). - provision
Type String - The ProvisionType of the Group. Valid values:
Manual
,Synchronized
.
- directory
Id string - The ID of the Directory.
- 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
). - provision
Type string - The ProvisionType 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 - File name where to save data source results (after running
pulumi preview
). - provision_
type str - The ProvisionType of the Group. Valid values:
Manual
,Synchronized
.
- directory
Id String - The ID of the Directory.
- 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
). - provision
Type String - The ProvisionType of the Group. Valid values:
Manual
,Synchronized
.
getGroups Result
The following output properties are available:
- Directory
Id string - Groups
List<Pulumi.
Ali Cloud. Cloud Sso. 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 - Provision
Type string
- Directory
Id 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 - Provision
Type string
- directory
Id 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 - provision
Type String
- directory
Id 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 - provision
Type string
- directory_
id str - 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 - provision_
type str
- directory
Id String - 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 - provision
Type String
Supporting Types
GetGroupsGroup
- Create
Time string - The Created Time of the Directory.
- Description string
- The Description of the Directory.
- Directory
Id string - The ID of the Directory.
- Group
Id string - The Group ID of the group.
- Group
Name string - The Name of the group.
- Id string
- The ID of the Group.
- Provision
Type string - The Provision Type of the Group. Valid values:
Manual
,Synchronized
.
- Create
Time string - The Created Time of the Directory.
- Description string
- The Description of the Directory.
- Directory
Id string - The ID of the Directory.
- Group
Id string - The Group ID of the group.
- Group
Name string - The Name of the group.
- Id string
- The ID of the Group.
- Provision
Type string - The Provision Type of the Group. Valid values:
Manual
,Synchronized
.
- create
Time String - The Created Time of the Directory.
- description String
- The Description of the Directory.
- directory
Id String - The ID of the Directory.
- group
Id String - The Group ID of the group.
- group
Name String - The Name of the group.
- id String
- The ID of the Group.
- provision
Type String - The Provision Type of the Group. Valid values:
Manual
,Synchronized
.
- create
Time string - The Created Time of the Directory.
- description string
- The Description of the Directory.
- directory
Id string - The ID of the Directory.
- group
Id string - The Group ID of the group.
- group
Name string - The Name of the group.
- id string
- The ID of the Group.
- provision
Type 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
.
- create
Time String - The Created Time of the Directory.
- description String
- The Description of the Directory.
- directory
Id String - The ID of the Directory.
- group
Id String - The Group ID of the group.
- group
Name String - The Name of the group.
- id String
- The ID of the Group.
- provision
Type String - The Provision Type of the Group. Valid values:
Manual
,Synchronized
.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.