pagerduty.Enablement
Explore with Pulumi AI
Enablements allow you to enable or disable specific features for PagerDuty entities such as services and event orchestrations.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as pagerduty from "@pulumi/pagerduty";
const example = pagerduty.getService({
name: "My Web Service",
});
const exampleEnablement = new pagerduty.Enablement("example", {
entityType: "service",
entityId: example.then(example => example.id),
feature: "aiops",
enabled: true,
});
import pulumi
import pulumi_pagerduty as pagerduty
example = pagerduty.get_service(name="My Web Service")
example_enablement = pagerduty.Enablement("example",
entity_type="service",
entity_id=example.id,
feature="aiops",
enabled=True)
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.LookupService(ctx, &pagerduty.LookupServiceArgs{
Name: "My Web Service",
}, nil)
if err != nil {
return err
}
_, err = pagerduty.NewEnablement(ctx, "example", &pagerduty.EnablementArgs{
EntityType: pulumi.String("service"),
EntityId: pulumi.String(example.Id),
Feature: pulumi.String("aiops"),
Enabled: pulumi.Bool(true),
})
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 = Pagerduty.GetService.Invoke(new()
{
Name = "My Web Service",
});
var exampleEnablement = new Pagerduty.Enablement("example", new()
{
EntityType = "service",
EntityId = example.Apply(getServiceResult => getServiceResult.Id),
Feature = "aiops",
Enabled = true,
});
});
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.GetServiceArgs;
import com.pulumi.pagerduty.Enablement;
import com.pulumi.pagerduty.EnablementArgs;
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 example = PagerdutyFunctions.getService(GetServiceArgs.builder()
.name("My Web Service")
.build());
var exampleEnablement = new Enablement("exampleEnablement", EnablementArgs.builder()
.entityType("service")
.entityId(example.id())
.feature("aiops")
.enabled(true)
.build());
}
}
resources:
exampleEnablement:
type: pagerduty:Enablement
name: example
properties:
entityType: service
entityId: ${example.id}
feature: aiops
enabled: true
variables:
example:
fn::invoke:
function: pagerduty:getService
arguments:
name: My Web Service
Create Enablement Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Enablement(name: string, args: EnablementArgs, opts?: CustomResourceOptions);
@overload
def Enablement(resource_name: str,
args: EnablementArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Enablement(resource_name: str,
opts: Optional[ResourceOptions] = None,
entity_id: Optional[str] = None,
entity_type: Optional[str] = None,
feature: Optional[str] = None,
enabled: Optional[bool] = None)
func NewEnablement(ctx *Context, name string, args EnablementArgs, opts ...ResourceOption) (*Enablement, error)
public Enablement(string name, EnablementArgs args, CustomResourceOptions? opts = null)
public Enablement(String name, EnablementArgs args)
public Enablement(String name, EnablementArgs args, CustomResourceOptions options)
type: pagerduty:Enablement
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 EnablementArgs
- 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 EnablementArgs
- 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 EnablementArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args EnablementArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args EnablementArgs
- 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 enablementResource = new Pagerduty.Enablement("enablementResource", new()
{
EntityId = "string",
EntityType = "string",
Feature = "string",
Enabled = false,
});
example, err := pagerduty.NewEnablement(ctx, "enablementResource", &pagerduty.EnablementArgs{
EntityId: pulumi.String("string"),
EntityType: pulumi.String("string"),
Feature: pulumi.String("string"),
Enabled: pulumi.Bool(false),
})
var enablementResource = new Enablement("enablementResource", EnablementArgs.builder()
.entityId("string")
.entityType("string")
.feature("string")
.enabled(false)
.build());
enablement_resource = pagerduty.Enablement("enablementResource",
entity_id="string",
entity_type="string",
feature="string",
enabled=False)
const enablementResource = new pagerduty.Enablement("enablementResource", {
entityId: "string",
entityType: "string",
feature: "string",
enabled: false,
});
type: pagerduty:Enablement
properties:
enabled: false
entityId: string
entityType: string
feature: string
Enablement 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 Enablement resource accepts the following input properties:
- Entity
Id string - The ID of the entity for which to manage the enablement.
- Entity
Type string - The type of entity for which to manage the enablement. Possible values can be
service
andevent_orchestration
. - Feature string
- The name of the feature to enable or disable. Possible values can be
aiops
. - Enabled bool
- Whether the feature should be enabled (
true
) or disabled (false
) for the specified entity.
- Entity
Id string - The ID of the entity for which to manage the enablement.
- Entity
Type string - The type of entity for which to manage the enablement. Possible values can be
service
andevent_orchestration
. - Feature string
- The name of the feature to enable or disable. Possible values can be
aiops
. - Enabled bool
- Whether the feature should be enabled (
true
) or disabled (false
) for the specified entity.
- entity
Id String - The ID of the entity for which to manage the enablement.
- entity
Type String - The type of entity for which to manage the enablement. Possible values can be
service
andevent_orchestration
. - feature String
- The name of the feature to enable or disable. Possible values can be
aiops
. - enabled Boolean
- Whether the feature should be enabled (
true
) or disabled (false
) for the specified entity.
- entity
Id string - The ID of the entity for which to manage the enablement.
- entity
Type string - The type of entity for which to manage the enablement. Possible values can be
service
andevent_orchestration
. - feature string
- The name of the feature to enable or disable. Possible values can be
aiops
. - enabled boolean
- Whether the feature should be enabled (
true
) or disabled (false
) for the specified entity.
- entity_
id str - The ID of the entity for which to manage the enablement.
- entity_
type str - The type of entity for which to manage the enablement. Possible values can be
service
andevent_orchestration
. - feature str
- The name of the feature to enable or disable. Possible values can be
aiops
. - enabled bool
- Whether the feature should be enabled (
true
) or disabled (false
) for the specified entity.
- entity
Id String - The ID of the entity for which to manage the enablement.
- entity
Type String - The type of entity for which to manage the enablement. Possible values can be
service
andevent_orchestration
. - feature String
- The name of the feature to enable or disable. Possible values can be
aiops
. - enabled Boolean
- Whether the feature should be enabled (
true
) or disabled (false
) for the specified entity.
Outputs
All input properties are implicitly available as output properties. Additionally, the Enablement 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 Enablement Resource
Get an existing Enablement 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?: EnablementState, opts?: CustomResourceOptions): Enablement
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
enabled: Optional[bool] = None,
entity_id: Optional[str] = None,
entity_type: Optional[str] = None,
feature: Optional[str] = None) -> Enablement
func GetEnablement(ctx *Context, name string, id IDInput, state *EnablementState, opts ...ResourceOption) (*Enablement, error)
public static Enablement Get(string name, Input<string> id, EnablementState? state, CustomResourceOptions? opts = null)
public static Enablement get(String name, Output<String> id, EnablementState state, CustomResourceOptions options)
resources: _: type: pagerduty:Enablement get: 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.
- Enabled bool
- Whether the feature should be enabled (
true
) or disabled (false
) for the specified entity. - Entity
Id string - The ID of the entity for which to manage the enablement.
- Entity
Type string - The type of entity for which to manage the enablement. Possible values can be
service
andevent_orchestration
. - Feature string
- The name of the feature to enable or disable. Possible values can be
aiops
.
- Enabled bool
- Whether the feature should be enabled (
true
) or disabled (false
) for the specified entity. - Entity
Id string - The ID of the entity for which to manage the enablement.
- Entity
Type string - The type of entity for which to manage the enablement. Possible values can be
service
andevent_orchestration
. - Feature string
- The name of the feature to enable or disable. Possible values can be
aiops
.
- enabled Boolean
- Whether the feature should be enabled (
true
) or disabled (false
) for the specified entity. - entity
Id String - The ID of the entity for which to manage the enablement.
- entity
Type String - The type of entity for which to manage the enablement. Possible values can be
service
andevent_orchestration
. - feature String
- The name of the feature to enable or disable. Possible values can be
aiops
.
- enabled boolean
- Whether the feature should be enabled (
true
) or disabled (false
) for the specified entity. - entity
Id string - The ID of the entity for which to manage the enablement.
- entity
Type string - The type of entity for which to manage the enablement. Possible values can be
service
andevent_orchestration
. - feature string
- The name of the feature to enable or disable. Possible values can be
aiops
.
- enabled bool
- Whether the feature should be enabled (
true
) or disabled (false
) for the specified entity. - entity_
id str - The ID of the entity for which to manage the enablement.
- entity_
type str - The type of entity for which to manage the enablement. Possible values can be
service
andevent_orchestration
. - feature str
- The name of the feature to enable or disable. Possible values can be
aiops
.
- enabled Boolean
- Whether the feature should be enabled (
true
) or disabled (false
) for the specified entity. - entity
Id String - The ID of the entity for which to manage the enablement.
- entity
Type String - The type of entity for which to manage the enablement. Possible values can be
service
andevent_orchestration
. - feature String
- The name of the feature to enable or disable. Possible values can be
aiops
.
Import
Enablements can be imported using the id
, which is constructed by concatenating the entity_type
, entity_id
, and feature
with dots, e.g.
$ pulumi import pagerduty:index/enablement:Enablement example service.P7HHMVK.aiops
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.