grafana.MessageTemplate

Explore with Pulumi AI

Manages Grafana Alerting message templates.

This resource requires Grafana 9.1.0 or later.

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Grafana = Lbrlabs.PulumiPackage.Grafana;

return await Deployment.RunAsync(() => 
{
    var myTemplate = new Grafana.MessageTemplate("myTemplate", new()
    {
        Template = @"{{define ""My Reusable Template"" }}
 template content
{{ end }}
",
    });

});
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := grafana.NewMessageTemplate(ctx, "myTemplate", &grafana.MessageTemplateArgs{
			Template: pulumi.String("{{define \"My Reusable Template\" }}\n template content\n{{ end }}\n"),
		})
		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.grafana.MessageTemplate;
import com.pulumi.grafana.MessageTemplateArgs;
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 myTemplate = new MessageTemplate("myTemplate", MessageTemplateArgs.builder()        
            .template("""
{{define "My Reusable Template" }}
 template content
{{ end }}
            """)
            .build());

    }
}
import pulumi
import lbrlabs_pulumi_grafana as grafana

my_template = grafana.MessageTemplate("myTemplate", template="""{{define "My Reusable Template" }}
 template content
{{ end }}
""")
import * as pulumi from "@pulumi/pulumi";
import * as grafana from "@lbrlabs/pulumi-grafana";

const myTemplate = new grafana.MessageTemplate("myTemplate", {template: `{{define "My Reusable Template" }}
 template content
{{ end }}
`});
resources:
  myTemplate:
    type: grafana:MessageTemplate
    properties:
      template: |
        {{define "My Reusable Template" }}
         template content
        {{ end }}        

Create MessageTemplate Resource

new MessageTemplate(name: string, args: MessageTemplateArgs, opts?: CustomResourceOptions);
@overload
def MessageTemplate(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    name: Optional[str] = None,
                    template: Optional[str] = None)
@overload
def MessageTemplate(resource_name: str,
                    args: MessageTemplateArgs,
                    opts: Optional[ResourceOptions] = None)
func NewMessageTemplate(ctx *Context, name string, args MessageTemplateArgs, opts ...ResourceOption) (*MessageTemplate, error)
public MessageTemplate(string name, MessageTemplateArgs args, CustomResourceOptions? opts = null)
public MessageTemplate(String name, MessageTemplateArgs args)
public MessageTemplate(String name, MessageTemplateArgs args, CustomResourceOptions options)
type: grafana:MessageTemplate
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

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

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

Template string

The content of the message template.

Name string

The name of the message template.

Template string

The content of the message template.

Name string

The name of the message template.

template String

The content of the message template.

name String

The name of the message template.

template string

The content of the message template.

name string

The name of the message template.

template str

The content of the message template.

name str

The name of the message template.

template String

The content of the message template.

name String

The name of the message template.

Outputs

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

Get an existing MessageTemplate 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?: MessageTemplateState, opts?: CustomResourceOptions): MessageTemplate
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        name: Optional[str] = None,
        template: Optional[str] = None) -> MessageTemplate
func GetMessageTemplate(ctx *Context, name string, id IDInput, state *MessageTemplateState, opts ...ResourceOption) (*MessageTemplate, error)
public static MessageTemplate Get(string name, Input<string> id, MessageTemplateState? state, CustomResourceOptions? opts = null)
public static MessageTemplate get(String name, Output<String> id, MessageTemplateState 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:
Name string

The name of the message template.

Template string

The content of the message template.

Name string

The name of the message template.

Template string

The content of the message template.

name String

The name of the message template.

template String

The content of the message template.

name string

The name of the message template.

template string

The content of the message template.

name str

The name of the message template.

template str

The content of the message template.

name String

The name of the message template.

template String

The content of the message template.

Import

 $ pulumi import grafana:index/messageTemplate:MessageTemplate message_template_name {{message_template_name}}

Package Details

Repository
grafana lbrlabs/pulumi-grafana
License
Apache-2.0
Notes

This Pulumi package is based on the grafana Terraform Provider.