1. Packages
  2. Sumologic Provider
  3. API Docs
  4. Connection
Sumo Logic v1.0.7 published on Friday, Apr 11, 2025 by Pulumi

sumologic.Connection

Explore with Pulumi AI

Provides the ability to create, read, delete, update connections.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as sumologic from "@pulumi/sumologic";

const connection = new sumologic.Connection("connection", {
    type: "WebhookConnection",
    name: "test-connection",
    description: "My description",
    url: "https://connection-endpoint.com",
    headers: {
        "X-Header": "my-header",
    },
    customHeaders: {
        "X-custom": "my-custom-header",
    },
    defaultPayload: `{
  "client" : "Sumo Logic",
  "eventType" : "{{Name}}",
  "description" : "{{Description}}",
  "search_url" : "{{QueryUrl}}",
  "num_records" : "{{NumRawResults}}",
  "search_results" : "{{AggregateResultsJson}}"
}
`,
    resolutionPayload: `{
  "client" : "Sumo Logic",
  "eventType" : "{{Name}}",
  "description" : "{{Description}}",
  "search_url" : "{{QueryUrl}}"
}
`,
    webhookType: "Webhook",
});
Copy
import pulumi
import pulumi_sumologic as sumologic

connection = sumologic.Connection("connection",
    type="WebhookConnection",
    name="test-connection",
    description="My description",
    url="https://connection-endpoint.com",
    headers={
        "X-Header": "my-header",
    },
    custom_headers={
        "X-custom": "my-custom-header",
    },
    default_payload="""{
  "client" : "Sumo Logic",
  "eventType" : "{{Name}}",
  "description" : "{{Description}}",
  "search_url" : "{{QueryUrl}}",
  "num_records" : "{{NumRawResults}}",
  "search_results" : "{{AggregateResultsJson}}"
}
""",
    resolution_payload="""{
  "client" : "Sumo Logic",
  "eventType" : "{{Name}}",
  "description" : "{{Description}}",
  "search_url" : "{{QueryUrl}}"
}
""",
    webhook_type="Webhook")
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := sumologic.NewConnection(ctx, "connection", &sumologic.ConnectionArgs{
			Type:        pulumi.String("WebhookConnection"),
			Name:        pulumi.String("test-connection"),
			Description: pulumi.String("My description"),
			Url:         pulumi.String("https://connection-endpoint.com"),
			Headers: pulumi.StringMap{
				"X-Header": pulumi.String("my-header"),
			},
			CustomHeaders: pulumi.StringMap{
				"X-custom": pulumi.String("my-custom-header"),
			},
			DefaultPayload: pulumi.String(`{
  "client" : "Sumo Logic",
  "eventType" : "{{Name}}",
  "description" : "{{Description}}",
  "search_url" : "{{QueryUrl}}",
  "num_records" : "{{NumRawResults}}",
  "search_results" : "{{AggregateResultsJson}}"
}
`),
			ResolutionPayload: pulumi.String(`{
  "client" : "Sumo Logic",
  "eventType" : "{{Name}}",
  "description" : "{{Description}}",
  "search_url" : "{{QueryUrl}}"
}
`),
			WebhookType: pulumi.String("Webhook"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using SumoLogic = Pulumi.SumoLogic;

return await Deployment.RunAsync(() => 
{
    var connection = new SumoLogic.Connection("connection", new()
    {
        Type = "WebhookConnection",
        Name = "test-connection",
        Description = "My description",
        Url = "https://connection-endpoint.com",
        Headers = 
        {
            { "X-Header", "my-header" },
        },
        CustomHeaders = 
        {
            { "X-custom", "my-custom-header" },
        },
        DefaultPayload = @"{
  ""client"" : ""Sumo Logic"",
  ""eventType"" : ""{{Name}}"",
  ""description"" : ""{{Description}}"",
  ""search_url"" : ""{{QueryUrl}}"",
  ""num_records"" : ""{{NumRawResults}}"",
  ""search_results"" : ""{{AggregateResultsJson}}""
}
",
        ResolutionPayload = @"{
  ""client"" : ""Sumo Logic"",
  ""eventType"" : ""{{Name}}"",
  ""description"" : ""{{Description}}"",
  ""search_url"" : ""{{QueryUrl}}""
}
",
        WebhookType = "Webhook",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.sumologic.Connection;
import com.pulumi.sumologic.ConnectionArgs;
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 connection = new Connection("connection", ConnectionArgs.builder()
            .type("WebhookConnection")
            .name("test-connection")
            .description("My description")
            .url("https://connection-endpoint.com")
            .headers(Map.of("X-Header", "my-header"))
            .customHeaders(Map.of("X-custom", "my-custom-header"))
            .defaultPayload("""
{
  "client" : "Sumo Logic",
  "eventType" : "{{Name}}",
  "description" : "{{Description}}",
  "search_url" : "{{QueryUrl}}",
  "num_records" : "{{NumRawResults}}",
  "search_results" : "{{AggregateResultsJson}}"
}
            """)
            .resolutionPayload("""
{
  "client" : "Sumo Logic",
  "eventType" : "{{Name}}",
  "description" : "{{Description}}",
  "search_url" : "{{QueryUrl}}"
}
            """)
            .webhookType("Webhook")
            .build());

    }
}
Copy
resources:
  connection:
    type: sumologic:Connection
    properties:
      type: WebhookConnection
      name: test-connection
      description: My description
      url: https://connection-endpoint.com
      headers:
        X-Header: my-header
      customHeaders:
        X-custom: my-custom-header
      defaultPayload: |
        {
          "client" : "Sumo Logic",
          "eventType" : "{{Name}}",
          "description" : "{{Description}}",
          "search_url" : "{{QueryUrl}}",
          "num_records" : "{{NumRawResults}}",
          "search_results" : "{{AggregateResultsJson}}"
        }        
      resolutionPayload: |
        {
          "client" : "Sumo Logic",
          "eventType" : "{{Name}}",
          "description" : "{{Description}}",
          "search_url" : "{{QueryUrl}}"
        }        
      webhookType: Webhook
Copy

Create Connection Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Connection(name: string, args: ConnectionArgs, opts?: CustomResourceOptions);
@overload
def Connection(resource_name: str,
               args: ConnectionArgs,
               opts: Optional[ResourceOptions] = None)

@overload
def Connection(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               default_payload: Optional[str] = None,
               type: Optional[str] = None,
               url: Optional[str] = None,
               connection_subtype: Optional[str] = None,
               custom_headers: Optional[Mapping[str, str]] = None,
               description: Optional[str] = None,
               headers: Optional[Mapping[str, str]] = None,
               name: Optional[str] = None,
               resolution_payload: Optional[str] = None,
               webhook_type: Optional[str] = None)
func NewConnection(ctx *Context, name string, args ConnectionArgs, opts ...ResourceOption) (*Connection, error)
public Connection(string name, ConnectionArgs args, CustomResourceOptions? opts = null)
public Connection(String name, ConnectionArgs args)
public Connection(String name, ConnectionArgs args, CustomResourceOptions options)
type: sumologic:Connection
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ConnectionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ConnectionArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ConnectionArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ConnectionArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ConnectionArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var connectionResource = new SumoLogic.Connection("connectionResource", new()
{
    DefaultPayload = "string",
    Type = "string",
    Url = "string",
    ConnectionSubtype = "string",
    CustomHeaders = 
    {
        { "string", "string" },
    },
    Description = "string",
    Headers = 
    {
        { "string", "string" },
    },
    Name = "string",
    ResolutionPayload = "string",
    WebhookType = "string",
});
Copy
example, err := sumologic.NewConnection(ctx, "connectionResource", &sumologic.ConnectionArgs{
	DefaultPayload:    pulumi.String("string"),
	Type:              pulumi.String("string"),
	Url:               pulumi.String("string"),
	ConnectionSubtype: pulumi.String("string"),
	CustomHeaders: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Description: pulumi.String("string"),
	Headers: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Name:              pulumi.String("string"),
	ResolutionPayload: pulumi.String("string"),
	WebhookType:       pulumi.String("string"),
})
Copy
var connectionResource = new Connection("connectionResource", ConnectionArgs.builder()
    .defaultPayload("string")
    .type("string")
    .url("string")
    .connectionSubtype("string")
    .customHeaders(Map.of("string", "string"))
    .description("string")
    .headers(Map.of("string", "string"))
    .name("string")
    .resolutionPayload("string")
    .webhookType("string")
    .build());
Copy
connection_resource = sumologic.Connection("connectionResource",
    default_payload="string",
    type="string",
    url="string",
    connection_subtype="string",
    custom_headers={
        "string": "string",
    },
    description="string",
    headers={
        "string": "string",
    },
    name="string",
    resolution_payload="string",
    webhook_type="string")
Copy
const connectionResource = new sumologic.Connection("connectionResource", {
    defaultPayload: "string",
    type: "string",
    url: "string",
    connectionSubtype: "string",
    customHeaders: {
        string: "string",
    },
    description: "string",
    headers: {
        string: "string",
    },
    name: "string",
    resolutionPayload: "string",
    webhookType: "string",
});
Copy
type: sumologic:Connection
properties:
    connectionSubtype: string
    customHeaders:
        string: string
    defaultPayload: string
    description: string
    headers:
        string: string
    name: string
    resolutionPayload: string
    type: string
    url: string
    webhookType: string
Copy

Connection Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Connection resource accepts the following input properties:

DefaultPayload This property is required. string
Default payload of the webhook.
Type
This property is required.
Changes to this property will trigger replacement.
string
Type of connection. Only WebhookConnection is implemented right now.
Url This property is required. string
URL for the webhook connection.
ConnectionSubtype string
The subtype of the connection. Valid values are Incident and Event. NOTE: This is only used for the ServiceNow webhook type.
CustomHeaders Dictionary<string, string>
Map of custom webhook headers
Description string
Description of the connection.
Headers Dictionary<string, string>
Map of access authorization headers.
Name string
Name of connection. Name should be a valid alphanumeric value.
ResolutionPayload string
Resolution payload of the webhook.
WebhookType string

Type of webhook. Valid values are AWSLambda, Azure, Datadog, HipChat, Jira, PagerDuty, Slack, Webhook, NewRelic, MicrosoftTeams, ServiceNow, and SumoCloudSOAR. Default: Webhook

Additional data provided in state

DefaultPayload This property is required. string
Default payload of the webhook.
Type
This property is required.
Changes to this property will trigger replacement.
string
Type of connection. Only WebhookConnection is implemented right now.
Url This property is required. string
URL for the webhook connection.
ConnectionSubtype string
The subtype of the connection. Valid values are Incident and Event. NOTE: This is only used for the ServiceNow webhook type.
CustomHeaders map[string]string
Map of custom webhook headers
Description string
Description of the connection.
Headers map[string]string
Map of access authorization headers.
Name string
Name of connection. Name should be a valid alphanumeric value.
ResolutionPayload string
Resolution payload of the webhook.
WebhookType string

Type of webhook. Valid values are AWSLambda, Azure, Datadog, HipChat, Jira, PagerDuty, Slack, Webhook, NewRelic, MicrosoftTeams, ServiceNow, and SumoCloudSOAR. Default: Webhook

Additional data provided in state

defaultPayload This property is required. String
Default payload of the webhook.
type
This property is required.
Changes to this property will trigger replacement.
String
Type of connection. Only WebhookConnection is implemented right now.
url This property is required. String
URL for the webhook connection.
connectionSubtype String
The subtype of the connection. Valid values are Incident and Event. NOTE: This is only used for the ServiceNow webhook type.
customHeaders Map<String,String>
Map of custom webhook headers
description String
Description of the connection.
headers Map<String,String>
Map of access authorization headers.
name String
Name of connection. Name should be a valid alphanumeric value.
resolutionPayload String
Resolution payload of the webhook.
webhookType String

Type of webhook. Valid values are AWSLambda, Azure, Datadog, HipChat, Jira, PagerDuty, Slack, Webhook, NewRelic, MicrosoftTeams, ServiceNow, and SumoCloudSOAR. Default: Webhook

Additional data provided in state

defaultPayload This property is required. string
Default payload of the webhook.
type
This property is required.
Changes to this property will trigger replacement.
string
Type of connection. Only WebhookConnection is implemented right now.
url This property is required. string
URL for the webhook connection.
connectionSubtype string
The subtype of the connection. Valid values are Incident and Event. NOTE: This is only used for the ServiceNow webhook type.
customHeaders {[key: string]: string}
Map of custom webhook headers
description string
Description of the connection.
headers {[key: string]: string}
Map of access authorization headers.
name string
Name of connection. Name should be a valid alphanumeric value.
resolutionPayload string
Resolution payload of the webhook.
webhookType string

Type of webhook. Valid values are AWSLambda, Azure, Datadog, HipChat, Jira, PagerDuty, Slack, Webhook, NewRelic, MicrosoftTeams, ServiceNow, and SumoCloudSOAR. Default: Webhook

Additional data provided in state

default_payload This property is required. str
Default payload of the webhook.
type
This property is required.
Changes to this property will trigger replacement.
str
Type of connection. Only WebhookConnection is implemented right now.
url This property is required. str
URL for the webhook connection.
connection_subtype str
The subtype of the connection. Valid values are Incident and Event. NOTE: This is only used for the ServiceNow webhook type.
custom_headers Mapping[str, str]
Map of custom webhook headers
description str
Description of the connection.
headers Mapping[str, str]
Map of access authorization headers.
name str
Name of connection. Name should be a valid alphanumeric value.
resolution_payload str
Resolution payload of the webhook.
webhook_type str

Type of webhook. Valid values are AWSLambda, Azure, Datadog, HipChat, Jira, PagerDuty, Slack, Webhook, NewRelic, MicrosoftTeams, ServiceNow, and SumoCloudSOAR. Default: Webhook

Additional data provided in state

defaultPayload This property is required. String
Default payload of the webhook.
type
This property is required.
Changes to this property will trigger replacement.
String
Type of connection. Only WebhookConnection is implemented right now.
url This property is required. String
URL for the webhook connection.
connectionSubtype String
The subtype of the connection. Valid values are Incident and Event. NOTE: This is only used for the ServiceNow webhook type.
customHeaders Map<String>
Map of custom webhook headers
description String
Description of the connection.
headers Map<String>
Map of access authorization headers.
name String
Name of connection. Name should be a valid alphanumeric value.
resolutionPayload String
Resolution payload of the webhook.
webhookType String

Type of webhook. Valid values are AWSLambda, Azure, Datadog, HipChat, Jira, PagerDuty, Slack, Webhook, NewRelic, MicrosoftTeams, ServiceNow, and SumoCloudSOAR. Default: Webhook

Additional data provided in state

Outputs

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

Get an existing Connection 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?: ConnectionState, opts?: CustomResourceOptions): Connection
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        connection_subtype: Optional[str] = None,
        custom_headers: Optional[Mapping[str, str]] = None,
        default_payload: Optional[str] = None,
        description: Optional[str] = None,
        headers: Optional[Mapping[str, str]] = None,
        name: Optional[str] = None,
        resolution_payload: Optional[str] = None,
        type: Optional[str] = None,
        url: Optional[str] = None,
        webhook_type: Optional[str] = None) -> Connection
func GetConnection(ctx *Context, name string, id IDInput, state *ConnectionState, opts ...ResourceOption) (*Connection, error)
public static Connection Get(string name, Input<string> id, ConnectionState? state, CustomResourceOptions? opts = null)
public static Connection get(String name, Output<String> id, ConnectionState state, CustomResourceOptions options)
resources:  _:    type: sumologic:Connection    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
ConnectionSubtype string
The subtype of the connection. Valid values are Incident and Event. NOTE: This is only used for the ServiceNow webhook type.
CustomHeaders Dictionary<string, string>
Map of custom webhook headers
DefaultPayload string
Default payload of the webhook.
Description string
Description of the connection.
Headers Dictionary<string, string>
Map of access authorization headers.
Name string
Name of connection. Name should be a valid alphanumeric value.
ResolutionPayload string
Resolution payload of the webhook.
Type Changes to this property will trigger replacement. string
Type of connection. Only WebhookConnection is implemented right now.
Url string
URL for the webhook connection.
WebhookType string

Type of webhook. Valid values are AWSLambda, Azure, Datadog, HipChat, Jira, PagerDuty, Slack, Webhook, NewRelic, MicrosoftTeams, ServiceNow, and SumoCloudSOAR. Default: Webhook

Additional data provided in state

ConnectionSubtype string
The subtype of the connection. Valid values are Incident and Event. NOTE: This is only used for the ServiceNow webhook type.
CustomHeaders map[string]string
Map of custom webhook headers
DefaultPayload string
Default payload of the webhook.
Description string
Description of the connection.
Headers map[string]string
Map of access authorization headers.
Name string
Name of connection. Name should be a valid alphanumeric value.
ResolutionPayload string
Resolution payload of the webhook.
Type Changes to this property will trigger replacement. string
Type of connection. Only WebhookConnection is implemented right now.
Url string
URL for the webhook connection.
WebhookType string

Type of webhook. Valid values are AWSLambda, Azure, Datadog, HipChat, Jira, PagerDuty, Slack, Webhook, NewRelic, MicrosoftTeams, ServiceNow, and SumoCloudSOAR. Default: Webhook

Additional data provided in state

connectionSubtype String
The subtype of the connection. Valid values are Incident and Event. NOTE: This is only used for the ServiceNow webhook type.
customHeaders Map<String,String>
Map of custom webhook headers
defaultPayload String
Default payload of the webhook.
description String
Description of the connection.
headers Map<String,String>
Map of access authorization headers.
name String
Name of connection. Name should be a valid alphanumeric value.
resolutionPayload String
Resolution payload of the webhook.
type Changes to this property will trigger replacement. String
Type of connection. Only WebhookConnection is implemented right now.
url String
URL for the webhook connection.
webhookType String

Type of webhook. Valid values are AWSLambda, Azure, Datadog, HipChat, Jira, PagerDuty, Slack, Webhook, NewRelic, MicrosoftTeams, ServiceNow, and SumoCloudSOAR. Default: Webhook

Additional data provided in state

connectionSubtype string
The subtype of the connection. Valid values are Incident and Event. NOTE: This is only used for the ServiceNow webhook type.
customHeaders {[key: string]: string}
Map of custom webhook headers
defaultPayload string
Default payload of the webhook.
description string
Description of the connection.
headers {[key: string]: string}
Map of access authorization headers.
name string
Name of connection. Name should be a valid alphanumeric value.
resolutionPayload string
Resolution payload of the webhook.
type Changes to this property will trigger replacement. string
Type of connection. Only WebhookConnection is implemented right now.
url string
URL for the webhook connection.
webhookType string

Type of webhook. Valid values are AWSLambda, Azure, Datadog, HipChat, Jira, PagerDuty, Slack, Webhook, NewRelic, MicrosoftTeams, ServiceNow, and SumoCloudSOAR. Default: Webhook

Additional data provided in state

connection_subtype str
The subtype of the connection. Valid values are Incident and Event. NOTE: This is only used for the ServiceNow webhook type.
custom_headers Mapping[str, str]
Map of custom webhook headers
default_payload str
Default payload of the webhook.
description str
Description of the connection.
headers Mapping[str, str]
Map of access authorization headers.
name str
Name of connection. Name should be a valid alphanumeric value.
resolution_payload str
Resolution payload of the webhook.
type Changes to this property will trigger replacement. str
Type of connection. Only WebhookConnection is implemented right now.
url str
URL for the webhook connection.
webhook_type str

Type of webhook. Valid values are AWSLambda, Azure, Datadog, HipChat, Jira, PagerDuty, Slack, Webhook, NewRelic, MicrosoftTeams, ServiceNow, and SumoCloudSOAR. Default: Webhook

Additional data provided in state

connectionSubtype String
The subtype of the connection. Valid values are Incident and Event. NOTE: This is only used for the ServiceNow webhook type.
customHeaders Map<String>
Map of custom webhook headers
defaultPayload String
Default payload of the webhook.
description String
Description of the connection.
headers Map<String>
Map of access authorization headers.
name String
Name of connection. Name should be a valid alphanumeric value.
resolutionPayload String
Resolution payload of the webhook.
type Changes to this property will trigger replacement. String
Type of connection. Only WebhookConnection is implemented right now.
url String
URL for the webhook connection.
webhookType String

Type of webhook. Valid values are AWSLambda, Azure, Datadog, HipChat, Jira, PagerDuty, Slack, Webhook, NewRelic, MicrosoftTeams, ServiceNow, and SumoCloudSOAR. Default: Webhook

Additional data provided in state

Import

Connections can be imported using the connection id, e.g.:

hcl

$ pulumi import sumologic:index/connection:Connection test 1234567890
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Sumo Logic pulumi/pulumi-sumologic
License
Apache-2.0
Notes
This Pulumi package is based on the sumologic Terraform Provider.