1. Packages
  2. Pagerduty Provider
  3. API Docs
  4. TagAssignment
PagerDuty v4.23.0 published on Wednesday, Apr 16, 2025 by Pulumi

pagerduty.TagAssignment

Explore with Pulumi AI

A tag is applied to Escalation Policies, Teams or Users and can be used to filter them.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as pagerduty from "@pulumi/pagerduty";

const example = new pagerduty.Tag("example", {label: "API"});
const engteam = new pagerduty.Team("engteam", {name: "Engineering"});
const exampleTagAssignment = new pagerduty.TagAssignment("example", {
    tagId: example.id,
    entityType: "teams",
    entityId: engteam.id,
});
Copy
import pulumi
import pulumi_pagerduty as pagerduty

example = pagerduty.Tag("example", label="API")
engteam = pagerduty.Team("engteam", name="Engineering")
example_tag_assignment = pagerduty.TagAssignment("example",
    tag_id=example.id,
    entity_type="teams",
    entity_id=engteam.id)
Copy
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.NewTag(ctx, "example", &pagerduty.TagArgs{
			Label: pulumi.String("API"),
		})
		if err != nil {
			return err
		}
		engteam, err := pagerduty.NewTeam(ctx, "engteam", &pagerduty.TeamArgs{
			Name: pulumi.String("Engineering"),
		})
		if err != nil {
			return err
		}
		_, err = pagerduty.NewTagAssignment(ctx, "example", &pagerduty.TagAssignmentArgs{
			TagId:      example.ID(),
			EntityType: pulumi.String("teams"),
			EntityId:   engteam.ID(),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Pagerduty = Pulumi.Pagerduty;

return await Deployment.RunAsync(() => 
{
    var example = new Pagerduty.Tag("example", new()
    {
        Label = "API",
    });

    var engteam = new Pagerduty.Team("engteam", new()
    {
        Name = "Engineering",
    });

    var exampleTagAssignment = new Pagerduty.TagAssignment("example", new()
    {
        TagId = example.Id,
        EntityType = "teams",
        EntityId = engteam.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.pagerduty.Tag;
import com.pulumi.pagerduty.TagArgs;
import com.pulumi.pagerduty.Team;
import com.pulumi.pagerduty.TeamArgs;
import com.pulumi.pagerduty.TagAssignment;
import com.pulumi.pagerduty.TagAssignmentArgs;
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 Tag("example", TagArgs.builder()
            .label("API")
            .build());

        var engteam = new Team("engteam", TeamArgs.builder()
            .name("Engineering")
            .build());

        var exampleTagAssignment = new TagAssignment("exampleTagAssignment", TagAssignmentArgs.builder()
            .tagId(example.id())
            .entityType("teams")
            .entityId(engteam.id())
            .build());

    }
}
Copy
resources:
  example:
    type: pagerduty:Tag
    properties:
      label: API
  engteam:
    type: pagerduty:Team
    properties:
      name: Engineering
  exampleTagAssignment:
    type: pagerduty:TagAssignment
    name: example
    properties:
      tagId: ${example.id}
      entityType: teams
      entityId: ${engteam.id}
Copy

Create TagAssignment Resource

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

Constructor syntax

new TagAssignment(name: string, args: TagAssignmentArgs, opts?: CustomResourceOptions);
@overload
def TagAssignment(resource_name: str,
                  args: TagAssignmentArgs,
                  opts: Optional[ResourceOptions] = None)

@overload
def TagAssignment(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  entity_id: Optional[str] = None,
                  entity_type: Optional[str] = None,
                  tag_id: Optional[str] = None)
func NewTagAssignment(ctx *Context, name string, args TagAssignmentArgs, opts ...ResourceOption) (*TagAssignment, error)
public TagAssignment(string name, TagAssignmentArgs args, CustomResourceOptions? opts = null)
public TagAssignment(String name, TagAssignmentArgs args)
public TagAssignment(String name, TagAssignmentArgs args, CustomResourceOptions options)
type: pagerduty:TagAssignment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. TagAssignmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. TagAssignmentArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. TagAssignmentArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. TagAssignmentArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. TagAssignmentArgs
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 tagAssignmentResource = new Pagerduty.TagAssignment("tagAssignmentResource", new()
{
    EntityId = "string",
    EntityType = "string",
    TagId = "string",
});
Copy
example, err := pagerduty.NewTagAssignment(ctx, "tagAssignmentResource", &pagerduty.TagAssignmentArgs{
	EntityId:   pulumi.String("string"),
	EntityType: pulumi.String("string"),
	TagId:      pulumi.String("string"),
})
Copy
var tagAssignmentResource = new TagAssignment("tagAssignmentResource", TagAssignmentArgs.builder()
    .entityId("string")
    .entityType("string")
    .tagId("string")
    .build());
Copy
tag_assignment_resource = pagerduty.TagAssignment("tagAssignmentResource",
    entity_id="string",
    entity_type="string",
    tag_id="string")
Copy
const tagAssignmentResource = new pagerduty.TagAssignment("tagAssignmentResource", {
    entityId: "string",
    entityType: "string",
    tagId: "string",
});
Copy
type: pagerduty:TagAssignment
properties:
    entityId: string
    entityType: string
    tagId: string
Copy

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

EntityId This property is required. string
The ID of the entity.
EntityType This property is required. string
Type of entity in the tag assignment. Possible values can be users, teams, and escalation_policies.
TagId This property is required. string
The ID of the tag.
EntityId This property is required. string
The ID of the entity.
EntityType This property is required. string
Type of entity in the tag assignment. Possible values can be users, teams, and escalation_policies.
TagId This property is required. string
The ID of the tag.
entityId This property is required. String
The ID of the entity.
entityType This property is required. String
Type of entity in the tag assignment. Possible values can be users, teams, and escalation_policies.
tagId This property is required. String
The ID of the tag.
entityId This property is required. string
The ID of the entity.
entityType This property is required. string
Type of entity in the tag assignment. Possible values can be users, teams, and escalation_policies.
tagId This property is required. string
The ID of the tag.
entity_id This property is required. str
The ID of the entity.
entity_type This property is required. str
Type of entity in the tag assignment. Possible values can be users, teams, and escalation_policies.
tag_id This property is required. str
The ID of the tag.
entityId This property is required. String
The ID of the entity.
entityType This property is required. String
Type of entity in the tag assignment. Possible values can be users, teams, and escalation_policies.
tagId This property is required. String
The ID of the tag.

Outputs

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

Get an existing TagAssignment 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?: TagAssignmentState, opts?: CustomResourceOptions): TagAssignment
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        entity_id: Optional[str] = None,
        entity_type: Optional[str] = None,
        tag_id: Optional[str] = None) -> TagAssignment
func GetTagAssignment(ctx *Context, name string, id IDInput, state *TagAssignmentState, opts ...ResourceOption) (*TagAssignment, error)
public static TagAssignment Get(string name, Input<string> id, TagAssignmentState? state, CustomResourceOptions? opts = null)
public static TagAssignment get(String name, Output<String> id, TagAssignmentState state, CustomResourceOptions options)
resources:  _:    type: pagerduty:TagAssignment    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
EntityId string
The ID of the entity.
EntityType string
Type of entity in the tag assignment. Possible values can be users, teams, and escalation_policies.
TagId string
The ID of the tag.
EntityId string
The ID of the entity.
EntityType string
Type of entity in the tag assignment. Possible values can be users, teams, and escalation_policies.
TagId string
The ID of the tag.
entityId String
The ID of the entity.
entityType String
Type of entity in the tag assignment. Possible values can be users, teams, and escalation_policies.
tagId String
The ID of the tag.
entityId string
The ID of the entity.
entityType string
Type of entity in the tag assignment. Possible values can be users, teams, and escalation_policies.
tagId string
The ID of the tag.
entity_id str
The ID of the entity.
entity_type str
Type of entity in the tag assignment. Possible values can be users, teams, and escalation_policies.
tag_id str
The ID of the tag.
entityId String
The ID of the entity.
entityType String
Type of entity in the tag assignment. Possible values can be users, teams, and escalation_policies.
tagId String
The ID of the tag.

Import

Tag assignments can be imported using the id which is constructed by taking the entity Type, entity ID and the tag ID separated by a dot, e.g.

$ pulumi import pagerduty:index/tagAssignment:TagAssignment main users.P7HHMVK.PYC7IQQ
Copy

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.