1. Packages
  2. Datadog Provider
  3. API Docs
  4. TeamMembership
Datadog v4.36.1 published on Friday, Nov 15, 2024 by Pulumi

datadog.TeamMembership

Explore with Pulumi AI

datadog logo
Datadog v4.36.1 published on Friday, Nov 15, 2024 by Pulumi

    Provides a Datadog TeamMembership resource. This can be used to create and manage Datadog team_membership.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as datadog from "@pulumi/datadog";
    
    const foo = new datadog.Team("foo", {
        description: "Example team",
        handle: "example-team-updated",
        name: "Example Team-updated",
    });
    const fooUser = new datadog.User("foo", {email: "new@example.com"});
    // Create new team_membership resource
    const fooTeamMembership = new datadog.TeamMembership("foo", {
        teamId: foo.id,
        userId: fooUser.id,
        role: "admin",
    });
    
    import pulumi
    import pulumi_datadog as datadog
    
    foo = datadog.Team("foo",
        description="Example team",
        handle="example-team-updated",
        name="Example Team-updated")
    foo_user = datadog.User("foo", email="new@example.com")
    # Create new team_membership resource
    foo_team_membership = datadog.TeamMembership("foo",
        team_id=foo.id,
        user_id=foo_user.id,
        role="admin")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-datadog/sdk/v4/go/datadog"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		foo, err := datadog.NewTeam(ctx, "foo", &datadog.TeamArgs{
    			Description: pulumi.String("Example team"),
    			Handle:      pulumi.String("example-team-updated"),
    			Name:        pulumi.String("Example Team-updated"),
    		})
    		if err != nil {
    			return err
    		}
    		fooUser, err := datadog.NewUser(ctx, "foo", &datadog.UserArgs{
    			Email: pulumi.String("new@example.com"),
    		})
    		if err != nil {
    			return err
    		}
    		// Create new team_membership resource
    		_, err = datadog.NewTeamMembership(ctx, "foo", &datadog.TeamMembershipArgs{
    			TeamId: foo.ID(),
    			UserId: fooUser.ID(),
    			Role:   pulumi.String("admin"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Datadog = Pulumi.Datadog;
    
    return await Deployment.RunAsync(() => 
    {
        var foo = new Datadog.Team("foo", new()
        {
            Description = "Example team",
            Handle = "example-team-updated",
            Name = "Example Team-updated",
        });
    
        var fooUser = new Datadog.User("foo", new()
        {
            Email = "new@example.com",
        });
    
        // Create new team_membership resource
        var fooTeamMembership = new Datadog.TeamMembership("foo", new()
        {
            TeamId = foo.Id,
            UserId = fooUser.Id,
            Role = "admin",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.datadog.Team;
    import com.pulumi.datadog.TeamArgs;
    import com.pulumi.datadog.User;
    import com.pulumi.datadog.UserArgs;
    import com.pulumi.datadog.TeamMembership;
    import com.pulumi.datadog.TeamMembershipArgs;
    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 foo = new Team("foo", TeamArgs.builder()
                .description("Example team")
                .handle("example-team-updated")
                .name("Example Team-updated")
                .build());
    
            var fooUser = new User("fooUser", UserArgs.builder()
                .email("new@example.com")
                .build());
    
            // Create new team_membership resource
            var fooTeamMembership = new TeamMembership("fooTeamMembership", TeamMembershipArgs.builder()
                .teamId(foo.id())
                .userId(fooUser.id())
                .role("admin")
                .build());
    
        }
    }
    
    resources:
      foo:
        type: datadog:Team
        properties:
          description: Example team
          handle: example-team-updated
          name: Example Team-updated
      fooUser:
        type: datadog:User
        name: foo
        properties:
          email: new@example.com
      # Create new team_membership resource
      fooTeamMembership:
        type: datadog:TeamMembership
        name: foo
        properties:
          teamId: ${foo.id}
          userId: ${fooUser.id}
          role: admin
    

    Create TeamMembership Resource

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

    Constructor syntax

    new TeamMembership(name: string, args: TeamMembershipArgs, opts?: CustomResourceOptions);
    @overload
    def TeamMembership(resource_name: str,
                       args: TeamMembershipArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def TeamMembership(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       team_id: Optional[str] = None,
                       user_id: Optional[str] = None,
                       role: Optional[str] = None)
    func NewTeamMembership(ctx *Context, name string, args TeamMembershipArgs, opts ...ResourceOption) (*TeamMembership, error)
    public TeamMembership(string name, TeamMembershipArgs args, CustomResourceOptions? opts = null)
    public TeamMembership(String name, TeamMembershipArgs args)
    public TeamMembership(String name, TeamMembershipArgs args, CustomResourceOptions options)
    
    type: datadog:TeamMembership
    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 TeamMembershipArgs
    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 TeamMembershipArgs
    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 TeamMembershipArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args TeamMembershipArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args TeamMembershipArgs
    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 teamMembershipResource = new Datadog.TeamMembership("teamMembershipResource", new()
    {
        TeamId = "string",
        UserId = "string",
        Role = "string",
    });
    
    example, err := datadog.NewTeamMembership(ctx, "teamMembershipResource", &datadog.TeamMembershipArgs{
    	TeamId: pulumi.String("string"),
    	UserId: pulumi.String("string"),
    	Role:   pulumi.String("string"),
    })
    
    var teamMembershipResource = new TeamMembership("teamMembershipResource", TeamMembershipArgs.builder()
        .teamId("string")
        .userId("string")
        .role("string")
        .build());
    
    team_membership_resource = datadog.TeamMembership("teamMembershipResource",
        team_id="string",
        user_id="string",
        role="string")
    
    const teamMembershipResource = new datadog.TeamMembership("teamMembershipResource", {
        teamId: "string",
        userId: "string",
        role: "string",
    });
    
    type: datadog:TeamMembership
    properties:
        role: string
        teamId: string
        userId: string
    

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

    TeamId string
    ID of the team the team membership is associated with.
    UserId string
    The ID of the user.
    Role string
    The user's role within the team. Valid values are admin.
    TeamId string
    ID of the team the team membership is associated with.
    UserId string
    The ID of the user.
    Role string
    The user's role within the team. Valid values are admin.
    teamId String
    ID of the team the team membership is associated with.
    userId String
    The ID of the user.
    role String
    The user's role within the team. Valid values are admin.
    teamId string
    ID of the team the team membership is associated with.
    userId string
    The ID of the user.
    role string
    The user's role within the team. Valid values are admin.
    team_id str
    ID of the team the team membership is associated with.
    user_id str
    The ID of the user.
    role str
    The user's role within the team. Valid values are admin.
    teamId String
    ID of the team the team membership is associated with.
    userId String
    The ID of the user.
    role String
    The user's role within the team. Valid values are admin.

    Outputs

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

    Get an existing TeamMembership 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?: TeamMembershipState, opts?: CustomResourceOptions): TeamMembership
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            role: Optional[str] = None,
            team_id: Optional[str] = None,
            user_id: Optional[str] = None) -> TeamMembership
    func GetTeamMembership(ctx *Context, name string, id IDInput, state *TeamMembershipState, opts ...ResourceOption) (*TeamMembership, error)
    public static TeamMembership Get(string name, Input<string> id, TeamMembershipState? state, CustomResourceOptions? opts = null)
    public static TeamMembership get(String name, Output<String> id, TeamMembershipState 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:
    Role string
    The user's role within the team. Valid values are admin.
    TeamId string
    ID of the team the team membership is associated with.
    UserId string
    The ID of the user.
    Role string
    The user's role within the team. Valid values are admin.
    TeamId string
    ID of the team the team membership is associated with.
    UserId string
    The ID of the user.
    role String
    The user's role within the team. Valid values are admin.
    teamId String
    ID of the team the team membership is associated with.
    userId String
    The ID of the user.
    role string
    The user's role within the team. Valid values are admin.
    teamId string
    ID of the team the team membership is associated with.
    userId string
    The ID of the user.
    role str
    The user's role within the team. Valid values are admin.
    team_id str
    ID of the team the team membership is associated with.
    user_id str
    The ID of the user.
    role String
    The user's role within the team. Valid values are admin.
    teamId String
    ID of the team the team membership is associated with.
    userId String
    The ID of the user.

    Import

    This resource is imported using team_id and user_id seperated by :.

    $ pulumi import datadog:index/teamMembership:TeamMembership foo "${team_id}:${user_id}"
    

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

    Package Details

    Repository
    Datadog pulumi/pulumi-datadog
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the datadog Terraform Provider.
    datadog logo
    Datadog v4.36.1 published on Friday, Nov 15, 2024 by Pulumi