1. Packages
  2. Opsgenie
  3. API Docs
  4. Team
Opsgenie v1.3.9 published on Tuesday, Jul 16, 2024 by Pulumi

opsgenie.Team

Explore with Pulumi AI

opsgenie logo
Opsgenie v1.3.9 published on Tuesday, Jul 16, 2024 by Pulumi

    Manages a Team within Opsgenie.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as opsgenie from "@pulumi/opsgenie";
    
    const first = new opsgenie.User("first", {
        username: "user@domain.com",
        fullName: "name ",
        role: "User",
    });
    const second = new opsgenie.User("second", {
        username: "test@domain.com",
        fullName: "name ",
        role: "User",
    });
    const test = new opsgenie.Team("test", {
        name: "example",
        description: "This team deals with all the things",
        members: [
            {
                id: first.id,
                role: "admin",
            },
            {
                id: second.id,
                role: "user",
            },
        ],
    });
    const self_service = new opsgenie.Team("self-service", {
        name: "Self Service",
        description: "Membership in this team is managed via OpsGenie web UI only",
        ignoreMembers: true,
        deleteDefaultResources: true,
    });
    
    import pulumi
    import pulumi_opsgenie as opsgenie
    
    first = opsgenie.User("first",
        username="user@domain.com",
        full_name="name ",
        role="User")
    second = opsgenie.User("second",
        username="test@domain.com",
        full_name="name ",
        role="User")
    test = opsgenie.Team("test",
        name="example",
        description="This team deals with all the things",
        members=[
            opsgenie.TeamMemberArgs(
                id=first.id,
                role="admin",
            ),
            opsgenie.TeamMemberArgs(
                id=second.id,
                role="user",
            ),
        ])
    self_service = opsgenie.Team("self-service",
        name="Self Service",
        description="Membership in this team is managed via OpsGenie web UI only",
        ignore_members=True,
        delete_default_resources=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-opsgenie/sdk/go/opsgenie"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		first, err := opsgenie.NewUser(ctx, "first", &opsgenie.UserArgs{
    			Username: pulumi.String("user@domain.com"),
    			FullName: pulumi.String("name "),
    			Role:     pulumi.String("User"),
    		})
    		if err != nil {
    			return err
    		}
    		second, err := opsgenie.NewUser(ctx, "second", &opsgenie.UserArgs{
    			Username: pulumi.String("test@domain.com"),
    			FullName: pulumi.String("name "),
    			Role:     pulumi.String("User"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = opsgenie.NewTeam(ctx, "test", &opsgenie.TeamArgs{
    			Name:        pulumi.String("example"),
    			Description: pulumi.String("This team deals with all the things"),
    			Members: opsgenie.TeamMemberArray{
    				&opsgenie.TeamMemberArgs{
    					Id:   first.ID(),
    					Role: pulumi.String("admin"),
    				},
    				&opsgenie.TeamMemberArgs{
    					Id:   second.ID(),
    					Role: pulumi.String("user"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = opsgenie.NewTeam(ctx, "self-service", &opsgenie.TeamArgs{
    			Name:                   pulumi.String("Self Service"),
    			Description:            pulumi.String("Membership in this team is managed via OpsGenie web UI only"),
    			IgnoreMembers:          pulumi.Bool(true),
    			DeleteDefaultResources: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Opsgenie = Pulumi.Opsgenie;
    
    return await Deployment.RunAsync(() => 
    {
        var first = new Opsgenie.User("first", new()
        {
            Username = "user@domain.com",
            FullName = "name ",
            Role = "User",
        });
    
        var second = new Opsgenie.User("second", new()
        {
            Username = "test@domain.com",
            FullName = "name ",
            Role = "User",
        });
    
        var test = new Opsgenie.Team("test", new()
        {
            Name = "example",
            Description = "This team deals with all the things",
            Members = new[]
            {
                new Opsgenie.Inputs.TeamMemberArgs
                {
                    Id = first.Id,
                    Role = "admin",
                },
                new Opsgenie.Inputs.TeamMemberArgs
                {
                    Id = second.Id,
                    Role = "user",
                },
            },
        });
    
        var self_service = new Opsgenie.Team("self-service", new()
        {
            Name = "Self Service",
            Description = "Membership in this team is managed via OpsGenie web UI only",
            IgnoreMembers = true,
            DeleteDefaultResources = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.opsgenie.User;
    import com.pulumi.opsgenie.UserArgs;
    import com.pulumi.opsgenie.Team;
    import com.pulumi.opsgenie.TeamArgs;
    import com.pulumi.opsgenie.inputs.TeamMemberArgs;
    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 first = new User("first", UserArgs.builder()
                .username("user@domain.com")
                .fullName("name ")
                .role("User")
                .build());
    
            var second = new User("second", UserArgs.builder()
                .username("test@domain.com")
                .fullName("name ")
                .role("User")
                .build());
    
            var test = new Team("test", TeamArgs.builder()
                .name("example")
                .description("This team deals with all the things")
                .members(            
                    TeamMemberArgs.builder()
                        .id(first.id())
                        .role("admin")
                        .build(),
                    TeamMemberArgs.builder()
                        .id(second.id())
                        .role("user")
                        .build())
                .build());
    
            var self_service = new Team("self-service", TeamArgs.builder()
                .name("Self Service")
                .description("Membership in this team is managed via OpsGenie web UI only")
                .ignoreMembers(true)
                .deleteDefaultResources(true)
                .build());
    
        }
    }
    
    resources:
      first:
        type: opsgenie:User
        properties:
          username: user@domain.com
          fullName: 'name '
          role: User
      second:
        type: opsgenie:User
        properties:
          username: test@domain.com
          fullName: 'name '
          role: User
      test:
        type: opsgenie:Team
        properties:
          name: example
          description: This team deals with all the things
          members:
            - id: ${first.id}
              role: admin
            - id: ${second.id}
              role: user
      self-service:
        type: opsgenie:Team
        properties:
          name: Self Service
          description: Membership in this team is managed via OpsGenie web UI only
          ignoreMembers: true
          deleteDefaultResources: true
    

    Create Team Resource

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

    Constructor syntax

    new Team(name: string, args?: TeamArgs, opts?: CustomResourceOptions);
    @overload
    def Team(resource_name: str,
             args: Optional[TeamArgs] = None,
             opts: Optional[ResourceOptions] = None)
    
    @overload
    def Team(resource_name: str,
             opts: Optional[ResourceOptions] = None,
             delete_default_resources: Optional[bool] = None,
             description: Optional[str] = None,
             ignore_members: Optional[bool] = None,
             members: Optional[Sequence[TeamMemberArgs]] = None,
             name: Optional[str] = None)
    func NewTeam(ctx *Context, name string, args *TeamArgs, opts ...ResourceOption) (*Team, error)
    public Team(string name, TeamArgs? args = null, CustomResourceOptions? opts = null)
    public Team(String name, TeamArgs args)
    public Team(String name, TeamArgs args, CustomResourceOptions options)
    
    type: opsgenie:Team
    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 TeamArgs
    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 TeamArgs
    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 TeamArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TeamArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TeamArgs
    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 teamResource = new Opsgenie.Team("teamResource", new()
    {
        DeleteDefaultResources = false,
        Description = "string",
        IgnoreMembers = false,
        Members = new[]
        {
            new Opsgenie.Inputs.TeamMemberArgs
            {
                Id = "string",
                Role = "string",
                Username = "string",
            },
        },
        Name = "string",
    });
    
    example, err := opsgenie.NewTeam(ctx, "teamResource", &opsgenie.TeamArgs{
    	DeleteDefaultResources: pulumi.Bool(false),
    	Description:            pulumi.String("string"),
    	IgnoreMembers:          pulumi.Bool(false),
    	Members: opsgenie.TeamMemberArray{
    		&opsgenie.TeamMemberArgs{
    			Id:       pulumi.String("string"),
    			Role:     pulumi.String("string"),
    			Username: pulumi.String("string"),
    		},
    	},
    	Name: pulumi.String("string"),
    })
    
    var teamResource = new Team("teamResource", TeamArgs.builder()
        .deleteDefaultResources(false)
        .description("string")
        .ignoreMembers(false)
        .members(TeamMemberArgs.builder()
            .id("string")
            .role("string")
            .username("string")
            .build())
        .name("string")
        .build());
    
    team_resource = opsgenie.Team("teamResource",
        delete_default_resources=False,
        description="string",
        ignore_members=False,
        members=[opsgenie.TeamMemberArgs(
            id="string",
            role="string",
            username="string",
        )],
        name="string")
    
    const teamResource = new opsgenie.Team("teamResource", {
        deleteDefaultResources: false,
        description: "string",
        ignoreMembers: false,
        members: [{
            id: "string",
            role: "string",
            username: "string",
        }],
        name: "string",
    });
    
    type: opsgenie:Team
    properties:
        deleteDefaultResources: false
        description: string
        ignoreMembers: false
        members:
            - id: string
              role: string
              username: string
        name: string
    

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

    DeleteDefaultResources bool
    Set to true to remove default escalation and schedule for newly created team. Be careful its also changes that team routing rule to None. That means you have to define routing rule as well
    Description string
    A description for this team.
    IgnoreMembers bool
    Set to true to ignore any configured member blocks and any team member added/updated/removed via OpsGenie web UI. Use this option e.g. to maintain membership via web UI only and use it only for new teams. Changing the value for existing teams might lead to strange behaviour. Default: false.
    Members List<TeamMember>
    A Member block as documented below.
    Name string
    The name associated with this team. Opsgenie defines that this must not be longer than 100 characters.
    DeleteDefaultResources bool
    Set to true to remove default escalation and schedule for newly created team. Be careful its also changes that team routing rule to None. That means you have to define routing rule as well
    Description string
    A description for this team.
    IgnoreMembers bool
    Set to true to ignore any configured member blocks and any team member added/updated/removed via OpsGenie web UI. Use this option e.g. to maintain membership via web UI only and use it only for new teams. Changing the value for existing teams might lead to strange behaviour. Default: false.
    Members []TeamMemberArgs
    A Member block as documented below.
    Name string
    The name associated with this team. Opsgenie defines that this must not be longer than 100 characters.
    deleteDefaultResources Boolean
    Set to true to remove default escalation and schedule for newly created team. Be careful its also changes that team routing rule to None. That means you have to define routing rule as well
    description String
    A description for this team.
    ignoreMembers Boolean
    Set to true to ignore any configured member blocks and any team member added/updated/removed via OpsGenie web UI. Use this option e.g. to maintain membership via web UI only and use it only for new teams. Changing the value for existing teams might lead to strange behaviour. Default: false.
    members List<TeamMember>
    A Member block as documented below.
    name String
    The name associated with this team. Opsgenie defines that this must not be longer than 100 characters.
    deleteDefaultResources boolean
    Set to true to remove default escalation and schedule for newly created team. Be careful its also changes that team routing rule to None. That means you have to define routing rule as well
    description string
    A description for this team.
    ignoreMembers boolean
    Set to true to ignore any configured member blocks and any team member added/updated/removed via OpsGenie web UI. Use this option e.g. to maintain membership via web UI only and use it only for new teams. Changing the value for existing teams might lead to strange behaviour. Default: false.
    members TeamMember[]
    A Member block as documented below.
    name string
    The name associated with this team. Opsgenie defines that this must not be longer than 100 characters.
    delete_default_resources bool
    Set to true to remove default escalation and schedule for newly created team. Be careful its also changes that team routing rule to None. That means you have to define routing rule as well
    description str
    A description for this team.
    ignore_members bool
    Set to true to ignore any configured member blocks and any team member added/updated/removed via OpsGenie web UI. Use this option e.g. to maintain membership via web UI only and use it only for new teams. Changing the value for existing teams might lead to strange behaviour. Default: false.
    members Sequence[TeamMemberArgs]
    A Member block as documented below.
    name str
    The name associated with this team. Opsgenie defines that this must not be longer than 100 characters.
    deleteDefaultResources Boolean
    Set to true to remove default escalation and schedule for newly created team. Be careful its also changes that team routing rule to None. That means you have to define routing rule as well
    description String
    A description for this team.
    ignoreMembers Boolean
    Set to true to ignore any configured member blocks and any team member added/updated/removed via OpsGenie web UI. Use this option e.g. to maintain membership via web UI only and use it only for new teams. Changing the value for existing teams might lead to strange behaviour. Default: false.
    members List<Property Map>
    A Member block as documented below.
    name String
    The name associated with this team. Opsgenie defines that this must not be longer than 100 characters.

    Outputs

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

    Get an existing Team 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?: TeamState, opts?: CustomResourceOptions): Team
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            delete_default_resources: Optional[bool] = None,
            description: Optional[str] = None,
            ignore_members: Optional[bool] = None,
            members: Optional[Sequence[TeamMemberArgs]] = None,
            name: Optional[str] = None) -> Team
    func GetTeam(ctx *Context, name string, id IDInput, state *TeamState, opts ...ResourceOption) (*Team, error)
    public static Team Get(string name, Input<string> id, TeamState? state, CustomResourceOptions? opts = null)
    public static Team get(String name, Output<String> id, TeamState 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.
    The following state arguments are supported:
    DeleteDefaultResources bool
    Set to true to remove default escalation and schedule for newly created team. Be careful its also changes that team routing rule to None. That means you have to define routing rule as well
    Description string
    A description for this team.
    IgnoreMembers bool
    Set to true to ignore any configured member blocks and any team member added/updated/removed via OpsGenie web UI. Use this option e.g. to maintain membership via web UI only and use it only for new teams. Changing the value for existing teams might lead to strange behaviour. Default: false.
    Members List<TeamMember>
    A Member block as documented below.
    Name string
    The name associated with this team. Opsgenie defines that this must not be longer than 100 characters.
    DeleteDefaultResources bool
    Set to true to remove default escalation and schedule for newly created team. Be careful its also changes that team routing rule to None. That means you have to define routing rule as well
    Description string
    A description for this team.
    IgnoreMembers bool
    Set to true to ignore any configured member blocks and any team member added/updated/removed via OpsGenie web UI. Use this option e.g. to maintain membership via web UI only and use it only for new teams. Changing the value for existing teams might lead to strange behaviour. Default: false.
    Members []TeamMemberArgs
    A Member block as documented below.
    Name string
    The name associated with this team. Opsgenie defines that this must not be longer than 100 characters.
    deleteDefaultResources Boolean
    Set to true to remove default escalation and schedule for newly created team. Be careful its also changes that team routing rule to None. That means you have to define routing rule as well
    description String
    A description for this team.
    ignoreMembers Boolean
    Set to true to ignore any configured member blocks and any team member added/updated/removed via OpsGenie web UI. Use this option e.g. to maintain membership via web UI only and use it only for new teams. Changing the value for existing teams might lead to strange behaviour. Default: false.
    members List<TeamMember>
    A Member block as documented below.
    name String
    The name associated with this team. Opsgenie defines that this must not be longer than 100 characters.
    deleteDefaultResources boolean
    Set to true to remove default escalation and schedule for newly created team. Be careful its also changes that team routing rule to None. That means you have to define routing rule as well
    description string
    A description for this team.
    ignoreMembers boolean
    Set to true to ignore any configured member blocks and any team member added/updated/removed via OpsGenie web UI. Use this option e.g. to maintain membership via web UI only and use it only for new teams. Changing the value for existing teams might lead to strange behaviour. Default: false.
    members TeamMember[]
    A Member block as documented below.
    name string
    The name associated with this team. Opsgenie defines that this must not be longer than 100 characters.
    delete_default_resources bool
    Set to true to remove default escalation and schedule for newly created team. Be careful its also changes that team routing rule to None. That means you have to define routing rule as well
    description str
    A description for this team.
    ignore_members bool
    Set to true to ignore any configured member blocks and any team member added/updated/removed via OpsGenie web UI. Use this option e.g. to maintain membership via web UI only and use it only for new teams. Changing the value for existing teams might lead to strange behaviour. Default: false.
    members Sequence[TeamMemberArgs]
    A Member block as documented below.
    name str
    The name associated with this team. Opsgenie defines that this must not be longer than 100 characters.
    deleteDefaultResources Boolean
    Set to true to remove default escalation and schedule for newly created team. Be careful its also changes that team routing rule to None. That means you have to define routing rule as well
    description String
    A description for this team.
    ignoreMembers Boolean
    Set to true to ignore any configured member blocks and any team member added/updated/removed via OpsGenie web UI. Use this option e.g. to maintain membership via web UI only and use it only for new teams. Changing the value for existing teams might lead to strange behaviour. Default: false.
    members List<Property Map>
    A Member block as documented below.
    name String
    The name associated with this team. Opsgenie defines that this must not be longer than 100 characters.

    Supporting Types

    TeamMember, TeamMemberArgs

    Id string
    The UUID for the member to add to this Team.
    Role string
    The role for the user within the Team - can be either admin or user. Default: user.
    Username string
    Id string
    The UUID for the member to add to this Team.
    Role string
    The role for the user within the Team - can be either admin or user. Default: user.
    Username string
    id String
    The UUID for the member to add to this Team.
    role String
    The role for the user within the Team - can be either admin or user. Default: user.
    username String
    id string
    The UUID for the member to add to this Team.
    role string
    The role for the user within the Team - can be either admin or user. Default: user.
    username string
    id str
    The UUID for the member to add to this Team.
    role str
    The role for the user within the Team - can be either admin or user. Default: user.
    username str
    id String
    The UUID for the member to add to this Team.
    role String
    The role for the user within the Team - can be either admin or user. Default: user.
    username String

    Import

    Teams can be imported using the team_id, e.g.

    $ pulumi import opsgenie:index/team:Team team1 team_id`
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Opsgenie pulumi/pulumi-opsgenie
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the opsgenie Terraform Provider.
    opsgenie logo
    Opsgenie v1.3.9 published on Tuesday, Jul 16, 2024 by Pulumi