1. Packages
  2. Mongodbatlas Provider
  3. API Docs
  4. getTeam
MongoDB Atlas v3.30.0 published on Friday, Mar 21, 2025 by Pulumi

mongodbatlas.getTeam

Explore with Pulumi AI

MongoDB Atlas v3.30.0 published on Friday, Mar 21, 2025 by Pulumi

# Data Source: mongodbatlas.Team

mongodbatlas.Team describes a Team. The resource requires your Organization ID, Project ID and Team ID.

NOTE: Groups and projects are synonymous terms. You may find group_id in the official documentation.

Example Usage

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

const testTeam = new mongodbatlas.Team("test", {
    orgId: "<ORGANIZATION-ID>",
    name: "myNewTeam",
    usernames: [
        "user1",
        "user2",
        "user3",
    ],
});
const test = mongodbatlas.getTeamOutput({
    orgId: testTeam.orgId,
    teamId: testTeam.teamId,
});
Copy
import pulumi
import pulumi_mongodbatlas as mongodbatlas

test_team = mongodbatlas.Team("test",
    org_id="<ORGANIZATION-ID>",
    name="myNewTeam",
    usernames=[
        "user1",
        "user2",
        "user3",
    ])
test = mongodbatlas.get_team_output(org_id=test_team.org_id,
    team_id=test_team.team_id)
Copy
package main

import (
	"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		testTeam, err := mongodbatlas.NewTeam(ctx, "test", &mongodbatlas.TeamArgs{
			OrgId: pulumi.String("<ORGANIZATION-ID>"),
			Name:  pulumi.String("myNewTeam"),
			Usernames: pulumi.StringArray{
				pulumi.String("user1"),
				pulumi.String("user2"),
				pulumi.String("user3"),
			},
		})
		if err != nil {
			return err
		}
		_ = mongodbatlas.LookupTeamOutput(ctx, mongodbatlas.GetTeamOutputArgs{
			OrgId:  testTeam.OrgId,
			TeamId: testTeam.TeamId,
		}, nil)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

return await Deployment.RunAsync(() => 
{
    var testTeam = new Mongodbatlas.Team("test", new()
    {
        OrgId = "<ORGANIZATION-ID>",
        Name = "myNewTeam",
        Usernames = new[]
        {
            "user1",
            "user2",
            "user3",
        },
    });

    var test = Mongodbatlas.GetTeam.Invoke(new()
    {
        OrgId = testTeam.OrgId,
        TeamId = testTeam.TeamId,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mongodbatlas.Team;
import com.pulumi.mongodbatlas.TeamArgs;
import com.pulumi.mongodbatlas.MongodbatlasFunctions;
import com.pulumi.mongodbatlas.inputs.GetTeamArgs;
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 testTeam = new Team("testTeam", TeamArgs.builder()
            .orgId("<ORGANIZATION-ID>")
            .name("myNewTeam")
            .usernames(            
                "user1",
                "user2",
                "user3")
            .build());

        final var test = MongodbatlasFunctions.getTeam(GetTeamArgs.builder()
            .orgId(testTeam.orgId())
            .teamId(testTeam.teamId())
            .build());

    }
}
Copy
resources:
  testTeam:
    type: mongodbatlas:Team
    name: test
    properties:
      orgId: <ORGANIZATION-ID>
      name: myNewTeam
      usernames:
        - user1
        - user2
        - user3
variables:
  test:
    fn::invoke:
      function: mongodbatlas:getTeam
      arguments:
        orgId: ${testTeam.orgId}
        teamId: ${testTeam.teamId}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";

const test = new mongodbatlas.Team("test", {
    orgId: "<ORGANIZATION-ID>",
    name: "myNewTeam",
    usernames: [
        "user1",
        "user2",
        "user3",
    ],
});
const test2 = mongodbatlas.getTeamOutput({
    orgId: test.orgId,
    name: test.name,
});
Copy
import pulumi
import pulumi_mongodbatlas as mongodbatlas

test = mongodbatlas.Team("test",
    org_id="<ORGANIZATION-ID>",
    name="myNewTeam",
    usernames=[
        "user1",
        "user2",
        "user3",
    ])
test2 = mongodbatlas.get_team_output(org_id=test.org_id,
    name=test.name)
Copy
package main

import (
	"github.com/pulumi/pulumi-mongodbatlas/sdk/v3/go/mongodbatlas"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		test, err := mongodbatlas.NewTeam(ctx, "test", &mongodbatlas.TeamArgs{
			OrgId: pulumi.String("<ORGANIZATION-ID>"),
			Name:  pulumi.String("myNewTeam"),
			Usernames: pulumi.StringArray{
				pulumi.String("user1"),
				pulumi.String("user2"),
				pulumi.String("user3"),
			},
		})
		if err != nil {
			return err
		}
		_ = mongodbatlas.LookupTeamOutput(ctx, mongodbatlas.GetTeamOutputArgs{
			OrgId: test.OrgId,
			Name:  test.Name,
		}, nil)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

return await Deployment.RunAsync(() => 
{
    var test = new Mongodbatlas.Team("test", new()
    {
        OrgId = "<ORGANIZATION-ID>",
        Name = "myNewTeam",
        Usernames = new[]
        {
            "user1",
            "user2",
            "user3",
        },
    });

    var test2 = Mongodbatlas.GetTeam.Invoke(new()
    {
        OrgId = test.OrgId,
        Name = test.Name,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mongodbatlas.Team;
import com.pulumi.mongodbatlas.TeamArgs;
import com.pulumi.mongodbatlas.MongodbatlasFunctions;
import com.pulumi.mongodbatlas.inputs.GetTeamArgs;
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 test = new Team("test", TeamArgs.builder()
            .orgId("<ORGANIZATION-ID>")
            .name("myNewTeam")
            .usernames(            
                "user1",
                "user2",
                "user3")
            .build());

        final var test2 = MongodbatlasFunctions.getTeam(GetTeamArgs.builder()
            .orgId(test.orgId())
            .name(test.name())
            .build());

    }
}
Copy
resources:
  test:
    type: mongodbatlas:Team
    properties:
      orgId: <ORGANIZATION-ID>
      name: myNewTeam
      usernames:
        - user1
        - user2
        - user3
variables:
  test2:
    fn::invoke:
      function: mongodbatlas:getTeam
      arguments:
        orgId: ${test.orgId}
        name: ${test.name}
Copy

Using getTeam

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getTeam(args: GetTeamArgs, opts?: InvokeOptions): Promise<GetTeamResult>
function getTeamOutput(args: GetTeamOutputArgs, opts?: InvokeOptions): Output<GetTeamResult>
Copy
def get_team(name: Optional[str] = None,
             org_id: Optional[str] = None,
             team_id: Optional[str] = None,
             opts: Optional[InvokeOptions] = None) -> GetTeamResult
def get_team_output(name: Optional[pulumi.Input[str]] = None,
             org_id: Optional[pulumi.Input[str]] = None,
             team_id: Optional[pulumi.Input[str]] = None,
             opts: Optional[InvokeOptions] = None) -> Output[GetTeamResult]
Copy
func LookupTeam(ctx *Context, args *LookupTeamArgs, opts ...InvokeOption) (*LookupTeamResult, error)
func LookupTeamOutput(ctx *Context, args *LookupTeamOutputArgs, opts ...InvokeOption) LookupTeamResultOutput
Copy

> Note: This function is named LookupTeam in the Go SDK.

public static class GetTeam 
{
    public static Task<GetTeamResult> InvokeAsync(GetTeamArgs args, InvokeOptions? opts = null)
    public static Output<GetTeamResult> Invoke(GetTeamInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetTeamResult> getTeam(GetTeamArgs args, InvokeOptions options)
public static Output<GetTeamResult> getTeam(GetTeamArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: mongodbatlas:index/getTeam:getTeam
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

OrgId This property is required. string
The unique identifier for the organization you want to associate the team with.
Name string

The team name.

IMPORTANT: Either team_id or name must be configured.

TeamId string
The unique identifier for the team.
OrgId This property is required. string
The unique identifier for the organization you want to associate the team with.
Name string

The team name.

IMPORTANT: Either team_id or name must be configured.

TeamId string
The unique identifier for the team.
orgId This property is required. String
The unique identifier for the organization you want to associate the team with.
name String

The team name.

IMPORTANT: Either team_id or name must be configured.

teamId String
The unique identifier for the team.
orgId This property is required. string
The unique identifier for the organization you want to associate the team with.
name string

The team name.

IMPORTANT: Either team_id or name must be configured.

teamId string
The unique identifier for the team.
org_id This property is required. str
The unique identifier for the organization you want to associate the team with.
name str

The team name.

IMPORTANT: Either team_id or name must be configured.

team_id str
The unique identifier for the team.
orgId This property is required. String
The unique identifier for the organization you want to associate the team with.
name String

The team name.

IMPORTANT: Either team_id or name must be configured.

teamId String
The unique identifier for the team.

getTeam Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the team you want to create.
OrgId string
TeamId string
The unique identifier for the team.
Usernames List<string>
The users who are part of the organization.
Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the team you want to create.
OrgId string
TeamId string
The unique identifier for the team.
Usernames []string
The users who are part of the organization.
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the team you want to create.
orgId String
teamId String
The unique identifier for the team.
usernames List<String>
The users who are part of the organization.
id string
The provider-assigned unique ID for this managed resource.
name string
The name of the team you want to create.
orgId string
teamId string
The unique identifier for the team.
usernames string[]
The users who are part of the organization.
id str
The provider-assigned unique ID for this managed resource.
name str
The name of the team you want to create.
org_id str
team_id str
The unique identifier for the team.
usernames Sequence[str]
The users who are part of the organization.
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the team you want to create.
orgId String
teamId String
The unique identifier for the team.
usernames List<String>
The users who are part of the organization.

Package Details

Repository
MongoDB Atlas pulumi/pulumi-mongodbatlas
License
Apache-2.0
Notes
This Pulumi package is based on the mongodbatlas Terraform Provider.
MongoDB Atlas v3.30.0 published on Friday, Mar 21, 2025 by Pulumi