published on Thursday, Sep 17, 2026 by Pulumi
published on Thursday, Sep 17, 2026 by Pulumi
Provides a Cms Dataset resource.
For information about Cms Dataset and how to use it, see What is Dataset.
NOTE: Available since v1.292.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.log.Project("default", {projectName: name});
const defaultWorkspace = new alicloud.cms.Workspace("default", {
workspaceName: name,
slsProject: _default.projectName,
});
const defaultDataset = new alicloud.cms.Dataset("default", {
workspace: defaultWorkspace.workspaceName,
datasetName: name,
description: "terraform-example",
schema: JSON.stringify({
type: "record",
name: "example",
fields: [{
name: "metric",
type: "string",
}],
}),
});
import pulumi
import json
import pulumi_alicloud as alicloud
config = pulumi.Config()
name = config.get("name")
if name is None:
name = "terraform-example"
default = alicloud.log.Project("default", project_name=name)
default_workspace = alicloud.cms.Workspace("default",
workspace_name=name,
sls_project=default.project_name)
default_dataset = alicloud.cms.Dataset("default",
workspace=default_workspace.workspace_name,
dataset_name=name,
description="terraform-example",
schema=json.dumps({
"type": "record",
"name": "example",
"fields": [{
"name": "metric",
"type": "string",
}],
}))
package main
import (
"encoding/json"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/cms"
"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/log"
"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
}
_default, err := log.NewProject(ctx, "default", &log.ProjectArgs{
ProjectName: pulumi.String(name),
})
if err != nil {
return err
}
defaultWorkspace, err := cms.NewWorkspace(ctx, "default", &cms.WorkspaceArgs{
WorkspaceName: pulumi.String(name),
SlsProject: _default.ProjectName,
})
if err != nil {
return err
}
tmpJSON0, err := json.Marshal(map[string]interface{}{
"type": "record",
"name": "example",
"fields": []map[string]string{
{
"name": "metric",
"type": "string",
},
},
})
if err != nil {
return err
}
json0 := string(tmpJSON0)
_, err = cms.NewDataset(ctx, "default", &cms.DatasetArgs{
Workspace: defaultWorkspace.WorkspaceName,
DatasetName: pulumi.String(name),
Description: pulumi.String("terraform-example"),
Schema: pulumi.String(json0),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
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.Log.Project("default", new()
{
ProjectName = name,
});
var defaultWorkspace = new AliCloud.Cms.Workspace("default", new()
{
WorkspaceName = name,
SlsProject = @default.ProjectName,
});
var defaultDataset = new AliCloud.Cms.Dataset("default", new()
{
Workspace = defaultWorkspace.WorkspaceName,
DatasetName = name,
Description = "terraform-example",
Schema = JsonSerializer.Serialize(new Dictionary<string, object?>
{
["type"] = "record",
["name"] = "example",
["fields"] = new[]
{
new Dictionary<string, object?>
{
["name"] = "metric",
["type"] = "string",
},
},
}),
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.alicloud.log.Project;
import com.pulumi.alicloud.log.ProjectArgs;
import com.pulumi.alicloud.cms.Workspace;
import com.pulumi.alicloud.cms.WorkspaceArgs;
import com.pulumi.alicloud.cms.Dataset;
import com.pulumi.alicloud.cms.DatasetArgs;
import static com.pulumi.codegen.internal.Serialization.*;
import java.util.ArrayList;
import java.util.Arrays;
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 Project("default", ProjectArgs.builder()
.projectName(name)
.build());
var defaultWorkspace = new Workspace("defaultWorkspace", WorkspaceArgs.builder()
.workspaceName(name)
.slsProject(default_.projectName())
.build());
var defaultDataset = new Dataset("defaultDataset", DatasetArgs.builder()
.workspace(defaultWorkspace.workspaceName())
.datasetName(name)
.description("terraform-example")
.schema(serializeJson(
jsonObject(
jsonProperty("type", "record"),
jsonProperty("name", "example"),
jsonProperty("fields", jsonArray(jsonObject(
jsonProperty("name", "metric"),
jsonProperty("type", "string")
)))
)))
.build());
}
}
configuration:
name:
type: string
default: terraform-example
resources:
default:
type: alicloud:log:Project
properties:
projectName: ${name}
defaultWorkspace:
type: alicloud:cms:Workspace
name: default
properties:
workspaceName: ${name}
slsProject: ${default.projectName}
defaultDataset:
type: alicloud:cms:Dataset
name: default
properties:
workspace: ${defaultWorkspace.workspaceName}
datasetName: ${name}
description: terraform-example
schema:
fn::toJSON:
type: record
name: example
fields:
- name: metric
type: string
pulumi {
required_providers {
alicloud = {
source = "pulumi/alicloud"
}
}
}
resource "alicloud_log_project" "default" {
project_name = var.name
}
resource "alicloud_cms_workspace" "default" {
workspace_name = var.name
sls_project = alicloud_log_project.default.project_name
}
resource "alicloud_cms_dataset" "default" {
workspace = alicloud_cms_workspace.default.workspace_name
dataset_name = var.name
description = "terraform-example"
schema = jsonencode({
"type" = "record"
"name" = "example"
"fields" = [{
"name" = "metric"
"type" = "string"
}]
})
}
variable "name" {
type = string
default = "terraform-example"
}
📚 Need more examples? VIEW MORE EXAMPLES
Create Dataset Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Dataset(name: string, args: DatasetArgs, opts?: CustomResourceOptions);@overload
def Dataset(resource_name: str,
args: DatasetArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Dataset(resource_name: str,
opts: Optional[ResourceOptions] = None,
dataset_name: Optional[str] = None,
schema: Optional[str] = None,
workspace: Optional[str] = None,
description: Optional[str] = None)func NewDataset(ctx *Context, name string, args DatasetArgs, opts ...ResourceOption) (*Dataset, error)public Dataset(string name, DatasetArgs args, CustomResourceOptions? opts = null)
public Dataset(String name, DatasetArgs args)
public Dataset(String name, DatasetArgs args, CustomResourceOptions options)
type: alicloud:cms:Dataset
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "alicloud_cms_dataset" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args DatasetArgs
- 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 DatasetArgs
- 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 DatasetArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DatasetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args DatasetArgs
- 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 datasetResource = new AliCloud.Cms.Dataset("datasetResource", new()
{
DatasetName = "string",
Schema = "string",
Workspace = "string",
Description = "string",
});
example, err := cms.NewDataset(ctx, "datasetResource", &cms.DatasetArgs{
DatasetName: pulumi.String("string"),
Schema: pulumi.String("string"),
Workspace: pulumi.String("string"),
Description: pulumi.String("string"),
})
resource "alicloud_cms_dataset" "datasetResource" {
lifecycle {
create_before_destroy = true
}
dataset_name = "string"
schema = "string"
workspace = "string"
description = "string"
}
var datasetResource = new Dataset("datasetResource", DatasetArgs.builder()
.datasetName("string")
.schema("string")
.workspace("string")
.description("string")
.build());
dataset_resource = alicloud.cms.Dataset("datasetResource",
dataset_name="string",
schema="string",
workspace="string",
description="string")
const datasetResource = new alicloud.cms.Dataset("datasetResource", {
datasetName: "string",
schema: "string",
workspace: "string",
description: "string",
});
type: alicloud:cms:Dataset
properties:
datasetName: string
description: string
schema: string
workspace: string
Dataset 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 Dataset resource accepts the following input properties:
- Dataset
Name string - The name of the resource.
- Schema string
- The schema definition of the dataset, in JSON format.
- Workspace string
- The name of the workspace to which the dataset belongs.
- Description string
- The description of the dataset.
- Dataset
Name string - The name of the resource.
- Schema string
- The schema definition of the dataset, in JSON format.
- Workspace string
- The name of the workspace to which the dataset belongs.
- Description string
- The description of the dataset.
- dataset_
name string - The name of the resource.
- schema string
- The schema definition of the dataset, in JSON format.
- workspace string
- The name of the workspace to which the dataset belongs.
- description string
- The description of the dataset.
- dataset
Name String - The name of the resource.
- schema String
- The schema definition of the dataset, in JSON format.
- workspace String
- The name of the workspace to which the dataset belongs.
- description String
- The description of the dataset.
- dataset
Name string - The name of the resource.
- schema string
- The schema definition of the dataset, in JSON format.
- workspace string
- The name of the workspace to which the dataset belongs.
- description string
- The description of the dataset.
- dataset_
name str - The name of the resource.
- schema str
- The schema definition of the dataset, in JSON format.
- workspace str
- The name of the workspace to which the dataset belongs.
- description str
- The description of the dataset.
- dataset
Name String - The name of the resource.
- schema String
- The schema definition of the dataset, in JSON format.
- workspace String
- The name of the workspace to which the dataset belongs.
- description String
- The description of the dataset.
Outputs
All input properties are implicitly available as output properties. Additionally, the Dataset 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.
- Region
Id string - The region ID of the resource.
- Update
Time string - The last modified time of the resource.
- Create
Time string - The creation time of the resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- Region
Id string - The region ID of the resource.
- Update
Time string - The last modified time of the resource.
- create_
time string - The creation time of the resource.
- id string
- The provider-assigned unique ID for this managed resource.
- region_
id string - The region ID of the resource.
- update_
time string - The last modified time of the resource.
- create
Time String - The creation time of the resource.
- id String
- The provider-assigned unique ID for this managed resource.
- region
Id String - The region ID of the resource.
- update
Time String - The last modified time of the resource.
- create
Time string - The creation time of the resource.
- id string
- The provider-assigned unique ID for this managed resource.
- region
Id string - The region ID of the resource.
- update
Time string - The last modified time of the resource.
- create_
time str - The creation time of the resource.
- id str
- The provider-assigned unique ID for this managed resource.
- region_
id str - The region ID of the resource.
- update_
time str - The last modified time of the resource.
- create
Time String - The creation time of the resource.
- id String
- The provider-assigned unique ID for this managed resource.
- region
Id String - The region ID of the resource.
- update
Time String - The last modified time of the resource.
Look up Existing Dataset Resource
Get an existing Dataset 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?: DatasetState, opts?: CustomResourceOptions): Dataset@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
create_time: Optional[str] = None,
dataset_name: Optional[str] = None,
description: Optional[str] = None,
region_id: Optional[str] = None,
schema: Optional[str] = None,
update_time: Optional[str] = None,
workspace: Optional[str] = None) -> Datasetfunc GetDataset(ctx *Context, name string, id IDInput, state *DatasetState, opts ...ResourceOption) (*Dataset, error)public static Dataset Get(string name, Input<string> id, DatasetState? state, CustomResourceOptions? opts = null)public static Dataset get(String name, Output<String> id, DatasetState state, CustomResourceOptions options)resources: _: type: alicloud:cms:Dataset get: id: ${id}import {
to = alicloud_cms_dataset.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.
- Create
Time string - The creation time of the resource.
- Dataset
Name string - The name of the resource.
- Description string
- The description of the dataset.
- Region
Id string - The region ID of the resource.
- Schema string
- The schema definition of the dataset, in JSON format.
- Update
Time string - The last modified time of the resource.
- Workspace string
- The name of the workspace to which the dataset belongs.
- Create
Time string - The creation time of the resource.
- Dataset
Name string - The name of the resource.
- Description string
- The description of the dataset.
- Region
Id string - The region ID of the resource.
- Schema string
- The schema definition of the dataset, in JSON format.
- Update
Time string - The last modified time of the resource.
- Workspace string
- The name of the workspace to which the dataset belongs.
- create_
time string - The creation time of the resource.
- dataset_
name string - The name of the resource.
- description string
- The description of the dataset.
- region_
id string - The region ID of the resource.
- schema string
- The schema definition of the dataset, in JSON format.
- update_
time string - The last modified time of the resource.
- workspace string
- The name of the workspace to which the dataset belongs.
- create
Time String - The creation time of the resource.
- dataset
Name String - The name of the resource.
- description String
- The description of the dataset.
- region
Id String - The region ID of the resource.
- schema String
- The schema definition of the dataset, in JSON format.
- update
Time String - The last modified time of the resource.
- workspace String
- The name of the workspace to which the dataset belongs.
- create
Time string - The creation time of the resource.
- dataset
Name string - The name of the resource.
- description string
- The description of the dataset.
- region
Id string - The region ID of the resource.
- schema string
- The schema definition of the dataset, in JSON format.
- update
Time string - The last modified time of the resource.
- workspace string
- The name of the workspace to which the dataset belongs.
- create_
time str - The creation time of the resource.
- dataset_
name str - The name of the resource.
- description str
- The description of the dataset.
- region_
id str - The region ID of the resource.
- schema str
- The schema definition of the dataset, in JSON format.
- update_
time str - The last modified time of the resource.
- workspace str
- The name of the workspace to which the dataset belongs.
- create
Time String - The creation time of the resource.
- dataset
Name String - The name of the resource.
- description String
- The description of the dataset.
- region
Id String - The region ID of the resource.
- schema String
- The schema definition of the dataset, in JSON format.
- update
Time String - The last modified time of the resource.
- workspace String
- The name of the workspace to which the dataset belongs.
Import
Cms Dataset can be imported using the id, e.g.
$ pulumi import alicloud:cms/dataset:Dataset example <workspace>:<dataset_name>
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
alicloudTerraform Provider.
published on Thursday, Sep 17, 2026 by Pulumi