Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

Opsgenie

v1.1.0 published on Thursday, Nov 11, 2021 by Pulumi

UserContact

Manages a User Contact.

Example Usage

using Pulumi;
using Opsgenie = Pulumi.Opsgenie;

class MyStack : Stack
{
    public MyStack()
    {
        var sms = new Opsgenie.UserContact("sms", new Opsgenie.UserContactArgs
        {
            Method = "sms",
            To = "39-123",
            Username = opsgenie_user.Exampleuser.Username,
        });
        var email = new Opsgenie.UserContact("email", new Opsgenie.UserContactArgs
        {
            Method = "email",
            To = "fahri@opsgenie.com",
            Username = opsgenie_user.Exampleuser.Username,
        });
        var voice = new Opsgenie.UserContact("voice", new Opsgenie.UserContactArgs
        {
            Method = "voice",
            To = "39-123",
            Username = opsgenie_user.Exampleuser.Username,
        });
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := opsgenie.NewUserContact(ctx, "sms", &opsgenie.UserContactArgs{
			Method:   pulumi.String("sms"),
			To:       pulumi.String("39-123"),
			Username: pulumi.Any(opsgenie_user.Exampleuser.Username),
		})
		if err != nil {
			return err
		}
		_, err = opsgenie.NewUserContact(ctx, "email", &opsgenie.UserContactArgs{
			Method:   pulumi.String("email"),
			To:       pulumi.String("fahri@opsgenie.com"),
			Username: pulumi.Any(opsgenie_user.Exampleuser.Username),
		})
		if err != nil {
			return err
		}
		_, err = opsgenie.NewUserContact(ctx, "voice", &opsgenie.UserContactArgs{
			Method:   pulumi.String("voice"),
			To:       pulumi.String("39-123"),
			Username: pulumi.Any(opsgenie_user.Exampleuser.Username),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_opsgenie as opsgenie

sms = opsgenie.UserContact("sms",
    method="sms",
    to="39-123",
    username=opsgenie_user["exampleuser"]["username"])
email = opsgenie.UserContact("email",
    method="email",
    to="fahri@opsgenie.com",
    username=opsgenie_user["exampleuser"]["username"])
voice = opsgenie.UserContact("voice",
    method="voice",
    to="39-123",
    username=opsgenie_user["exampleuser"]["username"])
import * as pulumi from "@pulumi/pulumi";
import * as opsgenie from "@pulumi/opsgenie";

const sms = new opsgenie.UserContact("sms", {
    method: "sms",
    to: "39-123",
    username: opsgenie_user_exampleuser.username,
});
const email = new opsgenie.UserContact("email", {
    method: "email",
    to: "fahri@opsgenie.com",
    username: opsgenie_user_exampleuser.username,
});
const voice = new opsgenie.UserContact("voice", {
    method: "voice",
    to: "39-123",
    username: opsgenie_user_exampleuser.username,
});

Create a UserContact Resource

new UserContact(name: string, args: UserContactArgs, opts?: CustomResourceOptions);
@overload
def UserContact(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                enabled: Optional[bool] = None,
                method: Optional[str] = None,
                to: Optional[str] = None,
                username: Optional[str] = None)
@overload
def UserContact(resource_name: str,
                args: UserContactArgs,
                opts: Optional[ResourceOptions] = None)
func NewUserContact(ctx *Context, name string, args UserContactArgs, opts ...ResourceOption) (*UserContact, error)
public UserContact(string name, UserContactArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args UserContactArgs
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 UserContactArgs
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 UserContactArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args UserContactArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

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

Method string
This parameter is the contact method of user and should be one of email, sms or voice. Please note that adding mobile is not supported from API.
To string
to field is the address of given method.
Username string
The username for contact.(reference)
Enabled bool
Enable contact of the user in OpsGenie. Default value is true.
Method string
This parameter is the contact method of user and should be one of email, sms or voice. Please note that adding mobile is not supported from API.
To string
to field is the address of given method.
Username string
The username for contact.(reference)
Enabled bool
Enable contact of the user in OpsGenie. Default value is true.
method string
This parameter is the contact method of user and should be one of email, sms or voice. Please note that adding mobile is not supported from API.
to string
to field is the address of given method.
username string
The username for contact.(reference)
enabled boolean
Enable contact of the user in OpsGenie. Default value is true.
method str
This parameter is the contact method of user and should be one of email, sms or voice. Please note that adding mobile is not supported from API.
to str
to field is the address of given method.
username str
The username for contact.(reference)
enabled bool
Enable contact of the user in OpsGenie. Default value is true.

Outputs

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

Get an existing UserContact 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?: UserContactState, opts?: CustomResourceOptions): UserContact
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        enabled: Optional[bool] = None,
        method: Optional[str] = None,
        to: Optional[str] = None,
        username: Optional[str] = None) -> UserContact
func GetUserContact(ctx *Context, name string, id IDInput, state *UserContactState, opts ...ResourceOption) (*UserContact, error)
public static UserContact Get(string name, Input<string> id, UserContactState? 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:

Enabled bool
Enable contact of the user in OpsGenie. Default value is true.
Method string
This parameter is the contact method of user and should be one of email, sms or voice. Please note that adding mobile is not supported from API.
To string
to field is the address of given method.
Username string
The username for contact.(reference)
Enabled bool
Enable contact of the user in OpsGenie. Default value is true.
Method string
This parameter is the contact method of user and should be one of email, sms or voice. Please note that adding mobile is not supported from API.
To string
to field is the address of given method.
Username string
The username for contact.(reference)
enabled boolean
Enable contact of the user in OpsGenie. Default value is true.
method string
This parameter is the contact method of user and should be one of email, sms or voice. Please note that adding mobile is not supported from API.
to string
to field is the address of given method.
username string
The username for contact.(reference)
enabled bool
Enable contact of the user in OpsGenie. Default value is true.
method str
This parameter is the contact method of user and should be one of email, sms or voice. Please note that adding mobile is not supported from API.
to str
to field is the address of given method.
username str
The username for contact.(reference)

Import

Users can be imported using the username/contact_id, e.g.

 $ pulumi import opsgenie:index/userContact:UserContact testcontact username/contact_id`

Package Details

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