1. Packages
  2. Grafana Cloud
  3. API Docs
  4. Annotation
Grafana v0.16.3 published on Monday, Apr 7, 2025 by pulumiverse

grafana.Annotation

Explore with Pulumi AI

Deprecated: grafana.index/annotation.Annotation has been deprecated in favor of grafana.oss/annotation.Annotation

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as grafana from "@pulumiverse/grafana";

const test = new grafana.oss.Annotation("test", {text: "basic text"});
Copy
import pulumi
import pulumiverse_grafana as grafana

test = grafana.oss.Annotation("test", text="basic text")
Copy
package main

import (
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
	"github.com/pulumiverse/pulumi-grafana/sdk/go/grafana/oss"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := oss.NewAnnotation(ctx, "test", &oss.AnnotationArgs{
			Text: pulumi.String("basic text"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Grafana = Pulumiverse.Grafana;

return await Deployment.RunAsync(() => 
{
    var test = new Grafana.Oss.Annotation("test", new()
    {
        Text = "basic text",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.grafana.oss.Annotation;
import com.pulumi.grafana.oss.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());

    }
}
Copy
resources:
  test:
    type: grafana:oss:Annotation
    properties:
      text: basic text
Copy

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,
               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)
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 This property is required. string
The unique name of the resource.
args This property is required. AnnotationArgs
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. 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 This property is required. string
The unique name of the resource.
args This property is required. AnnotationArgs
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. AnnotationArgs
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. AnnotationArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Annotation resource accepts the following input properties:

Text This property is required. string
The text to associate with the annotation.
DashboardUid Changes to this property will trigger replacement. string
The UID of the dashboard on which to create the annotation.
OrgId Changes to this property will trigger replacement. string
The Organization ID. If not set, the Org ID defined in the provider block will be used.
PanelId Changes to this property will trigger replacement. 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 This property is required. string
The text to associate with the annotation.
DashboardUid Changes to this property will trigger replacement. string
The UID of the dashboard on which to create the annotation.
OrgId Changes to this property will trigger replacement. string
The Organization ID. If not set, the Org ID defined in the provider block will be used.
PanelId Changes to this property will trigger replacement. 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 This property is required. String
The text to associate with the annotation.
dashboardUid Changes to this property will trigger replacement. String
The UID of the dashboard on which to create the annotation.
orgId Changes to this property will trigger replacement. String
The Organization ID. If not set, the Org ID defined in the provider block will be used.
panelId Changes to this property will trigger replacement. 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 This property is required. string
The text to associate with the annotation.
dashboardUid Changes to this property will trigger replacement. string
The UID of the dashboard on which to create the annotation.
orgId Changes to this property will trigger replacement. string
The Organization ID. If not set, the Org ID defined in the provider block will be used.
panelId Changes to this property will trigger replacement. 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 This property is required. str
The text to associate with the annotation.
dashboard_uid Changes to this property will trigger replacement. str
The UID of the dashboard on which to create the annotation.
org_id Changes to this property will trigger replacement. str
The Organization ID. If not set, the Org ID defined in the provider block will be used.
panel_id Changes to this property will trigger replacement. 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 This property is required. String
The text to associate with the annotation.
dashboardUid Changes to this property will trigger replacement. String
The UID of the dashboard on which to create the annotation.
orgId Changes to this property will trigger replacement. String
The Organization ID. If not set, the Org ID defined in the provider block will be used.
panelId Changes to this property will trigger replacement. 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_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)
resources:  _:    type: grafana:Annotation    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:
DashboardUid Changes to this property will trigger replacement. string
The UID of the dashboard on which to create the annotation.
OrgId Changes to this property will trigger replacement. string
The Organization ID. If not set, the Org ID defined in the provider block will be used.
PanelId Changes to this property will trigger replacement. 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.
DashboardUid Changes to this property will trigger replacement. string
The UID of the dashboard on which to create the annotation.
OrgId Changes to this property will trigger replacement. string
The Organization ID. If not set, the Org ID defined in the provider block will be used.
PanelId Changes to this property will trigger replacement. 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.
dashboardUid Changes to this property will trigger replacement. String
The UID of the dashboard on which to create the annotation.
orgId Changes to this property will trigger replacement. String
The Organization ID. If not set, the Org ID defined in the provider block will be used.
panelId Changes to this property will trigger replacement. 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.
dashboardUid Changes to this property will trigger replacement. string
The UID of the dashboard on which to create the annotation.
orgId Changes to this property will trigger replacement. string
The Organization ID. If not set, the Org ID defined in the provider block will be used.
panelId Changes to this property will trigger replacement. 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_uid Changes to this property will trigger replacement. str
The UID of the dashboard on which to create the annotation.
org_id Changes to this property will trigger replacement. str
The Organization ID. If not set, the Org ID defined in the provider block will be used.
panel_id Changes to this property will trigger replacement. 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.
dashboardUid Changes to this property will trigger replacement. String
The UID of the dashboard on which to create the annotation.
orgId Changes to this property will trigger replacement. String
The Organization ID. If not set, the Org ID defined in the provider block will be used.
panelId Changes to this property will trigger replacement. 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 }}"
Copy
$ pulumi import grafana:index/annotation:Annotation name "{{ orgID }}:{{ id }}"
Copy

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.