1. Registry
  2. Packages
  3. Zenduty Provider
  4. API Docs
  5. ServiceContext
Viewing docs for zenduty 2.2.0
published on Friday, Oct 30, 2026 by zenduty
zenduty
Viewing docs for zenduty 2.2.0
published on Friday, Oct 30, 2026 by zenduty

    zenduty.ServiceContext attaches a context integration (one that enriches incidents rather than creating them) to a service. The API has no update for this object, so every attribute forces a new resource.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as zenduty from "@pulumi/zenduty";
    
    const runbooks = new zenduty.ServiceContext("runbooks", {
        teamId: ops.id,
        serviceId: api.id,
        integration: runbookLinks.id,
    });
    
    import pulumi
    import pulumi_zenduty as zenduty
    
    runbooks = zenduty.ServiceContext("runbooks",
        team_id=ops["id"],
        service_id=api["id"],
        integration=runbook_links["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/zenduty/v2/zenduty"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := zenduty.NewServiceContext(ctx, "runbooks", &zenduty.ServiceContextArgs{
    			TeamId:      pulumi.Any(ops.Id),
    			ServiceId:   pulumi.Any(api.Id),
    			Integration: pulumi.Any(runbookLinks.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Zenduty = Pulumi.Zenduty;
    
    return await Deployment.RunAsync(() => 
    {
        var runbooks = new Zenduty.ServiceContext("runbooks", new()
        {
            TeamId = ops.Id,
            ServiceId = api.Id,
            Integration = runbookLinks.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.zenduty.ServiceContext;
    import com.pulumi.zenduty.ServiceContextArgs;
    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 runbooks = new ServiceContext("runbooks", ServiceContextArgs.builder()
                .teamId(ops.id())
                .serviceId(api.id())
                .integration(runbookLinks.id())
                .build());
    
        }
    }
    
    resources:
      runbooks:
        type: zenduty:ServiceContext
        properties:
          teamId: ${ops.id}
          serviceId: ${api.id}
          integration: ${runbookLinks.id}
    
    Example coming soon!
    

    Create ServiceContext Resource

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

    Constructor syntax

    new ServiceContext(name: string, args: ServiceContextArgs, opts?: CustomResourceOptions);
    @overload
    def ServiceContext(resource_name: str,
                       args: ServiceContextArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def ServiceContext(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       integration: Optional[str] = None,
                       service_id: Optional[str] = None,
                       team_id: Optional[str] = None,
                       service_context_id: Optional[str] = None)
    func NewServiceContext(ctx *Context, name string, args ServiceContextArgs, opts ...ResourceOption) (*ServiceContext, error)
    public ServiceContext(string name, ServiceContextArgs args, CustomResourceOptions? opts = null)
    public ServiceContext(String name, ServiceContextArgs args)
    public ServiceContext(String name, ServiceContextArgs args, CustomResourceOptions options)
    
    type: zenduty:ServiceContext
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "zenduty_service_context" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args ServiceContextArgs
    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 ServiceContextArgs
    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 ServiceContextArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ServiceContextArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ServiceContextArgs
    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 serviceContextResource = new Zenduty.ServiceContext("serviceContextResource", new()
    {
        Integration = "string",
        ServiceId = "string",
        TeamId = "string",
        ServiceContextId = "string",
    });
    
    example, err := zenduty.NewServiceContext(ctx, "serviceContextResource", &zenduty.ServiceContextArgs{
    	Integration:      pulumi.String("string"),
    	ServiceId:        pulumi.String("string"),
    	TeamId:           pulumi.String("string"),
    	ServiceContextId: pulumi.String("string"),
    })
    
    resource "zenduty_service_context" "serviceContextResource" {
      lifecycle {
        create_before_destroy = true
      }
      integration        = "string"
      service_id         = "string"
      team_id            = "string"
      service_context_id = "string"
    }
    
    var serviceContextResource = new ServiceContext("serviceContextResource", ServiceContextArgs.builder()
        .integration("string")
        .serviceId("string")
        .teamId("string")
        .serviceContextId("string")
        .build());
    
    service_context_resource = zenduty.ServiceContext("serviceContextResource",
        integration="string",
        service_id="string",
        team_id="string",
        service_context_id="string")
    
    const serviceContextResource = new zenduty.ServiceContext("serviceContextResource", {
        integration: "string",
        serviceId: "string",
        teamId: "string",
        serviceContextId: "string",
    });
    
    type: zenduty:ServiceContext
    properties:
        integration: string
        serviceContextId: string
        serviceId: string
        teamId: string
    

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

    Integration string
    The unique_id of the context integration. A service can link each integration once.
    ServiceId string
    The unique_id of the service.
    TeamId string
    The unique_id of the team.
    ServiceContextId string
    The unique_id of the service context.
    Integration string
    The unique_id of the context integration. A service can link each integration once.
    ServiceId string
    The unique_id of the service.
    TeamId string
    The unique_id of the team.
    ServiceContextId string
    The unique_id of the service context.
    integration string
    The unique_id of the context integration. A service can link each integration once.
    service_id string
    The unique_id of the service.
    team_id string
    The unique_id of the team.
    service_context_id string
    The unique_id of the service context.
    integration String
    The unique_id of the context integration. A service can link each integration once.
    serviceId String
    The unique_id of the service.
    teamId String
    The unique_id of the team.
    serviceContextId String
    The unique_id of the service context.
    integration string
    The unique_id of the context integration. A service can link each integration once.
    serviceId string
    The unique_id of the service.
    teamId string
    The unique_id of the team.
    serviceContextId string
    The unique_id of the service context.
    integration str
    The unique_id of the context integration. A service can link each integration once.
    service_id str
    The unique_id of the service.
    team_id str
    The unique_id of the team.
    service_context_id str
    The unique_id of the service context.
    integration String
    The unique_id of the context integration. A service can link each integration once.
    serviceId String
    The unique_id of the service.
    teamId String
    The unique_id of the team.
    serviceContextId String
    The unique_id of the service context.

    Outputs

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

    Get an existing ServiceContext 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?: ServiceContextState, opts?: CustomResourceOptions): ServiceContext
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            integration: Optional[str] = None,
            service_context_id: Optional[str] = None,
            service_id: Optional[str] = None,
            team_id: Optional[str] = None) -> ServiceContext
    func GetServiceContext(ctx *Context, name string, id IDInput, state *ServiceContextState, opts ...ResourceOption) (*ServiceContext, error)
    public static ServiceContext Get(string name, Input<string> id, ServiceContextState? state, CustomResourceOptions? opts = null)
    public static ServiceContext get(String name, Output<String> id, ServiceContextState state, CustomResourceOptions options)
    resources:  _:    type: zenduty:ServiceContext    get:      id: ${id}
    import {
      to = zenduty_service_context.example
      id = "${id}"
    }
    
    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:
    Integration string
    The unique_id of the context integration. A service can link each integration once.
    ServiceContextId string
    The unique_id of the service context.
    ServiceId string
    The unique_id of the service.
    TeamId string
    The unique_id of the team.
    Integration string
    The unique_id of the context integration. A service can link each integration once.
    ServiceContextId string
    The unique_id of the service context.
    ServiceId string
    The unique_id of the service.
    TeamId string
    The unique_id of the team.
    integration string
    The unique_id of the context integration. A service can link each integration once.
    service_context_id string
    The unique_id of the service context.
    service_id string
    The unique_id of the service.
    team_id string
    The unique_id of the team.
    integration String
    The unique_id of the context integration. A service can link each integration once.
    serviceContextId String
    The unique_id of the service context.
    serviceId String
    The unique_id of the service.
    teamId String
    The unique_id of the team.
    integration string
    The unique_id of the context integration. A service can link each integration once.
    serviceContextId string
    The unique_id of the service context.
    serviceId string
    The unique_id of the service.
    teamId string
    The unique_id of the team.
    integration str
    The unique_id of the context integration. A service can link each integration once.
    service_context_id str
    The unique_id of the service context.
    service_id str
    The unique_id of the service.
    team_id str
    The unique_id of the team.
    integration String
    The unique_id of the context integration. A service can link each integration once.
    serviceContextId String
    The unique_id of the service context.
    serviceId String
    The unique_id of the service.
    teamId String
    The unique_id of the team.

    Import

    hcl

    resource “zenduty_service_context” “runbooks” {

    }

    $ pulumi import zenduty:index/serviceContext:ServiceContext runbooks team_id/service_id/service_context_id`
    

    $ terraform state show zenduty_service_context.runbooks

    * copy the output data and paste inside zenduty_service_context.runbooks resource block and remove the id attribute

    $ pulumi preview to verify the import

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

    Package Details

    Repository
    zenduty zenduty/terraform-provider-zenduty
    License
    Notes
    This Pulumi package is based on the zenduty Terraform Provider.
    zenduty
    Viewing docs for zenduty 2.2.0
    published on Friday, Oct 30, 2026 by zenduty

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial