1. Packages
  2. Volcengine
  3. API Docs
  4. cloud_identity
  5. PermissionSetAssignments
Volcengine v0.0.24 published on Tuesday, Jun 25, 2024 by Volcengine

volcengine.cloud_identity.PermissionSetAssignments

Explore with Pulumi AI

volcengine logo
Volcengine v0.0.24 published on Tuesday, Jun 25, 2024 by Volcengine

    Use this data source to query detailed information of cloud identity permission set assignments

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Volcengine = Pulumi.Volcengine;
    
    return await Deployment.RunAsync(() => 
    {
        var fooPermissionSet = new Volcengine.Cloud_identity.PermissionSet("fooPermissionSet", new()
        {
            Description = "tf",
            SessionDuration = 5000,
            PermissionPolicies = new[]
            {
                new Volcengine.Cloud_identity.Inputs.PermissionSetPermissionPolicyArgs
                {
                    PermissionPolicyType = "System",
                    PermissionPolicyName = "AdministratorAccess",
                    InlinePolicyDocument = "",
                },
                new Volcengine.Cloud_identity.Inputs.PermissionSetPermissionPolicyArgs
                {
                    PermissionPolicyType = "System",
                    PermissionPolicyName = "ReadOnlyAccess",
                    InlinePolicyDocument = "",
                },
                new Volcengine.Cloud_identity.Inputs.PermissionSetPermissionPolicyArgs
                {
                    PermissionPolicyType = "Inline",
                    InlinePolicyDocument = "{\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"auto_scaling:DescribeScalingGroups\"],\"Resource\":[\"*\"]}]}",
                },
            },
        });
    
        var fooUser = new Volcengine.Cloud_identity.User("fooUser", new()
        {
            UserName = "acc-test-user",
            DisplayName = "tf-test-user",
            Description = "tf",
            Email = "88@qq.com",
            Phone = "181",
        });
    
        var fooPermissionSetAssignment = new Volcengine.Cloud_identity.PermissionSetAssignment("fooPermissionSetAssignment", new()
        {
            PermissionSetId = fooPermissionSet.Id,
            TargetId = "210026****",
            PrincipalType = "User",
            PrincipalId = fooUser.Id,
        });
    
        var fooPermissionSetAssignments = Volcengine.Cloud_identity.PermissionSetAssignments.Invoke(new()
        {
            PermissionSetId = fooPermissionSetAssignment.PermissionSetId,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/cloud_identity"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		fooPermissionSet, err := cloud_identity.NewPermissionSet(ctx, "fooPermissionSet", &cloud_identity.PermissionSetArgs{
    			Description:     pulumi.String("tf"),
    			SessionDuration: pulumi.Int(5000),
    			PermissionPolicies: cloud_identity.PermissionSetPermissionPolicyArray{
    				&cloud_identity.PermissionSetPermissionPolicyArgs{
    					PermissionPolicyType: pulumi.String("System"),
    					PermissionPolicyName: pulumi.String("AdministratorAccess"),
    					InlinePolicyDocument: pulumi.String(""),
    				},
    				&cloud_identity.PermissionSetPermissionPolicyArgs{
    					PermissionPolicyType: pulumi.String("System"),
    					PermissionPolicyName: pulumi.String("ReadOnlyAccess"),
    					InlinePolicyDocument: pulumi.String(""),
    				},
    				&cloud_identity.PermissionSetPermissionPolicyArgs{
    					PermissionPolicyType: pulumi.String("Inline"),
    					InlinePolicyDocument: pulumi.String("{\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"auto_scaling:DescribeScalingGroups\"],\"Resource\":[\"*\"]}]}"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		fooUser, err := cloud_identity.NewUser(ctx, "fooUser", &cloud_identity.UserArgs{
    			UserName:    pulumi.String("acc-test-user"),
    			DisplayName: pulumi.String("tf-test-user"),
    			Description: pulumi.String("tf"),
    			Email:       pulumi.String("88@qq.com"),
    			Phone:       pulumi.String("181"),
    		})
    		if err != nil {
    			return err
    		}
    		fooPermissionSetAssignment, err := cloud_identity.NewPermissionSetAssignment(ctx, "fooPermissionSetAssignment", &cloud_identity.PermissionSetAssignmentArgs{
    			PermissionSetId: fooPermissionSet.ID(),
    			TargetId:        pulumi.String("210026****"),
    			PrincipalType:   pulumi.String("User"),
    			PrincipalId:     fooUser.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		_ = cloud_identity.PermissionSetAssignmentsOutput(ctx, cloud_identity.PermissionSetAssignmentsOutputArgs{
    			PermissionSetId: fooPermissionSetAssignment.PermissionSetId,
    		}, nil)
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.volcengine.cloud_identity.PermissionSet;
    import com.pulumi.volcengine.cloud_identity.PermissionSetArgs;
    import com.pulumi.volcengine.cloud_identity.inputs.PermissionSetPermissionPolicyArgs;
    import com.pulumi.volcengine.cloud_identity.User;
    import com.pulumi.volcengine.cloud_identity.UserArgs;
    import com.pulumi.volcengine.cloud_identity.PermissionSetAssignment;
    import com.pulumi.volcengine.cloud_identity.PermissionSetAssignmentArgs;
    import com.pulumi.volcengine.cloud_identity.Cloud_identityFunctions;
    import com.pulumi.volcengine.cloud_identity.inputs.PermissionSetAssignmentsArgs;
    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) {
            var fooPermissionSet = new PermissionSet("fooPermissionSet", PermissionSetArgs.builder()        
                .description("tf")
                .sessionDuration(5000)
                .permissionPolicies(            
                    PermissionSetPermissionPolicyArgs.builder()
                        .permissionPolicyType("System")
                        .permissionPolicyName("AdministratorAccess")
                        .inlinePolicyDocument("")
                        .build(),
                    PermissionSetPermissionPolicyArgs.builder()
                        .permissionPolicyType("System")
                        .permissionPolicyName("ReadOnlyAccess")
                        .inlinePolicyDocument("")
                        .build(),
                    PermissionSetPermissionPolicyArgs.builder()
                        .permissionPolicyType("Inline")
                        .inlinePolicyDocument("{\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"auto_scaling:DescribeScalingGroups\"],\"Resource\":[\"*\"]}]}")
                        .build())
                .build());
    
            var fooUser = new User("fooUser", UserArgs.builder()        
                .userName("acc-test-user")
                .displayName("tf-test-user")
                .description("tf")
                .email("88@qq.com")
                .phone("181")
                .build());
    
            var fooPermissionSetAssignment = new PermissionSetAssignment("fooPermissionSetAssignment", PermissionSetAssignmentArgs.builder()        
                .permissionSetId(fooPermissionSet.id())
                .targetId("210026****")
                .principalType("User")
                .principalId(fooUser.id())
                .build());
    
            final var fooPermissionSetAssignments = Cloud_identityFunctions.PermissionSetAssignments(PermissionSetAssignmentsArgs.builder()
                .permissionSetId(fooPermissionSetAssignment.permissionSetId())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_volcengine as volcengine
    
    foo_permission_set = volcengine.cloud_identity.PermissionSet("fooPermissionSet",
        description="tf",
        session_duration=5000,
        permission_policies=[
            volcengine.cloud_identity.PermissionSetPermissionPolicyArgs(
                permission_policy_type="System",
                permission_policy_name="AdministratorAccess",
                inline_policy_document="",
            ),
            volcengine.cloud_identity.PermissionSetPermissionPolicyArgs(
                permission_policy_type="System",
                permission_policy_name="ReadOnlyAccess",
                inline_policy_document="",
            ),
            volcengine.cloud_identity.PermissionSetPermissionPolicyArgs(
                permission_policy_type="Inline",
                inline_policy_document="{\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"auto_scaling:DescribeScalingGroups\"],\"Resource\":[\"*\"]}]}",
            ),
        ])
    foo_user = volcengine.cloud_identity.User("fooUser",
        user_name="acc-test-user",
        display_name="tf-test-user",
        description="tf",
        email="88@qq.com",
        phone="181")
    foo_permission_set_assignment = volcengine.cloud_identity.PermissionSetAssignment("fooPermissionSetAssignment",
        permission_set_id=foo_permission_set.id,
        target_id="210026****",
        principal_type="User",
        principal_id=foo_user.id)
    foo_permission_set_assignments = volcengine.cloud_identity.permission_set_assignments_output(permission_set_id=foo_permission_set_assignment.permission_set_id)
    
    import * as pulumi from "@pulumi/pulumi";
    import * as volcengine from "@pulumi/volcengine";
    import * as volcengine from "@volcengine/pulumi";
    
    const fooPermissionSet = new volcengine.cloud_identity.PermissionSet("fooPermissionSet", {
        description: "tf",
        sessionDuration: 5000,
        permissionPolicies: [
            {
                permissionPolicyType: "System",
                permissionPolicyName: "AdministratorAccess",
                inlinePolicyDocument: "",
            },
            {
                permissionPolicyType: "System",
                permissionPolicyName: "ReadOnlyAccess",
                inlinePolicyDocument: "",
            },
            {
                permissionPolicyType: "Inline",
                inlinePolicyDocument: "{\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"auto_scaling:DescribeScalingGroups\"],\"Resource\":[\"*\"]}]}",
            },
        ],
    });
    const fooUser = new volcengine.cloud_identity.User("fooUser", {
        userName: "acc-test-user",
        displayName: "tf-test-user",
        description: "tf",
        email: "88@qq.com",
        phone: "181",
    });
    const fooPermissionSetAssignment = new volcengine.cloud_identity.PermissionSetAssignment("fooPermissionSetAssignment", {
        permissionSetId: fooPermissionSet.id,
        targetId: "210026****",
        principalType: "User",
        principalId: fooUser.id,
    });
    const fooPermissionSetAssignments = volcengine.cloud_identity.PermissionSetAssignmentsOutput({
        permissionSetId: fooPermissionSetAssignment.permissionSetId,
    });
    
    resources:
      fooPermissionSet:
        type: volcengine:cloud_identity:PermissionSet
        properties:
          description: tf
          sessionDuration: 5000
          permissionPolicies:
            - permissionPolicyType: System
              permissionPolicyName: AdministratorAccess
              inlinePolicyDocument:
            - permissionPolicyType: System
              permissionPolicyName: ReadOnlyAccess
              inlinePolicyDocument:
            - permissionPolicyType: Inline
              inlinePolicyDocument: '{"Statement":[{"Effect":"Allow","Action":["auto_scaling:DescribeScalingGroups"],"Resource":["*"]}]}'
      fooUser:
        type: volcengine:cloud_identity:User
        properties:
          userName: acc-test-user
          displayName: tf-test-user
          description: tf
          email: 88@qq.com
          phone: '181'
      fooPermissionSetAssignment:
        type: volcengine:cloud_identity:PermissionSetAssignment
        properties:
          permissionSetId: ${fooPermissionSet.id}
          targetId: 210026****
          principalType: User
          principalId: ${fooUser.id}
    variables:
      fooPermissionSetAssignments:
        fn::invoke:
          Function: volcengine:cloud_identity:PermissionSetAssignments
          Arguments:
            permissionSetId: ${fooPermissionSetAssignment.permissionSetId}
    

    Using PermissionSetAssignments

    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 permissionSetAssignments(args: PermissionSetAssignmentsArgs, opts?: InvokeOptions): Promise<PermissionSetAssignmentsResult>
    function permissionSetAssignmentsOutput(args: PermissionSetAssignmentsOutputArgs, opts?: InvokeOptions): Output<PermissionSetAssignmentsResult>
    def permission_set_assignments(name_regex: Optional[str] = None,
                                   output_file: Optional[str] = None,
                                   permission_set_id: Optional[str] = None,
                                   principal_id: Optional[str] = None,
                                   principal_type: Optional[str] = None,
                                   target_id: Optional[str] = None,
                                   opts: Optional[InvokeOptions] = None) -> PermissionSetAssignmentsResult
    def permission_set_assignments_output(name_regex: Optional[pulumi.Input[str]] = None,
                                   output_file: Optional[pulumi.Input[str]] = None,
                                   permission_set_id: Optional[pulumi.Input[str]] = None,
                                   principal_id: Optional[pulumi.Input[str]] = None,
                                   principal_type: Optional[pulumi.Input[str]] = None,
                                   target_id: Optional[pulumi.Input[str]] = None,
                                   opts: Optional[InvokeOptions] = None) -> Output[PermissionSetAssignmentsResult]
    func PermissionSetAssignments(ctx *Context, args *PermissionSetAssignmentsArgs, opts ...InvokeOption) (*PermissionSetAssignmentsResult, error)
    func PermissionSetAssignmentsOutput(ctx *Context, args *PermissionSetAssignmentsOutputArgs, opts ...InvokeOption) PermissionSetAssignmentsResultOutput
    public static class PermissionSetAssignments 
    {
        public static Task<PermissionSetAssignmentsResult> InvokeAsync(PermissionSetAssignmentsArgs args, InvokeOptions? opts = null)
        public static Output<PermissionSetAssignmentsResult> Invoke(PermissionSetAssignmentsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<PermissionSetAssignmentsResult> permissionSetAssignments(PermissionSetAssignmentsArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: volcengine:cloud_identity:PermissionSetAssignments
      arguments:
        # arguments dictionary

    The following arguments are supported:

    NameRegex string
    A Name Regex of Resource.
    OutputFile string
    File name where to save data source results.
    PermissionSetId string
    The id of cloud identity permission set.
    PrincipalId string
    The principal id of cloud identity permission set. When the principal_type is User, this field is specified to UserId. When the principal_type is Group, this field is specified to GroupId.
    PrincipalType string
    The principal type of cloud identity permission set. Valid values: User, Group.
    TargetId string
    The target account id of cloud identity permission set assignment.
    NameRegex string
    A Name Regex of Resource.
    OutputFile string
    File name where to save data source results.
    PermissionSetId string
    The id of cloud identity permission set.
    PrincipalId string
    The principal id of cloud identity permission set. When the principal_type is User, this field is specified to UserId. When the principal_type is Group, this field is specified to GroupId.
    PrincipalType string
    The principal type of cloud identity permission set. Valid values: User, Group.
    TargetId string
    The target account id of cloud identity permission set assignment.
    nameRegex String
    A Name Regex of Resource.
    outputFile String
    File name where to save data source results.
    permissionSetId String
    The id of cloud identity permission set.
    principalId String
    The principal id of cloud identity permission set. When the principal_type is User, this field is specified to UserId. When the principal_type is Group, this field is specified to GroupId.
    principalType String
    The principal type of cloud identity permission set. Valid values: User, Group.
    targetId String
    The target account id of cloud identity permission set assignment.
    nameRegex string
    A Name Regex of Resource.
    outputFile string
    File name where to save data source results.
    permissionSetId string
    The id of cloud identity permission set.
    principalId string
    The principal id of cloud identity permission set. When the principal_type is User, this field is specified to UserId. When the principal_type is Group, this field is specified to GroupId.
    principalType string
    The principal type of cloud identity permission set. Valid values: User, Group.
    targetId string
    The target account id of cloud identity permission set assignment.
    name_regex str
    A Name Regex of Resource.
    output_file str
    File name where to save data source results.
    permission_set_id str
    The id of cloud identity permission set.
    principal_id str
    The principal id of cloud identity permission set. When the principal_type is User, this field is specified to UserId. When the principal_type is Group, this field is specified to GroupId.
    principal_type str
    The principal type of cloud identity permission set. Valid values: User, Group.
    target_id str
    The target account id of cloud identity permission set assignment.
    nameRegex String
    A Name Regex of Resource.
    outputFile String
    File name where to save data source results.
    permissionSetId String
    The id of cloud identity permission set.
    principalId String
    The principal id of cloud identity permission set. When the principal_type is User, this field is specified to UserId. When the principal_type is Group, this field is specified to GroupId.
    principalType String
    The principal type of cloud identity permission set. Valid values: User, Group.
    targetId String
    The target account id of cloud identity permission set assignment.

    PermissionSetAssignments Result

    The following output properties are available:

    Assignments List<PermissionSetAssignmentsAssignment>
    The collection of query.
    Id string
    The provider-assigned unique ID for this managed resource.
    TotalCount int
    The total count of query.
    NameRegex string
    OutputFile string
    PermissionSetId string
    The id of the cloud identity permission set.
    PrincipalId string
    The principal id of the cloud identity permission set assignment.
    PrincipalType string
    The principal type of the cloud identity permission set assignment.
    TargetId string
    The target account id of the cloud identity permission set assignment.
    Assignments []PermissionSetAssignmentsAssignment
    The collection of query.
    Id string
    The provider-assigned unique ID for this managed resource.
    TotalCount int
    The total count of query.
    NameRegex string
    OutputFile string
    PermissionSetId string
    The id of the cloud identity permission set.
    PrincipalId string
    The principal id of the cloud identity permission set assignment.
    PrincipalType string
    The principal type of the cloud identity permission set assignment.
    TargetId string
    The target account id of the cloud identity permission set assignment.
    assignments List<PermissionSetAssignmentsAssignment>
    The collection of query.
    id String
    The provider-assigned unique ID for this managed resource.
    totalCount Integer
    The total count of query.
    nameRegex String
    outputFile String
    permissionSetId String
    The id of the cloud identity permission set.
    principalId String
    The principal id of the cloud identity permission set assignment.
    principalType String
    The principal type of the cloud identity permission set assignment.
    targetId String
    The target account id of the cloud identity permission set assignment.
    assignments PermissionSetAssignmentsAssignment[]
    The collection of query.
    id string
    The provider-assigned unique ID for this managed resource.
    totalCount number
    The total count of query.
    nameRegex string
    outputFile string
    permissionSetId string
    The id of the cloud identity permission set.
    principalId string
    The principal id of the cloud identity permission set assignment.
    principalType string
    The principal type of the cloud identity permission set assignment.
    targetId string
    The target account id of the cloud identity permission set assignment.
    assignments Sequence[PermissionSetAssignmentsAssignment]
    The collection of query.
    id str
    The provider-assigned unique ID for this managed resource.
    total_count int
    The total count of query.
    name_regex str
    output_file str
    permission_set_id str
    The id of the cloud identity permission set.
    principal_id str
    The principal id of the cloud identity permission set assignment.
    principal_type str
    The principal type of the cloud identity permission set assignment.
    target_id str
    The target account id of the cloud identity permission set assignment.
    assignments List<Property Map>
    The collection of query.
    id String
    The provider-assigned unique ID for this managed resource.
    totalCount Number
    The total count of query.
    nameRegex String
    outputFile String
    permissionSetId String
    The id of the cloud identity permission set.
    principalId String
    The principal id of the cloud identity permission set assignment.
    principalType String
    The principal type of the cloud identity permission set assignment.
    targetId String
    The target account id of the cloud identity permission set assignment.

    Supporting Types

    PermissionSetAssignmentsAssignment

    CreateTime string
    The create time of the cloud identity permission set assignment.
    Id string
    The id of the cloud identity permission set.
    PermissionSetId string
    The id of cloud identity permission set.
    PermissionSetName string
    The name of the cloud identity permission set.
    PrincipalId string
    The principal id of cloud identity permission set. When the principal_type is User, this field is specified to UserId. When the principal_type is Group, this field is specified to GroupId.
    PrincipalType string
    The principal type of cloud identity permission set. Valid values: User, Group.
    TargetId string
    The target account id of cloud identity permission set assignment.
    CreateTime string
    The create time of the cloud identity permission set assignment.
    Id string
    The id of the cloud identity permission set.
    PermissionSetId string
    The id of cloud identity permission set.
    PermissionSetName string
    The name of the cloud identity permission set.
    PrincipalId string
    The principal id of cloud identity permission set. When the principal_type is User, this field is specified to UserId. When the principal_type is Group, this field is specified to GroupId.
    PrincipalType string
    The principal type of cloud identity permission set. Valid values: User, Group.
    TargetId string
    The target account id of cloud identity permission set assignment.
    createTime String
    The create time of the cloud identity permission set assignment.
    id String
    The id of the cloud identity permission set.
    permissionSetId String
    The id of cloud identity permission set.
    permissionSetName String
    The name of the cloud identity permission set.
    principalId String
    The principal id of cloud identity permission set. When the principal_type is User, this field is specified to UserId. When the principal_type is Group, this field is specified to GroupId.
    principalType String
    The principal type of cloud identity permission set. Valid values: User, Group.
    targetId String
    The target account id of cloud identity permission set assignment.
    createTime string
    The create time of the cloud identity permission set assignment.
    id string
    The id of the cloud identity permission set.
    permissionSetId string
    The id of cloud identity permission set.
    permissionSetName string
    The name of the cloud identity permission set.
    principalId string
    The principal id of cloud identity permission set. When the principal_type is User, this field is specified to UserId. When the principal_type is Group, this field is specified to GroupId.
    principalType string
    The principal type of cloud identity permission set. Valid values: User, Group.
    targetId string
    The target account id of cloud identity permission set assignment.
    create_time str
    The create time of the cloud identity permission set assignment.
    id str
    The id of the cloud identity permission set.
    permission_set_id str
    The id of cloud identity permission set.
    permission_set_name str
    The name of the cloud identity permission set.
    principal_id str
    The principal id of cloud identity permission set. When the principal_type is User, this field is specified to UserId. When the principal_type is Group, this field is specified to GroupId.
    principal_type str
    The principal type of cloud identity permission set. Valid values: User, Group.
    target_id str
    The target account id of cloud identity permission set assignment.
    createTime String
    The create time of the cloud identity permission set assignment.
    id String
    The id of the cloud identity permission set.
    permissionSetId String
    The id of cloud identity permission set.
    permissionSetName String
    The name of the cloud identity permission set.
    principalId String
    The principal id of cloud identity permission set. When the principal_type is User, this field is specified to UserId. When the principal_type is Group, this field is specified to GroupId.
    principalType String
    The principal type of cloud identity permission set. Valid values: User, Group.
    targetId String
    The target account id of cloud identity permission set assignment.

    Package Details

    Repository
    volcengine volcengine/pulumi-volcengine
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the volcengine Terraform Provider.
    volcengine logo
    Volcengine v0.0.24 published on Tuesday, Jun 25, 2024 by Volcengine