1. Packages
  2. Volcengine
  3. API Docs
  4. cloud_identity
  5. PermissionSetAssignment
Volcengine v0.0.27 published on Tuesday, Dec 10, 2024 by Volcengine

volcengine.cloud_identity.PermissionSetAssignment

Explore with Pulumi AI

volcengine logo
Volcengine v0.0.27 published on Tuesday, Dec 10, 2024 by Volcengine

    Provides a resource to manage cloud identity permission set assignment

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    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,
    });
    
    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)
    
    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
    		}
    		_, 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
    		}
    		return nil
    	})
    }
    
    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,
        });
    
    });
    
    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 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());
    
        }
    }
    
    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}
    

    Create PermissionSetAssignment Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new PermissionSetAssignment(name: string, args: PermissionSetAssignmentArgs, opts?: CustomResourceOptions);
    @overload
    def PermissionSetAssignment(resource_name: str,
                                args: PermissionSetAssignmentArgs,
                                opts: Optional[ResourceOptions] = None)
    
    @overload
    def PermissionSetAssignment(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                permission_set_id: Optional[str] = None,
                                principal_id: Optional[str] = None,
                                principal_type: Optional[str] = None,
                                target_id: Optional[str] = None)
    func NewPermissionSetAssignment(ctx *Context, name string, args PermissionSetAssignmentArgs, opts ...ResourceOption) (*PermissionSetAssignment, error)
    public PermissionSetAssignment(string name, PermissionSetAssignmentArgs args, CustomResourceOptions? opts = null)
    public PermissionSetAssignment(String name, PermissionSetAssignmentArgs args)
    public PermissionSetAssignment(String name, PermissionSetAssignmentArgs args, CustomResourceOptions options)
    
    type: volcengine:cloud_identity:PermissionSetAssignment
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args PermissionSetAssignmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args PermissionSetAssignmentArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args PermissionSetAssignmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PermissionSetAssignmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PermissionSetAssignmentArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var permissionSetAssignmentResource = new Volcengine.Cloud_identity.PermissionSetAssignment("permissionSetAssignmentResource", new()
    {
        PermissionSetId = "string",
        PrincipalId = "string",
        PrincipalType = "string",
        TargetId = "string",
    });
    
    example, err := cloud_identity.NewPermissionSetAssignment(ctx, "permissionSetAssignmentResource", &cloud_identity.PermissionSetAssignmentArgs{
    	PermissionSetId: pulumi.String("string"),
    	PrincipalId:     pulumi.String("string"),
    	PrincipalType:   pulumi.String("string"),
    	TargetId:        pulumi.String("string"),
    })
    
    var permissionSetAssignmentResource = new PermissionSetAssignment("permissionSetAssignmentResource", PermissionSetAssignmentArgs.builder()
        .permissionSetId("string")
        .principalId("string")
        .principalType("string")
        .targetId("string")
        .build());
    
    permission_set_assignment_resource = volcengine.cloud_identity.PermissionSetAssignment("permissionSetAssignmentResource",
        permission_set_id="string",
        principal_id="string",
        principal_type="string",
        target_id="string")
    
    const permissionSetAssignmentResource = new volcengine.cloud_identity.PermissionSetAssignment("permissionSetAssignmentResource", {
        permissionSetId: "string",
        principalId: "string",
        principalType: "string",
        targetId: "string",
    });
    
    type: volcengine:cloud_identity:PermissionSetAssignment
    properties:
        permissionSetId: string
        principalId: string
        principalType: string
        targetId: string
    

    PermissionSetAssignment Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The PermissionSetAssignment resource accepts the following input properties:

    PermissionSetId string
    The id of the cloud identity permission set.
    PrincipalId string
    The principal id of the 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 the cloud identity permission set. Valid values: User, Group.
    TargetId string
    The target account id of the cloud identity permission set assignment.
    PermissionSetId string
    The id of the cloud identity permission set.
    PrincipalId string
    The principal id of the 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 the cloud identity permission set. Valid values: User, Group.
    TargetId string
    The target account id of the cloud identity permission set assignment.
    permissionSetId String
    The id of the cloud identity permission set.
    principalId String
    The principal id of the 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 the cloud identity permission set. Valid values: User, Group.
    targetId String
    The target account id of the cloud identity permission set assignment.
    permissionSetId string
    The id of the cloud identity permission set.
    principalId string
    The principal id of the 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 the cloud identity permission set. Valid values: User, Group.
    targetId string
    The target account id of the cloud identity permission set assignment.
    permission_set_id str
    The id of the cloud identity permission set.
    principal_id str
    The principal id of the 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 the cloud identity permission set. Valid values: User, Group.
    target_id str
    The target account id of the cloud identity permission set assignment.
    permissionSetId String
    The id of the cloud identity permission set.
    principalId String
    The principal id of the 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 the cloud identity permission set. Valid values: User, Group.
    targetId String
    The target account id of the cloud identity permission set assignment.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the PermissionSetAssignment resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing PermissionSetAssignment Resource

    Get an existing PermissionSetAssignment resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: PermissionSetAssignmentState, opts?: CustomResourceOptions): PermissionSetAssignment
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            permission_set_id: Optional[str] = None,
            principal_id: Optional[str] = None,
            principal_type: Optional[str] = None,
            target_id: Optional[str] = None) -> PermissionSetAssignment
    func GetPermissionSetAssignment(ctx *Context, name string, id IDInput, state *PermissionSetAssignmentState, opts ...ResourceOption) (*PermissionSetAssignment, error)
    public static PermissionSetAssignment Get(string name, Input<string> id, PermissionSetAssignmentState? state, CustomResourceOptions? opts = null)
    public static PermissionSetAssignment get(String name, Output<String> id, PermissionSetAssignmentState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    PermissionSetId string
    The id of the cloud identity permission set.
    PrincipalId string
    The principal id of the 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 the cloud identity permission set. Valid values: User, Group.
    TargetId string
    The target account id of the cloud identity permission set assignment.
    PermissionSetId string
    The id of the cloud identity permission set.
    PrincipalId string
    The principal id of the 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 the cloud identity permission set. Valid values: User, Group.
    TargetId string
    The target account id of the cloud identity permission set assignment.
    permissionSetId String
    The id of the cloud identity permission set.
    principalId String
    The principal id of the 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 the cloud identity permission set. Valid values: User, Group.
    targetId String
    The target account id of the cloud identity permission set assignment.
    permissionSetId string
    The id of the cloud identity permission set.
    principalId string
    The principal id of the 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 the cloud identity permission set. Valid values: User, Group.
    targetId string
    The target account id of the cloud identity permission set assignment.
    permission_set_id str
    The id of the cloud identity permission set.
    principal_id str
    The principal id of the 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 the cloud identity permission set. Valid values: User, Group.
    target_id str
    The target account id of the cloud identity permission set assignment.
    permissionSetId String
    The id of the cloud identity permission set.
    principalId String
    The principal id of the 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 the cloud identity permission set. Valid values: User, Group.
    targetId String
    The target account id of the cloud identity permission set assignment.

    Import

    CloudIdentityPermissionSetAssignment can be imported using the permission_set_id:target_id:principal_type:principal_id, e.g.

    $ pulumi import volcengine:cloud_identity/permissionSetAssignment:PermissionSetAssignment default resource_id
    

    To learn more about importing existing cloud resources, see Importing resources.

    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.27 published on Tuesday, Dec 10, 2024 by Volcengine