getService

Use this data source to get information about a specific service.

Example Usage

using Pulumi;
using Pagerduty = Pulumi.Pagerduty;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleService = Output.Create(Pagerduty.GetService.InvokeAsync(new Pagerduty.GetServiceArgs
        {
            Name = "My Service",
        }));
        var datadog = Output.Create(Pagerduty.GetVendor.InvokeAsync(new Pagerduty.GetVendorArgs
        {
            Name = "Datadog",
        }));
        var exampleServiceIntegration = new Pagerduty.ServiceIntegration("exampleServiceIntegration", new Pagerduty.ServiceIntegrationArgs
        {
            Vendor = datadog.Apply(datadog => datadog.Id),
            Service = exampleService.Apply(exampleService => exampleService.Id),
            Type = "generic_events_api_inbound_integration",
        });
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleService, err := pagerduty.LookupService(ctx, &pagerduty.LookupServiceArgs{
			Name: "My Service",
		}, nil)
		if err != nil {
			return err
		}
		datadog, err := pagerduty.GetVendor(ctx, &pagerduty.GetVendorArgs{
			Name: "Datadog",
		}, nil)
		if err != nil {
			return err
		}
		_, err = pagerduty.NewServiceIntegration(ctx, "exampleServiceIntegration", &pagerduty.ServiceIntegrationArgs{
			Vendor:  pulumi.String(datadog.Id),
			Service: pulumi.String(exampleService.Id),
			Type:    pulumi.String("generic_events_api_inbound_integration"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_pagerduty as pagerduty

example_service = pagerduty.get_service(name="My Service")
datadog = pagerduty.get_vendor(name="Datadog")
example_service_integration = pagerduty.ServiceIntegration("exampleServiceIntegration",
    vendor=datadog.id,
    service=example_service.id,
    type="generic_events_api_inbound_integration")
import * as pulumi from "@pulumi/pulumi";
import * as pagerduty from "@pulumi/pagerduty";

const exampleService = pagerduty.getService({
    name: "My Service",
});
const datadog = pagerduty.getVendor({
    name: "Datadog",
});
const exampleServiceIntegration = new pagerduty.ServiceIntegration("exampleServiceIntegration", {
    vendor: datadog.then(datadog => datadog.id),
    service: exampleService.then(exampleService => exampleService.id),
    type: "generic_events_api_inbound_integration",
});

Using getService

function getService(args: GetServiceArgs, opts?: InvokeOptions): Promise<GetServiceResult>
def get_service(name: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> GetServiceResult
func LookupService(ctx *Context, args *LookupServiceArgs, opts ...InvokeOption) (*LookupServiceResult, error)

Note: This function is named LookupService in the Go SDK.

public static class GetService {
    public static Task<GetServiceResult> InvokeAsync(GetServiceArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

Name string
The service name to use to find a service in the PagerDuty API.
Name string
The service name to use to find a service in the PagerDuty API.
name string
The service name to use to find a service in the PagerDuty API.
name str
The service name to use to find a service in the PagerDuty API.

getService Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Name string
The short name of the found service.
Id string
The provider-assigned unique ID for this managed resource.
Name string
The short name of the found service.
id string
The provider-assigned unique ID for this managed resource.
name string
The short name of the found service.
id str
The provider-assigned unique ID for this managed resource.
name str
The short name of the found service.

Package Details

Repository
https://github.com/pulumi/pulumi-pagerduty
License
Apache-2.0
Notes
This Pulumi package is based on the pagerduty Terraform Provider.