alicloud.pai.WorkspaceRun
Explore with Pulumi AI
Provides a PAI Workspace Run resource.
For information about PAI Workspace Run and how to use it, see What is Run.
NOTE: Available since v1.236.0.
Example Usage
Basic Usage
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
import * as std from "@pulumi/std";
const config = new pulumi.Config();
const name = config.get("name") || "terraform_example";
const defaultCAFUa9 = new alicloud.pai.WorkspaceWorkspace("defaultCAFUa9", {
description: name,
displayName: name,
workspaceName: name,
envTypes: ["prod"],
});
const defaultQRwWbv = new alicloud.pai.WorkspaceExperiment("defaultQRwWbv", {
accessibility: "PRIVATE",
artifactUri: "oss://example.oss-cn-hangzhou.aliyuncs.com/example/",
experimentName: std.format({
input: "%s1",
args: [name],
}).then(invoke => invoke.result),
workspaceId: defaultCAFUa9.id,
});
const _default = new alicloud.pai.WorkspaceRun("default", {
sourceType: "TrainingService",
sourceId: "759",
runName: name,
experimentId: defaultQRwWbv.id,
});
import pulumi
import pulumi_alicloud as alicloud
import pulumi_std as std
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform_example"
default_caf_ua9 = alicloud.pai.WorkspaceWorkspace("defaultCAFUa9",
description=name,
display_name=name,
workspace_name=name,
env_types=["prod"])
default_q_rw_wbv = alicloud.pai.WorkspaceExperiment("defaultQRwWbv",
accessibility="PRIVATE",
artifact_uri="oss://example.oss-cn-hangzhou.aliyuncs.com/example/",
experiment_name=std.format(input="%s1",
args=[name]).result,
workspace_id=default_caf_ua9.id)
default = alicloud.pai.WorkspaceRun("default",
source_type="TrainingService",
source_id="759",
run_name=name,
experiment_id=default_q_rw_wbv.id)
package main
import (
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/pai"
"github.com/pulumi/pulumi-std/sdk/go/std"
"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
}
defaultCAFUa9, err := pai.NewWorkspaceWorkspace(ctx, "defaultCAFUa9", &pai.WorkspaceWorkspaceArgs{
Description: pulumi.String(name),
DisplayName: pulumi.String(name),
WorkspaceName: pulumi.String(name),
EnvTypes: pulumi.StringArray{
pulumi.String("prod"),
},
})
if err != nil {
return err
}
invokeFormat, err := std.Format(ctx, &std.FormatArgs{
Input: "%s1",
Args: []string{
name,
},
}, nil)
if err != nil {
return err
}
defaultQRwWbv, err := pai.NewWorkspaceExperiment(ctx, "defaultQRwWbv", &pai.WorkspaceExperimentArgs{
Accessibility: pulumi.String("PRIVATE"),
ArtifactUri: pulumi.String("oss://example.oss-cn-hangzhou.aliyuncs.com/example/"),
ExperimentName: pulumi.String(invokeFormat.Result),
WorkspaceId: defaultCAFUa9.ID(),
})
if err != nil {
return err
}
_, err = pai.NewWorkspaceRun(ctx, "default", &pai.WorkspaceRunArgs{
SourceType: pulumi.String("TrainingService"),
SourceId: pulumi.String("759"),
RunName: pulumi.String(name),
ExperimentId: defaultQRwWbv.ID(),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
using Std = Pulumi.Std;
return await Deployment.RunAsync(() =>
{
var config = new Config();
var name = config.Get("name") ?? "terraform_example";
var defaultCAFUa9 = new AliCloud.Pai.WorkspaceWorkspace("defaultCAFUa9", new()
{
Description = name,
DisplayName = name,
WorkspaceName = name,
EnvTypes = new[]
{
"prod",
},
});
var defaultQRwWbv = new AliCloud.Pai.WorkspaceExperiment("defaultQRwWbv", new()
{
Accessibility = "PRIVATE",
ArtifactUri = "oss://example.oss-cn-hangzhou.aliyuncs.com/example/",
ExperimentName = Std.Format.Invoke(new()
{
Input = "%s1",
Args = new[]
{
name,
},
}).Apply(invoke => invoke.Result),
WorkspaceId = defaultCAFUa9.Id,
});
var @default = new AliCloud.Pai.WorkspaceRun("default", new()
{
SourceType = "TrainingService",
SourceId = "759",
RunName = name,
ExperimentId = defaultQRwWbv.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.pai.WorkspaceWorkspace;
import com.pulumi.alicloud.pai.WorkspaceWorkspaceArgs;
import com.pulumi.alicloud.pai.WorkspaceExperiment;
import com.pulumi.alicloud.pai.WorkspaceExperimentArgs;
import com.pulumi.std.StdFunctions;
import com.pulumi.std.inputs.FormatArgs;
import com.pulumi.alicloud.pai.WorkspaceRun;
import com.pulumi.alicloud.pai.WorkspaceRunArgs;
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 defaultCAFUa9 = new WorkspaceWorkspace("defaultCAFUa9", WorkspaceWorkspaceArgs.builder()
.description(name)
.displayName(name)
.workspaceName(name)
.envTypes("prod")
.build());
var defaultQRwWbv = new WorkspaceExperiment("defaultQRwWbv", WorkspaceExperimentArgs.builder()
.accessibility("PRIVATE")
.artifactUri("oss://example.oss-cn-hangzhou.aliyuncs.com/example/")
.experimentName(StdFunctions.format(FormatArgs.builder()
.input("%s1")
.args(name)
.build()).result())
.workspaceId(defaultCAFUa9.id())
.build());
var default_ = new WorkspaceRun("default", WorkspaceRunArgs.builder()
.sourceType("TrainingService")
.sourceId("759")
.runName(name)
.experimentId(defaultQRwWbv.id())
.build());
}
}
configuration:
name:
type: string
default: terraform_example
resources:
defaultCAFUa9:
type: alicloud:pai:WorkspaceWorkspace
properties:
description: ${name}
displayName: ${name}
workspaceName: ${name}
envTypes:
- prod
defaultQRwWbv:
type: alicloud:pai:WorkspaceExperiment
properties:
accessibility: PRIVATE
artifactUri: oss://example.oss-cn-hangzhou.aliyuncs.com/example/
experimentName:
fn::invoke:
function: std:format
arguments:
input: '%s1'
args:
- ${name}
return: result
workspaceId: ${defaultCAFUa9.id}
default:
type: alicloud:pai:WorkspaceRun
properties:
sourceType: TrainingService
sourceId: '759'
runName: ${name}
experimentId: ${defaultQRwWbv.id}
Create WorkspaceRun Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new WorkspaceRun(name: string, args: WorkspaceRunArgs, opts?: CustomResourceOptions);
@overload
def WorkspaceRun(resource_name: str,
args: WorkspaceRunArgs,
opts: Optional[ResourceOptions] = None)
@overload
def WorkspaceRun(resource_name: str,
opts: Optional[ResourceOptions] = None,
experiment_id: Optional[str] = None,
run_name: Optional[str] = None,
source_id: Optional[str] = None,
source_type: Optional[str] = None)
func NewWorkspaceRun(ctx *Context, name string, args WorkspaceRunArgs, opts ...ResourceOption) (*WorkspaceRun, error)
public WorkspaceRun(string name, WorkspaceRunArgs args, CustomResourceOptions? opts = null)
public WorkspaceRun(String name, WorkspaceRunArgs args)
public WorkspaceRun(String name, WorkspaceRunArgs args, CustomResourceOptions options)
type: alicloud:pai:WorkspaceRun
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 WorkspaceRunArgs
- 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 WorkspaceRunArgs
- 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 WorkspaceRunArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args WorkspaceRunArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args WorkspaceRunArgs
- 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 workspaceRunResource = new AliCloud.Pai.WorkspaceRun("workspaceRunResource", new()
{
ExperimentId = "string",
RunName = "string",
SourceId = "string",
SourceType = "string",
});
example, err := pai.NewWorkspaceRun(ctx, "workspaceRunResource", &pai.WorkspaceRunArgs{
ExperimentId: pulumi.String("string"),
RunName: pulumi.String("string"),
SourceId: pulumi.String("string"),
SourceType: pulumi.String("string"),
})
var workspaceRunResource = new WorkspaceRun("workspaceRunResource", WorkspaceRunArgs.builder()
.experimentId("string")
.runName("string")
.sourceId("string")
.sourceType("string")
.build());
workspace_run_resource = alicloud.pai.WorkspaceRun("workspaceRunResource",
experiment_id="string",
run_name="string",
source_id="string",
source_type="string")
const workspaceRunResource = new alicloud.pai.WorkspaceRun("workspaceRunResource", {
experimentId: "string",
runName: "string",
sourceId: "string",
sourceType: "string",
});
type: alicloud:pai:WorkspaceRun
properties:
experimentId: string
runName: string
sourceId: string
sourceType: string
WorkspaceRun 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 WorkspaceRun resource accepts the following input properties:
- Experiment
Id string - Resource attribute field of the experiment ID to which Run belongs
- Run
Name string - The name of the resource
- Source
Id string - Attribute Resource field representing the source task ID
- Source
Type string - Resource attribute fields representing the source type
- Experiment
Id string - Resource attribute field of the experiment ID to which Run belongs
- Run
Name string - The name of the resource
- Source
Id string - Attribute Resource field representing the source task ID
- Source
Type string - Resource attribute fields representing the source type
- experiment
Id String - Resource attribute field of the experiment ID to which Run belongs
- run
Name String - The name of the resource
- source
Id String - Attribute Resource field representing the source task ID
- source
Type String - Resource attribute fields representing the source type
- experiment
Id string - Resource attribute field of the experiment ID to which Run belongs
- run
Name string - The name of the resource
- source
Id string - Attribute Resource field representing the source task ID
- source
Type string - Resource attribute fields representing the source type
- experiment_
id str - Resource attribute field of the experiment ID to which Run belongs
- run_
name str - The name of the resource
- source_
id str - Attribute Resource field representing the source task ID
- source_
type str - Resource attribute fields representing the source type
- experiment
Id String - Resource attribute field of the experiment ID to which Run belongs
- run
Name String - The name of the resource
- source
Id String - Attribute Resource field representing the source task ID
- source
Type String - Resource attribute fields representing the source type
Outputs
All input properties are implicitly available as output properties. Additionally, the WorkspaceRun resource produces the following output properties:
- Create
Time string - The creation time of the resource
- Id string
- The provider-assigned unique ID for this managed resource.
- Create
Time string - The creation time of the resource
- Id string
- The provider-assigned unique ID for this managed resource.
- create
Time String - The creation time of the resource
- id String
- The provider-assigned unique ID for this managed resource.
- create
Time string - The creation time of the resource
- id string
- The provider-assigned unique ID for this managed resource.
- create_
time str - The creation time of the resource
- id str
- The provider-assigned unique ID for this managed resource.
- create
Time String - The creation time of the resource
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing WorkspaceRun Resource
Get an existing WorkspaceRun 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?: WorkspaceRunState, opts?: CustomResourceOptions): WorkspaceRun
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
create_time: Optional[str] = None,
experiment_id: Optional[str] = None,
run_name: Optional[str] = None,
source_id: Optional[str] = None,
source_type: Optional[str] = None) -> WorkspaceRun
func GetWorkspaceRun(ctx *Context, name string, id IDInput, state *WorkspaceRunState, opts ...ResourceOption) (*WorkspaceRun, error)
public static WorkspaceRun Get(string name, Input<string> id, WorkspaceRunState? state, CustomResourceOptions? opts = null)
public static WorkspaceRun get(String name, Output<String> id, WorkspaceRunState state, CustomResourceOptions options)
resources: _: type: alicloud:pai:WorkspaceRun 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.
- Create
Time string - The creation time of the resource
- Experiment
Id string - Resource attribute field of the experiment ID to which Run belongs
- Run
Name string - The name of the resource
- Source
Id string - Attribute Resource field representing the source task ID
- Source
Type string - Resource attribute fields representing the source type
- Create
Time string - The creation time of the resource
- Experiment
Id string - Resource attribute field of the experiment ID to which Run belongs
- Run
Name string - The name of the resource
- Source
Id string - Attribute Resource field representing the source task ID
- Source
Type string - Resource attribute fields representing the source type
- create
Time String - The creation time of the resource
- experiment
Id String - Resource attribute field of the experiment ID to which Run belongs
- run
Name String - The name of the resource
- source
Id String - Attribute Resource field representing the source task ID
- source
Type String - Resource attribute fields representing the source type
- create
Time string - The creation time of the resource
- experiment
Id string - Resource attribute field of the experiment ID to which Run belongs
- run
Name string - The name of the resource
- source
Id string - Attribute Resource field representing the source task ID
- source
Type string - Resource attribute fields representing the source type
- create_
time str - The creation time of the resource
- experiment_
id str - Resource attribute field of the experiment ID to which Run belongs
- run_
name str - The name of the resource
- source_
id str - Attribute Resource field representing the source task ID
- source_
type str - Resource attribute fields representing the source type
- create
Time String - The creation time of the resource
- experiment
Id String - Resource attribute field of the experiment ID to which Run belongs
- run
Name String - The name of the resource
- source
Id String - Attribute Resource field representing the source task ID
- source
Type String - Resource attribute fields representing the source type
Import
PAI Workspace Run can be imported using the id, e.g.
$ pulumi import alicloud:pai/workspaceRun:WorkspaceRun example <id>
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.