Alibaba Cloud v3.66.0 published on Friday, Nov 15, 2024 by Pulumi
alicloud.cloudsso.getUsers
Explore with Pulumi AI
This data source provides the Cloud Sso Users of the current Alibaba Cloud user.
NOTE: Available in v1.140.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.getUsers({
directoryId: "example_value",
ids: [
"example_value-1",
"example_value-2",
],
});
export const cloudSsoUserId1 = ids.then(ids => ids.users?.[0]?.id);
const nameRegex = alicloud.cloudsso.getUsers({
directoryId: "example_value",
nameRegex: "^my-User",
});
export const cloudSsoUserId2 = nameRegex.then(nameRegex => nameRegex.users?.[0]?.id);
const provisionType = alicloud.cloudsso.getUsers({
directoryId: "example_value",
ids: ["example_value-1"],
provisionType: "Manual",
});
export const cloudSsoUserId3 = provisionType.then(provisionType => provisionType.users?.[0]?.id);
const status = alicloud.cloudsso.getUsers({
directoryId: "example_value",
ids: ["example_value-1"],
status: "Enabled",
});
export const cloudSsoUserId4 = status.then(status => status.users?.[0]?.id);
import pulumi
import pulumi_alicloud as alicloud
ids = alicloud.cloudsso.get_users(directory_id="example_value",
ids=[
"example_value-1",
"example_value-2",
])
pulumi.export("cloudSsoUserId1", ids.users[0].id)
name_regex = alicloud.cloudsso.get_users(directory_id="example_value",
name_regex="^my-User")
pulumi.export("cloudSsoUserId2", name_regex.users[0].id)
provision_type = alicloud.cloudsso.get_users(directory_id="example_value",
ids=["example_value-1"],
provision_type="Manual")
pulumi.export("cloudSsoUserId3", provision_type.users[0].id)
status = alicloud.cloudsso.get_users(directory_id="example_value",
ids=["example_value-1"],
status="Enabled")
pulumi.export("cloudSsoUserId4", status.users[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.GetUsers(ctx, &cloudsso.GetUsersArgs{
DirectoryId: "example_value",
Ids: []string{
"example_value-1",
"example_value-2",
},
}, nil)
if err != nil {
return err
}
ctx.Export("cloudSsoUserId1", ids.Users[0].Id)
nameRegex, err := cloudsso.GetUsers(ctx, &cloudsso.GetUsersArgs{
DirectoryId: "example_value",
NameRegex: pulumi.StringRef("^my-User"),
}, nil)
if err != nil {
return err
}
ctx.Export("cloudSsoUserId2", nameRegex.Users[0].Id)
provisionType, err := cloudsso.GetUsers(ctx, &cloudsso.GetUsersArgs{
DirectoryId: "example_value",
Ids: []string{
"example_value-1",
},
ProvisionType: pulumi.StringRef("Manual"),
}, nil)
if err != nil {
return err
}
ctx.Export("cloudSsoUserId3", provisionType.Users[0].Id)
status, err := cloudsso.GetUsers(ctx, &cloudsso.GetUsersArgs{
DirectoryId: "example_value",
Ids: []string{
"example_value-1",
},
Status: pulumi.StringRef("Enabled"),
}, nil)
if err != nil {
return err
}
ctx.Export("cloudSsoUserId4", status.Users[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.GetUsers.Invoke(new()
{
DirectoryId = "example_value",
Ids = new[]
{
"example_value-1",
"example_value-2",
},
});
var nameRegex = AliCloud.CloudSso.GetUsers.Invoke(new()
{
DirectoryId = "example_value",
NameRegex = "^my-User",
});
var provisionType = AliCloud.CloudSso.GetUsers.Invoke(new()
{
DirectoryId = "example_value",
Ids = new[]
{
"example_value-1",
},
ProvisionType = "Manual",
});
var status = AliCloud.CloudSso.GetUsers.Invoke(new()
{
DirectoryId = "example_value",
Ids = new[]
{
"example_value-1",
},
Status = "Enabled",
});
return new Dictionary<string, object?>
{
["cloudSsoUserId1"] = ids.Apply(getUsersResult => getUsersResult.Users[0]?.Id),
["cloudSsoUserId2"] = nameRegex.Apply(getUsersResult => getUsersResult.Users[0]?.Id),
["cloudSsoUserId3"] = provisionType.Apply(getUsersResult => getUsersResult.Users[0]?.Id),
["cloudSsoUserId4"] = status.Apply(getUsersResult => getUsersResult.Users[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.GetUsersArgs;
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.getUsers(GetUsersArgs.builder()
.directoryId("example_value")
.ids(
"example_value-1",
"example_value-2")
.build());
ctx.export("cloudSsoUserId1", ids.applyValue(getUsersResult -> getUsersResult.users()[0].id()));
final var nameRegex = CloudssoFunctions.getUsers(GetUsersArgs.builder()
.directoryId("example_value")
.nameRegex("^my-User")
.build());
ctx.export("cloudSsoUserId2", nameRegex.applyValue(getUsersResult -> getUsersResult.users()[0].id()));
final var provisionType = CloudssoFunctions.getUsers(GetUsersArgs.builder()
.directoryId("example_value")
.ids("example_value-1")
.provisionType("Manual")
.build());
ctx.export("cloudSsoUserId3", provisionType.applyValue(getUsersResult -> getUsersResult.users()[0].id()));
final var status = CloudssoFunctions.getUsers(GetUsersArgs.builder()
.directoryId("example_value")
.ids("example_value-1")
.status("Enabled")
.build());
ctx.export("cloudSsoUserId4", status.applyValue(getUsersResult -> getUsersResult.users()[0].id()));
}
}
variables:
ids:
fn::invoke:
Function: alicloud:cloudsso:getUsers
Arguments:
directoryId: example_value
ids:
- example_value-1
- example_value-2
nameRegex:
fn::invoke:
Function: alicloud:cloudsso:getUsers
Arguments:
directoryId: example_value
nameRegex: ^my-User
provisionType:
fn::invoke:
Function: alicloud:cloudsso:getUsers
Arguments:
directoryId: example_value
ids:
- example_value-1
provisionType: Manual
status:
fn::invoke:
Function: alicloud:cloudsso:getUsers
Arguments:
directoryId: example_value
ids:
- example_value-1
status: Enabled
outputs:
cloudSsoUserId1: ${ids.users[0].id}
cloudSsoUserId2: ${nameRegex.users[0].id}
cloudSsoUserId3: ${provisionType.users[0].id}
cloudSsoUserId4: ${status.users[0].id}
Using getUsers
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 getUsers(args: GetUsersArgs, opts?: InvokeOptions): Promise<GetUsersResult>
function getUsersOutput(args: GetUsersOutputArgs, opts?: InvokeOptions): Output<GetUsersResult>
def get_users(directory_id: Optional[str] = None,
enable_details: Optional[bool] = None,
ids: Optional[Sequence[str]] = None,
name_regex: Optional[str] = None,
output_file: Optional[str] = None,
provision_type: Optional[str] = None,
status: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetUsersResult
def get_users_output(directory_id: Optional[pulumi.Input[str]] = None,
enable_details: Optional[pulumi.Input[bool]] = 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,
status: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetUsersResult]
func GetUsers(ctx *Context, args *GetUsersArgs, opts ...InvokeOption) (*GetUsersResult, error)
func GetUsersOutput(ctx *Context, args *GetUsersOutputArgs, opts ...InvokeOption) GetUsersResultOutput
> Note: This function is named GetUsers
in the Go SDK.
public static class GetUsers
{
public static Task<GetUsersResult> InvokeAsync(GetUsersArgs args, InvokeOptions? opts = null)
public static Output<GetUsersResult> Invoke(GetUsersInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetUsersResult> getUsers(GetUsersArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: alicloud:cloudsso/getUsers:getUsers
arguments:
# arguments dictionary
The following arguments are supported:
- Directory
Id string - The ID of the Directory.
- Enable
Details bool - Default to
false
. Set it totrue
can output more details about resource attributes. - Ids List<string>
- A list of User IDs.
- Name
Regex string - A regex string to filter results by User name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Provision
Type string - ProvisionType. Valid values:
Manual
,Synchronized
. - Status string
- The status of user. Valid values:
Disabled
,Enabled
.
- Directory
Id string - The ID of the Directory.
- Enable
Details bool - Default to
false
. Set it totrue
can output more details about resource attributes. - Ids []string
- A list of User IDs.
- Name
Regex string - A regex string to filter results by User name.
- Output
File string - File name where to save data source results (after running
pulumi preview
). - Provision
Type string - ProvisionType. Valid values:
Manual
,Synchronized
. - Status string
- The status of user. Valid values:
Disabled
,Enabled
.
- directory
Id String - The ID of the Directory.
- enable
Details Boolean - Default to
false
. Set it totrue
can output more details about resource attributes. - ids List<String>
- A list of User IDs.
- name
Regex String - A regex string to filter results by User name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - provision
Type String - ProvisionType. Valid values:
Manual
,Synchronized
. - status String
- The status of user. Valid values:
Disabled
,Enabled
.
- directory
Id string - The ID of the Directory.
- enable
Details boolean - Default to
false
. Set it totrue
can output more details about resource attributes. - ids string[]
- A list of User IDs.
- name
Regex string - A regex string to filter results by User name.
- output
File string - File name where to save data source results (after running
pulumi preview
). - provision
Type string - ProvisionType. Valid values:
Manual
,Synchronized
. - status string
- The status of user. Valid values:
Disabled
,Enabled
.
- directory_
id str - The ID of the Directory.
- enable_
details bool - Default to
false
. Set it totrue
can output more details about resource attributes. - ids Sequence[str]
- A list of User IDs.
- name_
regex str - A regex string to filter results by User name.
- output_
file str - File name where to save data source results (after running
pulumi preview
). - provision_
type str - ProvisionType. Valid values:
Manual
,Synchronized
. - status str
- The status of user. Valid values:
Disabled
,Enabled
.
- directory
Id String - The ID of the Directory.
- enable
Details Boolean - Default to
false
. Set it totrue
can output more details about resource attributes. - ids List<String>
- A list of User IDs.
- name
Regex String - A regex string to filter results by User name.
- output
File String - File name where to save data source results (after running
pulumi preview
). - provision
Type String - ProvisionType. Valid values:
Manual
,Synchronized
. - status String
- The status of user. Valid values:
Disabled
,Enabled
.
getUsers Result
The following output properties are available:
- Directory
Id string - Id string
- The provider-assigned unique ID for this managed resource.
- Ids List<string>
- Names List<string>
- Users
List<Pulumi.
Ali Cloud. Cloud Sso. Outputs. Get Users User> - Enable
Details bool - Name
Regex string - Output
File string - Provision
Type string - Status string
- Directory
Id string - Id string
- The provider-assigned unique ID for this managed resource.
- Ids []string
- Names []string
- Users
[]Get
Users User - Enable
Details bool - Name
Regex string - Output
File string - Provision
Type string - Status string
- directory
Id String - id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- users
List<Get
Users User> - enable
Details Boolean - name
Regex String - output
File String - provision
Type String - status String
- directory
Id string - id string
- The provider-assigned unique ID for this managed resource.
- ids string[]
- names string[]
- users
Get
Users User[] - enable
Details boolean - name
Regex string - output
File string - provision
Type string - status string
- directory_
id str - id str
- The provider-assigned unique ID for this managed resource.
- ids Sequence[str]
- names Sequence[str]
- users
Sequence[Get
Users User] - enable_
details bool - name_
regex str - output_
file str - provision_
type str - status str
- directory
Id String - id String
- The provider-assigned unique ID for this managed resource.
- ids List<String>
- names List<String>
- users List<Property Map>
- enable
Details Boolean - name
Regex String - output
File String - provision
Type String - status String
Supporting Types
GetUsersUser
- Create
Time string - The create time of the user.
- Description string
- The description of user.
- Directory
Id string - The ID of the Directory.
- Display
Name string - The display name of user.
- Email string
- The User's Contact Email Address.
- First
Name string - The first name of user.
- Id string
- The ID of the User.
- Last
Name string - The last name of user.
- Mfa
Devices List<Pulumi.Ali Cloud. Cloud Sso. Inputs. Get Users User Mfa Device> - The List of MFA Device for User.
- Provision
Type string - ProvisionType.
- Status string
- User status. Valid values:
Enabled
andDisabled
. - User
Id string - The User ID of the group.
- User
Name string - The name of user.
- Create
Time string - The create time of the user.
- Description string
- The description of user.
- Directory
Id string - The ID of the Directory.
- Display
Name string - The display name of user.
- Email string
- The User's Contact Email Address.
- First
Name string - The first name of user.
- Id string
- The ID of the User.
- Last
Name string - The last name of user.
- Mfa
Devices []GetUsers User Mfa Device - The List of MFA Device for User.
- Provision
Type string - ProvisionType.
- Status string
- User status. Valid values:
Enabled
andDisabled
. - User
Id string - The User ID of the group.
- User
Name string - The name of user.
- create
Time String - The create time of the user.
- description String
- The description of user.
- directory
Id String - The ID of the Directory.
- display
Name String - The display name of user.
- email String
- The User's Contact Email Address.
- first
Name String - The first name of user.
- id String
- The ID of the User.
- last
Name String - The last name of user.
- mfa
Devices List<GetUsers User Mfa Device> - The List of MFA Device for User.
- provision
Type String - ProvisionType.
- status String
- User status. Valid values:
Enabled
andDisabled
. - user
Id String - The User ID of the group.
- user
Name String - The name of user.
- create
Time string - The create time of the user.
- description string
- The description of user.
- directory
Id string - The ID of the Directory.
- display
Name string - The display name of user.
- email string
- The User's Contact Email Address.
- first
Name string - The first name of user.
- id string
- The ID of the User.
- last
Name string - The last name of user.
- mfa
Devices GetUsers User Mfa Device[] - The List of MFA Device for User.
- provision
Type string - ProvisionType.
- status string
- User status. Valid values:
Enabled
andDisabled
. - user
Id string - The User ID of the group.
- user
Name string - The name of user.
- create_
time str - The create time of the user.
- description str
- The description of user.
- directory_
id str - The ID of the Directory.
- display_
name str - The display name of user.
- email str
- The User's Contact Email Address.
- first_
name str - The first name of user.
- id str
- The ID of the User.
- last_
name str - The last name of user.
- mfa_
devices Sequence[GetUsers User Mfa Device] - The List of MFA Device for User.
- provision_
type str - ProvisionType.
- status str
- User status. Valid values:
Enabled
andDisabled
. - user_
id str - The User ID of the group.
- user_
name str - The name of user.
- create
Time String - The create time of the user.
- description String
- The description of user.
- directory
Id String - The ID of the Directory.
- display
Name String - The display name of user.
- email String
- The User's Contact Email Address.
- first
Name String - The first name of user.
- id String
- The ID of the User.
- last
Name String - The last name of user.
- mfa
Devices List<Property Map> - The List of MFA Device for User.
- provision
Type String - ProvisionType.
- status String
- User status. Valid values:
Enabled
andDisabled
. - user
Id String - The User ID of the group.
- user
Name String - The name of user.
GetUsersUserMfaDevice
- Device
Id string - The MFA Device ID.
- Device
Name string - The MFA Device Name.
- Device
Type string - The MFA Device Type.
- Effective
Time string - The Effective Time of MFA Device.
- Device
Id string - The MFA Device ID.
- Device
Name string - The MFA Device Name.
- Device
Type string - The MFA Device Type.
- Effective
Time string - The Effective Time of MFA Device.
- device
Id String - The MFA Device ID.
- device
Name String - The MFA Device Name.
- device
Type String - The MFA Device Type.
- effective
Time String - The Effective Time of MFA Device.
- device
Id string - The MFA Device ID.
- device
Name string - The MFA Device Name.
- device
Type string - The MFA Device Type.
- effective
Time string - The Effective Time of MFA Device.
- device_
id str - The MFA Device ID.
- device_
name str - The MFA Device Name.
- device_
type str - The MFA Device Type.
- effective_
time str - The Effective Time of MFA Device.
- device
Id String - The MFA Device ID.
- device
Name String - The MFA Device Name.
- device
Type String - The MFA Device Type.
- effective
Time String - The Effective Time of MFA Device.
Package Details
- Repository
- Alibaba Cloud pulumi/pulumi-alicloud
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
alicloud
Terraform Provider.