1. Packages
  2. Mongodbatlas Provider
  3. API Docs
  4. getTeamProjectAssignment
MongoDB Atlas v4.0.0 published on Tuesday, Dec 30, 2025 by Pulumi
mongodbatlas logo
MongoDB Atlas v4.0.0 published on Tuesday, Dec 30, 2025 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.LookupTeamProjectAssignmentOutput(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.TeamProjectAssignment("this", new()
        {
            ProjectId = projectId,
            TeamId = teamId,
            RoleNames = new[]
            {
                "GROUP_OWNER",
                "GROUP_DATA_ACCESS_ADMIN",
            },
        });
    
        var @this = Mongodbatlas.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. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
    TeamId string
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
    TeamId string
    projectId String
    Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
    teamId String
    projectId string
    Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
    teamId string
    project_id str
    Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
    team_id str
    projectId String
    Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
    teamId String

    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. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
    RoleNames List<string>
    TeamId string
    Id string
    The provider-assigned unique ID for this managed resource.
    ProjectId string
    Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
    RoleNames []string
    TeamId string
    id String
    The provider-assigned unique ID for this managed resource.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
    roleNames List<String>
    teamId String
    id string
    The provider-assigned unique ID for this managed resource.
    projectId string
    Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
    roleNames string[]
    teamId string
    id str
    The provider-assigned unique ID for this managed resource.
    project_id str
    Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
    role_names Sequence[str]
    team_id str
    id String
    The provider-assigned unique ID for this managed resource.
    projectId String
    Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
    roleNames List<String>
    teamId String

    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
    MongoDB Atlas v4.0.0 published on Tuesday, Dec 30, 2025 by Pulumi
      Meet Neo: Your AI Platform Teammate