alicloud_pai_workspace_dataset

更新时间:

Provides a PAI Workspace Dataset resource.

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

-> NOTE: Available since v1.236.0.

Example Usage

Basic Usage


provider "alicloud" {
  region = "cn-hangzhou"
}

variable "name" {
  default = "terraform_example"
}

resource "alicloud_pai_workspace_workspace" "defaultWorkspace" {
  description    = var.name
  display_name   = var.name
  workspace_name = var.name
  env_types      = ["prod"]
}


resource "alicloud_pai_workspace_dataset" "default" {
  options          = jsonencode({ "mountPath" : "/mnt/data/" })
  description      = var.name
  accessibility    = "PRIVATE"
  dataset_name     = var.name
  data_source_type = "NAS"
  source_type      = "ITAG"
  workspace_id     = alicloud_pai_workspace_workspace.defaultWorkspace.id
  data_type        = "PIC"
  property         = "DIRECTORY"
  uri              = "nas://086b649545.cn-hangzhou/"
  source_id        = "d-xxxxx_v1"
  user_id          = "1511928242963727"
}

Argument Reference

The following arguments are supported:

  • accessibility - (Optional, Computed) Workspace visibility. The following values are supported:

    • PRIVATE (default): indicates that the workspace is visible to itself and the administrator.
    • PUBLIC: The workspace is visible to all users.
  • data_source_type - (Required, ForceNew) The data source type. The following values are supported:

    • OSS: Alibaba Cloud Object Storage (OSS).
    • NAS: Alibaba cloud file storage (NAS).
  • data_type - (Optional, ForceNew, Computed) The dataset type. The default value is COMMON. The following values are supported:

    • COMMON: COMMON.
    • PIC: picture.
    • TEXT: TEXT.
    • VIDEO: VIDEO.
    • AUDIO: AUDIO.
  • dataset_name - (Required) The name of the dataset. The naming rules are as follows:

    • Start with a lowercase letter, uppercase letter, number, or Chinese.
    • Can contain an underscore (_) or a dash (-).
    • 1~127 characters in length.
  • description - (Optional) Custom descriptions of datasets to distinguish between different datasets.

  • labels - (Optional, List) Labels added to the dataset See labels below.

  • options - (Optional) The extended field, which is of the JsonString type.

    When DLC uses a dataset, you can specify the default Mount path for the dataset by configuring the mountPath field.

  • property - (Required, ForceNew) The properties of the dataset. The following values are supported:

    • FILE: FILE.
    • DIRECTORY: folder.
  • source_id - (Optional, ForceNew) The data source ID.

    • When the SourceType is USER, SourceId can be customized.
    • When SourceType is ITAG, that is, when the iTAG module labels the data set generated by the result, SourceId is the task ID of ITAG.
    • When SourceType is PAI_PUBLIC_DATASET, that is, a dataset created using PAI public datasets, SourceId is empty by default.
  • source_type - (Optional, ForceNew, Computed) The data source type. The default value is USER. The following values are supported:

    • PAI-PUBLIC-DATASET:PAI public dataset.
    • ITAG: The dataset generated by the iTAG module annotation result.
    • USER: The data set registered by the USER.
  • uri - (Required, ForceNew) The Uri configuration sample is as follows:

    • The data source type is OSS:'oss:// bucket.endpoint/object'
    • The data source type is NAS:

    The general NAS format is: 'nas://.region/subpath/to/dir/';

    CPFS1.0:'nas://.region/subpath/to/dir /';

    CPFS2.0:'nas://.region//'.

    CPFS1.0 and CPFS2.0 are distinguished by the format of fsid: CPFS1.0 is cpfs-;CPFS2.0 is cpfs-.

  • user_id - (Optional, ForceNew) The ID of the dataset owner.

  • workspace_id - (Required, ForceNew) The ID of the workspace where the dataset is located. For details about how to obtain the workspace ID, see [ListWorkspaces](~~ 449124 ~~).

    If this parameter is not configured, the default workspace is used. If the default workspace does not exist, an error is reported.

labels

The labels supports the following:

  • key - (Optional) The key of the tag. The length is limited to 128 bytes. "=" and "," are not supported.
  • value - (Optional) The value of the tag. The length is limited to 128 bytes. "=" and "," are not supported.

Attributes Reference

The following attributes are exported:

  • id - The ID of the resource supplied above.
  • create_time - The creation time of the resource

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 5 mins) Used when create the Dataset.
  • delete - (Defaults to 5 mins) Used when delete the Dataset.
  • update - (Defaults to 5 mins) Used when update the Dataset.

Import

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

$ terraform import alicloud_pai_workspace_dataset.example <id>