1. Packages
  2. Packages
  3. Temporalcloud Provider
  4. API Docs
  5. CustomRole
Viewing docs for Temporal Cloud 1.5.0
published on Friday, May 29, 2026 by temporalio
Viewing docs for Temporal Cloud 1.5.0
published on Friday, May 29, 2026 by temporalio

    Provisions a Temporal Cloud custom role.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as temporalcloud from "@pulumi/temporalcloud";
    
    const exampleCustomRole = new temporalcloud.CustomRole("example_custom_role", {
        name: "terraform-example-custom-role",
        description: "Example custom role created with Terraform.",
        permissions: [{
            actions: ["cloud.account.get"],
            resources: {
                resourceType: "account",
                resourceIds: [],
                allowAll: true,
            },
        }],
    });
    
    import pulumi
    import pulumi_temporalcloud as temporalcloud
    
    example_custom_role = temporalcloud.CustomRole("example_custom_role",
        name="terraform-example-custom-role",
        description="Example custom role created with Terraform.",
        permissions=[{
            "actions": ["cloud.account.get"],
            "resources": {
                "resource_type": "account",
                "resource_ids": [],
                "allow_all": True,
            },
        }])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/temporalcloud/temporalcloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := temporalcloud.NewCustomRole(ctx, "example_custom_role", &temporalcloud.CustomRoleArgs{
    			Name:        pulumi.String("terraform-example-custom-role"),
    			Description: pulumi.String("Example custom role created with Terraform."),
    			Permissions: temporalcloud.CustomRolePermissionArray{
    				&temporalcloud.CustomRolePermissionArgs{
    					Actions: pulumi.StringArray{
    						pulumi.String("cloud.account.get"),
    					},
    					Resources: &temporalcloud.CustomRolePermissionResourcesArgs{
    						ResourceType: pulumi.String("account"),
    						ResourceIds:  pulumi.StringArray{},
    						AllowAll:     pulumi.Bool(true),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Temporalcloud = Pulumi.Temporalcloud;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleCustomRole = new Temporalcloud.CustomRole("example_custom_role", new()
        {
            Name = "terraform-example-custom-role",
            Description = "Example custom role created with Terraform.",
            Permissions = new[]
            {
                new Temporalcloud.Inputs.CustomRolePermissionArgs
                {
                    Actions = new[]
                    {
                        "cloud.account.get",
                    },
                    Resources = new Temporalcloud.Inputs.CustomRolePermissionResourcesArgs
                    {
                        ResourceType = "account",
                        ResourceIds = new() { },
                        AllowAll = true,
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.temporalcloud.CustomRole;
    import com.pulumi.temporalcloud.CustomRoleArgs;
    import com.pulumi.temporalcloud.inputs.CustomRolePermissionArgs;
    import com.pulumi.temporalcloud.inputs.CustomRolePermissionResourcesArgs;
    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 exampleCustomRole = new CustomRole("exampleCustomRole", CustomRoleArgs.builder()
                .name("terraform-example-custom-role")
                .description("Example custom role created with Terraform.")
                .permissions(CustomRolePermissionArgs.builder()
                    .actions("cloud.account.get")
                    .resources(CustomRolePermissionResourcesArgs.builder()
                        .resourceType("account")
                        .resourceIds()
                        .allowAll(true)
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      exampleCustomRole:
        type: temporalcloud:CustomRole
        name: example_custom_role
        properties:
          name: terraform-example-custom-role
          description: Example custom role created with Terraform.
          permissions:
            - actions:
                - cloud.account.get
              resources:
                resourceType: account
                resourceIds: []
                allowAll: true
    
    Example coming soon!
    

    Create CustomRole Resource

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

    Constructor syntax

    new CustomRole(name: string, args: CustomRoleArgs, opts?: CustomResourceOptions);
    @overload
    def CustomRole(resource_name: str,
                   args: CustomRoleArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def CustomRole(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   permissions: Optional[Sequence[CustomRolePermissionArgs]] = None,
                   description: Optional[str] = None,
                   name: Optional[str] = None,
                   timeouts: Optional[CustomRoleTimeoutsArgs] = None)
    func NewCustomRole(ctx *Context, name string, args CustomRoleArgs, opts ...ResourceOption) (*CustomRole, error)
    public CustomRole(string name, CustomRoleArgs args, CustomResourceOptions? opts = null)
    public CustomRole(String name, CustomRoleArgs args)
    public CustomRole(String name, CustomRoleArgs args, CustomResourceOptions options)
    
    type: temporalcloud:CustomRole
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "temporalcloud_customrole" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args CustomRoleArgs
    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 CustomRoleArgs
    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 CustomRoleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CustomRoleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CustomRoleArgs
    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 customRoleResource = new Temporalcloud.CustomRole("customRoleResource", new()
    {
        Permissions = new[]
        {
            new Temporalcloud.Inputs.CustomRolePermissionArgs
            {
                Actions = new[]
                {
                    "string",
                },
                Resources = new Temporalcloud.Inputs.CustomRolePermissionResourcesArgs
                {
                    ResourceIds = new[]
                    {
                        "string",
                    },
                    ResourceType = "string",
                    AllowAll = false,
                },
            },
        },
        Description = "string",
        Name = "string",
        Timeouts = new Temporalcloud.Inputs.CustomRoleTimeoutsArgs
        {
            Create = "string",
            Delete = "string",
            Update = "string",
        },
    });
    
    example, err := temporalcloud.NewCustomRole(ctx, "customRoleResource", &temporalcloud.CustomRoleArgs{
    	Permissions: temporalcloud.CustomRolePermissionArray{
    		&temporalcloud.CustomRolePermissionArgs{
    			Actions: pulumi.StringArray{
    				pulumi.String("string"),
    			},
    			Resources: &temporalcloud.CustomRolePermissionResourcesArgs{
    				ResourceIds: pulumi.StringArray{
    					pulumi.String("string"),
    				},
    				ResourceType: pulumi.String("string"),
    				AllowAll:     pulumi.Bool(false),
    			},
    		},
    	},
    	Description: pulumi.String("string"),
    	Name:        pulumi.String("string"),
    	Timeouts: &temporalcloud.CustomRoleTimeoutsArgs{
    		Create: pulumi.String("string"),
    		Delete: pulumi.String("string"),
    		Update: pulumi.String("string"),
    	},
    })
    
    resource "temporalcloud_customrole" "customRoleResource" {
      permissions {
        actions = ["string"]
        resources = {
          resource_ids  = ["string"]
          resource_type = "string"
          allow_all     = false
        }
      }
      description = "string"
      name        = "string"
      timeouts = {
        create = "string"
        delete = "string"
        update = "string"
      }
    }
    
    var customRoleResource = new CustomRole("customRoleResource", CustomRoleArgs.builder()
        .permissions(CustomRolePermissionArgs.builder()
            .actions("string")
            .resources(CustomRolePermissionResourcesArgs.builder()
                .resourceIds("string")
                .resourceType("string")
                .allowAll(false)
                .build())
            .build())
        .description("string")
        .name("string")
        .timeouts(CustomRoleTimeoutsArgs.builder()
            .create("string")
            .delete("string")
            .update("string")
            .build())
        .build());
    
    custom_role_resource = temporalcloud.CustomRole("customRoleResource",
        permissions=[{
            "actions": ["string"],
            "resources": {
                "resource_ids": ["string"],
                "resource_type": "string",
                "allow_all": False,
            },
        }],
        description="string",
        name="string",
        timeouts={
            "create": "string",
            "delete": "string",
            "update": "string",
        })
    
    const customRoleResource = new temporalcloud.CustomRole("customRoleResource", {
        permissions: [{
            actions: ["string"],
            resources: {
                resourceIds: ["string"],
                resourceType: "string",
                allowAll: false,
            },
        }],
        description: "string",
        name: "string",
        timeouts: {
            create: "string",
            "delete": "string",
            update: "string",
        },
    });
    
    type: temporalcloud:CustomRole
    properties:
        description: string
        name: string
        permissions:
            - actions:
                - string
              resources:
                allowAll: false
                resourceIds:
                    - string
                resourceType: string
        timeouts:
            create: string
            delete: string
            update: string
    

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

    Permissions List<CustomRolePermission>
    The permissions assigned to the custom role.
    Description string
    The description of the custom role.
    Name string
    The name of the custom role.
    Timeouts CustomRoleTimeouts
    Permissions []CustomRolePermissionArgs
    The permissions assigned to the custom role.
    Description string
    The description of the custom role.
    Name string
    The name of the custom role.
    Timeouts CustomRoleTimeoutsArgs
    permissions list(object)
    The permissions assigned to the custom role.
    description string
    The description of the custom role.
    name string
    The name of the custom role.
    timeouts object
    permissions List<CustomRolePermission>
    The permissions assigned to the custom role.
    description String
    The description of the custom role.
    name String
    The name of the custom role.
    timeouts CustomRoleTimeouts
    permissions CustomRolePermission[]
    The permissions assigned to the custom role.
    description string
    The description of the custom role.
    name string
    The name of the custom role.
    timeouts CustomRoleTimeouts
    permissions Sequence[CustomRolePermissionArgs]
    The permissions assigned to the custom role.
    description str
    The description of the custom role.
    name str
    The name of the custom role.
    timeouts CustomRoleTimeoutsArgs
    permissions List<Property Map>
    The permissions assigned to the custom role.
    description String
    The description of the custom role.
    name String
    The name of the custom role.
    timeouts Property Map

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    State string
    The current state of the custom role.
    Id string
    The provider-assigned unique ID for this managed resource.
    State string
    The current state of the custom role.
    id string
    The provider-assigned unique ID for this managed resource.
    state string
    The current state of the custom role.
    id String
    The provider-assigned unique ID for this managed resource.
    state String
    The current state of the custom role.
    id string
    The provider-assigned unique ID for this managed resource.
    state string
    The current state of the custom role.
    id str
    The provider-assigned unique ID for this managed resource.
    state str
    The current state of the custom role.
    id String
    The provider-assigned unique ID for this managed resource.
    state String
    The current state of the custom role.

    Look up Existing CustomRole Resource

    Get an existing CustomRole 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?: CustomRoleState, opts?: CustomResourceOptions): CustomRole
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            description: Optional[str] = None,
            name: Optional[str] = None,
            permissions: Optional[Sequence[CustomRolePermissionArgs]] = None,
            state: Optional[str] = None,
            timeouts: Optional[CustomRoleTimeoutsArgs] = None) -> CustomRole
    func GetCustomRole(ctx *Context, name string, id IDInput, state *CustomRoleState, opts ...ResourceOption) (*CustomRole, error)
    public static CustomRole Get(string name, Input<string> id, CustomRoleState? state, CustomResourceOptions? opts = null)
    public static CustomRole get(String name, Output<String> id, CustomRoleState state, CustomResourceOptions options)
    resources:  _:    type: temporalcloud:CustomRole    get:      id: ${id}
    import {
      to = temporalcloud_customrole.example
      id = "${id}"
    }
    
    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:
    Description string
    The description of the custom role.
    Name string
    The name of the custom role.
    Permissions List<CustomRolePermission>
    The permissions assigned to the custom role.
    State string
    The current state of the custom role.
    Timeouts CustomRoleTimeouts
    Description string
    The description of the custom role.
    Name string
    The name of the custom role.
    Permissions []CustomRolePermissionArgs
    The permissions assigned to the custom role.
    State string
    The current state of the custom role.
    Timeouts CustomRoleTimeoutsArgs
    description string
    The description of the custom role.
    name string
    The name of the custom role.
    permissions list(object)
    The permissions assigned to the custom role.
    state string
    The current state of the custom role.
    timeouts object
    description String
    The description of the custom role.
    name String
    The name of the custom role.
    permissions List<CustomRolePermission>
    The permissions assigned to the custom role.
    state String
    The current state of the custom role.
    timeouts CustomRoleTimeouts
    description string
    The description of the custom role.
    name string
    The name of the custom role.
    permissions CustomRolePermission[]
    The permissions assigned to the custom role.
    state string
    The current state of the custom role.
    timeouts CustomRoleTimeouts
    description str
    The description of the custom role.
    name str
    The name of the custom role.
    permissions Sequence[CustomRolePermissionArgs]
    The permissions assigned to the custom role.
    state str
    The current state of the custom role.
    timeouts CustomRoleTimeoutsArgs
    description String
    The description of the custom role.
    name String
    The name of the custom role.
    permissions List<Property Map>
    The permissions assigned to the custom role.
    state String
    The current state of the custom role.
    timeouts Property Map

    Supporting Types

    CustomRolePermission, CustomRolePermissionArgs

    Actions List<string>
    The actions allowed by this permission.
    Resources CustomRolePermissionResources
    The resources this permission applies to.
    Actions []string
    The actions allowed by this permission.
    Resources CustomRolePermissionResources
    The resources this permission applies to.
    actions list(string)
    The actions allowed by this permission.
    resources object
    The resources this permission applies to.
    actions List<String>
    The actions allowed by this permission.
    resources CustomRolePermissionResources
    The resources this permission applies to.
    actions string[]
    The actions allowed by this permission.
    resources CustomRolePermissionResources
    The resources this permission applies to.
    actions Sequence[str]
    The actions allowed by this permission.
    resources CustomRolePermissionResources
    The resources this permission applies to.
    actions List<String>
    The actions allowed by this permission.
    resources Property Map
    The resources this permission applies to.

    CustomRolePermissionResources, CustomRolePermissionResourcesArgs

    ResourceIds List<string>
    The resource IDs this permission applies to. If empty, allow_all must be true.
    ResourceType string
    The resource type this permission applies to.
    AllowAll bool
    Whether this permission applies to all resources of the given type. If true, resource_ids must be empty.
    ResourceIds []string
    The resource IDs this permission applies to. If empty, allow_all must be true.
    ResourceType string
    The resource type this permission applies to.
    AllowAll bool
    Whether this permission applies to all resources of the given type. If true, resource_ids must be empty.
    resource_ids list(string)
    The resource IDs this permission applies to. If empty, allow_all must be true.
    resource_type string
    The resource type this permission applies to.
    allow_all bool
    Whether this permission applies to all resources of the given type. If true, resource_ids must be empty.
    resourceIds List<String>
    The resource IDs this permission applies to. If empty, allow_all must be true.
    resourceType String
    The resource type this permission applies to.
    allowAll Boolean
    Whether this permission applies to all resources of the given type. If true, resource_ids must be empty.
    resourceIds string[]
    The resource IDs this permission applies to. If empty, allow_all must be true.
    resourceType string
    The resource type this permission applies to.
    allowAll boolean
    Whether this permission applies to all resources of the given type. If true, resource_ids must be empty.
    resource_ids Sequence[str]
    The resource IDs this permission applies to. If empty, allow_all must be true.
    resource_type str
    The resource type this permission applies to.
    allow_all bool
    Whether this permission applies to all resources of the given type. If true, resource_ids must be empty.
    resourceIds List<String>
    The resource IDs this permission applies to. If empty, allow_all must be true.
    resourceType String
    The resource type this permission applies to.
    allowAll Boolean
    Whether this permission applies to all resources of the given type. If true, resource_ids must be empty.

    CustomRoleTimeouts, CustomRoleTimeoutsArgs

    Create string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    Delete string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    Update string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    Create string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    Delete string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    Update string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    create string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    delete string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    update string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    create String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    delete String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    update String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    create string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    delete string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    update string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    create str
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    delete str
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    update str
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    create String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    delete String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    update String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

    Package Details

    Repository
    temporalcloud temporalio/terraform-provider-temporalcloud
    License
    Notes
    This Pulumi package is based on the temporalcloud Terraform Provider.
    Viewing docs for Temporal Cloud 1.5.0
    published on Friday, May 29, 2026 by temporalio

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial