Notification

This resource allows you to create and manage recipients to receive alarm notifications. There will always be a default recipient created upon instance creation. This recipient will use team email and receive notifications from default alarms.

Available for all subscription plans.

Notification Type reference

Valid options for notification type.

  • email
  • webhook
  • pagerduty
  • victorops
  • opsgenie
  • opsgenie-eu
  • slack
  • teams

Dependency

This resource depends on CloudAMQP instance identifier, cloudamqp_instance.instance.id.

Example Usage

using Pulumi;
using CloudAmqp = Pulumi.CloudAmqp;

class MyStack : Stack
{
    public MyStack()
    {
        // New recipient to receieve notifications
        var recipient01 = new CloudAmqp.Notification("recipient01", new CloudAmqp.NotificationArgs
        {
            InstanceId = cloudamqp_instance.Instance.Id,
            Type = "email",
            Value = "alarm@example.com",
        });
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudamqp.NewNotification(ctx, "recipient01", &cloudamqp.NotificationArgs{
			InstanceId: pulumi.Any(cloudamqp_instance.Instance.Id),
			Type:       pulumi.String("email"),
			Value:      pulumi.String("alarm@example.com"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_cloudamqp as cloudamqp

# New recipient to receieve notifications
recipient01 = cloudamqp.Notification("recipient01",
    instance_id=cloudamqp_instance["instance"]["id"],
    type="email",
    value="alarm@example.com")
import * as pulumi from "@pulumi/pulumi";
import * as cloudamqp from "@pulumi/cloudamqp";

// New recipient to receieve notifications
const recipient01 = new cloudamqp.Notification("recipient01", {
    instanceId: cloudamqp_instance.instance.id,
    type: "email",
    value: "alarm@example.com",
});

Create a Notification Resource

new Notification(name: string, args: NotificationArgs, opts?: CustomResourceOptions);
@overload
def Notification(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 instance_id: Optional[int] = None,
                 name: Optional[str] = None,
                 type: Optional[str] = None,
                 value: Optional[str] = None)
@overload
def Notification(resource_name: str,
                 args: NotificationArgs,
                 opts: Optional[ResourceOptions] = None)
func NewNotification(ctx *Context, name string, args NotificationArgs, opts ...ResourceOption) (*Notification, error)
public Notification(string name, NotificationArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args NotificationArgs
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 NotificationArgs
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 NotificationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args NotificationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

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

InstanceId int
The CloudAMQP instance ID.
Type string
Type of the notification. See valid options below.
Value string
Endpoint to send the notification.
Name string
Display name of the recipient.
InstanceId int
The CloudAMQP instance ID.
Type string
Type of the notification. See valid options below.
Value string
Endpoint to send the notification.
Name string
Display name of the recipient.
instanceId number
The CloudAMQP instance ID.
type string
Type of the notification. See valid options below.
value string
Endpoint to send the notification.
name string
Display name of the recipient.
instance_id int
The CloudAMQP instance ID.
type str
Type of the notification. See valid options below.
value str
Endpoint to send the notification.
name str
Display name of the recipient.

Outputs

All input properties are implicitly available as output properties. Additionally, the Notification 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 str
The provider-assigned unique ID for this managed resource.

Look up an Existing Notification Resource

Get an existing Notification 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?: NotificationState, opts?: CustomResourceOptions): Notification
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        instance_id: Optional[int] = None,
        name: Optional[str] = None,
        type: Optional[str] = None,
        value: Optional[str] = None) -> Notification
func GetNotification(ctx *Context, name string, id IDInput, state *NotificationState, opts ...ResourceOption) (*Notification, error)
public static Notification Get(string name, Input<string> id, NotificationState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

InstanceId int
The CloudAMQP instance ID.
Name string
Display name of the recipient.
Type string
Type of the notification. See valid options below.
Value string
Endpoint to send the notification.
InstanceId int
The CloudAMQP instance ID.
Name string
Display name of the recipient.
Type string
Type of the notification. See valid options below.
Value string
Endpoint to send the notification.
instanceId number
The CloudAMQP instance ID.
name string
Display name of the recipient.
type string
Type of the notification. See valid options below.
value string
Endpoint to send the notification.
instance_id int
The CloudAMQP instance ID.
name str
Display name of the recipient.
type str
Type of the notification. See valid options below.
value str
Endpoint to send the notification.

Import

cloudamqp_notification can be imported using CloudAMQP internal identifier of a recipient together (CSV separated) with the instance identifier. To retrieve the identifier of a recipient, use CloudAMQP API

 $ pulumi import cloudamqp:index/notification:Notification recipient <id>,<instance_id>`

Package Details

Repository
https://github.com/pulumi/pulumi-cloudamqp
License
Apache-2.0
Notes
This Pulumi package is based on the cloudamqp Terraform Provider.