1. Packages
  2. Alibaba Cloud
  3. API Docs
  4. log
  5. Dashboard
Alibaba Cloud v3.56.0 published on Friday, May 31, 2024 by Pulumi

alicloud.log.Dashboard

Explore with Pulumi AI

alicloud logo
Alibaba Cloud v3.56.0 published on Friday, May 31, 2024 by Pulumi

    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", {
        name: `terraform-example-${_default.result}`,
        description: "terraform-example",
    });
    const exampleStore = new alicloud.log.Store("example", {
        project: example.name,
        name: "example-store",
        shardCount: 3,
        autoSplit: true,
        maxSplitShardCount: 60,
        appendMeta: true,
    });
    const exampleDashboard = new alicloud.log.Dashboard("example", {
        projectName: example.name,
        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"
          }
        }
      ]
    `,
    });
    
    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",
        name=f"terraform-example-{default['result']}",
        description="terraform-example")
    example_store = alicloud.log.Store("example",
        project=example.name,
        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.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"
          }
        }
      ]
    """)
    
    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 {
    		_, err := random.NewInteger(ctx, "default", &random.IntegerArgs{
    			Max: 99999,
    			Min: 10000,
    		})
    		if err != nil {
    			return err
    		}
    		example, err := log.NewProject(ctx, "example", &log.ProjectArgs{
    			Name:        pulumi.String(fmt.Sprintf("terraform-example-%v", _default.Result)),
    			Description: pulumi.String("terraform-example"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = log.NewStore(ctx, "example", &log.StoreArgs{
    			Project:            example.Name,
    			Name:               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.Name,
    			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
    	})
    }
    
    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()
        {
            Name = $"terraform-example-{@default.Result}",
            Description = "terraform-example",
        });
    
        var exampleStore = new AliCloud.Log.Store("example", new()
        {
            Project = example.Name,
            Name = "example-store",
            ShardCount = 3,
            AutoSplit = true,
            MaxSplitShardCount = 60,
            AppendMeta = true,
        });
    
        var exampleDashboard = new AliCloud.Log.Dashboard("example", new()
        {
            ProjectName = example.Name,
            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""
          }
        }
      ]
    ",
        });
    
    });
    
    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()
                .name(String.format("terraform-example-%s", default_.result()))
                .description("terraform-example")
                .build());
    
            var exampleStore = new Store("exampleStore", StoreArgs.builder()
                .project(example.name())
                .name("example-store")
                .shardCount(3)
                .autoSplit(true)
                .maxSplitShardCount(60)
                .appendMeta(true)
                .build());
    
            var exampleDashboard = new Dashboard("exampleDashboard", DashboardArgs.builder()
                .projectName(example.name())
                .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());
    
        }
    }
    
    resources:
      default:
        type: random:integer
        properties:
          max: 99999
          min: 10000
      example:
        type: alicloud:log:Project
        properties:
          name: terraform-example-${default.result}
          description: terraform-example
      exampleStore:
        type: alicloud:log:Store
        name: example
        properties:
          project: ${example.name}
          name: example-store
          shardCount: 3
          autoSplit: true
          maxSplitShardCount: 60
          appendMeta: true
      exampleDashboard:
        type: alicloud:log:Dashboard
        name: example
        properties:
          projectName: ${example.name}
          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"
                  }
                }
              ]
    

    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 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.

    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",
    });
    
    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"),
    })
    
    var dashboardResource = new Dashboard("dashboardResource", DashboardArgs.builder()
        .charList("string")
        .dashboardName("string")
        .projectName("string")
        .attribute("string")
        .displayName("string")
        .build());
    
    dashboard_resource = alicloud.log.Dashboard("dashboardResource",
        char_list="string",
        dashboard_name="string",
        project_name="string",
        attribute="string",
        display_name="string")
    
    const dashboardResource = new alicloud.log.Dashboard("dashboardResource", {
        charList: "string",
        dashboardName: "string",
        projectName: "string",
        attribute: "string",
        displayName: "string",
    });
    
    type: alicloud:log:Dashboard
    properties:
        attribute: string
        charList: string
        dashboardName: string
        displayName: string
        projectName: string
    

    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. Note: From version 1.164.0, char_list can set parameter "action".
    DashboardName string
    The name of the Log Dashboard.
    ProjectName string
    The name of the log project. It is the only in one Alicloud account.
    Attribute string
    Dashboard attribute.
    DisplayName string
    Dashboard alias.
    CharList string
    Configuration of charts in the dashboard. Note: From version 1.164.0, char_list can set parameter "action".
    DashboardName string
    The name of the Log Dashboard.
    ProjectName string
    The name of the log project. It is the only in one Alicloud account.
    Attribute string
    Dashboard attribute.
    DisplayName string
    Dashboard alias.
    charList String
    Configuration of charts in the dashboard. Note: From version 1.164.0, char_list can set parameter "action".
    dashboardName String
    The name of the Log Dashboard.
    projectName String
    The name of the log project. It is the only in one Alicloud account.
    attribute String
    Dashboard attribute.
    displayName String
    Dashboard alias.
    charList string
    Configuration of charts in the dashboard. Note: From version 1.164.0, char_list can set parameter "action".
    dashboardName string
    The name of the Log Dashboard.
    projectName 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 str
    Configuration of charts in the dashboard. Note: From version 1.164.0, char_list can set parameter "action".
    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.
    attribute str
    Dashboard attribute.
    display_name str
    Dashboard alias.
    charList String
    Configuration of charts in the dashboard. Note: From version 1.164.0, char_list can set parameter "action".
    dashboardName String
    The name of the Log Dashboard.
    projectName 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)
    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:
    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 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.
    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 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.
    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 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.
    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 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.
    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 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.
    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 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, e.g.

    $ pulumi import alicloud:log/dashboard:Dashboard example <project_name>:<dashboard_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 alicloud Terraform Provider.
    alicloud logo
    Alibaba Cloud v3.56.0 published on Friday, May 31, 2024 by Pulumi