1. Packages
  2. Alicloud Provider
  3. API Docs
  4. cloudsso
  5. getAccessAssignments
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi

alicloud.cloudsso.getAccessAssignments

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 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);
    
    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)
    
    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
    	})
    }
    
    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),
        };
    });
    
    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()));
        }
    }
    
    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}
    

    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>
    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]
    func GetAccessAssignments(ctx *Context, args *GetAccessAssignmentsArgs, opts ...InvokeOption) (*GetAccessAssignmentsResult, error)
    func GetAccessAssignmentsOutput(ctx *Context, args *GetAccessAssignmentsOutputArgs, opts ...InvokeOption) GetAccessAssignmentsResultOutput

    > 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)
    }
    public static CompletableFuture<GetAccessAssignmentsResult> getAccessAssignments(GetAccessAssignmentsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: alicloud:cloudsso/getAccessAssignments:getAccessAssignments
      arguments:
        # arguments dictionary

    The following arguments are supported:

    DirectoryId string
    Directory ID.
    AccessConfigurationId string
    Access configuration ID.
    Ids List<string>
    A list of Access Assignment IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PrincipalType string
    Create the identity type of the access assignment, which can be a user or a user group. Valid values: Group, User.
    TargetId string
    The ID of the target to create the resource range.
    TargetType 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 string
    Directory ID.
    AccessConfigurationId string
    Access configuration ID.
    Ids []string
    A list of Access Assignment IDs.
    OutputFile string
    File name where to save data source results (after running pulumi preview).
    PrincipalType string
    Create the identity type of the access assignment, which can be a user or a user group. Valid values: Group, User.
    TargetId string
    The ID of the target to create the resource range.
    TargetType 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 String
    Directory ID.
    accessConfigurationId String
    Access configuration ID.
    ids List<String>
    A list of Access Assignment IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    principalType String
    Create the identity type of the access assignment, which can be a user or a user group. Valid values: Group, User.
    targetId String
    The ID of the target to create the resource range.
    targetType 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 string
    Directory ID.
    accessConfigurationId string
    Access configuration ID.
    ids string[]
    A list of Access Assignment IDs.
    outputFile string
    File name where to save data source results (after running pulumi preview).
    principalType string
    Create the identity type of the access assignment, which can be a user or a user group. Valid values: Group, User.
    targetId string
    The ID of the target to create the resource range.
    targetType 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 str
    Directory ID.
    access_configuration_id str
    Access configuration ID.
    ids 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 str
    Create the identity type of the access assignment, which can be a user or a user group. Valid values: Group, User.
    target_id str
    The ID of the target to create the resource range.
    target_type 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 String
    Directory ID.
    accessConfigurationId String
    Access configuration ID.
    ids List<String>
    A list of Access Assignment IDs.
    outputFile String
    File name where to save data source results (after running pulumi preview).
    principalType String
    Create the identity type of the access assignment, which can be a user or a user group. Valid values: Group, User.
    targetId String
    The ID of the target to create the resource range.
    targetType 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 string
    Access configuration ID.
    AccessConfigurationName string
    The name of the access configuration.
    DirectoryId string
    Directory ID.
    Id string
    The ID of the Access Assignment.
    PrincipalId string
    The ID of the access assignment.
    PrincipalName string
    Cloud SSO identity name.
    PrincipalType string
    Create the identity type of the access assignment, which can be a user or a user group.
    TargetId string
    The ID of the target to create the resource range.
    TargetName string
    Task target name.
    TargetPathName string
    The path name of the task target in the resource directory.
    TargetType 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 string
    Access configuration ID.
    AccessConfigurationName string
    The name of the access configuration.
    DirectoryId string
    Directory ID.
    Id string
    The ID of the Access Assignment.
    PrincipalId string
    The ID of the access assignment.
    PrincipalName string
    Cloud SSO identity name.
    PrincipalType string
    Create the identity type of the access assignment, which can be a user or a user group.
    TargetId string
    The ID of the target to create the resource range.
    TargetName string
    Task target name.
    TargetPathName string
    The path name of the task target in the resource directory.
    TargetType 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 String
    Access configuration ID.
    accessConfigurationName String
    The name of the access configuration.
    directoryId String
    Directory ID.
    id String
    The ID of the Access Assignment.
    principalId String
    The ID of the access assignment.
    principalName String
    Cloud SSO identity name.
    principalType String
    Create the identity type of the access assignment, which can be a user or a user group.
    targetId String
    The ID of the target to create the resource range.
    targetName String
    Task target name.
    targetPathName String
    The path name of the task target in the resource directory.
    targetType 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 string
    Access configuration ID.
    accessConfigurationName string
    The name of the access configuration.
    directoryId string
    Directory ID.
    id string
    The ID of the Access Assignment.
    principalId string
    The ID of the access assignment.
    principalName string
    Cloud SSO identity name.
    principalType string
    Create the identity type of the access assignment, which can be a user or a user group.
    targetId string
    The ID of the target to create the resource range.
    targetName string
    Task target name.
    targetPathName string
    The path name of the task target in the resource directory.
    targetType 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 str
    Access configuration ID.
    access_configuration_name str
    The name of the access configuration.
    directory_id str
    Directory ID.
    id str
    The ID of the Access Assignment.
    principal_id str
    The ID of the access assignment.
    principal_name str
    Cloud SSO identity name.
    principal_type str
    Create the identity type of the access assignment, which can be a user or a user group.
    target_id str
    The ID of the target to create the resource range.
    target_name str
    Task target name.
    target_path_name str
    The path name of the task target in the resource directory.
    target_type 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 String
    Access configuration ID.
    accessConfigurationName String
    The name of the access configuration.
    directoryId String
    Directory ID.
    id String
    The ID of the Access Assignment.
    principalId String
    The ID of the access assignment.
    principalName String
    Cloud SSO identity name.
    principalType String
    Create the identity type of the access assignment, which can be a user or a user group.
    targetId String
    The ID of the target to create the resource range.
    targetName String
    Task target name.
    targetPathName String
    The path name of the task target in the resource directory.
    targetType 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.
    alicloud logo
    Alibaba Cloud v3.62.1 published on Monday, Sep 16, 2024 by Pulumi