1. Packages
  2. Alibaba Cloud Provider
  3. API Docs
  4. log
  5. Dashboard
Alibaba Cloud v3.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

alicloud.log.Dashboard

Explore with Pulumi AI

The dashboard is a real-time data analysis platform provided by the log service. You can display frequently used query and analysis statements in the form of charts and save statistical charts to the dashboard. Refer to details.

NOTE: Available since v1.86.0.

Example Usage

Basic Usage

import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";
import * as random from "@pulumi/random";

const _default = new random.index.Integer("default", {
    max: 99999,
    min: 10000,
});
const example = new alicloud.log.Project("example", {
    projectName: `terraform-example-${_default.result}`,
    description: "terraform-example",
});
const exampleStore = new alicloud.log.Store("example", {
    projectName: example.projectName,
    logstoreName: "example-store",
    shardCount: 3,
    autoSplit: true,
    maxSplitShardCount: 60,
    appendMeta: true,
});
const exampleDashboard = new alicloud.log.Dashboard("example", {
    projectName: example.projectName,
    dashboardName: "terraform-example",
    displayName: "terraform-example",
    attribute: `  {
    "type":"grid"
  }
`,
    charList: `  [
    {
      "action": {},
      "title":"new_title",
      "type":"map",
      "search":{
        "logstore":"example-store",
        "topic":"new_topic",
        "query":"* | SELECT COUNT(name) as ct_name, COUNT(product) as ct_product, name,product GROUP BY name,product",
        "start":"-86400s",
        "end":"now"
      },
      "display":{
        "xAxis":[
          "ct_name"
        ],
        "yAxis":[
          "ct_product"
        ],
        "xPos":0,
        "yPos":0,
        "width":10,
        "height":12,
        "displayName":"terraform-example"
      }
    }
  ]
`,
});
Copy
import pulumi
import pulumi_alicloud as alicloud
import pulumi_random as random

default = random.index.Integer("default",
    max=99999,
    min=10000)
example = alicloud.log.Project("example",
    project_name=f"terraform-example-{default['result']}",
    description="terraform-example")
example_store = alicloud.log.Store("example",
    project_name=example.project_name,
    logstore_name="example-store",
    shard_count=3,
    auto_split=True,
    max_split_shard_count=60,
    append_meta=True)
example_dashboard = alicloud.log.Dashboard("example",
    project_name=example.project_name,
    dashboard_name="terraform-example",
    display_name="terraform-example",
    attribute="""  {
    "type":"grid"
  }
""",
    char_list="""  [
    {
      "action": {},
      "title":"new_title",
      "type":"map",
      "search":{
        "logstore":"example-store",
        "topic":"new_topic",
        "query":"* | SELECT COUNT(name) as ct_name, COUNT(product) as ct_product, name,product GROUP BY name,product",
        "start":"-86400s",
        "end":"now"
      },
      "display":{
        "xAxis":[
          "ct_name"
        ],
        "yAxis":[
          "ct_product"
        ],
        "xPos":0,
        "yPos":0,
        "width":10,
        "height":12,
        "displayName":"terraform-example"
      }
    }
  ]
""")
Copy
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-alicloud/sdk/v3/go/alicloud/log"
	"github.com/pulumi/pulumi-random/sdk/v4/go/random"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_default, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
			Max: 99999,
			Min: 10000,
		})
		if err != nil {
			return err
		}
		example, err := log.NewProject(ctx, "example", &log.ProjectArgs{
			ProjectName: pulumi.Sprintf("terraform-example-%v", _default.Result),
			Description: pulumi.String("terraform-example"),
		})
		if err != nil {
			return err
		}
		_, err = log.NewStore(ctx, "example", &log.StoreArgs{
			ProjectName:        example.ProjectName,
			LogstoreName:       pulumi.String("example-store"),
			ShardCount:         pulumi.Int(3),
			AutoSplit:          pulumi.Bool(true),
			MaxSplitShardCount: pulumi.Int(60),
			AppendMeta:         pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		_, err = log.NewDashboard(ctx, "example", &log.DashboardArgs{
			ProjectName:   example.ProjectName,
			DashboardName: pulumi.String("terraform-example"),
			DisplayName:   pulumi.String("terraform-example"),
			Attribute:     pulumi.String("  {\n    \"type\":\"grid\"\n  }\n"),
			CharList: pulumi.String(`  [
    {
      "action": {},
      "title":"new_title",
      "type":"map",
      "search":{
        "logstore":"example-store",
        "topic":"new_topic",
        "query":"* | SELECT COUNT(name) as ct_name, COUNT(product) as ct_product, name,product GROUP BY name,product",
        "start":"-86400s",
        "end":"now"
      },
      "display":{
        "xAxis":[
          "ct_name"
        ],
        "yAxis":[
          "ct_product"
        ],
        "xPos":0,
        "yPos":0,
        "width":10,
        "height":12,
        "displayName":"terraform-example"
      }
    }
  ]
`),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AliCloud = Pulumi.AliCloud;
using Random = Pulumi.Random;

return await Deployment.RunAsync(() => 
{
    var @default = new Random.Index.Integer("default", new()
    {
        Max = 99999,
        Min = 10000,
    });

    var example = new AliCloud.Log.Project("example", new()
    {
        ProjectName = $"terraform-example-{@default.Result}",
        Description = "terraform-example",
    });

    var exampleStore = new AliCloud.Log.Store("example", new()
    {
        ProjectName = example.ProjectName,
        LogstoreName = "example-store",
        ShardCount = 3,
        AutoSplit = true,
        MaxSplitShardCount = 60,
        AppendMeta = true,
    });

    var exampleDashboard = new AliCloud.Log.Dashboard("example", new()
    {
        ProjectName = example.ProjectName,
        DashboardName = "terraform-example",
        DisplayName = "terraform-example",
        Attribute = @"  {
    ""type"":""grid""
  }
",
        CharList = @"  [
    {
      ""action"": {},
      ""title"":""new_title"",
      ""type"":""map"",
      ""search"":{
        ""logstore"":""example-store"",
        ""topic"":""new_topic"",
        ""query"":""* | SELECT COUNT(name) as ct_name, COUNT(product) as ct_product, name,product GROUP BY name,product"",
        ""start"":""-86400s"",
        ""end"":""now""
      },
      ""display"":{
        ""xAxis"":[
          ""ct_name""
        ],
        ""yAxis"":[
          ""ct_product""
        ],
        ""xPos"":0,
        ""yPos"":0,
        ""width"":10,
        ""height"":12,
        ""displayName"":""terraform-example""
      }
    }
  ]
",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.random.integer;
import com.pulumi.random.IntegerArgs;
import com.pulumi.alicloud.log.Project;
import com.pulumi.alicloud.log.ProjectArgs;
import com.pulumi.alicloud.log.Store;
import com.pulumi.alicloud.log.StoreArgs;
import com.pulumi.alicloud.log.Dashboard;
import com.pulumi.alicloud.log.DashboardArgs;
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) {
        var default_ = new Integer("default", IntegerArgs.builder()
            .max(99999)
            .min(10000)
            .build());

        var example = new Project("example", ProjectArgs.builder()
            .projectName(String.format("terraform-example-%s", default_.result()))
            .description("terraform-example")
            .build());

        var exampleStore = new Store("exampleStore", StoreArgs.builder()
            .projectName(example.projectName())
            .logstoreName("example-store")
            .shardCount(3)
            .autoSplit(true)
            .maxSplitShardCount(60)
            .appendMeta(true)
            .build());

        var exampleDashboard = new Dashboard("exampleDashboard", DashboardArgs.builder()
            .projectName(example.projectName())
            .dashboardName("terraform-example")
            .displayName("terraform-example")
            .attribute("""
  {
    "type":"grid"
  }
            """)
            .charList("""
  [
    {
      "action": {},
      "title":"new_title",
      "type":"map",
      "search":{
        "logstore":"example-store",
        "topic":"new_topic",
        "query":"* | SELECT COUNT(name) as ct_name, COUNT(product) as ct_product, name,product GROUP BY name,product",
        "start":"-86400s",
        "end":"now"
      },
      "display":{
        "xAxis":[
          "ct_name"
        ],
        "yAxis":[
          "ct_product"
        ],
        "xPos":0,
        "yPos":0,
        "width":10,
        "height":12,
        "displayName":"terraform-example"
      }
    }
  ]
            """)
            .build());

    }
}
Copy
resources:
  default:
    type: random:integer
    properties:
      max: 99999
      min: 10000
  example:
    type: alicloud:log:Project
    properties:
      projectName: terraform-example-${default.result}
      description: terraform-example
  exampleStore:
    type: alicloud:log:Store
    name: example
    properties:
      projectName: ${example.projectName}
      logstoreName: example-store
      shardCount: 3
      autoSplit: true
      maxSplitShardCount: 60
      appendMeta: true
  exampleDashboard:
    type: alicloud:log:Dashboard
    name: example
    properties:
      projectName: ${example.projectName}
      dashboardName: terraform-example
      displayName: terraform-example
      attribute: |2
          {
            "type":"grid"
          }
      charList: |2
          [
            {
              "action": {},
              "title":"new_title",
              "type":"map",
              "search":{
                "logstore":"example-store",
                "topic":"new_topic",
                "query":"* | SELECT COUNT(name) as ct_name, COUNT(product) as ct_product, name,product GROUP BY name,product",
                "start":"-86400s",
                "end":"now"
              },
              "display":{
                "xAxis":[
                  "ct_name"
                ],
                "yAxis":[
                  "ct_product"
                ],
                "xPos":0,
                "yPos":0,
                "width":10,
                "height":12,
                "displayName":"terraform-example"
              }
            }
          ]
Copy

Create Dashboard Resource

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

Constructor syntax

new Dashboard(name: string, args: DashboardArgs, opts?: CustomResourceOptions);
@overload
def Dashboard(resource_name: str,
              args: DashboardArgs,
              opts: Optional[ResourceOptions] = None)

@overload
def Dashboard(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              char_list: Optional[str] = None,
              dashboard_name: Optional[str] = None,
              project_name: Optional[str] = None,
              attribute: Optional[str] = None,
              display_name: Optional[str] = None)
func NewDashboard(ctx *Context, name string, args DashboardArgs, opts ...ResourceOption) (*Dashboard, error)
public Dashboard(string name, DashboardArgs args, CustomResourceOptions? opts = null)
public Dashboard(String name, DashboardArgs args)
public Dashboard(String name, DashboardArgs args, CustomResourceOptions options)
type: alicloud:log:Dashboard
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. DashboardArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. DashboardArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. DashboardArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. DashboardArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. DashboardArgs
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 dashboardResource = new AliCloud.Log.Dashboard("dashboardResource", new()
{
    CharList = "string",
    DashboardName = "string",
    ProjectName = "string",
    Attribute = "string",
    DisplayName = "string",
});
Copy
example, err := log.NewDashboard(ctx, "dashboardResource", &log.DashboardArgs{
	CharList:      pulumi.String("string"),
	DashboardName: pulumi.String("string"),
	ProjectName:   pulumi.String("string"),
	Attribute:     pulumi.String("string"),
	DisplayName:   pulumi.String("string"),
})
Copy
var dashboardResource = new Dashboard("dashboardResource", DashboardArgs.builder()
    .charList("string")
    .dashboardName("string")
    .projectName("string")
    .attribute("string")
    .displayName("string")
    .build());
Copy
dashboard_resource = alicloud.log.Dashboard("dashboardResource",
    char_list="string",
    dashboard_name="string",
    project_name="string",
    attribute="string",
    display_name="string")
Copy
const dashboardResource = new alicloud.log.Dashboard("dashboardResource", {
    charList: "string",
    dashboardName: "string",
    projectName: "string",
    attribute: "string",
    displayName: "string",
});
Copy
type: alicloud:log:Dashboard
properties:
    attribute: string
    charList: string
    dashboardName: string
    displayName: string
    projectName: string
Copy

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

CharList This property is required. string
Configuration of charts in the dashboard. Note: From version 1.164.0, char_list can set parameter "action".
DashboardName
This property is required.
Changes to this property will trigger replacement.
string
The name of the Log Dashboard.
ProjectName
This property is required.
Changes to this property will trigger replacement.
string
The name of the log project. It is the only in one Alicloud account.
Attribute string
Dashboard attribute.
DisplayName string
Dashboard alias.
CharList This property is required. string
Configuration of charts in the dashboard. Note: From version 1.164.0, char_list can set parameter "action".
DashboardName
This property is required.
Changes to this property will trigger replacement.
string
The name of the Log Dashboard.
ProjectName
This property is required.
Changes to this property will trigger replacement.
string
The name of the log project. It is the only in one Alicloud account.
Attribute string
Dashboard attribute.
DisplayName string
Dashboard alias.
charList This property is required. String
Configuration of charts in the dashboard. Note: From version 1.164.0, char_list can set parameter "action".
dashboardName
This property is required.
Changes to this property will trigger replacement.
String
The name of the Log Dashboard.
projectName
This property is required.
Changes to this property will trigger replacement.
String
The name of the log project. It is the only in one Alicloud account.
attribute String
Dashboard attribute.
displayName String
Dashboard alias.
charList This property is required. string
Configuration of charts in the dashboard. Note: From version 1.164.0, char_list can set parameter "action".
dashboardName
This property is required.
Changes to this property will trigger replacement.
string
The name of the Log Dashboard.
projectName
This property is required.
Changes to this property will trigger replacement.
string
The name of the log project. It is the only in one Alicloud account.
attribute string
Dashboard attribute.
displayName string
Dashboard alias.
char_list This property is required. str
Configuration of charts in the dashboard. Note: From version 1.164.0, char_list can set parameter "action".
dashboard_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the Log Dashboard.
project_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the log project. It is the only in one Alicloud account.
attribute str
Dashboard attribute.
display_name str
Dashboard alias.
charList This property is required. String
Configuration of charts in the dashboard. Note: From version 1.164.0, char_list can set parameter "action".
dashboardName
This property is required.
Changes to this property will trigger replacement.
String
The name of the Log Dashboard.
projectName
This property is required.
Changes to this property will trigger replacement.
String
The name of the log project. It is the only in one Alicloud account.
attribute String
Dashboard attribute.
displayName String
Dashboard alias.

Outputs

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

Get an existing Dashboard 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?: DashboardState, opts?: CustomResourceOptions): Dashboard
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        attribute: Optional[str] = None,
        char_list: Optional[str] = None,
        dashboard_name: Optional[str] = None,
        display_name: Optional[str] = None,
        project_name: Optional[str] = None) -> Dashboard
func GetDashboard(ctx *Context, name string, id IDInput, state *DashboardState, opts ...ResourceOption) (*Dashboard, error)
public static Dashboard Get(string name, Input<string> id, DashboardState? state, CustomResourceOptions? opts = null)
public static Dashboard get(String name, Output<String> id, DashboardState state, CustomResourceOptions options)
resources:  _:    type: alicloud:log:Dashboard    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Attribute string
Dashboard attribute.
CharList string
Configuration of charts in the dashboard. Note: From version 1.164.0, char_list can set parameter "action".
DashboardName Changes to this property will trigger replacement. string
The name of the Log Dashboard.
DisplayName string
Dashboard alias.
ProjectName Changes to this property will trigger replacement. string
The name of the log project. It is the only in one Alicloud account.
Attribute string
Dashboard attribute.
CharList string
Configuration of charts in the dashboard. Note: From version 1.164.0, char_list can set parameter "action".
DashboardName Changes to this property will trigger replacement. string
The name of the Log Dashboard.
DisplayName string
Dashboard alias.
ProjectName Changes to this property will trigger replacement. string
The name of the log project. It is the only in one Alicloud account.
attribute String
Dashboard attribute.
charList String
Configuration of charts in the dashboard. Note: From version 1.164.0, char_list can set parameter "action".
dashboardName Changes to this property will trigger replacement. String
The name of the Log Dashboard.
displayName String
Dashboard alias.
projectName Changes to this property will trigger replacement. String
The name of the log project. It is the only in one Alicloud account.
attribute string
Dashboard attribute.
charList string
Configuration of charts in the dashboard. Note: From version 1.164.0, char_list can set parameter "action".
dashboardName Changes to this property will trigger replacement. string
The name of the Log Dashboard.
displayName string
Dashboard alias.
projectName Changes to this property will trigger replacement. string
The name of the log project. It is the only in one Alicloud account.
attribute str
Dashboard attribute.
char_list str
Configuration of charts in the dashboard. Note: From version 1.164.0, char_list can set parameter "action".
dashboard_name Changes to this property will trigger replacement. str
The name of the Log Dashboard.
display_name str
Dashboard alias.
project_name Changes to this property will trigger replacement. str
The name of the log project. It is the only in one Alicloud account.
attribute String
Dashboard attribute.
charList String
Configuration of charts in the dashboard. Note: From version 1.164.0, char_list can set parameter "action".
dashboardName Changes to this property will trigger replacement. String
The name of the Log Dashboard.
displayName String
Dashboard alias.
projectName Changes to this property will trigger replacement. String
The name of the log project. It is the only in one Alicloud account.

Import

Log Dashboard can be imported using the id, e.g.

$ pulumi import alicloud:log/dashboard:Dashboard example <project_name>:<dashboard_name>
Copy

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.