1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. cloudsso
  5. getAccessAssignments
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.cloudsso.getAccessAssignments

Explore with Pulumi AI

Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

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

NOTE: Available in v1.193.0+.

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

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const ids = alicloud.cloudsso.getAccessAssignments({
    directoryId: "example_value",
    ids: [
        "example_value-1",
        "example_value-2",
    ],
});
export const cloudSsoAccessAssignmentId1 = ids.then(ids => ids.assignments?.[0]?.id);
Copy
import pulumi
import pulumi_alicloud as alicloud

ids = alicloud.cloudsso.get_access_assignments(directory_id="example_value",
    ids=[
        "example_value-1",
        "example_value-2",
    ])
pulumi.export("cloudSsoAccessAssignmentId1", ids.assignments[0].id)
Copy
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.GetAccessAssignments(ctx, &cloudsso.GetAccessAssignmentsArgs{
			DirectoryId: "example_value",
			Ids: []string{
				"example_value-1",
				"example_value-2",
			},
		}, nil)
		if err != nil {
			return err
		}
		ctx.Export("cloudSsoAccessAssignmentId1", ids.Assignments[0].Id)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;

return await Deployment.RunAsync(() => 
{
    var ids = AliCloud.CloudSso.GetAccessAssignments.Invoke(new()
    {
        DirectoryId = "example_value",
        Ids = new[]
        {
            "example_value-1",
            "example_value-2",
        },
    });

    return new Dictionary<string, object?>
    {
        ["cloudSsoAccessAssignmentId1"] = ids.Apply(getAccessAssignmentsResult => getAccessAssignmentsResult.Assignments[0]?.Id),
    };
});
Copy
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.GetAccessAssignmentsArgs;
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.getAccessAssignments(GetAccessAssignmentsArgs.builder()
            .directoryId("example_value")
            .ids(            
                "example_value-1",
                "example_value-2")
            .build());

        ctx.export("cloudSsoAccessAssignmentId1", ids.applyValue(getAccessAssignmentsResult -> getAccessAssignmentsResult.assignments()[0].id()));
    }
}
Copy
variables:
  ids:
    fn::invoke:
      function: alicloud:cloudsso:getAccessAssignments
      arguments:
        directoryId: example_value
        ids:
          - example_value-1
          - example_value-2
outputs:
  cloudSsoAccessAssignmentId1: ${ids.assignments[0].id}
Copy

Using getAccessAssignments

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 getAccessAssignments(args: GetAccessAssignmentsArgs, opts?: InvokeOptions): Promise<GetAccessAssignmentsResult>
function getAccessAssignmentsOutput(args: GetAccessAssignmentsOutputArgs, opts?: InvokeOptions): Output<GetAccessAssignmentsResult>
Copy
def get_access_assignments(access_configuration_id: Optional[str] = None,
                           directory_id: Optional[str] = None,
                           ids: Optional[Sequence[str]] = None,
                           output_file: Optional[str] = None,
                           principal_type: Optional[str] = None,
                           target_id: Optional[str] = None,
                           target_type: Optional[str] = None,
                           opts: Optional[InvokeOptions] = None) -> GetAccessAssignmentsResult
def get_access_assignments_output(access_configuration_id: Optional[pulumi.Input[str]] = None,
                           directory_id: Optional[pulumi.Input[str]] = None,
                           ids: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                           output_file: Optional[pulumi.Input[str]] = None,
                           principal_type: Optional[pulumi.Input[str]] = None,
                           target_id: Optional[pulumi.Input[str]] = None,
                           target_type: Optional[pulumi.Input[str]] = None,
                           opts: Optional[InvokeOptions] = None) -> Output[GetAccessAssignmentsResult]
Copy
func GetAccessAssignments(ctx *Context, args *GetAccessAssignmentsArgs, opts ...InvokeOption) (*GetAccessAssignmentsResult, error)
func GetAccessAssignmentsOutput(ctx *Context, args *GetAccessAssignmentsOutputArgs, opts ...InvokeOption) GetAccessAssignmentsResultOutput
Copy

> Note: This function is named GetAccessAssignments in the Go SDK.

public static class GetAccessAssignments 
{
    public static Task<GetAccessAssignmentsResult> InvokeAsync(GetAccessAssignmentsArgs args, InvokeOptions? opts = null)
    public static Output<GetAccessAssignmentsResult> Invoke(GetAccessAssignmentsInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetAccessAssignmentsResult> getAccessAssignments(GetAccessAssignmentsArgs args, InvokeOptions options)
public static Output<GetAccessAssignmentsResult> getAccessAssignments(GetAccessAssignmentsArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: alicloud:cloudsso/getAccessAssignments:getAccessAssignments
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

DirectoryId
This property is required.
Changes to this property will trigger replacement.
string
Directory ID.
AccessConfigurationId Changes to this property will trigger replacement. string
Access configuration ID.
Ids Changes to this property will trigger replacement. List<string>
A list of Access Assignment IDs.
OutputFile string
File name where to save data source results (after running pulumi preview).
PrincipalType Changes to this property will trigger replacement. string
Create the identity type of the access assignment, which can be a user or a user group. Valid values: Group, User.
TargetId Changes to this property will trigger replacement. string
The ID of the target to create the resource range.
TargetType Changes to this property will trigger replacement. string
The type of the resource range target to be accessed. Only a single RD primary account or member account can be specified in the first phase. Valid values: RD-Account.
DirectoryId
This property is required.
Changes to this property will trigger replacement.
string
Directory ID.
AccessConfigurationId Changes to this property will trigger replacement. string
Access configuration ID.
Ids Changes to this property will trigger replacement. []string
A list of Access Assignment IDs.
OutputFile string
File name where to save data source results (after running pulumi preview).
PrincipalType Changes to this property will trigger replacement. string
Create the identity type of the access assignment, which can be a user or a user group. Valid values: Group, User.
TargetId Changes to this property will trigger replacement. string
The ID of the target to create the resource range.
TargetType Changes to this property will trigger replacement. string
The type of the resource range target to be accessed. Only a single RD primary account or member account can be specified in the first phase. Valid values: RD-Account.
directoryId
This property is required.
Changes to this property will trigger replacement.
String
Directory ID.
accessConfigurationId Changes to this property will trigger replacement. String
Access configuration ID.
ids Changes to this property will trigger replacement. List<String>
A list of Access Assignment IDs.
outputFile String
File name where to save data source results (after running pulumi preview).
principalType Changes to this property will trigger replacement. String
Create the identity type of the access assignment, which can be a user or a user group. Valid values: Group, User.
targetId Changes to this property will trigger replacement. String
The ID of the target to create the resource range.
targetType Changes to this property will trigger replacement. String
The type of the resource range target to be accessed. Only a single RD primary account or member account can be specified in the first phase. Valid values: RD-Account.
directoryId
This property is required.
Changes to this property will trigger replacement.
string
Directory ID.
accessConfigurationId Changes to this property will trigger replacement. string
Access configuration ID.
ids Changes to this property will trigger replacement. string[]
A list of Access Assignment IDs.
outputFile string
File name where to save data source results (after running pulumi preview).
principalType Changes to this property will trigger replacement. string
Create the identity type of the access assignment, which can be a user or a user group. Valid values: Group, User.
targetId Changes to this property will trigger replacement. string
The ID of the target to create the resource range.
targetType Changes to this property will trigger replacement. string
The type of the resource range target to be accessed. Only a single RD primary account or member account can be specified in the first phase. Valid values: RD-Account.
directory_id
This property is required.
Changes to this property will trigger replacement.
str
Directory ID.
access_configuration_id Changes to this property will trigger replacement. str
Access configuration ID.
ids Changes to this property will trigger replacement. Sequence[str]
A list of Access Assignment IDs.
output_file str
File name where to save data source results (after running pulumi preview).
principal_type Changes to this property will trigger replacement. str
Create the identity type of the access assignment, which can be a user or a user group. Valid values: Group, User.
target_id Changes to this property will trigger replacement. str
The ID of the target to create the resource range.
target_type Changes to this property will trigger replacement. str
The type of the resource range target to be accessed. Only a single RD primary account or member account can be specified in the first phase. Valid values: RD-Account.
directoryId
This property is required.
Changes to this property will trigger replacement.
String
Directory ID.
accessConfigurationId Changes to this property will trigger replacement. String
Access configuration ID.
ids Changes to this property will trigger replacement. List<String>
A list of Access Assignment IDs.
outputFile String
File name where to save data source results (after running pulumi preview).
principalType Changes to this property will trigger replacement. String
Create the identity type of the access assignment, which can be a user or a user group. Valid values: Group, User.
targetId Changes to this property will trigger replacement. String
The ID of the target to create the resource range.
targetType Changes to this property will trigger replacement. String
The type of the resource range target to be accessed. Only a single RD primary account or member account can be specified in the first phase. Valid values: RD-Account.

getAccessAssignments Result

The following output properties are available:

Assignments List<Pulumi.AliCloud.CloudSso.Outputs.GetAccessAssignmentsAssignment>
DirectoryId string
Id string
The provider-assigned unique ID for this managed resource.
Ids List<string>
AccessConfigurationId string
OutputFile string
PrincipalType string
TargetId string
TargetType string
Assignments []GetAccessAssignmentsAssignment
DirectoryId string
Id string
The provider-assigned unique ID for this managed resource.
Ids []string
AccessConfigurationId string
OutputFile string
PrincipalType string
TargetId string
TargetType string
assignments List<GetAccessAssignmentsAssignment>
directoryId String
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
accessConfigurationId String
outputFile String
principalType String
targetId String
targetType String
assignments GetAccessAssignmentsAssignment[]
directoryId string
id string
The provider-assigned unique ID for this managed resource.
ids string[]
accessConfigurationId string
outputFile string
principalType string
targetId string
targetType string
assignments Sequence[GetAccessAssignmentsAssignment]
directory_id str
id str
The provider-assigned unique ID for this managed resource.
ids Sequence[str]
access_configuration_id str
output_file str
principal_type str
target_id str
target_type str
assignments List<Property Map>
directoryId String
id String
The provider-assigned unique ID for this managed resource.
ids List<String>
accessConfigurationId String
outputFile String
principalType String
targetId String
targetType String

Supporting Types

GetAccessAssignmentsAssignment

AccessConfigurationId This property is required. string
Access configuration ID.
AccessConfigurationName This property is required. string
The name of the access configuration.
DirectoryId This property is required. string
Directory ID.
Id This property is required. string
The ID of the Access Assignment.
PrincipalId This property is required. string
The ID of the access assignment.
PrincipalName This property is required. string
Cloud SSO identity name.
PrincipalType This property is required. string
Create the identity type of the access assignment, which can be a user or a user group.
TargetId This property is required. string
The ID of the target to create the resource range.
TargetName This property is required. string
Task target name.
TargetPathName This property is required. string
The path name of the task target in the resource directory.
TargetType This property is required. string
The type of the resource range target to be accessed. Only a single RD primary account or member account can be specified in the first phase.
AccessConfigurationId This property is required. string
Access configuration ID.
AccessConfigurationName This property is required. string
The name of the access configuration.
DirectoryId This property is required. string
Directory ID.
Id This property is required. string
The ID of the Access Assignment.
PrincipalId This property is required. string
The ID of the access assignment.
PrincipalName This property is required. string
Cloud SSO identity name.
PrincipalType This property is required. string
Create the identity type of the access assignment, which can be a user or a user group.
TargetId This property is required. string
The ID of the target to create the resource range.
TargetName This property is required. string
Task target name.
TargetPathName This property is required. string
The path name of the task target in the resource directory.
TargetType This property is required. string
The type of the resource range target to be accessed. Only a single RD primary account or member account can be specified in the first phase.
accessConfigurationId This property is required. String
Access configuration ID.
accessConfigurationName This property is required. String
The name of the access configuration.
directoryId This property is required. String
Directory ID.
id This property is required. String
The ID of the Access Assignment.
principalId This property is required. String
The ID of the access assignment.
principalName This property is required. String
Cloud SSO identity name.
principalType This property is required. String
Create the identity type of the access assignment, which can be a user or a user group.
targetId This property is required. String
The ID of the target to create the resource range.
targetName This property is required. String
Task target name.
targetPathName This property is required. String
The path name of the task target in the resource directory.
targetType This property is required. String
The type of the resource range target to be accessed. Only a single RD primary account or member account can be specified in the first phase.
accessConfigurationId This property is required. string
Access configuration ID.
accessConfigurationName This property is required. string
The name of the access configuration.
directoryId This property is required. string
Directory ID.
id This property is required. string
The ID of the Access Assignment.
principalId This property is required. string
The ID of the access assignment.
principalName This property is required. string
Cloud SSO identity name.
principalType This property is required. string
Create the identity type of the access assignment, which can be a user or a user group.
targetId This property is required. string
The ID of the target to create the resource range.
targetName This property is required. string
Task target name.
targetPathName This property is required. string
The path name of the task target in the resource directory.
targetType This property is required. string
The type of the resource range target to be accessed. Only a single RD primary account or member account can be specified in the first phase.
access_configuration_id This property is required. str
Access configuration ID.
access_configuration_name This property is required. str
The name of the access configuration.
directory_id This property is required. str
Directory ID.
id This property is required. str
The ID of the Access Assignment.
principal_id This property is required. str
The ID of the access assignment.
principal_name This property is required. str
Cloud SSO identity name.
principal_type This property is required. str
Create the identity type of the access assignment, which can be a user or a user group.
target_id This property is required. str
The ID of the target to create the resource range.
target_name This property is required. str
Task target name.
target_path_name This property is required. str
The path name of the task target in the resource directory.
target_type This property is required. str
The type of the resource range target to be accessed. Only a single RD primary account or member account can be specified in the first phase.
accessConfigurationId This property is required. String
Access configuration ID.
accessConfigurationName This property is required. String
The name of the access configuration.
directoryId This property is required. String
Directory ID.
id This property is required. String
The ID of the Access Assignment.
principalId This property is required. String
The ID of the access assignment.
principalName This property is required. String
Cloud SSO identity name.
principalType This property is required. String
Create the identity type of the access assignment, which can be a user or a user group.
targetId This property is required. String
The ID of the target to create the resource range.
targetName This property is required. String
Task target name.
targetPathName This property is required. String
The path name of the task target in the resource directory.
targetType This property is required. String
The type of the resource range target to be accessed. Only a single RD primary account or member account can be specified in the first phase.

Package Details

Repository
Alibaba Cloud pulumi/pulumi-alicloud
License
Apache-2.0
Notes
This Pulumi package is based on the alicloud Terraform Provider.
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi