1. Packages
  2. Packages
  3. Mongodbatlas Provider
  4. API Docs
  5. getTeamProjectAssignment
Viewing docs for MongoDB Atlas v4.8.0
published on Thursday, Apr 23, 2026 by Pulumi
mongodbatlas logo
Viewing docs for MongoDB Atlas v4.8.0
published on Thursday, Apr 23, 2026 by Pulumi

    mongodbatlas.TeamProjectAssignment provides a Team Project Assignment data source. The data source lets you retrieve a team assigned to a project.

    Example Usage

    S

    import * as pulumi from "@pulumi/pulumi";
    import * as mongodbatlas from "@pulumi/mongodbatlas";
    
    const thisTeamProjectAssignment = new mongodbatlas.TeamProjectAssignment("this", {
        projectId: projectId,
        teamId: teamId,
        roleNames: [
            "GROUP_OWNER",
            "GROUP_DATA_ACCESS_ADMIN",
        ],
    });
    const _this = mongodbatlas.getTeamProjectAssignmentOutput({
        projectId: thisTeamProjectAssignment.projectId,
        teamId: thisTeamProjectAssignment.teamId,
    });
    
    import pulumi
    import pulumi_mongodbatlas as mongodbatlas
    
    this_team_project_assignment = mongodbatlas.TeamProjectAssignment("this",
        project_id=project_id,
        team_id=team_id,
        role_names=[
            "GROUP_OWNER",
            "GROUP_DATA_ACCESS_ADMIN",
        ])
    this = mongodbatlas.get_team_project_assignment_output(project_id=this_team_project_assignment.project_id,
        team_id=this_team_project_assignment.team_id)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-mongodbatlas/sdk/v4/go/mongodbatlas"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		thisTeamProjectAssignment, err := mongodbatlas.NewTeamProjectAssignment(ctx, "this", &mongodbatlas.TeamProjectAssignmentArgs{
    			ProjectId: pulumi.Any(projectId),
    			TeamId:    pulumi.Any(teamId),
    			RoleNames: pulumi.StringArray{
    				pulumi.String("GROUP_OWNER"),
    				pulumi.String("GROUP_DATA_ACCESS_ADMIN"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_ = mongodbatlas.GetTeamProjectAssignmentOutput(ctx, mongodbatlas.GetTeamProjectAssignmentOutputArgs{
    			ProjectId: thisTeamProjectAssignment.ProjectId,
    			TeamId:    thisTeamProjectAssignment.TeamId,
    		}, nil)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Mongodbatlas = Pulumi.Mongodbatlas;
    
    return await Deployment.RunAsync(() => 
    {
        var thisTeamProjectAssignment = new Mongodbatlas.Index.TeamProjectAssignment("this", new()
        {
            ProjectId = projectId,
            TeamId = teamId,
            RoleNames = new[]
            {
                "GROUP_OWNER",
                "GROUP_DATA_ACCESS_ADMIN",
            },
        });
    
        var @this = Mongodbatlas.Index.GetTeamProjectAssignment.Invoke(new()
        {
            ProjectId = thisTeamProjectAssignment.ProjectId,
            TeamId = thisTeamProjectAssignment.TeamId,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.mongodbatlas.TeamProjectAssignment;
    import com.pulumi.mongodbatlas.TeamProjectAssignmentArgs;
    import com.pulumi.mongodbatlas.MongodbatlasFunctions;
    import com.pulumi.mongodbatlas.inputs.GetTeamProjectAssignmentArgs;
    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 thisTeamProjectAssignment = new TeamProjectAssignment("thisTeamProjectAssignment", TeamProjectAssignmentArgs.builder()
                .projectId(projectId)
                .teamId(teamId)
                .roleNames(            
                    "GROUP_OWNER",
                    "GROUP_DATA_ACCESS_ADMIN")
                .build());
    
            final var this = MongodbatlasFunctions.getTeamProjectAssignment(GetTeamProjectAssignmentArgs.builder()
                .projectId(thisTeamProjectAssignment.projectId())
                .teamId(thisTeamProjectAssignment.teamId())
                .build());
    
        }
    }
    
    resources:
      thisTeamProjectAssignment:
        type: mongodbatlas:TeamProjectAssignment
        name: this
        properties:
          projectId: ${projectId}
          teamId: ${teamId}
          roleNames:
            - GROUP_OWNER
            - GROUP_DATA_ACCESS_ADMIN
    variables:
      this:
        fn::invoke:
          function: mongodbatlas:getTeamProjectAssignment
          arguments:
            projectId: ${thisTeamProjectAssignment.projectId}
            teamId: ${thisTeamProjectAssignment.teamId}
    

    Using getTeamProjectAssignment

    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 getTeamProjectAssignment(args: GetTeamProjectAssignmentArgs, opts?: InvokeOptions): Promise<GetTeamProjectAssignmentResult>
    function getTeamProjectAssignmentOutput(args: GetTeamProjectAssignmentOutputArgs, opts?: InvokeOptions): Output<GetTeamProjectAssignmentResult>
    def get_team_project_assignment(project_id: Optional[str] = None,
                                    team_id: Optional[str] = None,
                                    opts: Optional[InvokeOptions] = None) -> GetTeamProjectAssignmentResult
    def get_team_project_assignment_output(project_id: Optional[pulumi.Input[str]] = None,
                                    team_id: Optional[pulumi.Input[str]] = None,
                                    opts: Optional[InvokeOptions] = None) -> Output[GetTeamProjectAssignmentResult]
    func LookupTeamProjectAssignment(ctx *Context, args *LookupTeamProjectAssignmentArgs, opts ...InvokeOption) (*LookupTeamProjectAssignmentResult, error)
    func LookupTeamProjectAssignmentOutput(ctx *Context, args *LookupTeamProjectAssignmentOutputArgs, opts ...InvokeOption) LookupTeamProjectAssignmentResultOutput

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

    public static class GetTeamProjectAssignment 
    {
        public static Task<GetTeamProjectAssignmentResult> InvokeAsync(GetTeamProjectAssignmentArgs args, InvokeOptions? opts = null)
        public static Output<GetTeamProjectAssignmentResult> Invoke(GetTeamProjectAssignmentInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetTeamProjectAssignmentResult> getTeamProjectAssignment(GetTeamProjectAssignmentArgs args, InvokeOptions options)
    public static Output<GetTeamProjectAssignmentResult> getTeamProjectAssignment(GetTeamProjectAssignmentArgs args, InvokeOptions options)
    
    fn::invoke:
      function: mongodbatlas:index/getTeamProjectAssignment:getTeamProjectAssignment
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    TeamId string
    Unique 24-hexadecimal character string that identifies the team.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    TeamId string
    Unique 24-hexadecimal character string that identifies the team.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    teamId String
    Unique 24-hexadecimal character string that identifies the team.
    projectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    teamId string
    Unique 24-hexadecimal character string that identifies the team.
    project_id str
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    team_id str
    Unique 24-hexadecimal character string that identifies the team.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    teamId String
    Unique 24-hexadecimal character string that identifies the team.

    getTeamProjectAssignment Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    RoleNames List<string>
    One or more project-level roles assigned to the team.
    TeamId string
    Unique 24-hexadecimal character string that identifies the team.
    Id string
    The provider-assigned unique ID for this managed resource.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    RoleNames []string
    One or more project-level roles assigned to the team.
    TeamId string
    Unique 24-hexadecimal character string that identifies the team.
    id String
    The provider-assigned unique ID for this managed resource.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    roleNames List<String>
    One or more project-level roles assigned to the team.
    teamId String
    Unique 24-hexadecimal character string that identifies the team.
    id string
    The provider-assigned unique ID for this managed resource.
    projectId string
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    roleNames string[]
    One or more project-level roles assigned to the team.
    teamId string
    Unique 24-hexadecimal character string that identifies the team.
    id str
    The provider-assigned unique ID for this managed resource.
    project_id str
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    role_names Sequence[str]
    One or more project-level roles assigned to the team.
    team_id str
    Unique 24-hexadecimal character string that identifies the team.
    id String
    The provider-assigned unique ID for this managed resource.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project, also known as groupId in the official documentation.
    roleNames List<String>
    One or more project-level roles assigned to the team.
    teamId String
    Unique 24-hexadecimal character string that identifies the team.

    Package Details

    Repository
    MongoDB Atlas pulumi/pulumi-mongodbatlas
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the mongodbatlas Terraform Provider.
    mongodbatlas logo
    Viewing docs for MongoDB Atlas v4.8.0
    published on Thursday, Apr 23, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.