Sumo Logic v0.23.4 published on Friday, Sep 20, 2024 by Pulumi
sumologic.getCollector
Explore with Pulumi AI
Provides a way to retrieve Sumo Logic collector details (id, names, etc) for a collector.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as sumologic from "@pulumi/sumologic";
const this = sumologic.getCollector({
name: "MyCollector",
});
import pulumi
import pulumi_sumologic as sumologic
this = sumologic.get_collector(name="MyCollector")
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.LookupCollector(ctx, &sumologic.LookupCollectorArgs{
Name: pulumi.StringRef("MyCollector"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using SumoLogic = Pulumi.SumoLogic;
return await Deployment.RunAsync(() =>
{
var @this = SumoLogic.GetCollector.Invoke(new()
{
Name = "MyCollector",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.sumologic.SumologicFunctions;
import com.pulumi.sumologic.inputs.GetCollectorArgs;
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) {
final var this = SumologicFunctions.getCollector(GetCollectorArgs.builder()
.name("MyCollector")
.build());
}
}
variables:
this:
fn::invoke:
Function: sumologic:getCollector
Arguments:
name: MyCollector
import * as pulumi from "@pulumi/pulumi";
import * as sumologic from "@pulumi/sumologic";
const that = sumologic.getCollector({
id: 1234567890,
});
import pulumi
import pulumi_sumologic as sumologic
that = sumologic.get_collector(id=1234567890)
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.LookupCollector(ctx, &sumologic.LookupCollectorArgs{
Id: pulumi.IntRef(1234567890),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using SumoLogic = Pulumi.SumoLogic;
return await Deployment.RunAsync(() =>
{
var that = SumoLogic.GetCollector.Invoke(new()
{
Id = 1234567890,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.sumologic.SumologicFunctions;
import com.pulumi.sumologic.inputs.GetCollectorArgs;
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) {
final var that = SumologicFunctions.getCollector(GetCollectorArgs.builder()
.id("1234567890")
.build());
}
}
variables:
that:
fn::invoke:
Function: sumologic:getCollector
Arguments:
id: '1234567890'
A collector can be looked up by either id
or name
. One of those attributes needs to be specified.
If both id
and name
have been specified, id
takes precedence.
Attributes reference
The following attributes are exported:
id
- The internal ID of the collector. This can be used to attach sources to the collector.name
- The name of the collector.description
- The description of the collector.category
- The default source category for any source attached to this collector.timezone
- The time zone to use for this collector. The value follows the [tzdata][2] naming convention.
Using getCollector
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getCollector(args: GetCollectorArgs, opts?: InvokeOptions): Promise<GetCollectorResult>
function getCollectorOutput(args: GetCollectorOutputArgs, opts?: InvokeOptions): Output<GetCollectorResult>
def get_collector(id: Optional[int] = None,
name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetCollectorResult
def get_collector_output(id: Optional[pulumi.Input[int]] = None,
name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetCollectorResult]
func LookupCollector(ctx *Context, args *LookupCollectorArgs, opts ...InvokeOption) (*LookupCollectorResult, error)
func LookupCollectorOutput(ctx *Context, args *LookupCollectorOutputArgs, opts ...InvokeOption) LookupCollectorResultOutput
> Note: This function is named LookupCollector
in the Go SDK.
public static class GetCollector
{
public static Task<GetCollectorResult> InvokeAsync(GetCollectorArgs args, InvokeOptions? opts = null)
public static Output<GetCollectorResult> Invoke(GetCollectorInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetCollectorResult> getCollector(GetCollectorArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: sumologic:index/getCollector:getCollector
arguments:
# arguments dictionary
The following arguments are supported:
getCollector Result
The following output properties are available:
Package Details
- Repository
- Sumo Logic pulumi/pulumi-sumologic
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
sumologic
Terraform Provider.