MongoDB Atlas v3.16.3 published on Friday, Jun 28, 2024 by Pulumi
mongodbatlas.getProjects
Explore with Pulumi AI
mongodbatlas.getProjects describe all Projects. This represents projects that have been created.
NOTE: Groups and projects are synonymous terms. You may find
groupIdin the official documentation.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";
const test = mongodbatlas.getRolesOrgId({});
const testProject = new mongodbatlas.Project("test", {
    name: "project-name",
    orgId: test.then(test => test.orgId),
    teams: [
        {
            teamId: "5e0fa8c99ccf641c722fe645",
            roleNames: ["GROUP_OWNER"],
        },
        {
            teamId: "5e1dd7b4f2a30ba80a70cd4rw",
            roleNames: [
                "GROUP_READ_ONLY",
                "GROUP_DATA_ACCESS_READ_WRITE",
            ],
        },
    ],
    limits: [{
        name: "atlas.project.deployment.clusters",
        value: 26,
    }],
});
const testGetProjects = mongodbatlas.getProjects({
    pageNum: 1,
    itemsPerPage: 5,
});
import pulumi
import pulumi_mongodbatlas as mongodbatlas
test = mongodbatlas.get_roles_org_id()
test_project = mongodbatlas.Project("test",
    name="project-name",
    org_id=test.org_id,
    teams=[
        mongodbatlas.ProjectTeamArgs(
            team_id="5e0fa8c99ccf641c722fe645",
            role_names=["GROUP_OWNER"],
        ),
        mongodbatlas.ProjectTeamArgs(
            team_id="5e1dd7b4f2a30ba80a70cd4rw",
            role_names=[
                "GROUP_READ_ONLY",
                "GROUP_DATA_ACCESS_READ_WRITE",
            ],
        ),
    ],
    limits=[mongodbatlas.ProjectLimitArgs(
        name="atlas.project.deployment.clusters",
        value=26,
    )])
test_get_projects = mongodbatlas.get_projects(page_num=1,
    items_per_page=5)
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.GetRolesOrgId(ctx, nil, nil)
		if err != nil {
			return err
		}
		_, err = mongodbatlas.NewProject(ctx, "test", &mongodbatlas.ProjectArgs{
			Name:  pulumi.String("project-name"),
			OrgId: pulumi.String(test.OrgId),
			Teams: mongodbatlas.ProjectTeamArray{
				&mongodbatlas.ProjectTeamArgs{
					TeamId: pulumi.String("5e0fa8c99ccf641c722fe645"),
					RoleNames: pulumi.StringArray{
						pulumi.String("GROUP_OWNER"),
					},
				},
				&mongodbatlas.ProjectTeamArgs{
					TeamId: pulumi.String("5e1dd7b4f2a30ba80a70cd4rw"),
					RoleNames: pulumi.StringArray{
						pulumi.String("GROUP_READ_ONLY"),
						pulumi.String("GROUP_DATA_ACCESS_READ_WRITE"),
					},
				},
			},
			Limits: mongodbatlas.ProjectLimitArray{
				&mongodbatlas.ProjectLimitArgs{
					Name:  pulumi.String("atlas.project.deployment.clusters"),
					Value: pulumi.Int(26),
				},
			},
		})
		if err != nil {
			return err
		}
		_, err = mongodbatlas.LookupProjects(ctx, &mongodbatlas.LookupProjectsArgs{
			PageNum:      pulumi.IntRef(1),
			ItemsPerPage: pulumi.IntRef(5),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
return await Deployment.RunAsync(() => 
{
    var test = Mongodbatlas.GetRolesOrgId.Invoke();
    var testProject = new Mongodbatlas.Project("test", new()
    {
        Name = "project-name",
        OrgId = test.Apply(getRolesOrgIdResult => getRolesOrgIdResult.OrgId),
        Teams = new[]
        {
            new Mongodbatlas.Inputs.ProjectTeamArgs
            {
                TeamId = "5e0fa8c99ccf641c722fe645",
                RoleNames = new[]
                {
                    "GROUP_OWNER",
                },
            },
            new Mongodbatlas.Inputs.ProjectTeamArgs
            {
                TeamId = "5e1dd7b4f2a30ba80a70cd4rw",
                RoleNames = new[]
                {
                    "GROUP_READ_ONLY",
                    "GROUP_DATA_ACCESS_READ_WRITE",
                },
            },
        },
        Limits = new[]
        {
            new Mongodbatlas.Inputs.ProjectLimitArgs
            {
                Name = "atlas.project.deployment.clusters",
                Value = 26,
            },
        },
    });
    var testGetProjects = Mongodbatlas.GetProjects.Invoke(new()
    {
        PageNum = 1,
        ItemsPerPage = 5,
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mongodbatlas.MongodbatlasFunctions;
import com.pulumi.mongodbatlas.Project;
import com.pulumi.mongodbatlas.ProjectArgs;
import com.pulumi.mongodbatlas.inputs.ProjectTeamArgs;
import com.pulumi.mongodbatlas.inputs.ProjectLimitArgs;
import com.pulumi.mongodbatlas.inputs.GetProjectsArgs;
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) {
        final var test = MongodbatlasFunctions.getRolesOrgId();
        var testProject = new Project("testProject", ProjectArgs.builder()
            .name("project-name")
            .orgId(test.applyValue(getRolesOrgIdResult -> getRolesOrgIdResult.orgId()))
            .teams(            
                ProjectTeamArgs.builder()
                    .teamId("5e0fa8c99ccf641c722fe645")
                    .roleNames("GROUP_OWNER")
                    .build(),
                ProjectTeamArgs.builder()
                    .teamId("5e1dd7b4f2a30ba80a70cd4rw")
                    .roleNames(                    
                        "GROUP_READ_ONLY",
                        "GROUP_DATA_ACCESS_READ_WRITE")
                    .build())
            .limits(ProjectLimitArgs.builder()
                .name("atlas.project.deployment.clusters")
                .value(26)
                .build())
            .build());
        final var testGetProjects = MongodbatlasFunctions.getProjects(GetProjectsArgs.builder()
            .pageNum(1)
            .itemsPerPage(5)
            .build());
    }
}
resources:
  testProject:
    type: mongodbatlas:Project
    name: test
    properties:
      name: project-name
      orgId: ${test.orgId}
      teams:
        - teamId: 5e0fa8c99ccf641c722fe645
          roleNames:
            - GROUP_OWNER
        - teamId: 5e1dd7b4f2a30ba80a70cd4rw
          roleNames:
            - GROUP_READ_ONLY
            - GROUP_DATA_ACCESS_READ_WRITE
      limits:
        - name: atlas.project.deployment.clusters
          value: 26
variables:
  test:
    fn::invoke:
      Function: mongodbatlas:getRolesOrgId
      Arguments: {}
  testGetProjects:
    fn::invoke:
      Function: mongodbatlas:getProjects
      Arguments:
        pageNum: 1
        itemsPerPage: 5
Using getProjects
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 getProjects(args: GetProjectsArgs, opts?: InvokeOptions): Promise<GetProjectsResult>
function getProjectsOutput(args: GetProjectsOutputArgs, opts?: InvokeOptions): Output<GetProjectsResult>def get_projects(items_per_page: Optional[int] = None,
                 page_num: Optional[int] = None,
                 opts: Optional[InvokeOptions] = None) -> GetProjectsResult
def get_projects_output(items_per_page: Optional[pulumi.Input[int]] = None,
                 page_num: Optional[pulumi.Input[int]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetProjectsResult]func LookupProjects(ctx *Context, args *LookupProjectsArgs, opts ...InvokeOption) (*LookupProjectsResult, error)
func LookupProjectsOutput(ctx *Context, args *LookupProjectsOutputArgs, opts ...InvokeOption) LookupProjectsResultOutput> Note: This function is named LookupProjects in the Go SDK.
public static class GetProjects 
{
    public static Task<GetProjectsResult> InvokeAsync(GetProjectsArgs args, InvokeOptions? opts = null)
    public static Output<GetProjectsResult> Invoke(GetProjectsInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetProjectsResult> getProjects(GetProjectsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: mongodbatlas:index/getProjects:getProjects
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Items
Per intPage  - Number of items to return per page, up to a maximum of 500. Defaults to 
100. - Page
Num int - The page to return. Defaults to 
1. 
- Items
Per intPage  - Number of items to return per page, up to a maximum of 500. Defaults to 
100. - Page
Num int - The page to return. Defaults to 
1. 
- items
Per IntegerPage  - Number of items to return per page, up to a maximum of 500. Defaults to 
100. - page
Num Integer - The page to return. Defaults to 
1. 
- items
Per numberPage  - Number of items to return per page, up to a maximum of 500. Defaults to 
100. - page
Num number - The page to return. Defaults to 
1. 
- items_
per_ intpage  - Number of items to return per page, up to a maximum of 500. Defaults to 
100. - page_
num int - The page to return. Defaults to 
1. 
- items
Per NumberPage  - Number of items to return per page, up to a maximum of 500. Defaults to 
100. - page
Num Number - The page to return. Defaults to 
1. 
getProjects Result
The following output properties are available:
- Id string
 - Results
List<Get
Projects Result>  - Total
Count int - Items
Per intPage  - Page
Num int 
- Id string
 - Results
[]Get
Projects Result  - Total
Count int - Items
Per intPage  - Page
Num int 
- id String
 - results
List<Get
Projects Result>  - total
Count Integer - items
Per IntegerPage  - page
Num Integer 
- id string
 - results
Get
Projects Result[]  - total
Count number - items
Per numberPage  - page
Num number 
- id String
 - results List<Property Map>
 - total
Count Number - items
Per NumberPage  - page
Num Number 
Supporting Types
GetProjectsResult  
- Cluster
Count int - Created string
 - Id string
 - Autogenerated Unique ID for this data source.
 - Ip
Addresses GetProjects Result Ip Addresses  - Is
Collect boolDatabase Specifics Statistics Enabled  - Is
Data boolExplorer Enabled  - Is
Extended boolStorage Sizes Enabled  - Is
Performance boolAdvisor Enabled  - Is
Realtime boolPerformance Panel Enabled  - Is
Schema boolAdvisor Enabled  - Limits
List<Get
Projects Result Limit>  - Name string
 - Org
Id string - Project
Id string - Region
Usage stringRestrictions  - Dictionary<string, string>
 - Teams
List<Get
Projects Result Team>  
- Cluster
Count int - Created string
 - Id string
 - Autogenerated Unique ID for this data source.
 - Ip
Addresses GetProjects Result Ip Addresses  - Is
Collect boolDatabase Specifics Statistics Enabled  - Is
Data boolExplorer Enabled  - Is
Extended boolStorage Sizes Enabled  - Is
Performance boolAdvisor Enabled  - Is
Realtime boolPerformance Panel Enabled  - Is
Schema boolAdvisor Enabled  - Limits
[]Get
Projects Result Limit  - Name string
 - Org
Id string - Project
Id string - Region
Usage stringRestrictions  - map[string]string
 - Teams
[]Get
Projects Result Team  
- cluster
Count Integer - created String
 - id String
 - Autogenerated Unique ID for this data source.
 - ip
Addresses GetProjects Result Ip Addresses  - is
Collect BooleanDatabase Specifics Statistics Enabled  - is
Data BooleanExplorer Enabled  - is
Extended BooleanStorage Sizes Enabled  - is
Performance BooleanAdvisor Enabled  - is
Realtime BooleanPerformance Panel Enabled  - is
Schema BooleanAdvisor Enabled  - limits
List<Get
Projects Result Limit>  - name String
 - org
Id String - project
Id String - region
Usage StringRestrictions  - Map<String,String>
 - teams
List<Get
Projects Result Team>  
- cluster
Count number - created string
 - id string
 - Autogenerated Unique ID for this data source.
 - ip
Addresses GetProjects Result Ip Addresses  - is
Collect booleanDatabase Specifics Statistics Enabled  - is
Data booleanExplorer Enabled  - is
Extended booleanStorage Sizes Enabled  - is
Performance booleanAdvisor Enabled  - is
Realtime booleanPerformance Panel Enabled  - is
Schema booleanAdvisor Enabled  - limits
Get
Projects Result Limit[]  - name string
 - org
Id string - project
Id string - region
Usage stringRestrictions  - {[key: string]: string}
 - teams
Get
Projects Result Team[]  
- cluster_
count int - created str
 - id str
 - Autogenerated Unique ID for this data source.
 - ip_
addresses GetProjects Result Ip Addresses  - is_
collect_ booldatabase_ specifics_ statistics_ enabled  - is_
data_ boolexplorer_ enabled  - is_
extended_ boolstorage_ sizes_ enabled  - is_
performance_ booladvisor_ enabled  - is_
realtime_ boolperformance_ panel_ enabled  - is_
schema_ booladvisor_ enabled  - limits
Sequence[Get
Projects Result Limit]  - name str
 - org_
id str - project_
id str - region_
usage_ strrestrictions  - Mapping[str, str]
 - teams
Sequence[Get
Projects Result Team]  
- cluster
Count Number - created String
 - id String
 - Autogenerated Unique ID for this data source.
 - ip
Addresses Property Map - is
Collect BooleanDatabase Specifics Statistics Enabled  - is
Data BooleanExplorer Enabled  - is
Extended BooleanStorage Sizes Enabled  - is
Performance BooleanAdvisor Enabled  - is
Realtime BooleanPerformance Panel Enabled  - is
Schema BooleanAdvisor Enabled  - limits List<Property Map>
 - name String
 - org
Id String - project
Id String - region
Usage StringRestrictions  - Map<String>
 - teams List<Property Map>
 
GetProjectsResultIpAddresses    
GetProjectsResultIpAddressesServices     
GetProjectsResultIpAddressesServicesCluster      
- Cluster
Name string - Inbounds List<string>
 - Outbounds List<string>
 
- Cluster
Name string - Inbounds []string
 - Outbounds []string
 
- cluster
Name String - inbounds List<String>
 - outbounds List<String>
 
- cluster
Name string - inbounds string[]
 - outbounds string[]
 
- cluster_
name str - inbounds Sequence[str]
 - outbounds Sequence[str]
 
- cluster
Name String - inbounds List<String>
 - outbounds List<String>
 
GetProjectsResultLimit   
- Current
Usage int - Amount that indicates the current usage of the limit.
 - Default
Limit int - Default value of the limit.
 - Maximum
Limit int - Maximum value of the limit.
 - Name string
 - Human-readable label that identifies this project limit.
 - Value int
 - Amount the limit is set to.
 
- Current
Usage int - Amount that indicates the current usage of the limit.
 - Default
Limit int - Default value of the limit.
 - Maximum
Limit int - Maximum value of the limit.
 - Name string
 - Human-readable label that identifies this project limit.
 - Value int
 - Amount the limit is set to.
 
- current
Usage Integer - Amount that indicates the current usage of the limit.
 - default
Limit Integer - Default value of the limit.
 - maximum
Limit Integer - Maximum value of the limit.
 - name String
 - Human-readable label that identifies this project limit.
 - value Integer
 - Amount the limit is set to.
 
- current
Usage number - Amount that indicates the current usage of the limit.
 - default
Limit number - Default value of the limit.
 - maximum
Limit number - Maximum value of the limit.
 - name string
 - Human-readable label that identifies this project limit.
 - value number
 - Amount the limit is set to.
 
- current_
usage int - Amount that indicates the current usage of the limit.
 - default_
limit int - Default value of the limit.
 - maximum_
limit int - Maximum value of the limit.
 - name str
 - Human-readable label that identifies this project limit.
 - value int
 - Amount the limit is set to.
 
- current
Usage Number - Amount that indicates the current usage of the limit.
 - default
Limit Number - Default value of the limit.
 - maximum
Limit Number - Maximum value of the limit.
 - name String
 - Human-readable label that identifies this project limit.
 - value Number
 - Amount the limit is set to.
 
GetProjectsResultTeam   
- Role
Names List<string> - Each string in the array represents a project role assigned to the team. Every user associated with the team inherits these roles. The MongoDB Documentation describes the roles a user can have.
 - Team
Id string - The unique identifier of the team you want to associate with the project. The team and project must share the same parent organization.
 
- Role
Names []string - Each string in the array represents a project role assigned to the team. Every user associated with the team inherits these roles. The MongoDB Documentation describes the roles a user can have.
 - Team
Id string - The unique identifier of the team you want to associate with the project. The team and project must share the same parent organization.
 
- role
Names List<String> - Each string in the array represents a project role assigned to the team. Every user associated with the team inherits these roles. The MongoDB Documentation describes the roles a user can have.
 - team
Id String - The unique identifier of the team you want to associate with the project. The team and project must share the same parent organization.
 
- role
Names string[] - Each string in the array represents a project role assigned to the team. Every user associated with the team inherits these roles. The MongoDB Documentation describes the roles a user can have.
 - team
Id string - The unique identifier of the team you want to associate with the project. The team and project must share the same parent organization.
 
- role_
names Sequence[str] - Each string in the array represents a project role assigned to the team. Every user associated with the team inherits these roles. The MongoDB Documentation describes the roles a user can have.
 - team_
id str - The unique identifier of the team you want to associate with the project. The team and project must share the same parent organization.
 
- role
Names List<String> - Each string in the array represents a project role assigned to the team. Every user associated with the team inherits these roles. The MongoDB Documentation describes the roles a user can have.
 - team
Id String - The unique identifier of the team you want to associate with the project. The team and project must share the same parent organization.
 
Package Details
- Repository
 - MongoDB Atlas pulumi/pulumi-mongodbatlas
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
mongodbatlasTerraform Provider.