1. Packages
  2. Opsgenie
  3. API Docs
  4. UserContact
Opsgenie v1.3.6 published on Tuesday, Feb 27, 2024 by Pulumi

opsgenie.UserContact

Explore with Pulumi AI

opsgenie logo
Opsgenie v1.3.6 published on Tuesday, Feb 27, 2024 by Pulumi

    Manages a User Contact.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Opsgenie = Pulumi.Opsgenie;
    
    return await Deployment.RunAsync(() => 
    {
        var sms = new Opsgenie.UserContact("sms", new()
        {
            Method = "sms",
            To = "39-123",
            Username = opsgenie_user.Exampleuser.Username,
        });
    
        var email = new Opsgenie.UserContact("email", new()
        {
            Method = "email",
            To = "fahri@opsgenie.com",
            Username = opsgenie_user.Exampleuser.Username,
        });
    
        var voice = new Opsgenie.UserContact("voice", new()
        {
            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
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.opsgenie.UserContact;
    import com.pulumi.opsgenie.UserContactArgs;
    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 sms = new UserContact("sms", UserContactArgs.builder()        
                .method("sms")
                .to("39-123")
                .username(opsgenie_user.exampleuser().username())
                .build());
    
            var email = new UserContact("email", UserContactArgs.builder()        
                .method("email")
                .to("fahri@opsgenie.com")
                .username(opsgenie_user.exampleuser().username())
                .build());
    
            var voice = new UserContact("voice", UserContactArgs.builder()        
                .method("voice")
                .to("39-123")
                .username(opsgenie_user.exampleuser().username())
                .build());
    
        }
    }
    
    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,
    });
    
    resources:
      sms:
        type: opsgenie:UserContact
        properties:
          method: sms
          to: 39-123
          username: ${opsgenie_user.exampleuser.username}
      email:
        type: opsgenie:UserContact
        properties:
          method: email
          to: fahri@opsgenie.com
          username: ${opsgenie_user.exampleuser.username}
      voice:
        type: opsgenie:UserContact
        properties:
          method: voice
          to: 39-123
          username: ${opsgenie_user.exampleuser.username}
    

    Create 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)
    public UserContact(String name, UserContactArgs args)
    public UserContact(String name, UserContactArgs args, CustomResourceOptions options)
    
    type: opsgenie:UserContact
    properties: # The arguments to resource properties.
    options: # 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.
    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.
    name String
    The unique name of the resource.
    args UserContactArgs
    The arguments to resource properties.
    options 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 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.
    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.

    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 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 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)
    public static UserContact get(String name, Output<String> id, UserContactState 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:
    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 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)
    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)

    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
    Opsgenie pulumi/pulumi-opsgenie
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the opsgenie Terraform Provider.
    opsgenie logo
    Opsgenie v1.3.6 published on Tuesday, Feb 27, 2024 by Pulumi