1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. pai
  5. WorkspaceUserConfig
Alibaba Cloud v3.81.0 published on Monday, Jun 23, 2025 by Pulumi

alicloud.pai.WorkspaceUserConfig

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.81.0 published on Monday, Jun 23, 2025 by Pulumi

    Provides a PAI Workspace User Config resource.

    For information about PAI Workspace User Config and how to use it, see What is User Config.

    NOTE: Available since v1.250.0.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as alicloud from "@pulumi/alicloud";
    
    const config = new pulumi.Config();
    const name = config.get("name") || "terraform_example";
    const _default = new alicloud.pai.WorkspaceUserConfig("default", {
        categoryName: "DataPrivacyConfig",
        configKey: "customizePAIAssumedRole",
        configValue: name,
    });
    
    import pulumi
    import pulumi_alicloud as alicloud
    
    config = pulumi.Config()
    name = config.get("name")
    if name is None:
        name = "terraform_example"
    default = alicloud.pai.WorkspaceUserConfig("default",
        category_name="DataPrivacyConfig",
        config_key="customizePAIAssumedRole",
        config_value=name)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/pai"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi/config"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		cfg := config.New(ctx, "")
    		name := "terraform_example"
    		if param := cfg.Get("name"); param != "" {
    			name = param
    		}
    		_, err := pai.NewWorkspaceUserConfig(ctx, "default", &pai.WorkspaceUserConfigArgs{
    			CategoryName: pulumi.String("DataPrivacyConfig"),
    			ConfigKey:    pulumi.String("customizePAIAssumedRole"),
    			ConfigValue:  pulumi.String(name),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AliCloud = Pulumi.AliCloud;
    
    return await Deployment.RunAsync(() => 
    {
        var config = new Config();
        var name = config.Get("name") ?? "terraform_example";
        var @default = new AliCloud.Pai.WorkspaceUserConfig("default", new()
        {
            CategoryName = "DataPrivacyConfig",
            ConfigKey = "customizePAIAssumedRole",
            ConfigValue = name,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.alicloud.pai.WorkspaceUserConfig;
    import com.pulumi.alicloud.pai.WorkspaceUserConfigArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var config = ctx.config();
            final var name = config.get("name").orElse("terraform_example");
            var default_ = new WorkspaceUserConfig("default", WorkspaceUserConfigArgs.builder()
                .categoryName("DataPrivacyConfig")
                .configKey("customizePAIAssumedRole")
                .configValue(name)
                .build());
    
        }
    }
    
    configuration:
      name:
        type: string
        default: terraform_example
    resources:
      default:
        type: alicloud:pai:WorkspaceUserConfig
        properties:
          categoryName: DataPrivacyConfig
          configKey: customizePAIAssumedRole
          configValue: ${name}
    

    Create WorkspaceUserConfig Resource

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

    Constructor syntax

    new WorkspaceUserConfig(name: string, args: WorkspaceUserConfigArgs, opts?: CustomResourceOptions);
    @overload
    def WorkspaceUserConfig(resource_name: str,
                            args: WorkspaceUserConfigArgs,
                            opts: Optional[ResourceOptions] = None)
    
    @overload
    def WorkspaceUserConfig(resource_name: str,
                            opts: Optional[ResourceOptions] = None,
                            category_name: Optional[str] = None,
                            config_key: Optional[str] = None,
                            config_value: Optional[str] = None,
                            scope: Optional[str] = None)
    func NewWorkspaceUserConfig(ctx *Context, name string, args WorkspaceUserConfigArgs, opts ...ResourceOption) (*WorkspaceUserConfig, error)
    public WorkspaceUserConfig(string name, WorkspaceUserConfigArgs args, CustomResourceOptions? opts = null)
    public WorkspaceUserConfig(String name, WorkspaceUserConfigArgs args)
    public WorkspaceUserConfig(String name, WorkspaceUserConfigArgs args, CustomResourceOptions options)
    
    type: alicloud:pai:WorkspaceUserConfig
    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 WorkspaceUserConfigArgs
    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 WorkspaceUserConfigArgs
    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 WorkspaceUserConfigArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args WorkspaceUserConfigArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args WorkspaceUserConfigArgs
    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 workspaceUserConfigResource = new AliCloud.Pai.WorkspaceUserConfig("workspaceUserConfigResource", new()
    {
        CategoryName = "string",
        ConfigKey = "string",
        ConfigValue = "string",
        Scope = "string",
    });
    
    example, err := pai.NewWorkspaceUserConfig(ctx, "workspaceUserConfigResource", &pai.WorkspaceUserConfigArgs{
    	CategoryName: pulumi.String("string"),
    	ConfigKey:    pulumi.String("string"),
    	ConfigValue:  pulumi.String("string"),
    	Scope:        pulumi.String("string"),
    })
    
    var workspaceUserConfigResource = new WorkspaceUserConfig("workspaceUserConfigResource", WorkspaceUserConfigArgs.builder()
        .categoryName("string")
        .configKey("string")
        .configValue("string")
        .scope("string")
        .build());
    
    workspace_user_config_resource = alicloud.pai.WorkspaceUserConfig("workspaceUserConfigResource",
        category_name="string",
        config_key="string",
        config_value="string",
        scope="string")
    
    const workspaceUserConfigResource = new alicloud.pai.WorkspaceUserConfig("workspaceUserConfigResource", {
        categoryName: "string",
        configKey: "string",
        configValue: "string",
        scope: "string",
    });
    
    type: alicloud:pai:WorkspaceUserConfig
    properties:
        categoryName: string
        configKey: string
        configValue: string
        scope: string
    

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

    CategoryName string
    The category. Valid values: DataPrivacyConfig.
    ConfigKey string
    The key of the configuration.
    ConfigValue string
    The value of the configuration.
    Scope string
    The scope. Default value: owner. Valid values: owner, subUser.
    CategoryName string
    The category. Valid values: DataPrivacyConfig.
    ConfigKey string
    The key of the configuration.
    ConfigValue string
    The value of the configuration.
    Scope string
    The scope. Default value: owner. Valid values: owner, subUser.
    categoryName String
    The category. Valid values: DataPrivacyConfig.
    configKey String
    The key of the configuration.
    configValue String
    The value of the configuration.
    scope String
    The scope. Default value: owner. Valid values: owner, subUser.
    categoryName string
    The category. Valid values: DataPrivacyConfig.
    configKey string
    The key of the configuration.
    configValue string
    The value of the configuration.
    scope string
    The scope. Default value: owner. Valid values: owner, subUser.
    category_name str
    The category. Valid values: DataPrivacyConfig.
    config_key str
    The key of the configuration.
    config_value str
    The value of the configuration.
    scope str
    The scope. Default value: owner. Valid values: owner, subUser.
    categoryName String
    The category. Valid values: DataPrivacyConfig.
    configKey String
    The key of the configuration.
    configValue String
    The value of the configuration.
    scope String
    The scope. Default value: owner. Valid values: owner, subUser.

    Outputs

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

    Get an existing WorkspaceUserConfig 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?: WorkspaceUserConfigState, opts?: CustomResourceOptions): WorkspaceUserConfig
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            category_name: Optional[str] = None,
            config_key: Optional[str] = None,
            config_value: Optional[str] = None,
            scope: Optional[str] = None) -> WorkspaceUserConfig
    func GetWorkspaceUserConfig(ctx *Context, name string, id IDInput, state *WorkspaceUserConfigState, opts ...ResourceOption) (*WorkspaceUserConfig, error)
    public static WorkspaceUserConfig Get(string name, Input<string> id, WorkspaceUserConfigState? state, CustomResourceOptions? opts = null)
    public static WorkspaceUserConfig get(String name, Output<String> id, WorkspaceUserConfigState state, CustomResourceOptions options)
    resources:  _:    type: alicloud:pai:WorkspaceUserConfig    get:      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:
    CategoryName string
    The category. Valid values: DataPrivacyConfig.
    ConfigKey string
    The key of the configuration.
    ConfigValue string
    The value of the configuration.
    Scope string
    The scope. Default value: owner. Valid values: owner, subUser.
    CategoryName string
    The category. Valid values: DataPrivacyConfig.
    ConfigKey string
    The key of the configuration.
    ConfigValue string
    The value of the configuration.
    Scope string
    The scope. Default value: owner. Valid values: owner, subUser.
    categoryName String
    The category. Valid values: DataPrivacyConfig.
    configKey String
    The key of the configuration.
    configValue String
    The value of the configuration.
    scope String
    The scope. Default value: owner. Valid values: owner, subUser.
    categoryName string
    The category. Valid values: DataPrivacyConfig.
    configKey string
    The key of the configuration.
    configValue string
    The value of the configuration.
    scope string
    The scope. Default value: owner. Valid values: owner, subUser.
    category_name str
    The category. Valid values: DataPrivacyConfig.
    config_key str
    The key of the configuration.
    config_value str
    The value of the configuration.
    scope str
    The scope. Default value: owner. Valid values: owner, subUser.
    categoryName String
    The category. Valid values: DataPrivacyConfig.
    configKey String
    The key of the configuration.
    configValue String
    The value of the configuration.
    scope String
    The scope. Default value: owner. Valid values: owner, subUser.

    Import

    PAI Workspace User Config can be imported using the id, e.g.

    $ pulumi import alicloud:pai/workspaceUserConfig:WorkspaceUserConfig example <category_name>:<config_key>
    

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

    Package Details

    Repository
    Alibaba Cloud pulumi/pulumi-alicloud
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.81.0 published on Monday, Jun 23, 2025 by Pulumi