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

volcengine.cloud_identity.PermissionSet

Explore with Pulumi AI

Provides a resource to manage cloud identity permission set

Example Usage

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

const foo = new volcengine.cloud_identity.PermissionSet("foo", {
    description: "tf",
    permissionPolicies: [
        {
            inlinePolicyDocument: "",
            permissionPolicyName: "AdministratorAccess",
            permissionPolicyType: "System",
        },
        {
            inlinePolicyDocument: "",
            permissionPolicyName: "ReadOnlyAccess",
            permissionPolicyType: "System",
        },
        {
            inlinePolicyDocument: "{\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"auto_scaling:DescribeScalingGroups\"],\"Resource\":[\"*\"]}]}",
            permissionPolicyType: "Inline",
        },
    ],
    sessionDuration: 5000,
});
Copy
import pulumi
import pulumi_volcengine as volcengine

foo = volcengine.cloud_identity.PermissionSet("foo",
    description="tf",
    permission_policies=[
        volcengine.cloud_identity.PermissionSetPermissionPolicyArgs(
            inline_policy_document="",
            permission_policy_name="AdministratorAccess",
            permission_policy_type="System",
        ),
        volcengine.cloud_identity.PermissionSetPermissionPolicyArgs(
            inline_policy_document="",
            permission_policy_name="ReadOnlyAccess",
            permission_policy_type="System",
        ),
        volcengine.cloud_identity.PermissionSetPermissionPolicyArgs(
            inline_policy_document="{\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"auto_scaling:DescribeScalingGroups\"],\"Resource\":[\"*\"]}]}",
            permission_policy_type="Inline",
        ),
    ],
    session_duration=5000)
Copy
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 {
		_, err := cloud_identity.NewPermissionSet(ctx, "foo", &cloud_identity.PermissionSetArgs{
			Description: pulumi.String("tf"),
			PermissionPolicies: cloud_identity.PermissionSetPermissionPolicyArray{
				&cloud_identity.PermissionSetPermissionPolicyArgs{
					InlinePolicyDocument: pulumi.String(""),
					PermissionPolicyName: pulumi.String("AdministratorAccess"),
					PermissionPolicyType: pulumi.String("System"),
				},
				&cloud_identity.PermissionSetPermissionPolicyArgs{
					InlinePolicyDocument: pulumi.String(""),
					PermissionPolicyName: pulumi.String("ReadOnlyAccess"),
					PermissionPolicyType: pulumi.String("System"),
				},
				&cloud_identity.PermissionSetPermissionPolicyArgs{
					InlinePolicyDocument: pulumi.String("{\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"auto_scaling:DescribeScalingGroups\"],\"Resource\":[\"*\"]}]}"),
					PermissionPolicyType: pulumi.String("Inline"),
				},
			},
			SessionDuration: pulumi.Int(5000),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Volcengine = Pulumi.Volcengine;

return await Deployment.RunAsync(() => 
{
    var foo = new Volcengine.Cloud_identity.PermissionSet("foo", new()
    {
        Description = "tf",
        PermissionPolicies = new[]
        {
            new Volcengine.Cloud_identity.Inputs.PermissionSetPermissionPolicyArgs
            {
                InlinePolicyDocument = "",
                PermissionPolicyName = "AdministratorAccess",
                PermissionPolicyType = "System",
            },
            new Volcengine.Cloud_identity.Inputs.PermissionSetPermissionPolicyArgs
            {
                InlinePolicyDocument = "",
                PermissionPolicyName = "ReadOnlyAccess",
                PermissionPolicyType = "System",
            },
            new Volcengine.Cloud_identity.Inputs.PermissionSetPermissionPolicyArgs
            {
                InlinePolicyDocument = "{\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"auto_scaling:DescribeScalingGroups\"],\"Resource\":[\"*\"]}]}",
                PermissionPolicyType = "Inline",
            },
        },
        SessionDuration = 5000,
    });

});
Copy
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 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 foo = new PermissionSet("foo", PermissionSetArgs.builder()        
            .description("tf")
            .permissionPolicies(            
                PermissionSetPermissionPolicyArgs.builder()
                    .inlinePolicyDocument("")
                    .permissionPolicyName("AdministratorAccess")
                    .permissionPolicyType("System")
                    .build(),
                PermissionSetPermissionPolicyArgs.builder()
                    .inlinePolicyDocument("")
                    .permissionPolicyName("ReadOnlyAccess")
                    .permissionPolicyType("System")
                    .build(),
                PermissionSetPermissionPolicyArgs.builder()
                    .inlinePolicyDocument("{\"Statement\":[{\"Effect\":\"Allow\",\"Action\":[\"auto_scaling:DescribeScalingGroups\"],\"Resource\":[\"*\"]}]}")
                    .permissionPolicyType("Inline")
                    .build())
            .sessionDuration(5000)
            .build());

    }
}
Copy
resources:
  foo:
    type: volcengine:cloud_identity:PermissionSet
    properties:
      description: tf
      permissionPolicies:
        - inlinePolicyDocument:
          permissionPolicyName: AdministratorAccess
          permissionPolicyType: System
        - inlinePolicyDocument:
          permissionPolicyName: ReadOnlyAccess
          permissionPolicyType: System
        - inlinePolicyDocument: '{"Statement":[{"Effect":"Allow","Action":["auto_scaling:DescribeScalingGroups"],"Resource":["*"]}]}'
          permissionPolicyType: Inline
      sessionDuration: 5000
Copy

Create PermissionSet Resource

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

Constructor syntax

new PermissionSet(name: string, args?: PermissionSetArgs, opts?: CustomResourceOptions);
@overload
def PermissionSet(resource_name: str,
                  args: Optional[PermissionSetArgs] = None,
                  opts: Optional[ResourceOptions] = None)

@overload
def PermissionSet(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  description: Optional[str] = None,
                  name: Optional[str] = None,
                  permission_policies: Optional[Sequence[PermissionSetPermissionPolicyArgs]] = None,
                  relay_state: Optional[str] = None,
                  session_duration: Optional[int] = None)
func NewPermissionSet(ctx *Context, name string, args *PermissionSetArgs, opts ...ResourceOption) (*PermissionSet, error)
public PermissionSet(string name, PermissionSetArgs? args = null, CustomResourceOptions? opts = null)
public PermissionSet(String name, PermissionSetArgs args)
public PermissionSet(String name, PermissionSetArgs args, CustomResourceOptions options)
type: volcengine:cloud_identity:PermissionSet
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args PermissionSetArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args PermissionSetArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args PermissionSetArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args PermissionSetArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. PermissionSetArgs
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 permissionSetResource = new Volcengine.Cloud_identity.PermissionSet("permissionSetResource", new()
{
    Description = "string",
    Name = "string",
    PermissionPolicies = new[]
    {
        new Volcengine.Cloud_identity.Inputs.PermissionSetPermissionPolicyArgs
        {
            PermissionPolicyType = "string",
            InlinePolicyDocument = "string",
            PermissionPolicyName = "string",
        },
    },
    RelayState = "string",
    SessionDuration = 0,
});
Copy
example, err := cloud_identity.NewPermissionSet(ctx, "permissionSetResource", &cloud_identity.PermissionSetArgs{
	Description: pulumi.String("string"),
	Name:        pulumi.String("string"),
	PermissionPolicies: cloud_identity.PermissionSetPermissionPolicyArray{
		&cloud_identity.PermissionSetPermissionPolicyArgs{
			PermissionPolicyType: pulumi.String("string"),
			InlinePolicyDocument: pulumi.String("string"),
			PermissionPolicyName: pulumi.String("string"),
		},
	},
	RelayState:      pulumi.String("string"),
	SessionDuration: pulumi.Int(0),
})
Copy
var permissionSetResource = new PermissionSet("permissionSetResource", PermissionSetArgs.builder()
    .description("string")
    .name("string")
    .permissionPolicies(PermissionSetPermissionPolicyArgs.builder()
        .permissionPolicyType("string")
        .inlinePolicyDocument("string")
        .permissionPolicyName("string")
        .build())
    .relayState("string")
    .sessionDuration(0)
    .build());
Copy
permission_set_resource = volcengine.cloud_identity.PermissionSet("permissionSetResource",
    description="string",
    name="string",
    permission_policies=[{
        "permission_policy_type": "string",
        "inline_policy_document": "string",
        "permission_policy_name": "string",
    }],
    relay_state="string",
    session_duration=0)
Copy
const permissionSetResource = new volcengine.cloud_identity.PermissionSet("permissionSetResource", {
    description: "string",
    name: "string",
    permissionPolicies: [{
        permissionPolicyType: "string",
        inlinePolicyDocument: "string",
        permissionPolicyName: "string",
    }],
    relayState: "string",
    sessionDuration: 0,
});
Copy
type: volcengine:cloud_identity:PermissionSet
properties:
    description: string
    name: string
    permissionPolicies:
        - inlinePolicyDocument: string
          permissionPolicyName: string
          permissionPolicyType: string
    relayState: string
    sessionDuration: 0
Copy

PermissionSet 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 PermissionSet resource accepts the following input properties:

Description string
The description of the cloud identity permission set.
Name Changes to this property will trigger replacement. string
The name of the cloud identity permission set.
PermissionPolicies List<PermissionSetPermissionPolicy>
The policies of the cloud identity permission set.
RelayState string
The relay state of the cloud identity permission set.
SessionDuration int
The session duration of the cloud identity permission set. Unit: second. Valid value range in 3600~43200.
Description string
The description of the cloud identity permission set.
Name Changes to this property will trigger replacement. string
The name of the cloud identity permission set.
PermissionPolicies []PermissionSetPermissionPolicyArgs
The policies of the cloud identity permission set.
RelayState string
The relay state of the cloud identity permission set.
SessionDuration int
The session duration of the cloud identity permission set. Unit: second. Valid value range in 3600~43200.
description String
The description of the cloud identity permission set.
name Changes to this property will trigger replacement. String
The name of the cloud identity permission set.
permissionPolicies List<PermissionSetPermissionPolicy>
The policies of the cloud identity permission set.
relayState String
The relay state of the cloud identity permission set.
sessionDuration Integer
The session duration of the cloud identity permission set. Unit: second. Valid value range in 3600~43200.
description string
The description of the cloud identity permission set.
name Changes to this property will trigger replacement. string
The name of the cloud identity permission set.
permissionPolicies PermissionSetPermissionPolicy[]
The policies of the cloud identity permission set.
relayState string
The relay state of the cloud identity permission set.
sessionDuration number
The session duration of the cloud identity permission set. Unit: second. Valid value range in 3600~43200.
description str
The description of the cloud identity permission set.
name Changes to this property will trigger replacement. str
The name of the cloud identity permission set.
permission_policies Sequence[PermissionSetPermissionPolicyArgs]
The policies of the cloud identity permission set.
relay_state str
The relay state of the cloud identity permission set.
session_duration int
The session duration of the cloud identity permission set. Unit: second. Valid value range in 3600~43200.
description String
The description of the cloud identity permission set.
name Changes to this property will trigger replacement. String
The name of the cloud identity permission set.
permissionPolicies List<Property Map>
The policies of the cloud identity permission set.
relayState String
The relay state of the cloud identity permission set.
sessionDuration Number
The session duration of the cloud identity permission set. Unit: second. Valid value range in 3600~43200.

Outputs

All input properties are implicitly available as output properties. Additionally, the PermissionSet 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 PermissionSet Resource

Get an existing PermissionSet 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?: PermissionSetState, opts?: CustomResourceOptions): PermissionSet
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        description: Optional[str] = None,
        name: Optional[str] = None,
        permission_policies: Optional[Sequence[PermissionSetPermissionPolicyArgs]] = None,
        relay_state: Optional[str] = None,
        session_duration: Optional[int] = None) -> PermissionSet
func GetPermissionSet(ctx *Context, name string, id IDInput, state *PermissionSetState, opts ...ResourceOption) (*PermissionSet, error)
public static PermissionSet Get(string name, Input<string> id, PermissionSetState? state, CustomResourceOptions? opts = null)
public static PermissionSet get(String name, Output<String> id, PermissionSetState state, CustomResourceOptions options)
resources:  _:    type: volcengine:cloud_identity:PermissionSet    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Description string
The description of the cloud identity permission set.
Name Changes to this property will trigger replacement. string
The name of the cloud identity permission set.
PermissionPolicies List<PermissionSetPermissionPolicy>
The policies of the cloud identity permission set.
RelayState string
The relay state of the cloud identity permission set.
SessionDuration int
The session duration of the cloud identity permission set. Unit: second. Valid value range in 3600~43200.
Description string
The description of the cloud identity permission set.
Name Changes to this property will trigger replacement. string
The name of the cloud identity permission set.
PermissionPolicies []PermissionSetPermissionPolicyArgs
The policies of the cloud identity permission set.
RelayState string
The relay state of the cloud identity permission set.
SessionDuration int
The session duration of the cloud identity permission set. Unit: second. Valid value range in 3600~43200.
description String
The description of the cloud identity permission set.
name Changes to this property will trigger replacement. String
The name of the cloud identity permission set.
permissionPolicies List<PermissionSetPermissionPolicy>
The policies of the cloud identity permission set.
relayState String
The relay state of the cloud identity permission set.
sessionDuration Integer
The session duration of the cloud identity permission set. Unit: second. Valid value range in 3600~43200.
description string
The description of the cloud identity permission set.
name Changes to this property will trigger replacement. string
The name of the cloud identity permission set.
permissionPolicies PermissionSetPermissionPolicy[]
The policies of the cloud identity permission set.
relayState string
The relay state of the cloud identity permission set.
sessionDuration number
The session duration of the cloud identity permission set. Unit: second. Valid value range in 3600~43200.
description str
The description of the cloud identity permission set.
name Changes to this property will trigger replacement. str
The name of the cloud identity permission set.
permission_policies Sequence[PermissionSetPermissionPolicyArgs]
The policies of the cloud identity permission set.
relay_state str
The relay state of the cloud identity permission set.
session_duration int
The session duration of the cloud identity permission set. Unit: second. Valid value range in 3600~43200.
description String
The description of the cloud identity permission set.
name Changes to this property will trigger replacement. String
The name of the cloud identity permission set.
permissionPolicies List<Property Map>
The policies of the cloud identity permission set.
relayState String
The relay state of the cloud identity permission set.
sessionDuration Number
The session duration of the cloud identity permission set. Unit: second. Valid value range in 3600~43200.

Supporting Types

PermissionSetPermissionPolicy
, PermissionSetPermissionPolicyArgs

PermissionPolicyType This property is required. string
The type of the cloud identity permission set policy. Valid values: System, Inline.
InlinePolicyDocument string
The document of the cloud identity permission set inline policy. When the permission_policy_type is Inline, this field must be specified.
PermissionPolicyName string
The name of the cloud identity permission set system policy. When the permission_policy_type is System, this field must be specified.
PermissionPolicyType This property is required. string
The type of the cloud identity permission set policy. Valid values: System, Inline.
InlinePolicyDocument string
The document of the cloud identity permission set inline policy. When the permission_policy_type is Inline, this field must be specified.
PermissionPolicyName string
The name of the cloud identity permission set system policy. When the permission_policy_type is System, this field must be specified.
permissionPolicyType This property is required. String
The type of the cloud identity permission set policy. Valid values: System, Inline.
inlinePolicyDocument String
The document of the cloud identity permission set inline policy. When the permission_policy_type is Inline, this field must be specified.
permissionPolicyName String
The name of the cloud identity permission set system policy. When the permission_policy_type is System, this field must be specified.
permissionPolicyType This property is required. string
The type of the cloud identity permission set policy. Valid values: System, Inline.
inlinePolicyDocument string
The document of the cloud identity permission set inline policy. When the permission_policy_type is Inline, this field must be specified.
permissionPolicyName string
The name of the cloud identity permission set system policy. When the permission_policy_type is System, this field must be specified.
permission_policy_type This property is required. str
The type of the cloud identity permission set policy. Valid values: System, Inline.
inline_policy_document str
The document of the cloud identity permission set inline policy. When the permission_policy_type is Inline, this field must be specified.
permission_policy_name str
The name of the cloud identity permission set system policy. When the permission_policy_type is System, this field must be specified.
permissionPolicyType This property is required. String
The type of the cloud identity permission set policy. Valid values: System, Inline.
inlinePolicyDocument String
The document of the cloud identity permission set inline policy. When the permission_policy_type is Inline, this field must be specified.
permissionPolicyName String
The name of the cloud identity permission set system policy. When the permission_policy_type is System, this field must be specified.

Import

CloudIdentityPermissionSet can be imported using the id, e.g.

$ pulumi import volcengine:cloud_identity/permissionSet:PermissionSet default resource_id
Copy

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.