pagerduty.AutomationActionsActionServiceAssociation
Explore with Pulumi AI
An Automation Actions action association with a service configures the relation of a specific Action with a Service.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as pagerduty from "@pulumi/pagerduty";
const example = new pagerduty.User("example", {
name: "Earline Greenholt",
email: "125.greenholt.earline@graham.name",
});
const foo = new pagerduty.EscalationPolicy("foo", {
name: "Engineering Escalation Policy",
numLoops: 2,
rules: [{
escalationDelayInMinutes: 10,
targets: [{
type: "user_reference",
id: example.id,
}],
}],
});
const exampleService = new pagerduty.Service("example", {
name: "My Web App",
autoResolveTimeout: "14400",
acknowledgementTimeout: "600",
escalationPolicy: foo.id,
alertCreation: "create_alerts_and_incidents",
autoPauseNotificationsParameters: {
enabled: true,
timeout: 300,
},
});
const paActionExample = new pagerduty.AutomationActionsAction("pa_action_example", {
name: "PA Action created via TF",
description: "Description of the PA Action created via TF",
actionType: "process_automation",
actionDataReference: {
processAutomationJobId: "P123456",
},
});
const fooAutomationActionsActionServiceAssociation = new pagerduty.AutomationActionsActionServiceAssociation("foo", {
actionId: paActionExample.id,
serviceId: exampleService.id,
});
import pulumi
import pulumi_pagerduty as pagerduty
example = pagerduty.User("example",
name="Earline Greenholt",
email="125.greenholt.earline@graham.name")
foo = pagerduty.EscalationPolicy("foo",
name="Engineering Escalation Policy",
num_loops=2,
rules=[{
"escalation_delay_in_minutes": 10,
"targets": [{
"type": "user_reference",
"id": example.id,
}],
}])
example_service = pagerduty.Service("example",
name="My Web App",
auto_resolve_timeout="14400",
acknowledgement_timeout="600",
escalation_policy=foo.id,
alert_creation="create_alerts_and_incidents",
auto_pause_notifications_parameters={
"enabled": True,
"timeout": 300,
})
pa_action_example = pagerduty.AutomationActionsAction("pa_action_example",
name="PA Action created via TF",
description="Description of the PA Action created via TF",
action_type="process_automation",
action_data_reference={
"process_automation_job_id": "P123456",
})
foo_automation_actions_action_service_association = pagerduty.AutomationActionsActionServiceAssociation("foo",
action_id=pa_action_example.id,
service_id=example_service.id)
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 {
example, err := pagerduty.NewUser(ctx, "example", &pagerduty.UserArgs{
Name: pulumi.String("Earline Greenholt"),
Email: pulumi.String("125.greenholt.earline@graham.name"),
})
if err != nil {
return err
}
foo, err := pagerduty.NewEscalationPolicy(ctx, "foo", &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_reference"),
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: foo.ID(),
AlertCreation: pulumi.String("create_alerts_and_incidents"),
AutoPauseNotificationsParameters: &pagerduty.ServiceAutoPauseNotificationsParametersArgs{
Enabled: pulumi.Bool(true),
Timeout: pulumi.Int(300),
},
})
if err != nil {
return err
}
paActionExample, err := pagerduty.NewAutomationActionsAction(ctx, "pa_action_example", &pagerduty.AutomationActionsActionArgs{
Name: pulumi.String("PA Action created via TF"),
Description: pulumi.String("Description of the PA Action created via TF"),
ActionType: pulumi.String("process_automation"),
ActionDataReference: &pagerduty.AutomationActionsActionActionDataReferenceArgs{
ProcessAutomationJobId: pulumi.String("P123456"),
},
})
if err != nil {
return err
}
_, err = pagerduty.NewAutomationActionsActionServiceAssociation(ctx, "foo", &pagerduty.AutomationActionsActionServiceAssociationArgs{
ActionId: paActionExample.ID(),
ServiceId: exampleService.ID(),
})
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 example = new Pagerduty.User("example", new()
{
Name = "Earline Greenholt",
Email = "125.greenholt.earline@graham.name",
});
var foo = new Pagerduty.EscalationPolicy("foo", new()
{
Name = "Engineering Escalation Policy",
NumLoops = 2,
Rules = new[]
{
new Pagerduty.Inputs.EscalationPolicyRuleArgs
{
EscalationDelayInMinutes = 10,
Targets = new[]
{
new Pagerduty.Inputs.EscalationPolicyRuleTargetArgs
{
Type = "user_reference",
Id = example.Id,
},
},
},
},
});
var exampleService = new Pagerduty.Service("example", new()
{
Name = "My Web App",
AutoResolveTimeout = "14400",
AcknowledgementTimeout = "600",
EscalationPolicy = foo.Id,
AlertCreation = "create_alerts_and_incidents",
AutoPauseNotificationsParameters = new Pagerduty.Inputs.ServiceAutoPauseNotificationsParametersArgs
{
Enabled = true,
Timeout = 300,
},
});
var paActionExample = new Pagerduty.AutomationActionsAction("pa_action_example", new()
{
Name = "PA Action created via TF",
Description = "Description of the PA Action created via TF",
ActionType = "process_automation",
ActionDataReference = new Pagerduty.Inputs.AutomationActionsActionActionDataReferenceArgs
{
ProcessAutomationJobId = "P123456",
},
});
var fooAutomationActionsActionServiceAssociation = new Pagerduty.AutomationActionsActionServiceAssociation("foo", new()
{
ActionId = paActionExample.Id,
ServiceId = exampleService.Id,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
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.inputs.ServiceAutoPauseNotificationsParametersArgs;
import com.pulumi.pagerduty.AutomationActionsAction;
import com.pulumi.pagerduty.AutomationActionsActionArgs;
import com.pulumi.pagerduty.inputs.AutomationActionsActionActionDataReferenceArgs;
import com.pulumi.pagerduty.AutomationActionsActionServiceAssociation;
import com.pulumi.pagerduty.AutomationActionsActionServiceAssociationArgs;
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 example = new User("example", UserArgs.builder()
.name("Earline Greenholt")
.email("125.greenholt.earline@graham.name")
.build());
var foo = new EscalationPolicy("foo", EscalationPolicyArgs.builder()
.name("Engineering Escalation Policy")
.numLoops(2)
.rules(EscalationPolicyRuleArgs.builder()
.escalationDelayInMinutes(10)
.targets(EscalationPolicyRuleTargetArgs.builder()
.type("user_reference")
.id(example.id())
.build())
.build())
.build());
var exampleService = new Service("exampleService", ServiceArgs.builder()
.name("My Web App")
.autoResolveTimeout(14400)
.acknowledgementTimeout(600)
.escalationPolicy(foo.id())
.alertCreation("create_alerts_and_incidents")
.autoPauseNotificationsParameters(ServiceAutoPauseNotificationsParametersArgs.builder()
.enabled(true)
.timeout(300)
.build())
.build());
var paActionExample = new AutomationActionsAction("paActionExample", AutomationActionsActionArgs.builder()
.name("PA Action created via TF")
.description("Description of the PA Action created via TF")
.actionType("process_automation")
.actionDataReference(AutomationActionsActionActionDataReferenceArgs.builder()
.processAutomationJobId("P123456")
.build())
.build());
var fooAutomationActionsActionServiceAssociation = new AutomationActionsActionServiceAssociation("fooAutomationActionsActionServiceAssociation", AutomationActionsActionServiceAssociationArgs.builder()
.actionId(paActionExample.id())
.serviceId(exampleService.id())
.build());
}
}
resources:
example:
type: pagerduty:User
properties:
name: Earline Greenholt
email: 125.greenholt.earline@graham.name
foo:
type: pagerduty:EscalationPolicy
properties:
name: Engineering Escalation Policy
numLoops: 2
rules:
- escalationDelayInMinutes: 10
targets:
- type: user_reference
id: ${example.id}
exampleService:
type: pagerduty:Service
name: example
properties:
name: My Web App
autoResolveTimeout: 14400
acknowledgementTimeout: 600
escalationPolicy: ${foo.id}
alertCreation: create_alerts_and_incidents
autoPauseNotificationsParameters:
enabled: true
timeout: 300
paActionExample:
type: pagerduty:AutomationActionsAction
name: pa_action_example
properties:
name: PA Action created via TF
description: Description of the PA Action created via TF
actionType: process_automation
actionDataReference:
processAutomationJobId: P123456
fooAutomationActionsActionServiceAssociation:
type: pagerduty:AutomationActionsActionServiceAssociation
name: foo
properties:
actionId: ${paActionExample.id}
serviceId: ${exampleService.id}
Create AutomationActionsActionServiceAssociation Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AutomationActionsActionServiceAssociation(name: string, args: AutomationActionsActionServiceAssociationArgs, opts?: CustomResourceOptions);
@overload
def AutomationActionsActionServiceAssociation(resource_name: str,
args: AutomationActionsActionServiceAssociationArgs,
opts: Optional[ResourceOptions] = None)
@overload
def AutomationActionsActionServiceAssociation(resource_name: str,
opts: Optional[ResourceOptions] = None,
action_id: Optional[str] = None,
service_id: Optional[str] = None)
func NewAutomationActionsActionServiceAssociation(ctx *Context, name string, args AutomationActionsActionServiceAssociationArgs, opts ...ResourceOption) (*AutomationActionsActionServiceAssociation, error)
public AutomationActionsActionServiceAssociation(string name, AutomationActionsActionServiceAssociationArgs args, CustomResourceOptions? opts = null)
public AutomationActionsActionServiceAssociation(String name, AutomationActionsActionServiceAssociationArgs args)
public AutomationActionsActionServiceAssociation(String name, AutomationActionsActionServiceAssociationArgs args, CustomResourceOptions options)
type: pagerduty:AutomationActionsActionServiceAssociation
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 AutomationActionsActionServiceAssociationArgs
- 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 AutomationActionsActionServiceAssociationArgs
- 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 AutomationActionsActionServiceAssociationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AutomationActionsActionServiceAssociationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AutomationActionsActionServiceAssociationArgs
- 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 automationActionsActionServiceAssociationResource = new Pagerduty.AutomationActionsActionServiceAssociation("automationActionsActionServiceAssociationResource", new()
{
ActionId = "string",
ServiceId = "string",
});
example, err := pagerduty.NewAutomationActionsActionServiceAssociation(ctx, "automationActionsActionServiceAssociationResource", &pagerduty.AutomationActionsActionServiceAssociationArgs{
ActionId: pulumi.String("string"),
ServiceId: pulumi.String("string"),
})
var automationActionsActionServiceAssociationResource = new AutomationActionsActionServiceAssociation("automationActionsActionServiceAssociationResource", AutomationActionsActionServiceAssociationArgs.builder()
.actionId("string")
.serviceId("string")
.build());
automation_actions_action_service_association_resource = pagerduty.AutomationActionsActionServiceAssociation("automationActionsActionServiceAssociationResource",
action_id="string",
service_id="string")
const automationActionsActionServiceAssociationResource = new pagerduty.AutomationActionsActionServiceAssociation("automationActionsActionServiceAssociationResource", {
actionId: "string",
serviceId: "string",
});
type: pagerduty:AutomationActionsActionServiceAssociation
properties:
actionId: string
serviceId: string
AutomationActionsActionServiceAssociation 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 AutomationActionsActionServiceAssociation resource accepts the following input properties:
- action_
id str - Id of the action.
- service_
id str - Id of the service associated to the action.
Outputs
All input properties are implicitly available as output properties. Additionally, the AutomationActionsActionServiceAssociation 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 Existing AutomationActionsActionServiceAssociation Resource
Get an existing AutomationActionsActionServiceAssociation 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?: AutomationActionsActionServiceAssociationState, opts?: CustomResourceOptions): AutomationActionsActionServiceAssociation
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
action_id: Optional[str] = None,
service_id: Optional[str] = None) -> AutomationActionsActionServiceAssociation
func GetAutomationActionsActionServiceAssociation(ctx *Context, name string, id IDInput, state *AutomationActionsActionServiceAssociationState, opts ...ResourceOption) (*AutomationActionsActionServiceAssociation, error)
public static AutomationActionsActionServiceAssociation Get(string name, Input<string> id, AutomationActionsActionServiceAssociationState? state, CustomResourceOptions? opts = null)
public static AutomationActionsActionServiceAssociation get(String name, Output<String> id, AutomationActionsActionServiceAssociationState 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.
- action_
id str - Id of the action.
- service_
id str - Id of the service associated to the action.
Import
Action service association can be imported using the action_id
and service_id
separated by a colon, e.g.
$ pulumi import pagerduty:index/automationActionsActionServiceAssociation:AutomationActionsActionServiceAssociation example 01DER7CUUBF7TH4116K0M4WKPU:PLB09Z
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.