Alibaba Cloud

v3.28.0 published on Tuesday, Aug 16, 2022 by Pulumi

Dashboard

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 in 1.86.0, parameter “action” in char_list is supported since 1.164.0+.

Example Usage

Basic Usage

using Pulumi;
using AliCloud = Pulumi.AliCloud;

class MyStack : Stack
{
    public MyStack()
    {
        var defaultProject = new AliCloud.Log.Project("defaultProject", new AliCloud.Log.ProjectArgs
        {
            Description = "tf unit test",
        });
        var defaultStore = new AliCloud.Log.Store("defaultStore", new AliCloud.Log.StoreArgs
        {
            Project = "tf-project",
            RetentionPeriod = 3000,
            ShardCount = 1,
        });
        var example = new AliCloud.Log.Dashboard("example", new AliCloud.Log.DashboardArgs
        {
            CharList = @"  [
    {
      ""action"": {},
      ""title"":""new_title"",
      ""type"":""map"",
      ""search"":{
        ""logstore"":""tf-logstore"",
        ""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"":""xixihaha911""
      }
    }
  ]

",
            DashboardName = "tf-dashboard",
            ProjectName = "tf-project",
        });
    }

}
package main

import (
	"fmt"

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := log.NewProject(ctx, "defaultProject", &log.ProjectArgs{
			Description: pulumi.String("tf unit test"),
		})
		if err != nil {
			return err
		}
		_, err = log.NewStore(ctx, "defaultStore", &log.StoreArgs{
			Project:         pulumi.String("tf-project"),
			RetentionPeriod: pulumi.Int(3000),
			ShardCount:      pulumi.Int(1),
		})
		if err != nil {
			return err
		}
		_, err = log.NewDashboard(ctx, "example", &log.DashboardArgs{
			CharList: pulumi.String(fmt.Sprintf(`  [
    {
      "action": {},
      "title":"new_title",
      "type":"map",
      "search":{
        "logstore":"tf-logstore",
        "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":"xixihaha911"
      }
    }
  ]

`)),
			DashboardName: pulumi.String("tf-dashboard"),
			ProjectName:   pulumi.String("tf-project"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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.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 defaultProject = new Project("defaultProject", ProjectArgs.builder()        
            .description("tf unit test")
            .build());

        var defaultStore = new Store("defaultStore", StoreArgs.builder()        
            .project("tf-project")
            .retentionPeriod("3000")
            .shardCount(1)
            .build());

        var example = new Dashboard("example", DashboardArgs.builder()        
            .charList("""
  [
    {
      "action": {},
      "title":"new_title",
      "type":"map",
      "search":{
        "logstore":"tf-logstore",
        "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":"xixihaha911"
      }
    }
  ]

            """)
            .dashboardName("tf-dashboard")
            .projectName("tf-project")
            .build());

    }
}
import pulumi
import pulumi_alicloud as alicloud

default_project = alicloud.log.Project("defaultProject", description="tf unit test")
default_store = alicloud.log.Store("defaultStore",
    project="tf-project",
    retention_period=3000,
    shard_count=1)
example = alicloud.log.Dashboard("example",
    char_list="""  [
    {
      "action": {},
      "title":"new_title",
      "type":"map",
      "search":{
        "logstore":"tf-logstore",
        "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":"xixihaha911"
      }
    }
  ]

""",
    dashboard_name="tf-dashboard",
    project_name="tf-project")
import * as pulumi from "@pulumi/pulumi";
import * as alicloud from "@pulumi/alicloud";

const defaultProject = new alicloud.log.Project("default", {
    description: "tf unit test",
});
const defaultStore = new alicloud.log.Store("default", {
    project: "tf-project",
    retentionPeriod: 3000,
    shardCount: 1,
});
const example = new alicloud.log.Dashboard("example", {
    charList: `  [
    {
      "action": {},
      "title":"new_title",
      "type":"map",
      "search":{
        "logstore":"tf-logstore",
        "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":"xixihaha911"
      }
    }
  ]
`,
    dashboardName: "tf-dashboard",
    projectName: "tf-project",
});
resources:
  defaultProject:
    type: alicloud:log:Project
    properties:
      description: tf unit test
  defaultStore:
    type: alicloud:log:Store
    properties:
      project: tf-project
      retentionPeriod: 3000
      shardCount: 1
  example:
    type: alicloud:log:Dashboard
    properties:
      charList: |2+
          [
            {
              "action": {},
              "title":"new_title",
              "type":"map",
              "search":{
                "logstore":"tf-logstore",
                "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":"xixihaha911"
              }
            }
          ]

      dashboardName: tf-dashboard
      projectName: tf-project

Create Dashboard Resource

new Dashboard(name: string, args: DashboardArgs, opts?: CustomResourceOptions);
@overload
def Dashboard(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              char_list: Optional[str] = None,
              dashboard_name: Optional[str] = None,
              display_name: Optional[str] = None,
              project_name: Optional[str] = None)
@overload
def Dashboard(resource_name: str,
              args: DashboardArgs,
              opts: Optional[ResourceOptions] = 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.

name string
The unique name of the resource.
args DashboardArgs
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 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 string
The unique name of the resource.
args DashboardArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args DashboardArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args DashboardArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

The Dashboard resource accepts the following input properties:

CharList string

Configuration of charts in the dashboard.

DashboardName string

The name of the Log Dashboard.

ProjectName string

The name of the log project. It is the only in one Alicloud account.

DisplayName string

Dashboard alias.

CharList string

Configuration of charts in the dashboard.

DashboardName string

The name of the Log Dashboard.

ProjectName string

The name of the log project. It is the only in one Alicloud account.

DisplayName string

Dashboard alias.

charList String

Configuration of charts in the dashboard.

dashboardName String

The name of the Log Dashboard.

projectName String

The name of the log project. It is the only in one Alicloud account.

displayName String

Dashboard alias.

charList string

Configuration of charts in the dashboard.

dashboardName string

The name of the Log Dashboard.

projectName string

The name of the log project. It is the only in one Alicloud account.

displayName string

Dashboard alias.

char_list str

Configuration of charts in the dashboard.

dashboard_name str

The name of the Log Dashboard.

project_name str

The name of the log project. It is the only in one Alicloud account.

display_name str

Dashboard alias.

charList String

Configuration of charts in the dashboard.

dashboardName String

The name of the Log Dashboard.

projectName String

The name of the log project. It is the only in one Alicloud account.

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,
        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)
Resource lookup is not supported in YAML
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:
CharList string

Configuration of charts in the dashboard.

DashboardName string

The name of the Log Dashboard.

DisplayName string

Dashboard alias.

ProjectName string

The name of the log project. It is the only in one Alicloud account.

CharList string

Configuration of charts in the dashboard.

DashboardName string

The name of the Log Dashboard.

DisplayName string

Dashboard alias.

ProjectName string

The name of the log project. It is the only in one Alicloud account.

charList String

Configuration of charts in the dashboard.

dashboardName String

The name of the Log Dashboard.

displayName String

Dashboard alias.

projectName String

The name of the log project. It is the only in one Alicloud account.

charList string

Configuration of charts in the dashboard.

dashboardName string

The name of the Log Dashboard.

displayName string

Dashboard alias.

projectName string

The name of the log project. It is the only in one Alicloud account.

char_list str

Configuration of charts in the dashboard.

dashboard_name str

The name of the Log Dashboard.

display_name str

Dashboard alias.

project_name str

The name of the log project. It is the only in one Alicloud account.

charList String

Configuration of charts in the dashboard.

dashboardName String

The name of the Log Dashboard.

displayName String

Dashboard alias.

projectName String

The name of the log project. It is the only in one Alicloud account.

Import

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

 $ pulumi import alicloud:log/dashboard:Dashboard example tf-project:tf-logstore:tf-dashboard

Package Details

Repository
https://github.com/pulumi/pulumi-alicloud
License
Apache-2.0
Notes

This Pulumi package is based on the alicloud Terraform Provider.