1. Packages
  2. Grafana Cloud
  3. API Docs
  4. Annotation
Grafana v0.5.1 published on Wednesday, Jun 12, 2024 by pulumiverse

grafana.Annotation

Explore with Pulumi AI

grafana logo
Grafana v0.5.1 published on Wednesday, Jun 12, 2024 by pulumiverse

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as grafana from "@pulumiverse/grafana";
    
    const test = new grafana.Annotation("test", {text: "basic text"});
    
    import pulumi
    import pulumiverse_grafana as grafana
    
    test = grafana.Annotation("test", text="basic text")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/pulumiverse/pulumi-grafana/sdk/go/grafana"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := grafana.NewAnnotation(ctx, "test", &grafana.AnnotationArgs{
    			Text: pulumi.String("basic text"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Grafana = Pulumiverse.Grafana;
    
    return await Deployment.RunAsync(() => 
    {
        var test = new Grafana.Annotation("test", new()
        {
            Text = "basic text",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.grafana.Annotation;
    import com.pulumi.grafana.AnnotationArgs;
    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 test = new Annotation("test", AnnotationArgs.builder()        
                .text("basic text")
                .build());
    
        }
    }
    
    resources:
      test:
        type: grafana:Annotation
        properties:
          text: basic text
    

    Create Annotation Resource

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

    Constructor syntax

    new Annotation(name: string, args: AnnotationArgs, opts?: CustomResourceOptions);
    @overload
    def Annotation(resource_name: str,
                   args: AnnotationArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def Annotation(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   text: Optional[str] = None,
                   dashboard_id: Optional[int] = None,
                   dashboard_uid: Optional[str] = None,
                   org_id: Optional[str] = None,
                   panel_id: Optional[int] = None,
                   tags: Optional[Sequence[str]] = None,
                   time: Optional[str] = None,
                   time_end: Optional[str] = None)
    func NewAnnotation(ctx *Context, name string, args AnnotationArgs, opts ...ResourceOption) (*Annotation, error)
    public Annotation(string name, AnnotationArgs args, CustomResourceOptions? opts = null)
    public Annotation(String name, AnnotationArgs args)
    public Annotation(String name, AnnotationArgs args, CustomResourceOptions options)
    
    type: grafana:Annotation
    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 AnnotationArgs
    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 AnnotationArgs
    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 AnnotationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args AnnotationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args AnnotationArgs
    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 annotationResource = new Grafana.Annotation("annotationResource", new()
    {
        Text = "string",
        DashboardUid = "string",
        OrgId = "string",
        PanelId = 0,
        Tags = new[]
        {
            "string",
        },
        Time = "string",
        TimeEnd = "string",
    });
    
    example, err := grafana.NewAnnotation(ctx, "annotationResource", &grafana.AnnotationArgs{
    	Text:         pulumi.String("string"),
    	DashboardUid: pulumi.String("string"),
    	OrgId:        pulumi.String("string"),
    	PanelId:      pulumi.Int(0),
    	Tags: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	Time:    pulumi.String("string"),
    	TimeEnd: pulumi.String("string"),
    })
    
    var annotationResource = new Annotation("annotationResource", AnnotationArgs.builder()
        .text("string")
        .dashboardUid("string")
        .orgId("string")
        .panelId(0)
        .tags("string")
        .time("string")
        .timeEnd("string")
        .build());
    
    annotation_resource = grafana.Annotation("annotationResource",
        text="string",
        dashboard_uid="string",
        org_id="string",
        panel_id=0,
        tags=["string"],
        time="string",
        time_end="string")
    
    const annotationResource = new grafana.Annotation("annotationResource", {
        text: "string",
        dashboardUid: "string",
        orgId: "string",
        panelId: 0,
        tags: ["string"],
        time: "string",
        timeEnd: "string",
    });
    
    type: grafana:Annotation
    properties:
        dashboardUid: string
        orgId: string
        panelId: 0
        tags:
            - string
        text: string
        time: string
        timeEnd: string
    

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

    Text string
    The text to associate with the annotation.
    DashboardId int
    The ID of the dashboard on which to create the annotation. Deprecated: Use dashboard_uid instead.

    Deprecated: Use dashboard_uid instead.

    DashboardUid string
    The ID of the dashboard on which to create the annotation.
    OrgId string
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    PanelId int
    The ID of the dashboard panel on which to create the annotation.
    Tags List<string>
    The tags to associate with the annotation.
    Time string
    The RFC 3339-formatted time string indicating the annotation's time.
    TimeEnd string
    The RFC 3339-formatted time string indicating the annotation's end time.
    Text string
    The text to associate with the annotation.
    DashboardId int
    The ID of the dashboard on which to create the annotation. Deprecated: Use dashboard_uid instead.

    Deprecated: Use dashboard_uid instead.

    DashboardUid string
    The ID of the dashboard on which to create the annotation.
    OrgId string
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    PanelId int
    The ID of the dashboard panel on which to create the annotation.
    Tags []string
    The tags to associate with the annotation.
    Time string
    The RFC 3339-formatted time string indicating the annotation's time.
    TimeEnd string
    The RFC 3339-formatted time string indicating the annotation's end time.
    text String
    The text to associate with the annotation.
    dashboardId Integer
    The ID of the dashboard on which to create the annotation. Deprecated: Use dashboard_uid instead.

    Deprecated: Use dashboard_uid instead.

    dashboardUid String
    The ID of the dashboard on which to create the annotation.
    orgId String
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    panelId Integer
    The ID of the dashboard panel on which to create the annotation.
    tags List<String>
    The tags to associate with the annotation.
    time String
    The RFC 3339-formatted time string indicating the annotation's time.
    timeEnd String
    The RFC 3339-formatted time string indicating the annotation's end time.
    text string
    The text to associate with the annotation.
    dashboardId number
    The ID of the dashboard on which to create the annotation. Deprecated: Use dashboard_uid instead.

    Deprecated: Use dashboard_uid instead.

    dashboardUid string
    The ID of the dashboard on which to create the annotation.
    orgId string
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    panelId number
    The ID of the dashboard panel on which to create the annotation.
    tags string[]
    The tags to associate with the annotation.
    time string
    The RFC 3339-formatted time string indicating the annotation's time.
    timeEnd string
    The RFC 3339-formatted time string indicating the annotation's end time.
    text str
    The text to associate with the annotation.
    dashboard_id int
    The ID of the dashboard on which to create the annotation. Deprecated: Use dashboard_uid instead.

    Deprecated: Use dashboard_uid instead.

    dashboard_uid str
    The ID of the dashboard on which to create the annotation.
    org_id str
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    panel_id int
    The ID of the dashboard panel on which to create the annotation.
    tags Sequence[str]
    The tags to associate with the annotation.
    time str
    The RFC 3339-formatted time string indicating the annotation's time.
    time_end str
    The RFC 3339-formatted time string indicating the annotation's end time.
    text String
    The text to associate with the annotation.
    dashboardId Number
    The ID of the dashboard on which to create the annotation. Deprecated: Use dashboard_uid instead.

    Deprecated: Use dashboard_uid instead.

    dashboardUid String
    The ID of the dashboard on which to create the annotation.
    orgId String
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    panelId Number
    The ID of the dashboard panel on which to create the annotation.
    tags List<String>
    The tags to associate with the annotation.
    time String
    The RFC 3339-formatted time string indicating the annotation's time.
    timeEnd String
    The RFC 3339-formatted time string indicating the annotation's end time.

    Outputs

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

    Get an existing Annotation 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?: AnnotationState, opts?: CustomResourceOptions): Annotation
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            dashboard_id: Optional[int] = None,
            dashboard_uid: Optional[str] = None,
            org_id: Optional[str] = None,
            panel_id: Optional[int] = None,
            tags: Optional[Sequence[str]] = None,
            text: Optional[str] = None,
            time: Optional[str] = None,
            time_end: Optional[str] = None) -> Annotation
    func GetAnnotation(ctx *Context, name string, id IDInput, state *AnnotationState, opts ...ResourceOption) (*Annotation, error)
    public static Annotation Get(string name, Input<string> id, AnnotationState? state, CustomResourceOptions? opts = null)
    public static Annotation get(String name, Output<String> id, AnnotationState 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:
    DashboardId int
    The ID of the dashboard on which to create the annotation. Deprecated: Use dashboard_uid instead.

    Deprecated: Use dashboard_uid instead.

    DashboardUid string
    The ID of the dashboard on which to create the annotation.
    OrgId string
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    PanelId int
    The ID of the dashboard panel on which to create the annotation.
    Tags List<string>
    The tags to associate with the annotation.
    Text string
    The text to associate with the annotation.
    Time string
    The RFC 3339-formatted time string indicating the annotation's time.
    TimeEnd string
    The RFC 3339-formatted time string indicating the annotation's end time.
    DashboardId int
    The ID of the dashboard on which to create the annotation. Deprecated: Use dashboard_uid instead.

    Deprecated: Use dashboard_uid instead.

    DashboardUid string
    The ID of the dashboard on which to create the annotation.
    OrgId string
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    PanelId int
    The ID of the dashboard panel on which to create the annotation.
    Tags []string
    The tags to associate with the annotation.
    Text string
    The text to associate with the annotation.
    Time string
    The RFC 3339-formatted time string indicating the annotation's time.
    TimeEnd string
    The RFC 3339-formatted time string indicating the annotation's end time.
    dashboardId Integer
    The ID of the dashboard on which to create the annotation. Deprecated: Use dashboard_uid instead.

    Deprecated: Use dashboard_uid instead.

    dashboardUid String
    The ID of the dashboard on which to create the annotation.
    orgId String
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    panelId Integer
    The ID of the dashboard panel on which to create the annotation.
    tags List<String>
    The tags to associate with the annotation.
    text String
    The text to associate with the annotation.
    time String
    The RFC 3339-formatted time string indicating the annotation's time.
    timeEnd String
    The RFC 3339-formatted time string indicating the annotation's end time.
    dashboardId number
    The ID of the dashboard on which to create the annotation. Deprecated: Use dashboard_uid instead.

    Deprecated: Use dashboard_uid instead.

    dashboardUid string
    The ID of the dashboard on which to create the annotation.
    orgId string
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    panelId number
    The ID of the dashboard panel on which to create the annotation.
    tags string[]
    The tags to associate with the annotation.
    text string
    The text to associate with the annotation.
    time string
    The RFC 3339-formatted time string indicating the annotation's time.
    timeEnd string
    The RFC 3339-formatted time string indicating the annotation's end time.
    dashboard_id int
    The ID of the dashboard on which to create the annotation. Deprecated: Use dashboard_uid instead.

    Deprecated: Use dashboard_uid instead.

    dashboard_uid str
    The ID of the dashboard on which to create the annotation.
    org_id str
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    panel_id int
    The ID of the dashboard panel on which to create the annotation.
    tags Sequence[str]
    The tags to associate with the annotation.
    text str
    The text to associate with the annotation.
    time str
    The RFC 3339-formatted time string indicating the annotation's time.
    time_end str
    The RFC 3339-formatted time string indicating the annotation's end time.
    dashboardId Number
    The ID of the dashboard on which to create the annotation. Deprecated: Use dashboard_uid instead.

    Deprecated: Use dashboard_uid instead.

    dashboardUid String
    The ID of the dashboard on which to create the annotation.
    orgId String
    The Organization ID. If not set, the Org ID defined in the provider block will be used.
    panelId Number
    The ID of the dashboard panel on which to create the annotation.
    tags List<String>
    The tags to associate with the annotation.
    text String
    The text to associate with the annotation.
    time String
    The RFC 3339-formatted time string indicating the annotation's time.
    timeEnd String
    The RFC 3339-formatted time string indicating the annotation's end time.

    Import

    $ pulumi import grafana:index/annotation:Annotation name "{{ id }}"
    
    $ pulumi import grafana:index/annotation:Annotation name "{{ orgID }}:{{ id }}"
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    grafana pulumiverse/pulumi-grafana
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the grafana Terraform Provider.
    grafana logo
    Grafana v0.5.1 published on Wednesday, Jun 12, 2024 by pulumiverse