opsgenie logo
Opsgenie v1.2.4, May 26 23

opsgenie.EmailIntegration

Explore with Pulumi AI

Manages an Email Integration within Opsgenie.

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Opsgenie = Pulumi.Opsgenie;

return await Deployment.RunAsync(() => 
{
    var testEmailIntegration = new Opsgenie.EmailIntegration("testEmailIntegration", new()
    {
        EmailUsername = "fahri",
    });

    var testIndex_emailIntegrationEmailIntegration = new Opsgenie.EmailIntegration("testIndex/emailIntegrationEmailIntegration", new()
    {
        Responders = new[]
        {
            new Opsgenie.Inputs.EmailIntegrationResponderArgs
            {
                Type = "user",
                Id = opsgenie_user.Test.Id,
            },
            new Opsgenie.Inputs.EmailIntegrationResponderArgs
            {
                Type = "schedule",
                Id = opsgenie_schedule.Test.Id,
            },
            new Opsgenie.Inputs.EmailIntegrationResponderArgs
            {
                Type = "escalation",
                Id = opsgenie_escalation.Test.Id,
            },
            new Opsgenie.Inputs.EmailIntegrationResponderArgs
            {
                Type = "team",
                Id = opsgenie_team.Test2.Id,
            },
        },
        EmailUsername = "test",
        Enabled = true,
        IgnoreRespondersFromPayload = true,
        SuppressNotifications = true,
    });

    var testOpsgenieIndex_emailIntegrationEmailIntegration = new Opsgenie.EmailIntegration("testOpsgenieIndex/emailIntegrationEmailIntegration", new()
    {
        Responders = new[]
        {
            new Opsgenie.Inputs.EmailIntegrationResponderArgs
            {
                Type = "user",
                Id = opsgenie_user.Test.Id,
            },
        },
        EmailUsername = "test",
        Enabled = true,
        IgnoreRespondersFromPayload = true,
        SuppressNotifications = true,
        OwnerTeamId = opsgenie_team_genies.Id,
    });

});
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.NewEmailIntegration(ctx, "testEmailIntegration", &opsgenie.EmailIntegrationArgs{
			EmailUsername: pulumi.String("fahri"),
		})
		if err != nil {
			return err
		}
		_, err = opsgenie.NewEmailIntegration(ctx, "testIndex/emailIntegrationEmailIntegration", &opsgenie.EmailIntegrationArgs{
			Responders: opsgenie.EmailIntegrationResponderArray{
				&opsgenie.EmailIntegrationResponderArgs{
					Type: pulumi.String("user"),
					Id:   pulumi.Any(opsgenie_user.Test.Id),
				},
				&opsgenie.EmailIntegrationResponderArgs{
					Type: pulumi.String("schedule"),
					Id:   pulumi.Any(opsgenie_schedule.Test.Id),
				},
				&opsgenie.EmailIntegrationResponderArgs{
					Type: pulumi.String("escalation"),
					Id:   pulumi.Any(opsgenie_escalation.Test.Id),
				},
				&opsgenie.EmailIntegrationResponderArgs{
					Type: pulumi.String("team"),
					Id:   pulumi.Any(opsgenie_team.Test2.Id),
				},
			},
			EmailUsername:               pulumi.String("test"),
			Enabled:                     pulumi.Bool(true),
			IgnoreRespondersFromPayload: pulumi.Bool(true),
			SuppressNotifications:       pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		_, err = opsgenie.NewEmailIntegration(ctx, "testOpsgenieIndex/emailIntegrationEmailIntegration", &opsgenie.EmailIntegrationArgs{
			Responders: opsgenie.EmailIntegrationResponderArray{
				&opsgenie.EmailIntegrationResponderArgs{
					Type: pulumi.String("user"),
					Id:   pulumi.Any(opsgenie_user.Test.Id),
				},
			},
			EmailUsername:               pulumi.String("test"),
			Enabled:                     pulumi.Bool(true),
			IgnoreRespondersFromPayload: pulumi.Bool(true),
			SuppressNotifications:       pulumi.Bool(true),
			OwnerTeamId:                 pulumi.Any(opsgenie_team_genies.Id),
		})
		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.EmailIntegration;
import com.pulumi.opsgenie.EmailIntegrationArgs;
import com.pulumi.opsgenie.inputs.EmailIntegrationResponderArgs;
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 testEmailIntegration = new EmailIntegration("testEmailIntegration", EmailIntegrationArgs.builder()        
            .emailUsername("fahri")
            .build());

        var testIndex_emailIntegrationEmailIntegration = new EmailIntegration("testIndex/emailIntegrationEmailIntegration", EmailIntegrationArgs.builder()        
            .responders(            
                EmailIntegrationResponderArgs.builder()
                    .type("user")
                    .id(opsgenie_user.test().id())
                    .build(),
                EmailIntegrationResponderArgs.builder()
                    .type("schedule")
                    .id(opsgenie_schedule.test().id())
                    .build(),
                EmailIntegrationResponderArgs.builder()
                    .type("escalation")
                    .id(opsgenie_escalation.test().id())
                    .build(),
                EmailIntegrationResponderArgs.builder()
                    .type("team")
                    .id(opsgenie_team.test2().id())
                    .build())
            .emailUsername("test")
            .enabled(true)
            .ignoreRespondersFromPayload(true)
            .suppressNotifications(true)
            .build());

        var testOpsgenieIndex_emailIntegrationEmailIntegration = new EmailIntegration("testOpsgenieIndex/emailIntegrationEmailIntegration", EmailIntegrationArgs.builder()        
            .responders(EmailIntegrationResponderArgs.builder()
                .type("user")
                .id(opsgenie_user.test().id())
                .build())
            .emailUsername("test")
            .enabled(true)
            .ignoreRespondersFromPayload(true)
            .suppressNotifications(true)
            .ownerTeamId(opsgenie_team_genies.id())
            .build());

    }
}
import pulumi
import pulumi_opsgenie as opsgenie

test_email_integration = opsgenie.EmailIntegration("testEmailIntegration", email_username="fahri")
test_index_email_integration_email_integration = opsgenie.EmailIntegration("testIndex/emailIntegrationEmailIntegration",
    responders=[
        opsgenie.EmailIntegrationResponderArgs(
            type="user",
            id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        ),
        opsgenie.EmailIntegrationResponderArgs(
            type="schedule",
            id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        ),
        opsgenie.EmailIntegrationResponderArgs(
            type="escalation",
            id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        ),
        opsgenie.EmailIntegrationResponderArgs(
            type="team",
            id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        ),
    ],
    email_username="test",
    enabled=True,
    ignore_responders_from_payload=True,
    suppress_notifications=True)
test_opsgenie_index_email_integration_email_integration = opsgenie.EmailIntegration("testOpsgenieIndex/emailIntegrationEmailIntegration",
    responders=[opsgenie.EmailIntegrationResponderArgs(
        type="user",
        id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
    )],
    email_username="test",
    enabled=True,
    ignore_responders_from_payload=True,
    suppress_notifications=True,
    owner_team_id=opsgenie_team_genies["id"])
import * as pulumi from "@pulumi/pulumi";
import * as opsgenie from "@pulumi/opsgenie";

const testEmailIntegration = new opsgenie.EmailIntegration("testEmailIntegration", {emailUsername: "fahri"});
const testIndex_emailIntegrationEmailIntegration = new opsgenie.EmailIntegration("testIndex/emailIntegrationEmailIntegration", {
    responders: [
        {
            type: "user",
            id: opsgenie_user.test.id,
        },
        {
            type: "schedule",
            id: opsgenie_schedule.test.id,
        },
        {
            type: "escalation",
            id: opsgenie_escalation.test.id,
        },
        {
            type: "team",
            id: opsgenie_team.test2.id,
        },
    ],
    emailUsername: "test",
    enabled: true,
    ignoreRespondersFromPayload: true,
    suppressNotifications: true,
});
const testOpsgenieIndex_emailIntegrationEmailIntegration = new opsgenie.EmailIntegration("testOpsgenieIndex/emailIntegrationEmailIntegration", {
    responders: [{
        type: "user",
        id: opsgenie_user.test.id,
    }],
    emailUsername: "test",
    enabled: true,
    ignoreRespondersFromPayload: true,
    suppressNotifications: true,
    ownerTeamId: opsgenie_team_genies.id,
});
resources:
  testEmailIntegration:
    type: opsgenie:EmailIntegration
    properties:
      emailUsername: fahri
  testIndex/emailIntegrationEmailIntegration:
    type: opsgenie:EmailIntegration
    properties:
      responders:
        - type: user
          id: ${opsgenie_user.test.id}
        - type: schedule
          id: ${opsgenie_schedule.test.id}
        - type: escalation
          id: ${opsgenie_escalation.test.id}
        - type: team
          id: ${opsgenie_team.test2.id}
      emailUsername: test
      enabled: true
      ignoreRespondersFromPayload: true
      suppressNotifications: true
  testOpsgenieIndex/emailIntegrationEmailIntegration:
    type: opsgenie:EmailIntegration
    properties:
      responders:
        - type: user
          id: ${opsgenie_user.test.id}
      emailUsername: test
      enabled: true
      ignoreRespondersFromPayload: true
      suppressNotifications: true
      ownerTeamId: ${opsgenie_team_genies.id}

Create EmailIntegration Resource

new EmailIntegration(name: string, args: EmailIntegrationArgs, opts?: CustomResourceOptions);
@overload
def EmailIntegration(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     email_username: Optional[str] = None,
                     enabled: Optional[bool] = None,
                     ignore_responders_from_payload: Optional[bool] = None,
                     name: Optional[str] = None,
                     owner_team_id: Optional[str] = None,
                     responders: Optional[Sequence[EmailIntegrationResponderArgs]] = None,
                     suppress_notifications: Optional[bool] = None)
@overload
def EmailIntegration(resource_name: str,
                     args: EmailIntegrationArgs,
                     opts: Optional[ResourceOptions] = None)
func NewEmailIntegration(ctx *Context, name string, args EmailIntegrationArgs, opts ...ResourceOption) (*EmailIntegration, error)
public EmailIntegration(string name, EmailIntegrationArgs args, CustomResourceOptions? opts = null)
public EmailIntegration(String name, EmailIntegrationArgs args)
public EmailIntegration(String name, EmailIntegrationArgs args, CustomResourceOptions options)
type: opsgenie:EmailIntegration
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

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

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

EmailUsername string

The username part of the email address. It must be unique for each integration.

Enabled bool

A Member block as documented below.

IgnoreRespondersFromPayload bool

If enabled, the integration will ignore recipients sent in request payloads. Default: false.

Name string

Name of the integration. Name must be unique for each integration.

OwnerTeamId string

Owner team id of the integration.

Responders List<EmailIntegrationResponderArgs>
SuppressNotifications bool

If enabled, notifications that come from alerts will be suppressed. Default: false.

EmailUsername string

The username part of the email address. It must be unique for each integration.

Enabled bool

A Member block as documented below.

IgnoreRespondersFromPayload bool

If enabled, the integration will ignore recipients sent in request payloads. Default: false.

Name string

Name of the integration. Name must be unique for each integration.

OwnerTeamId string

Owner team id of the integration.

Responders []EmailIntegrationResponderArgs
SuppressNotifications bool

If enabled, notifications that come from alerts will be suppressed. Default: false.

emailUsername String

The username part of the email address. It must be unique for each integration.

enabled Boolean

A Member block as documented below.

ignoreRespondersFromPayload Boolean

If enabled, the integration will ignore recipients sent in request payloads. Default: false.

name String

Name of the integration. Name must be unique for each integration.

ownerTeamId String

Owner team id of the integration.

responders List<EmailIntegrationResponderArgs>
suppressNotifications Boolean

If enabled, notifications that come from alerts will be suppressed. Default: false.

emailUsername string

The username part of the email address. It must be unique for each integration.

enabled boolean

A Member block as documented below.

ignoreRespondersFromPayload boolean

If enabled, the integration will ignore recipients sent in request payloads. Default: false.

name string

Name of the integration. Name must be unique for each integration.

ownerTeamId string

Owner team id of the integration.

responders EmailIntegrationResponderArgs[]
suppressNotifications boolean

If enabled, notifications that come from alerts will be suppressed. Default: false.

email_username str

The username part of the email address. It must be unique for each integration.

enabled bool

A Member block as documented below.

ignore_responders_from_payload bool

If enabled, the integration will ignore recipients sent in request payloads. Default: false.

name str

Name of the integration. Name must be unique for each integration.

owner_team_id str

Owner team id of the integration.

responders Sequence[EmailIntegrationResponderArgs]
suppress_notifications bool

If enabled, notifications that come from alerts will be suppressed. Default: false.

emailUsername String

The username part of the email address. It must be unique for each integration.

enabled Boolean

A Member block as documented below.

ignoreRespondersFromPayload Boolean

If enabled, the integration will ignore recipients sent in request payloads. Default: false.

name String

Name of the integration. Name must be unique for each integration.

ownerTeamId String

Owner team id of the integration.

responders List<Property Map>
suppressNotifications Boolean

If enabled, notifications that come from alerts will be suppressed. Default: false.

Outputs

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

Get an existing EmailIntegration 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?: EmailIntegrationState, opts?: CustomResourceOptions): EmailIntegration
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        email_username: Optional[str] = None,
        enabled: Optional[bool] = None,
        ignore_responders_from_payload: Optional[bool] = None,
        name: Optional[str] = None,
        owner_team_id: Optional[str] = None,
        responders: Optional[Sequence[EmailIntegrationResponderArgs]] = None,
        suppress_notifications: Optional[bool] = None) -> EmailIntegration
func GetEmailIntegration(ctx *Context, name string, id IDInput, state *EmailIntegrationState, opts ...ResourceOption) (*EmailIntegration, error)
public static EmailIntegration Get(string name, Input<string> id, EmailIntegrationState? state, CustomResourceOptions? opts = null)
public static EmailIntegration get(String name, Output<String> id, EmailIntegrationState 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:
EmailUsername string

The username part of the email address. It must be unique for each integration.

Enabled bool

A Member block as documented below.

IgnoreRespondersFromPayload bool

If enabled, the integration will ignore recipients sent in request payloads. Default: false.

Name string

Name of the integration. Name must be unique for each integration.

OwnerTeamId string

Owner team id of the integration.

Responders List<EmailIntegrationResponderArgs>
SuppressNotifications bool

If enabled, notifications that come from alerts will be suppressed. Default: false.

EmailUsername string

The username part of the email address. It must be unique for each integration.

Enabled bool

A Member block as documented below.

IgnoreRespondersFromPayload bool

If enabled, the integration will ignore recipients sent in request payloads. Default: false.

Name string

Name of the integration. Name must be unique for each integration.

OwnerTeamId string

Owner team id of the integration.

Responders []EmailIntegrationResponderArgs
SuppressNotifications bool

If enabled, notifications that come from alerts will be suppressed. Default: false.

emailUsername String

The username part of the email address. It must be unique for each integration.

enabled Boolean

A Member block as documented below.

ignoreRespondersFromPayload Boolean

If enabled, the integration will ignore recipients sent in request payloads. Default: false.

name String

Name of the integration. Name must be unique for each integration.

ownerTeamId String

Owner team id of the integration.

responders List<EmailIntegrationResponderArgs>
suppressNotifications Boolean

If enabled, notifications that come from alerts will be suppressed. Default: false.

emailUsername string

The username part of the email address. It must be unique for each integration.

enabled boolean

A Member block as documented below.

ignoreRespondersFromPayload boolean

If enabled, the integration will ignore recipients sent in request payloads. Default: false.

name string

Name of the integration. Name must be unique for each integration.

ownerTeamId string

Owner team id of the integration.

responders EmailIntegrationResponderArgs[]
suppressNotifications boolean

If enabled, notifications that come from alerts will be suppressed. Default: false.

email_username str

The username part of the email address. It must be unique for each integration.

enabled bool

A Member block as documented below.

ignore_responders_from_payload bool

If enabled, the integration will ignore recipients sent in request payloads. Default: false.

name str

Name of the integration. Name must be unique for each integration.

owner_team_id str

Owner team id of the integration.

responders Sequence[EmailIntegrationResponderArgs]
suppress_notifications bool

If enabled, notifications that come from alerts will be suppressed. Default: false.

emailUsername String

The username part of the email address. It must be unique for each integration.

enabled Boolean

A Member block as documented below.

ignoreRespondersFromPayload Boolean

If enabled, the integration will ignore recipients sent in request payloads. Default: false.

name String

Name of the integration. Name must be unique for each integration.

ownerTeamId String

Owner team id of the integration.

responders List<Property Map>
suppressNotifications Boolean

If enabled, notifications that come from alerts will be suppressed. Default: false.

Supporting Types

EmailIntegrationResponder

Id string

The id of the responder.

Type string

The responder type.

Id string

The id of the responder.

Type string

The responder type.

id String

The id of the responder.

type String

The responder type.

id string

The id of the responder.

type string

The responder type.

id str

The id of the responder.

type str

The responder type.

id String

The id of the responder.

type String

The responder type.

Import

Email Integrations can be imported using the id, e.g.

 $ pulumi import opsgenie:index/emailIntegration:EmailIntegration test id`

Package Details

Repository
Opsgenie pulumi/pulumi-opsgenie
License
Apache-2.0
Notes

This Pulumi package is based on the opsgenie Terraform Provider.