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,
});
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)
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
})
}
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,
});
});
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());
}
}
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}
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 string
- The unique name of the resource.
- args TagAssignmentArgs
- 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 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 string
- The unique name of the resource.
- args TagAssignmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TagAssignmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
});
example, err := pagerduty.NewTagAssignment(ctx, "tagAssignmentResource", &pagerduty.TagAssignmentArgs{
EntityId: pulumi.String("string"),
EntityType: pulumi.String("string"),
TagId: pulumi.String("string"),
})
var tagAssignmentResource = new TagAssignment("tagAssignmentResource", TagAssignmentArgs.builder()
.entityId("string")
.entityType("string")
.tagId("string")
.build());
tag_assignment_resource = pagerduty.TagAssignment("tagAssignmentResource",
entity_id="string",
entity_type="string",
tag_id="string")
const tagAssignmentResource = new pagerduty.TagAssignment("tagAssignmentResource", {
entityId: "string",
entityType: "string",
tagId: "string",
});
type: pagerduty:TagAssignment
properties:
entityId: string
entityType: string
tagId: string
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
The TagAssignment resource accepts the following input properties:
- Entity
Id string - The ID of the entity.
- Entity
Type string - Type of entity in the tag assignment. Possible values can be
users
,teams
, andescalation_policies
. - Tag
Id string - The ID of the tag.
- Entity
Id string - The ID of the entity.
- Entity
Type string - Type of entity in the tag assignment. Possible values can be
users
,teams
, andescalation_policies
. - Tag
Id string - The ID of the tag.
- entity
Id String - The ID of the entity.
- entity
Type String - Type of entity in the tag assignment. Possible values can be
users
,teams
, andescalation_policies
. - tag
Id String - The ID of the tag.
- entity
Id string - The ID of the entity.
- entity
Type string - Type of entity in the tag assignment. Possible values can be
users
,teams
, andescalation_policies
. - tag
Id 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
, andescalation_policies
. - tag_
id str - The ID of the tag.
- entity
Id String - The ID of the entity.
- entity
Type String - Type of entity in the tag assignment. Possible values can be
users
,teams
, andescalation_policies
. - tag
Id 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)
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.
- Entity
Id string - The ID of the entity.
- Entity
Type string - Type of entity in the tag assignment. Possible values can be
users
,teams
, andescalation_policies
. - Tag
Id string - The ID of the tag.
- Entity
Id string - The ID of the entity.
- Entity
Type string - Type of entity in the tag assignment. Possible values can be
users
,teams
, andescalation_policies
. - Tag
Id string - The ID of the tag.
- entity
Id String - The ID of the entity.
- entity
Type String - Type of entity in the tag assignment. Possible values can be
users
,teams
, andescalation_policies
. - tag
Id String - The ID of the tag.
- entity
Id string - The ID of the entity.
- entity
Type string - Type of entity in the tag assignment. Possible values can be
users
,teams
, andescalation_policies
. - tag
Id 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
, andescalation_policies
. - tag_
id str - The ID of the tag.
- entity
Id String - The ID of the entity.
- entity
Type String - Type of entity in the tag assignment. Possible values can be
users
,teams
, andescalation_policies
. - tag
Id 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
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.