SumoLogic

Pulumi Official
Package maintained by Pulumi
v0.6.0 published on Thursday, Apr 7, 2022 by Pulumi

Content

Attributes reference

The following attributes are exported:

  • id - Unique identifier for the content item.

Example Usage

using System.Collections.Generic;
using System.Text.Json;
using Pulumi;
using SumoLogic = Pulumi.SumoLogic;

class MyStack : Stack
{
    public MyStack()
    {
        var personalFolder = Output.Create(SumoLogic.GetPersonalFolder.InvokeAsync());
        var test = new SumoLogic.Content("test", new SumoLogic.ContentArgs
        {
            ParentId = personalFolder.Apply(personalFolder => personalFolder.Id),
            Config = JsonSerializer.Serialize(new Dictionary<string, object?>
            {
                { "type", "SavedSearchWithScheduleSyncDefinition" },
                { "name", "test-333" },
                { "search", new Dictionary<string, object?>
                {
                    { "queryText", "\"warn\"" },
                    { "defaultTimeRange", "-15m" },
                    { "byReceiptTime", false },
                    { "viewName", "" },
                    { "viewStartTime", "1970-01-01T00:00:00Z" },
                    { "queryParameters", new[]
                        {
                        }
                     },
                    { "parsingMode", "Manual" },
                } },
                { "searchSchedule", new Dictionary<string, object?>
                {
                    { "cronExpression", "0 0 * * * ? *" },
                    { "displayableTimeRange", "-10m" },
                    { "parseableTimeRange", new Dictionary<string, object?>
                    {
                        { "type", "BeginBoundedTimeRange" },
                        { "from", new Dictionary<string, object?>
                        {
                            { "type", "RelativeTimeRangeBoundary" },
                            { "relativeTime", "-50m" },
                        } },
                        { "to", null },
                    } },
                    { "timeZone", "America/Los_Angeles" },
                    { "threshold", new Dictionary<string, object?>
                    {
                        { "thresholdType", "message" },
                        { "operator", "gt" },
                        { "count", 0 },
                    } },
                    { "notification", new Dictionary<string, object?>
                    {
                        { "taskType", "EmailSearchNotificationSyncDefinition" },
                        { "toList", new[]
                            {
                                "ops@acme.org",
                            }
                         },
                        { "subjectTemplate", "Search Results: {{Name}}" },
                        { "includeQuery", true },
                        { "includeResultSet", true },
                        { "includeHistogram", false },
                        { "includeCsvAttachment", false },
                    } },
                    { "scheduleType", "1Hour" },
                    { "muteErrorEmails", false },
                    { "parameters", new[]
                        {
                        }
                     },
                } },
                { "description", "Runs every hour with timerange of 15m and sends email notifications" },
            }),
        });
    }

}
package main

import (
	"encoding/json"

	"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 {
		personalFolder, err := sumologic.GetPersonalFolder(ctx, nil, nil)
		if err != nil {
			return err
		}
		tmpJSON0, err := json.Marshal(map[string]interface{}{
			"type": "SavedSearchWithScheduleSyncDefinition",
			"name": "test-333",
			"search": map[string]interface{}{
				"queryText":        "\"warn\"",
				"defaultTimeRange": "-15m",
				"byReceiptTime":    false,
				"viewName":         "",
				"viewStartTime":    "1970-01-01T00:00:00Z",
				"queryParameters":  []interface{}{},
				"parsingMode":      "Manual",
			},
			"searchSchedule": map[string]interface{}{
				"cronExpression":       "0 0 * * * ? *",
				"displayableTimeRange": "-10m",
				"parseableTimeRange": map[string]interface{}{
					"type": "BeginBoundedTimeRange",
					"from": map[string]interface{}{
						"type":         "RelativeTimeRangeBoundary",
						"relativeTime": "-50m",
					},
					"to": nil,
				},
				"timeZone": "America/Los_Angeles",
				"threshold": map[string]interface{}{
					"thresholdType": "message",
					"operator":      "gt",
					"count":         0,
				},
				"notification": map[string]interface{}{
					"taskType": "EmailSearchNotificationSyncDefinition",
					"toList": []string{
						"ops@acme.org",
					},
					"subjectTemplate":      "Search Results: {{Name}}",
					"includeQuery":         true,
					"includeResultSet":     true,
					"includeHistogram":     false,
					"includeCsvAttachment": false,
				},
				"scheduleType":    "1Hour",
				"muteErrorEmails": false,
				"parameters":      []interface{}{},
			},
			"description": "Runs every hour with timerange of 15m and sends email notifications",
		})
		if err != nil {
			return err
		}
		json0 := string(tmpJSON0)
		_, err = sumologic.NewContent(ctx, "test", &sumologic.ContentArgs{
			ParentId: pulumi.String(personalFolder.Id),
			Config:   pulumi.String(json0),
		})
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import json
import pulumi_sumologic as sumologic

personal_folder = sumologic.get_personal_folder()
test = sumologic.Content("test",
    parent_id=personal_folder.id,
    config=json.dumps({
        "type": "SavedSearchWithScheduleSyncDefinition",
        "name": "test-333",
        "search": {
            "queryText": "\"warn\"",
            "defaultTimeRange": "-15m",
            "byReceiptTime": False,
            "viewName": "",
            "viewStartTime": "1970-01-01T00:00:00Z",
            "queryParameters": [],
            "parsingMode": "Manual",
        },
        "searchSchedule": {
            "cronExpression": "0 0 * * * ? *",
            "displayableTimeRange": "-10m",
            "parseableTimeRange": {
                "type": "BeginBoundedTimeRange",
                "from": {
                    "type": "RelativeTimeRangeBoundary",
                    "relativeTime": "-50m",
                },
                "to": None,
            },
            "timeZone": "America/Los_Angeles",
            "threshold": {
                "thresholdType": "message",
                "operator": "gt",
                "count": 0,
            },
            "notification": {
                "taskType": "EmailSearchNotificationSyncDefinition",
                "toList": ["ops@acme.org"],
                "subjectTemplate": "Search Results: {{Name}}",
                "includeQuery": True,
                "includeResultSet": True,
                "includeHistogram": False,
                "includeCsvAttachment": False,
            },
            "scheduleType": "1Hour",
            "muteErrorEmails": False,
            "parameters": [],
        },
        "description": "Runs every hour with timerange of 15m and sends email notifications",
    }))
import * as pulumi from "@pulumi/pulumi";
import * as sumologic from "@pulumi/sumologic";

const personalFolder = sumologic.getPersonalFolder({});
const test = new sumologic.Content("test", {
    parentId: personalFolder.then(personalFolder => personalFolder.id),
    config: JSON.stringify({
        type: "SavedSearchWithScheduleSyncDefinition",
        name: "test-333",
        search: {
            queryText: "\"warn\"",
            defaultTimeRange: "-15m",
            byReceiptTime: false,
            viewName: "",
            viewStartTime: "1970-01-01T00:00:00Z",
            queryParameters: [],
            parsingMode: "Manual",
        },
        searchSchedule: {
            cronExpression: "0 0 * * * ? *",
            displayableTimeRange: "-10m",
            parseableTimeRange: {
                type: "BeginBoundedTimeRange",
                from: {
                    type: "RelativeTimeRangeBoundary",
                    relativeTime: "-50m",
                },
                to: undefined,
            },
            timeZone: "America/Los_Angeles",
            threshold: {
                thresholdType: "message",
                operator: "gt",
                count: 0,
            },
            notification: {
                taskType: "EmailSearchNotificationSyncDefinition",
                toList: ["ops@acme.org"],
                subjectTemplate: "Search Results: {{Name}}",
                includeQuery: true,
                includeResultSet: true,
                includeHistogram: false,
                includeCsvAttachment: false,
            },
            scheduleType: "1Hour",
            muteErrorEmails: false,
            parameters: [],
        },
        description: "Runs every hour with timerange of 15m and sends email notifications",
    }),
});

Coming soon!

Create a Content Resource

new Content(name: string, args: ContentArgs, opts?: CustomResourceOptions);
@overload
def Content(resource_name: str,
            opts: Optional[ResourceOptions] = None,
            config: Optional[str] = None,
            parent_id: Optional[str] = None)
@overload
def Content(resource_name: str,
            args: ContentArgs,
            opts: Optional[ResourceOptions] = None)
func NewContent(ctx *Context, name string, args ContentArgs, opts ...ResourceOption) (*Content, error)
public Content(string name, ContentArgs args, CustomResourceOptions? opts = null)
public Content(String name, ContentArgs args)
public Content(String name, ContentArgs args, CustomResourceOptions options)
type: sumologic:Content
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

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

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

Config string

JSON block for the content to import. NOTE: Updating the name will create a new object and leave a untracked content item (delete the existing content item and create a new content item if you want to update the name).

ParentId string

The identifier of the folder to import into. Identifiers from the Library in the Sumo user interface are provided in decimal format which is incompatible with this provider. The identifier needs to be in hexadecimal format.

Config string

JSON block for the content to import. NOTE: Updating the name will create a new object and leave a untracked content item (delete the existing content item and create a new content item if you want to update the name).

ParentId string

The identifier of the folder to import into. Identifiers from the Library in the Sumo user interface are provided in decimal format which is incompatible with this provider. The identifier needs to be in hexadecimal format.

config String

JSON block for the content to import. NOTE: Updating the name will create a new object and leave a untracked content item (delete the existing content item and create a new content item if you want to update the name).

parentId String

The identifier of the folder to import into. Identifiers from the Library in the Sumo user interface are provided in decimal format which is incompatible with this provider. The identifier needs to be in hexadecimal format.

config string

JSON block for the content to import. NOTE: Updating the name will create a new object and leave a untracked content item (delete the existing content item and create a new content item if you want to update the name).

parentId string

The identifier of the folder to import into. Identifiers from the Library in the Sumo user interface are provided in decimal format which is incompatible with this provider. The identifier needs to be in hexadecimal format.

config str

JSON block for the content to import. NOTE: Updating the name will create a new object and leave a untracked content item (delete the existing content item and create a new content item if you want to update the name).

parent_id str

The identifier of the folder to import into. Identifiers from the Library in the Sumo user interface are provided in decimal format which is incompatible with this provider. The identifier needs to be in hexadecimal format.

config String

JSON block for the content to import. NOTE: Updating the name will create a new object and leave a untracked content item (delete the existing content item and create a new content item if you want to update the name).

parentId String

The identifier of the folder to import into. Identifiers from the Library in the Sumo user interface are provided in decimal format which is incompatible with this provider. The identifier needs to be in hexadecimal format.

Outputs

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

Get an existing Content 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?: ContentState, opts?: CustomResourceOptions): Content
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        config: Optional[str] = None,
        parent_id: Optional[str] = None) -> Content
func GetContent(ctx *Context, name string, id IDInput, state *ContentState, opts ...ResourceOption) (*Content, error)
public static Content Get(string name, Input<string> id, ContentState? state, CustomResourceOptions? opts = null)
public static Content get(String name, Output<String> id, ContentState 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:
Config string

JSON block for the content to import. NOTE: Updating the name will create a new object and leave a untracked content item (delete the existing content item and create a new content item if you want to update the name).

ParentId string

The identifier of the folder to import into. Identifiers from the Library in the Sumo user interface are provided in decimal format which is incompatible with this provider. The identifier needs to be in hexadecimal format.

Config string

JSON block for the content to import. NOTE: Updating the name will create a new object and leave a untracked content item (delete the existing content item and create a new content item if you want to update the name).

ParentId string

The identifier of the folder to import into. Identifiers from the Library in the Sumo user interface are provided in decimal format which is incompatible with this provider. The identifier needs to be in hexadecimal format.

config String

JSON block for the content to import. NOTE: Updating the name will create a new object and leave a untracked content item (delete the existing content item and create a new content item if you want to update the name).

parentId String

The identifier of the folder to import into. Identifiers from the Library in the Sumo user interface are provided in decimal format which is incompatible with this provider. The identifier needs to be in hexadecimal format.

config string

JSON block for the content to import. NOTE: Updating the name will create a new object and leave a untracked content item (delete the existing content item and create a new content item if you want to update the name).

parentId string

The identifier of the folder to import into. Identifiers from the Library in the Sumo user interface are provided in decimal format which is incompatible with this provider. The identifier needs to be in hexadecimal format.

config str

JSON block for the content to import. NOTE: Updating the name will create a new object and leave a untracked content item (delete the existing content item and create a new content item if you want to update the name).

parent_id str

The identifier of the folder to import into. Identifiers from the Library in the Sumo user interface are provided in decimal format which is incompatible with this provider. The identifier needs to be in hexadecimal format.

config String

JSON block for the content to import. NOTE: Updating the name will create a new object and leave a untracked content item (delete the existing content item and create a new content item if you want to update the name).

parentId String

The identifier of the folder to import into. Identifiers from the Library in the Sumo user interface are provided in decimal format which is incompatible with this provider. The identifier needs to be in hexadecimal format.

Package Details

Repository
https://github.com/pulumi/pulumi-sumologic
License
Apache-2.0
Notes

This Pulumi package is based on the sumologic Terraform Provider.