datadog.TeamMembership
Explore with Pulumi AI
Provides a Datadog TeamMembership resource. This can be used to create and manage Datadog team_membership.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Datadog = Pulumi.Datadog;
return await Deployment.RunAsync(() =>
{
var fooTeam = new Datadog.Team("fooTeam", new()
{
Description = "Example team",
Handle = "example-team-updated",
Name = "Example Team-updated",
});
var fooUser = new Datadog.User("fooUser", new()
{
Email = "new@example.com",
});
// Create new team_membership resource
var fooTeamMembership = new Datadog.TeamMembership("fooTeamMembership", new()
{
TeamId = fooTeam.Id,
UserId = fooUser.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 {
fooTeam, err := datadog.NewTeam(ctx, "fooTeam", &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, "fooUser", &datadog.UserArgs{
Email: pulumi.String("new@example.com"),
})
if err != nil {
return err
}
_, err = datadog.NewTeamMembership(ctx, "fooTeamMembership", &datadog.TeamMembershipArgs{
TeamId: fooTeam.ID(),
UserId: fooUser.ID(),
Role: pulumi.String("admin"),
})
if err != nil {
return err
}
return nil
})
}
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 fooTeam = new Team("fooTeam", 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());
var fooTeamMembership = new TeamMembership("fooTeamMembership", TeamMembershipArgs.builder()
.teamId(fooTeam.id())
.userId(fooUser.id())
.role("admin")
.build());
}
}
import pulumi
import pulumi_datadog as datadog
foo_team = datadog.Team("fooTeam",
description="Example team",
handle="example-team-updated",
name="Example Team-updated")
foo_user = datadog.User("fooUser", email="new@example.com")
# Create new team_membership resource
foo_team_membership = datadog.TeamMembership("fooTeamMembership",
team_id=foo_team.id,
user_id=foo_user.id,
role="admin")
import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";
const fooTeam = new datadog.Team("fooTeam", {
description: "Example team",
handle: "example-team-updated",
name: "Example Team-updated",
});
const fooUser = new datadog.User("fooUser", {email: "new@example.com"});
// Create new team_membership resource
const fooTeamMembership = new datadog.TeamMembership("fooTeamMembership", {
teamId: fooTeam.id,
userId: fooUser.id,
role: "admin",
});
resources:
fooTeam:
type: datadog:Team
properties:
description: Example team
handle: example-team-updated
name: Example Team-updated
fooUser:
type: datadog:User
properties:
email: new@example.com
# Create new team_membership resource
fooTeamMembership:
type: datadog:TeamMembership
properties:
teamId: ${fooTeam.id}
userId: ${fooUser.id}
role: admin
Create TeamMembership Resource
new TeamMembership(name: string, args: TeamMembershipArgs, opts?: CustomResourceOptions);
@overload
def TeamMembership(resource_name: str,
opts: Optional[ResourceOptions] = None,
role: Optional[str] = None,
team_id: Optional[str] = None,
user_id: Optional[str] = None)
@overload
def TeamMembership(resource_name: str,
args: TeamMembershipArgs,
opts: Optional[ResourceOptions] = 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.
- 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.
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
The TeamMembership resource accepts the following input properties:
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.
Import
This resource is imported using team_id and user_id seperated by :
.
$ pulumi import datadog:index/teamMembership:TeamMembership foo "${team_id}:${user_id}"
Package Details
- Repository
- Datadog pulumi/pulumi-datadog
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
datadog
Terraform Provider.