1. Packages
  2. Hsdp Provider
  3. API Docs
  4. AiWorkspaceComputeTarget
hsdp 0.65.3 published on Tuesday, Apr 15, 2025 by philips-software

hsdp.AiWorkspaceComputeTarget

Explore with Pulumi AI

hsdp logo
hsdp 0.65.3 published on Tuesday, Apr 15, 2025 by philips-software

    Manages HSDP AI Workspace compute targets

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as hsdp from "@pulumi/hsdp";
    
    const workspace = hsdp.getConfig({
        service: "workspace",
    });
    const ws = workspace.then(workspace => hsdp.getAiWorkspaceServiceInstance({
        baseUrl: workspace.url,
        organizationId: _var.workspace_tenant_org_id,
    }));
    const target = new hsdp.AiInferenceComputeTarget("target", {
        endpoint: data.hsdp_ai_inference_service_instance.inference.endpoint,
        description: "First Compute Target",
        instanceType: "ml.p3.16xlarge",
        storage: 20,
    }, {
        dependsOn: [module["ai-inference-onboarding"]],
    });
    const workspace1 = new hsdp.AiWorkspace("workspace1", {
        endpoint: data.hsdp_ai_inference_service_instance.inference.endpoint,
        description: "Test workspace for my world changing algorithm",
        computeTarget: {
            identifier: hsdp_ai_workspace_compute_target.target.id,
        },
        sourceCode: {
            url: "git@github.com:loafoe/algo.git",
            branch: "main",
            commitId: "e1f9366",
            sshKey: "...",
        },
        labels: ["CNN"],
    });
    
    import pulumi
    import pulumi_hsdp as hsdp
    
    workspace = hsdp.get_config(service="workspace")
    ws = hsdp.get_ai_workspace_service_instance(base_url=workspace.url,
        organization_id=var["workspace_tenant_org_id"])
    target = hsdp.AiInferenceComputeTarget("target",
        endpoint=data["hsdp_ai_inference_service_instance"]["inference"]["endpoint"],
        description="First Compute Target",
        instance_type="ml.p3.16xlarge",
        storage=20,
        opts = pulumi.ResourceOptions(depends_on=[module["ai-inference-onboarding"]]))
    workspace1 = hsdp.AiWorkspace("workspace1",
        endpoint=data["hsdp_ai_inference_service_instance"]["inference"]["endpoint"],
        description="Test workspace for my world changing algorithm",
        compute_target={
            "identifier": hsdp_ai_workspace_compute_target["target"]["id"],
        },
        source_code={
            "url": "git@github.com:loafoe/algo.git",
            "branch": "main",
            "commit_id": "e1f9366",
            "ssh_key": "...",
        },
        labels=["CNN"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/hsdp/hsdp"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		workspace, err := hsdp.GetConfig(ctx, &hsdp.GetConfigArgs{
    			Service: "workspace",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = hsdp.GetAiWorkspaceServiceInstance(ctx, &hsdp.GetAiWorkspaceServiceInstanceArgs{
    			BaseUrl:        workspace.Url,
    			OrganizationId: _var.Workspace_tenant_org_id,
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = hsdp.NewAiInferenceComputeTarget(ctx, "target", &hsdp.AiInferenceComputeTargetArgs{
    			Endpoint:     pulumi.Any(data.Hsdp_ai_inference_service_instance.Inference.Endpoint),
    			Description:  pulumi.String("First Compute Target"),
    			InstanceType: pulumi.String("ml.p3.16xlarge"),
    			Storage:      pulumi.Float64(20),
    		}, pulumi.DependsOn([]pulumi.Resource{
    			module.AiInferenceOnboarding,
    		}))
    		if err != nil {
    			return err
    		}
    		_, err = hsdp.NewAiWorkspace(ctx, "workspace1", &hsdp.AiWorkspaceArgs{
    			Endpoint:    pulumi.Any(data.Hsdp_ai_inference_service_instance.Inference.Endpoint),
    			Description: pulumi.String("Test workspace for my world changing algorithm"),
    			ComputeTarget: &hsdp.AiWorkspaceComputeTargetTypeArgs{
    				Identifier: pulumi.Any(hsdp_ai_workspace_compute_target.Target.Id),
    			},
    			SourceCode: &hsdp.AiWorkspaceSourceCodeArgs{
    				Url:      pulumi.String("git@github.com:loafoe/algo.git"),
    				Branch:   pulumi.String("main"),
    				CommitId: pulumi.String("e1f9366"),
    				SshKey:   pulumi.String("..."),
    			},
    			Labels: pulumi.StringArray{
    				pulumi.String("CNN"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Hsdp = Pulumi.Hsdp;
    
    return await Deployment.RunAsync(() => 
    {
        var workspace = Hsdp.GetConfig.Invoke(new()
        {
            Service = "workspace",
        });
    
        var ws = Hsdp.GetAiWorkspaceServiceInstance.Invoke(new()
        {
            BaseUrl = workspace.Apply(getConfigResult => getConfigResult.Url),
            OrganizationId = @var.Workspace_tenant_org_id,
        });
    
        var target = new Hsdp.AiInferenceComputeTarget("target", new()
        {
            Endpoint = data.Hsdp_ai_inference_service_instance.Inference.Endpoint,
            Description = "First Compute Target",
            InstanceType = "ml.p3.16xlarge",
            Storage = 20,
        }, new CustomResourceOptions
        {
            DependsOn =
            {
                module.Ai_inference_onboarding,
            },
        });
    
        var workspace1 = new Hsdp.AiWorkspace("workspace1", new()
        {
            Endpoint = data.Hsdp_ai_inference_service_instance.Inference.Endpoint,
            Description = "Test workspace for my world changing algorithm",
            ComputeTarget = new Hsdp.Inputs.AiWorkspaceComputeTargetArgs
            {
                Identifier = hsdp_ai_workspace_compute_target.Target.Id,
            },
            SourceCode = new Hsdp.Inputs.AiWorkspaceSourceCodeArgs
            {
                Url = "git@github.com:loafoe/algo.git",
                Branch = "main",
                CommitId = "e1f9366",
                SshKey = "...",
            },
            Labels = new[]
            {
                "CNN",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.hsdp.HsdpFunctions;
    import com.pulumi.hsdp.inputs.GetConfigArgs;
    import com.pulumi.hsdp.inputs.GetAiWorkspaceServiceInstanceArgs;
    import com.pulumi.hsdp.AiInferenceComputeTarget;
    import com.pulumi.hsdp.AiInferenceComputeTargetArgs;
    import com.pulumi.hsdp.AiWorkspace;
    import com.pulumi.hsdp.AiWorkspaceArgs;
    import com.pulumi.hsdp.inputs.AiWorkspaceComputeTargetArgs;
    import com.pulumi.hsdp.inputs.AiWorkspaceSourceCodeArgs;
    import com.pulumi.resources.CustomResourceOptions;
    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 workspace = HsdpFunctions.getConfig(GetConfigArgs.builder()
                .service("workspace")
                .build());
    
            final var ws = HsdpFunctions.getAiWorkspaceServiceInstance(GetAiWorkspaceServiceInstanceArgs.builder()
                .baseUrl(workspace.applyValue(getConfigResult -> getConfigResult.url()))
                .organizationId(var_.workspace_tenant_org_id())
                .build());
    
            var target = new AiInferenceComputeTarget("target", AiInferenceComputeTargetArgs.builder()
                .endpoint(data.hsdp_ai_inference_service_instance().inference().endpoint())
                .description("First Compute Target")
                .instanceType("ml.p3.16xlarge")
                .storage(20)
                .build(), CustomResourceOptions.builder()
                    .dependsOn(module.ai-inference-onboarding())
                    .build());
    
            var workspace1 = new AiWorkspace("workspace1", AiWorkspaceArgs.builder()
                .endpoint(data.hsdp_ai_inference_service_instance().inference().endpoint())
                .description("Test workspace for my world changing algorithm")
                .computeTarget(AiWorkspaceComputeTargetArgs.builder()
                    .identifier(hsdp_ai_workspace_compute_target.target().id())
                    .build())
                .sourceCode(AiWorkspaceSourceCodeArgs.builder()
                    .url("git@github.com:loafoe/algo.git")
                    .branch("main")
                    .commitId("e1f9366")
                    .sshKey("...")
                    .build())
                .labels("CNN")
                .build());
    
        }
    }
    
    resources:
      target:
        type: hsdp:AiInferenceComputeTarget
        properties:
          endpoint: ${data.hsdp_ai_inference_service_instance.inference.endpoint}
          description: First Compute Target
          instanceType: ml.p3.16xlarge
          storage: 20
        options:
          dependsOn:
            - ${module"ai-inference-onboarding"[%!s(MISSING)]}
      workspace1:
        type: hsdp:AiWorkspace
        properties:
          endpoint: ${data.hsdp_ai_inference_service_instance.inference.endpoint}
          description: Test workspace for my world changing algorithm
          computeTarget:
            identifier: ${hsdp_ai_workspace_compute_target.target.id}
          sourceCode:
            url: git@github.com:loafoe/algo.git
            branch: main
            commitId: e1f9366
            sshKey: '...'
          labels:
            - CNN
    variables:
      workspace:
        fn::invoke:
          function: hsdp:getConfig
          arguments:
            service: workspace
      ws:
        fn::invoke:
          function: hsdp:getAiWorkspaceServiceInstance
          arguments:
            baseUrl: ${workspace.url}
            organizationId: ${var.workspace_tenant_org_id}
    

    Create AiWorkspaceComputeTarget Resource

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

    Constructor syntax

    new AiWorkspaceComputeTarget(name: string, args: AiWorkspaceComputeTargetArgs, opts?: CustomResourceOptions);
    @overload
    def AiWorkspaceComputeTarget(resource_name: str,
                                 args: AiWorkspaceComputeTargetInitArgs,
                                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def AiWorkspaceComputeTarget(resource_name: str,
                                 opts: Optional[ResourceOptions] = None,
                                 endpoint: Optional[str] = None,
                                 instance_type: Optional[str] = None,
                                 storage: Optional[float] = None,
                                 ai_workspace_compute_target_id: Optional[str] = None,
                                 description: Optional[str] = None,
                                 name: Optional[str] = None)
    func NewAiWorkspaceComputeTarget(ctx *Context, name string, args AiWorkspaceComputeTargetArgs, opts ...ResourceOption) (*AiWorkspaceComputeTarget, error)
    public AiWorkspaceComputeTarget(string name, AiWorkspaceComputeTargetArgs args, CustomResourceOptions? opts = null)
    public AiWorkspaceComputeTarget(String name, AiWorkspaceComputeTargetArgs args)
    public AiWorkspaceComputeTarget(String name, AiWorkspaceComputeTargetArgs args, CustomResourceOptions options)
    
    type: hsdp:AiWorkspaceComputeTarget
    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 AiWorkspaceComputeTargetArgs
    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 AiWorkspaceComputeTargetInitArgs
    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 AiWorkspaceComputeTargetArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AiWorkspaceComputeTargetArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AiWorkspaceComputeTargetArgs
    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 aiWorkspaceComputeTargetResource = new Hsdp.AiWorkspaceComputeTarget("aiWorkspaceComputeTargetResource", new()
    {
        Endpoint = "string",
        InstanceType = "string",
        Storage = 0,
        AiWorkspaceComputeTargetId = "string",
        Description = "string",
        Name = "string",
    });
    
    example, err := hsdp.NewAiWorkspaceComputeTarget(ctx, "aiWorkspaceComputeTargetResource", &hsdp.AiWorkspaceComputeTargetArgs{
    	Endpoint:                   pulumi.String("string"),
    	InstanceType:               pulumi.String("string"),
    	Storage:                    pulumi.Float64(0),
    	AiWorkspaceComputeTargetId: pulumi.String("string"),
    	Description:                pulumi.String("string"),
    	Name:                       pulumi.String("string"),
    })
    
    var aiWorkspaceComputeTargetResource = new AiWorkspaceComputeTarget("aiWorkspaceComputeTargetResource", AiWorkspaceComputeTargetArgs.builder()
        .endpoint("string")
        .instanceType("string")
        .storage(0)
        .aiWorkspaceComputeTargetId("string")
        .description("string")
        .name("string")
        .build());
    
    ai_workspace_compute_target_resource = hsdp.AiWorkspaceComputeTarget("aiWorkspaceComputeTargetResource",
        endpoint="string",
        instance_type="string",
        storage=0,
        ai_workspace_compute_target_id="string",
        description="string",
        name="string")
    
    const aiWorkspaceComputeTargetResource = new hsdp.AiWorkspaceComputeTarget("aiWorkspaceComputeTargetResource", {
        endpoint: "string",
        instanceType: "string",
        storage: 0,
        aiWorkspaceComputeTargetId: "string",
        description: "string",
        name: "string",
    });
    
    type: hsdp:AiWorkspaceComputeTarget
    properties:
        aiWorkspaceComputeTargetId: string
        description: string
        endpoint: string
        instanceType: string
        name: string
        storage: 0
    

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

    Endpoint string
    The AI Inference instance endpoint
    InstanceType string
    The instance type
    Storage double
    The storage to allocate
    AiWorkspaceComputeTargetId string
    The GUID of the Model
    Description string
    Name string
    The name of the Model
    Endpoint string
    The AI Inference instance endpoint
    InstanceType string
    The instance type
    Storage float64
    The storage to allocate
    AiWorkspaceComputeTargetId string
    The GUID of the Model
    Description string
    Name string
    The name of the Model
    endpoint String
    The AI Inference instance endpoint
    instanceType String
    The instance type
    storage Double
    The storage to allocate
    aiWorkspaceComputeTargetId String
    The GUID of the Model
    description String
    name String
    The name of the Model
    endpoint string
    The AI Inference instance endpoint
    instanceType string
    The instance type
    storage number
    The storage to allocate
    aiWorkspaceComputeTargetId string
    The GUID of the Model
    description string
    name string
    The name of the Model
    endpoint str
    The AI Inference instance endpoint
    instance_type str
    The instance type
    storage float
    The storage to allocate
    ai_workspace_compute_target_id str
    The GUID of the Model
    description str
    name str
    The name of the Model
    endpoint String
    The AI Inference instance endpoint
    instanceType String
    The instance type
    storage Number
    The storage to allocate
    aiWorkspaceComputeTargetId String
    The GUID of the Model
    description String
    name String
    The name of the Model

    Outputs

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

    Created string
    The date this Model was created
    CreatedBy string
    Who created the Model
    Id string
    The provider-assigned unique ID for this managed resource.
    IsFactory bool
    Reference string
    Created string
    The date this Model was created
    CreatedBy string
    Who created the Model
    Id string
    The provider-assigned unique ID for this managed resource.
    IsFactory bool
    Reference string
    created String
    The date this Model was created
    createdBy String
    Who created the Model
    id String
    The provider-assigned unique ID for this managed resource.
    isFactory Boolean
    reference String
    created string
    The date this Model was created
    createdBy string
    Who created the Model
    id string
    The provider-assigned unique ID for this managed resource.
    isFactory boolean
    reference string
    created str
    The date this Model was created
    created_by str
    Who created the Model
    id str
    The provider-assigned unique ID for this managed resource.
    is_factory bool
    reference str
    created String
    The date this Model was created
    createdBy String
    Who created the Model
    id String
    The provider-assigned unique ID for this managed resource.
    isFactory Boolean
    reference String

    Look up Existing AiWorkspaceComputeTarget Resource

    Get an existing AiWorkspaceComputeTarget 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?: AiWorkspaceComputeTargetState, opts?: CustomResourceOptions): AiWorkspaceComputeTarget
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            ai_workspace_compute_target_id: Optional[str] = None,
            created: Optional[str] = None,
            created_by: Optional[str] = None,
            description: Optional[str] = None,
            endpoint: Optional[str] = None,
            instance_type: Optional[str] = None,
            is_factory: Optional[bool] = None,
            name: Optional[str] = None,
            reference: Optional[str] = None,
            storage: Optional[float] = None) -> AiWorkspaceComputeTarget
    func GetAiWorkspaceComputeTarget(ctx *Context, name string, id IDInput, state *AiWorkspaceComputeTargetState, opts ...ResourceOption) (*AiWorkspaceComputeTarget, error)
    public static AiWorkspaceComputeTarget Get(string name, Input<string> id, AiWorkspaceComputeTargetState? state, CustomResourceOptions? opts = null)
    public static AiWorkspaceComputeTarget get(String name, Output<String> id, AiWorkspaceComputeTargetState state, CustomResourceOptions options)
    resources:  _:    type: hsdp:AiWorkspaceComputeTarget    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:
    AiWorkspaceComputeTargetId string
    The GUID of the Model
    Created string
    The date this Model was created
    CreatedBy string
    Who created the Model
    Description string
    Endpoint string
    The AI Inference instance endpoint
    InstanceType string
    The instance type
    IsFactory bool
    Name string
    The name of the Model
    Reference string
    Storage double
    The storage to allocate
    AiWorkspaceComputeTargetId string
    The GUID of the Model
    Created string
    The date this Model was created
    CreatedBy string
    Who created the Model
    Description string
    Endpoint string
    The AI Inference instance endpoint
    InstanceType string
    The instance type
    IsFactory bool
    Name string
    The name of the Model
    Reference string
    Storage float64
    The storage to allocate
    aiWorkspaceComputeTargetId String
    The GUID of the Model
    created String
    The date this Model was created
    createdBy String
    Who created the Model
    description String
    endpoint String
    The AI Inference instance endpoint
    instanceType String
    The instance type
    isFactory Boolean
    name String
    The name of the Model
    reference String
    storage Double
    The storage to allocate
    aiWorkspaceComputeTargetId string
    The GUID of the Model
    created string
    The date this Model was created
    createdBy string
    Who created the Model
    description string
    endpoint string
    The AI Inference instance endpoint
    instanceType string
    The instance type
    isFactory boolean
    name string
    The name of the Model
    reference string
    storage number
    The storage to allocate
    ai_workspace_compute_target_id str
    The GUID of the Model
    created str
    The date this Model was created
    created_by str
    Who created the Model
    description str
    endpoint str
    The AI Inference instance endpoint
    instance_type str
    The instance type
    is_factory bool
    name str
    The name of the Model
    reference str
    storage float
    The storage to allocate
    aiWorkspaceComputeTargetId String
    The GUID of the Model
    created String
    The date this Model was created
    createdBy String
    Who created the Model
    description String
    endpoint String
    The AI Inference instance endpoint
    instanceType String
    The instance type
    isFactory Boolean
    name String
    The name of the Model
    reference String
    storage Number
    The storage to allocate

    Package Details

    Repository
    hsdp philips-software/terraform-provider-hsdp
    License
    Notes
    This Pulumi package is based on the hsdp Terraform Provider.
    hsdp logo
    hsdp 0.65.3 published on Tuesday, Apr 15, 2025 by philips-software