pagerduty.ExtensionServiceNow
Explore with Pulumi AI
A special case for extension for ServiceNow.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as pagerduty from "@pulumi/pagerduty";
const servicenow = pagerduty.getExtensionSchema({
name: "ServiceNow (v7)",
});
const example = new pagerduty.User("example", {
name: "Howard James",
email: "howard.james@example.domain",
});
const exampleEscalationPolicy = new pagerduty.EscalationPolicy("example", {
name: "Engineering Escalation Policy",
numLoops: 2,
rules: [{
escalationDelayInMinutes: 10,
targets: [{
type: "user",
id: example.id,
}],
}],
});
const exampleService = new pagerduty.Service("example", {
name: "My Web App",
autoResolveTimeout: "14400",
acknowledgementTimeout: "600",
escalationPolicy: exampleEscalationPolicy.id,
});
const snow = new pagerduty.ExtensionServiceNow("snow", {
name: "My Web App Extension",
extensionSchema: servicenow.then(servicenow => servicenow.id),
extensionObjects: [exampleService.id],
snowUser: "meeps",
snowPassword: "zorz",
syncOptions: "manual_sync",
target: "https://foo.servicenow.com/webhook_foo",
taskType: "incident",
referer: "None",
});
import pulumi
import pulumi_pagerduty as pagerduty
servicenow = pagerduty.get_extension_schema(name="ServiceNow (v7)")
example = pagerduty.User("example",
name="Howard James",
email="howard.james@example.domain")
example_escalation_policy = pagerduty.EscalationPolicy("example",
name="Engineering Escalation Policy",
num_loops=2,
rules=[pagerduty.EscalationPolicyRuleArgs(
escalation_delay_in_minutes=10,
targets=[pagerduty.EscalationPolicyRuleTargetArgs(
type="user",
id=example.id,
)],
)])
example_service = pagerduty.Service("example",
name="My Web App",
auto_resolve_timeout="14400",
acknowledgement_timeout="600",
escalation_policy=example_escalation_policy.id)
snow = pagerduty.ExtensionServiceNow("snow",
name="My Web App Extension",
extension_schema=servicenow.id,
extension_objects=[example_service.id],
snow_user="meeps",
snow_password="zorz",
sync_options="manual_sync",
target="https://foo.servicenow.com/webhook_foo",
task_type="incident",
referer="None")
package main
import (
"github.com/pulumi/pulumi-pagerduty/sdk/v4/go/pagerduty"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
servicenow, err := pagerduty.GetExtensionSchema(ctx, &pagerduty.GetExtensionSchemaArgs{
Name: "ServiceNow (v7)",
}, nil)
if err != nil {
return err
}
example, err := pagerduty.NewUser(ctx, "example", &pagerduty.UserArgs{
Name: pulumi.String("Howard James"),
Email: pulumi.String("howard.james@example.domain"),
})
if err != nil {
return err
}
exampleEscalationPolicy, err := pagerduty.NewEscalationPolicy(ctx, "example", &pagerduty.EscalationPolicyArgs{
Name: pulumi.String("Engineering Escalation Policy"),
NumLoops: pulumi.Int(2),
Rules: pagerduty.EscalationPolicyRuleArray{
&pagerduty.EscalationPolicyRuleArgs{
EscalationDelayInMinutes: pulumi.Int(10),
Targets: pagerduty.EscalationPolicyRuleTargetArray{
&pagerduty.EscalationPolicyRuleTargetArgs{
Type: pulumi.String("user"),
Id: example.ID(),
},
},
},
},
})
if err != nil {
return err
}
exampleService, err := pagerduty.NewService(ctx, "example", &pagerduty.ServiceArgs{
Name: pulumi.String("My Web App"),
AutoResolveTimeout: pulumi.String("14400"),
AcknowledgementTimeout: pulumi.String("600"),
EscalationPolicy: exampleEscalationPolicy.ID(),
})
if err != nil {
return err
}
_, err = pagerduty.NewExtensionServiceNow(ctx, "snow", &pagerduty.ExtensionServiceNowArgs{
Name: pulumi.String("My Web App Extension"),
ExtensionSchema: pulumi.String(servicenow.Id),
ExtensionObjects: pulumi.StringArray{
exampleService.ID(),
},
SnowUser: pulumi.String("meeps"),
SnowPassword: pulumi.String("zorz"),
SyncOptions: pulumi.String("manual_sync"),
Target: pulumi.String("https://foo.servicenow.com/webhook_foo"),
TaskType: pulumi.String("incident"),
Referer: pulumi.String("None"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Pagerduty = Pulumi.Pagerduty;
return await Deployment.RunAsync(() =>
{
var servicenow = Pagerduty.GetExtensionSchema.Invoke(new()
{
Name = "ServiceNow (v7)",
});
var example = new Pagerduty.User("example", new()
{
Name = "Howard James",
Email = "howard.james@example.domain",
});
var exampleEscalationPolicy = new Pagerduty.EscalationPolicy("example", new()
{
Name = "Engineering Escalation Policy",
NumLoops = 2,
Rules = new[]
{
new Pagerduty.Inputs.EscalationPolicyRuleArgs
{
EscalationDelayInMinutes = 10,
Targets = new[]
{
new Pagerduty.Inputs.EscalationPolicyRuleTargetArgs
{
Type = "user",
Id = example.Id,
},
},
},
},
});
var exampleService = new Pagerduty.Service("example", new()
{
Name = "My Web App",
AutoResolveTimeout = "14400",
AcknowledgementTimeout = "600",
EscalationPolicy = exampleEscalationPolicy.Id,
});
var snow = new Pagerduty.ExtensionServiceNow("snow", new()
{
Name = "My Web App Extension",
ExtensionSchema = servicenow.Apply(getExtensionSchemaResult => getExtensionSchemaResult.Id),
ExtensionObjects = new[]
{
exampleService.Id,
},
SnowUser = "meeps",
SnowPassword = "zorz",
SyncOptions = "manual_sync",
Target = "https://foo.servicenow.com/webhook_foo",
TaskType = "incident",
Referer = "None",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.pagerduty.PagerdutyFunctions;
import com.pulumi.pagerduty.inputs.GetExtensionSchemaArgs;
import com.pulumi.pagerduty.User;
import com.pulumi.pagerduty.UserArgs;
import com.pulumi.pagerduty.EscalationPolicy;
import com.pulumi.pagerduty.EscalationPolicyArgs;
import com.pulumi.pagerduty.inputs.EscalationPolicyRuleArgs;
import com.pulumi.pagerduty.Service;
import com.pulumi.pagerduty.ServiceArgs;
import com.pulumi.pagerduty.ExtensionServiceNow;
import com.pulumi.pagerduty.ExtensionServiceNowArgs;
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 servicenow = PagerdutyFunctions.getExtensionSchema(GetExtensionSchemaArgs.builder()
.name("ServiceNow (v7)")
.build());
var example = new User("example", UserArgs.builder()
.name("Howard James")
.email("howard.james@example.domain")
.build());
var exampleEscalationPolicy = new EscalationPolicy("exampleEscalationPolicy", EscalationPolicyArgs.builder()
.name("Engineering Escalation Policy")
.numLoops(2)
.rules(EscalationPolicyRuleArgs.builder()
.escalationDelayInMinutes(10)
.targets(EscalationPolicyRuleTargetArgs.builder()
.type("user")
.id(example.id())
.build())
.build())
.build());
var exampleService = new Service("exampleService", ServiceArgs.builder()
.name("My Web App")
.autoResolveTimeout(14400)
.acknowledgementTimeout(600)
.escalationPolicy(exampleEscalationPolicy.id())
.build());
var snow = new ExtensionServiceNow("snow", ExtensionServiceNowArgs.builder()
.name("My Web App Extension")
.extensionSchema(servicenow.applyValue(getExtensionSchemaResult -> getExtensionSchemaResult.id()))
.extensionObjects(exampleService.id())
.snowUser("meeps")
.snowPassword("zorz")
.syncOptions("manual_sync")
.target("https://foo.servicenow.com/webhook_foo")
.taskType("incident")
.referer("None")
.build());
}
}
resources:
example:
type: pagerduty:User
properties:
name: Howard James
email: howard.james@example.domain
exampleEscalationPolicy:
type: pagerduty:EscalationPolicy
name: example
properties:
name: Engineering Escalation Policy
numLoops: 2
rules:
- escalationDelayInMinutes: 10
targets:
- type: user
id: ${example.id}
exampleService:
type: pagerduty:Service
name: example
properties:
name: My Web App
autoResolveTimeout: 14400
acknowledgementTimeout: 600
escalationPolicy: ${exampleEscalationPolicy.id}
snow:
type: pagerduty:ExtensionServiceNow
properties:
name: My Web App Extension
extensionSchema: ${servicenow.id}
extensionObjects:
- ${exampleService.id}
snowUser: meeps
snowPassword: zorz
syncOptions: manual_sync
target: https://foo.servicenow.com/webhook_foo
taskType: incident
referer: None
variables:
servicenow:
fn::invoke:
Function: pagerduty:getExtensionSchema
Arguments:
name: ServiceNow (v7)
Create ExtensionServiceNow Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ExtensionServiceNow(name: string, args: ExtensionServiceNowArgs, opts?: CustomResourceOptions);
@overload
def ExtensionServiceNow(resource_name: str,
args: ExtensionServiceNowArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ExtensionServiceNow(resource_name: str,
opts: Optional[ResourceOptions] = None,
extension_objects: Optional[Sequence[str]] = None,
extension_schema: Optional[str] = None,
referer: Optional[str] = None,
snow_password: Optional[str] = None,
snow_user: Optional[str] = None,
sync_options: Optional[str] = None,
target: Optional[str] = None,
task_type: Optional[str] = None,
endpoint_url: Optional[str] = None,
name: Optional[str] = None,
summary: Optional[str] = None,
type: Optional[str] = None)
func NewExtensionServiceNow(ctx *Context, name string, args ExtensionServiceNowArgs, opts ...ResourceOption) (*ExtensionServiceNow, error)
public ExtensionServiceNow(string name, ExtensionServiceNowArgs args, CustomResourceOptions? opts = null)
public ExtensionServiceNow(String name, ExtensionServiceNowArgs args)
public ExtensionServiceNow(String name, ExtensionServiceNowArgs args, CustomResourceOptions options)
type: pagerduty:ExtensionServiceNow
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ExtensionServiceNowArgs
- 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 ExtensionServiceNowArgs
- 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 ExtensionServiceNowArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ExtensionServiceNowArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ExtensionServiceNowArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Example
The following reference example uses placeholder values for all input properties.
var extensionServiceNowResource = new Pagerduty.ExtensionServiceNow("extensionServiceNowResource", new()
{
ExtensionObjects = new[]
{
"string",
},
ExtensionSchema = "string",
Referer = "string",
SnowPassword = "string",
SnowUser = "string",
SyncOptions = "string",
Target = "string",
TaskType = "string",
EndpointUrl = "string",
Name = "string",
Summary = "string",
Type = "string",
});
example, err := pagerduty.NewExtensionServiceNow(ctx, "extensionServiceNowResource", &pagerduty.ExtensionServiceNowArgs{
ExtensionObjects: pulumi.StringArray{
pulumi.String("string"),
},
ExtensionSchema: pulumi.String("string"),
Referer: pulumi.String("string"),
SnowPassword: pulumi.String("string"),
SnowUser: pulumi.String("string"),
SyncOptions: pulumi.String("string"),
Target: pulumi.String("string"),
TaskType: pulumi.String("string"),
EndpointUrl: pulumi.String("string"),
Name: pulumi.String("string"),
Summary: pulumi.String("string"),
Type: pulumi.String("string"),
})
var extensionServiceNowResource = new ExtensionServiceNow("extensionServiceNowResource", ExtensionServiceNowArgs.builder()
.extensionObjects("string")
.extensionSchema("string")
.referer("string")
.snowPassword("string")
.snowUser("string")
.syncOptions("string")
.target("string")
.taskType("string")
.endpointUrl("string")
.name("string")
.summary("string")
.type("string")
.build());
extension_service_now_resource = pagerduty.ExtensionServiceNow("extensionServiceNowResource",
extension_objects=["string"],
extension_schema="string",
referer="string",
snow_password="string",
snow_user="string",
sync_options="string",
target="string",
task_type="string",
endpoint_url="string",
name="string",
summary="string",
type="string")
const extensionServiceNowResource = new pagerduty.ExtensionServiceNow("extensionServiceNowResource", {
extensionObjects: ["string"],
extensionSchema: "string",
referer: "string",
snowPassword: "string",
snowUser: "string",
syncOptions: "string",
target: "string",
taskType: "string",
endpointUrl: "string",
name: "string",
summary: "string",
type: "string",
});
type: pagerduty:ExtensionServiceNow
properties:
endpointUrl: string
extensionObjects:
- string
extensionSchema: string
name: string
referer: string
snowPassword: string
snowUser: string
summary: string
syncOptions: string
target: string
taskType: string
type: string
ExtensionServiceNow 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 ExtensionServiceNow resource accepts the following input properties:
- Extension
Objects List<string> - Extension
Schema string - Referer string
- Snow
Password string - Snow
User string - Sync
Options string - Target string
- Task
Type string - Endpoint
Url string - Name string
- Summary string
- Type string
- Extension
Objects []string - Extension
Schema string - Referer string
- Snow
Password string - Snow
User string - Sync
Options string - Target string
- Task
Type string - Endpoint
Url string - Name string
- Summary string
- Type string
- extension
Objects List<String> - extension
Schema String - referer String
- snow
Password String - snow
User String - sync
Options String - target String
- task
Type String - endpoint
Url String - name String
- summary String
- type String
- extension
Objects string[] - extension
Schema string - referer string
- snow
Password string - snow
User string - sync
Options string - target string
- task
Type string - endpoint
Url string - name string
- summary string
- type string
- extension_
objects Sequence[str] - extension_
schema str - referer str
- snow_
password str - snow_
user str - sync_
options str - target str
- task_
type str - endpoint_
url str - name str
- summary str
- type str
- extension
Objects List<String> - extension
Schema String - referer String
- snow
Password String - snow
User String - sync
Options String - target String
- task
Type String - endpoint
Url String - name String
- summary String
- type String
Outputs
All input properties are implicitly available as output properties. Additionally, the ExtensionServiceNow resource produces the following output properties:
Look up Existing ExtensionServiceNow Resource
Get an existing ExtensionServiceNow 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?: ExtensionServiceNowState, opts?: CustomResourceOptions): ExtensionServiceNow
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
endpoint_url: Optional[str] = None,
extension_objects: Optional[Sequence[str]] = None,
extension_schema: Optional[str] = None,
html_url: Optional[str] = None,
name: Optional[str] = None,
referer: Optional[str] = None,
snow_password: Optional[str] = None,
snow_user: Optional[str] = None,
summary: Optional[str] = None,
sync_options: Optional[str] = None,
target: Optional[str] = None,
task_type: Optional[str] = None,
type: Optional[str] = None) -> ExtensionServiceNow
func GetExtensionServiceNow(ctx *Context, name string, id IDInput, state *ExtensionServiceNowState, opts ...ResourceOption) (*ExtensionServiceNow, error)
public static ExtensionServiceNow Get(string name, Input<string> id, ExtensionServiceNowState? state, CustomResourceOptions? opts = null)
public static ExtensionServiceNow get(String name, Output<String> id, ExtensionServiceNowState 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.
- Endpoint
Url string - Extension
Objects List<string> - Extension
Schema string - Html
Url string - URL at which the entity is uniquely displayed in the Web app.
- Name string
- Referer string
- Snow
Password string - Snow
User string - Summary string
- Sync
Options string - Target string
- Task
Type string - Type string
- Endpoint
Url string - Extension
Objects []string - Extension
Schema string - Html
Url string - URL at which the entity is uniquely displayed in the Web app.
- Name string
- Referer string
- Snow
Password string - Snow
User string - Summary string
- Sync
Options string - Target string
- Task
Type string - Type string
- endpoint
Url String - extension
Objects List<String> - extension
Schema String - html
Url String - URL at which the entity is uniquely displayed in the Web app.
- name String
- referer String
- snow
Password String - snow
User String - summary String
- sync
Options String - target String
- task
Type String - type String
- endpoint
Url string - extension
Objects string[] - extension
Schema string - html
Url string - URL at which the entity is uniquely displayed in the Web app.
- name string
- referer string
- snow
Password string - snow
User string - summary string
- sync
Options string - target string
- task
Type string - type string
- endpoint_
url str - extension_
objects Sequence[str] - extension_
schema str - html_
url str - URL at which the entity is uniquely displayed in the Web app.
- name str
- referer str
- snow_
password str - snow_
user str - summary str
- sync_
options str - target str
- task_
type str - type str
- endpoint
Url String - extension
Objects List<String> - extension
Schema String - html
Url String - URL at which the entity is uniquely displayed in the Web app.
- name String
- referer String
- snow
Password String - snow
User String - summary String
- sync
Options String - target String
- task
Type String - type String
Import
Extensions can be imported using the id.e.g.
$ pulumi import pagerduty:index/extensionServiceNow:ExtensionServiceNow main PLBP09X
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- PagerDuty pulumi/pulumi-pagerduty
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
pagerduty
Terraform Provider.