mongodbatlas.getProjects
mongodbatlas.getProjects
describe all Projects. This represents projects that have been created.
NOTE: Groups and projects are synonymous terms. You may find
groupId
in the official documentation.
Example Usage
using System.Collections.Generic;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
return await Deployment.RunAsync(() =>
{
var testRolesOrgId = Mongodbatlas.GetRolesOrgId.Invoke();
var testProject = new Mongodbatlas.Project("testProject", new()
{
OrgId = testRolesOrgId.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",
},
},
},
ApiKeys = new[]
{
new Mongodbatlas.Inputs.ProjectApiKeyArgs
{
ApiKeyId = "61003b299dda8d54a9d7d10c",
RoleNames = new[]
{
"GROUP_READ_ONLY",
},
},
},
});
var testProjects = Mongodbatlas.GetProjects.Invoke(new()
{
PageNum = 1,
ItemsPerPage = 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 {
testRolesOrgId, err := mongodbatlas.GetRolesOrgId(ctx, nil, nil)
if err != nil {
return err
}
_, err = mongodbatlas.NewProject(ctx, "testProject", &mongodbatlas.ProjectArgs{
OrgId: *pulumi.String(testRolesOrgId.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"),
},
},
},
ApiKeys: mongodbatlas.ProjectApiKeyTypeArray{
&mongodbatlas.ProjectApiKeyTypeArgs{
ApiKeyId: pulumi.String("61003b299dda8d54a9d7d10c"),
RoleNames: pulumi.StringArray{
pulumi.String("GROUP_READ_ONLY"),
},
},
},
})
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
})
}
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.ProjectApiKeyArgs;
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 testRolesOrgId = MongodbatlasFunctions.getRolesOrgId();
var testProject = new Project("testProject", ProjectArgs.builder()
.orgId(testRolesOrgId.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())
.apiKeys(ProjectApiKeyArgs.builder()
.apiKeyId("61003b299dda8d54a9d7d10c")
.roleNames("GROUP_READ_ONLY")
.build())
.build());
final var testProjects = MongodbatlasFunctions.getProjects(GetProjectsArgs.builder()
.pageNum(1)
.itemsPerPage(5)
.build());
}
}
import pulumi
import pulumi_mongodbatlas as mongodbatlas
test_roles_org_id = mongodbatlas.get_roles_org_id()
test_project = mongodbatlas.Project("testProject",
org_id=test_roles_org_id.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",
],
),
],
api_keys=[mongodbatlas.ProjectApiKeyArgs(
api_key_id="61003b299dda8d54a9d7d10c",
role_names=["GROUP_READ_ONLY"],
)])
test_projects = mongodbatlas.get_projects(page_num=1,
items_per_page=5)
import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";
const testRolesOrgId = mongodbatlas.getRolesOrgId({});
const testProject = new mongodbatlas.Project("testProject", {
orgId: testRolesOrgId.then(testRolesOrgId => testRolesOrgId.orgId),
teams: [
{
teamId: "5e0fa8c99ccf641c722fe645",
roleNames: ["GROUP_OWNER"],
},
{
teamId: "5e1dd7b4f2a30ba80a70cd4rw",
roleNames: [
"GROUP_READ_ONLY",
"GROUP_DATA_ACCESS_READ_WRITE",
],
},
],
apiKeys: [{
apiKeyId: "61003b299dda8d54a9d7d10c",
roleNames: ["GROUP_READ_ONLY"],
}],
});
const testProjects = mongodbatlas.getProjects({
pageNum: 1,
itemsPerPage: 5,
});
resources:
testProject:
type: mongodbatlas:Project
properties:
orgId: ${testRolesOrgId.orgId}
teams:
- teamId: 5e0fa8c99ccf641c722fe645
roleNames:
- GROUP_OWNER
- teamId: 5e1dd7b4f2a30ba80a70cd4rw
roleNames:
- GROUP_READ_ONLY
- GROUP_DATA_ACCESS_READ_WRITE
apiKeys:
- apiKeyId: 61003b299dda8d54a9d7d10c
roleNames:
- GROUP_READ_ONLY
variables:
testRolesOrgId:
fn::invoke:
Function: mongodbatlas:getRolesOrgId
Arguments: {}
testProjects:
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 dictionary
The 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
The provider-assigned unique ID for this managed resource.
- Results
List<Get
Projects Result> - Total
Count int - Items
Per intPage - Page
Num int
- Id string
The provider-assigned unique ID for this managed resource.
- Results
[]Get
Projects Result - Total
Count int - Items
Per intPage - Page
Num int
- id String
The provider-assigned unique ID for this managed resource.
- results
List<Get
Projects Result> - total
Count Integer - items
Per IntegerPage - page
Num Integer
- id string
The provider-assigned unique ID for this managed resource.
- results
Get
Projects Result[] - total
Count number - items
Per numberPage - page
Num number
- id str
The provider-assigned unique ID for this managed resource.
- results
Sequence[Get
Projects Result] - total_
count int - items_
per_ intpage - page_
num int
- id String
The provider-assigned unique ID for this managed resource.
- results List<Property Map>
- total
Count Number - items
Per NumberPage - page
Num Number
Supporting Types
GetProjectsResult
- Api
Keys List<GetProjects Result Api Key> - Cluster
Count int The number of Atlas clusters deployed in the project.
- Created string
The ISO-8601-formatted timestamp of when Atlas created the project.
teams.#.team_id
- The unique identifier of the team you want to associate with the project. The team and project must share the same parent organization.teams.#.role_names
- Each string in the array represents a project role assigned to the team. Every user associated with the team inherits these roles. The following are valid roles:
- Id string
Autogenerated Unique ID for this data source.
- Is
Collect boolDatabase Specifics Statistics Enabled Flag that indicates whether to enable statistics in cluster metrics collection for the project.
- Is
Data boolExplorer Enabled Flag that indicates whether to enable Data Explorer for the project. If enabled, you can query your database with an easy to use interface.
- Is
Performance boolAdvisor Enabled Flag that indicates whether to enable Performance Advisor and Profiler for the project. If enabled, you can analyze database logs to recommend performance improvements.
- Is
Realtime boolPerformance Panel Enabled Flag that indicates whether to enable Real Time Performance Panel for the project. If enabled, you can see real time metrics from your MongoDB database.
- Is
Schema boolAdvisor Enabled Flag that indicates whether to enable Schema Advisor for the project. If enabled, you receive customized recommendations to optimize your data model and enhance performance. Disable this setting to disable schema suggestions in the Performance Advisor and the Data Explorer.
- Name string
The name of the project you want to create. (Cannot be changed via this Provider after creation.)
- Org
Id string The ID of the organization you want to create the project within.
- Region
Usage stringRestrictions If GOV_REGIONS_ONLY the project can be used for government regions only, otherwise defaults to standard regions. For more information see MongoDB Atlas for Government.
- Teams
List<Get
Projects Result Team>
- Api
Keys []GetProjects Result Api Key - Cluster
Count int The number of Atlas clusters deployed in the project.
- Created string
The ISO-8601-formatted timestamp of when Atlas created the project.
teams.#.team_id
- The unique identifier of the team you want to associate with the project. The team and project must share the same parent organization.teams.#.role_names
- Each string in the array represents a project role assigned to the team. Every user associated with the team inherits these roles. The following are valid roles:
- Id string
Autogenerated Unique ID for this data source.
- Is
Collect boolDatabase Specifics Statistics Enabled Flag that indicates whether to enable statistics in cluster metrics collection for the project.
- Is
Data boolExplorer Enabled Flag that indicates whether to enable Data Explorer for the project. If enabled, you can query your database with an easy to use interface.
- Is
Performance boolAdvisor Enabled Flag that indicates whether to enable Performance Advisor and Profiler for the project. If enabled, you can analyze database logs to recommend performance improvements.
- Is
Realtime boolPerformance Panel Enabled Flag that indicates whether to enable Real Time Performance Panel for the project. If enabled, you can see real time metrics from your MongoDB database.
- Is
Schema boolAdvisor Enabled Flag that indicates whether to enable Schema Advisor for the project. If enabled, you receive customized recommendations to optimize your data model and enhance performance. Disable this setting to disable schema suggestions in the Performance Advisor and the Data Explorer.
- Name string
The name of the project you want to create. (Cannot be changed via this Provider after creation.)
- Org
Id string The ID of the organization you want to create the project within.
- Region
Usage stringRestrictions If GOV_REGIONS_ONLY the project can be used for government regions only, otherwise defaults to standard regions. For more information see MongoDB Atlas for Government.
- Teams
[]Get
Projects Result Team
- api
Keys List<GetProjects Result Api Key> - cluster
Count Integer The number of Atlas clusters deployed in the project.
- created String
The ISO-8601-formatted timestamp of when Atlas created the project.
teams.#.team_id
- The unique identifier of the team you want to associate with the project. The team and project must share the same parent organization.teams.#.role_names
- Each string in the array represents a project role assigned to the team. Every user associated with the team inherits these roles. The following are valid roles:
- id String
Autogenerated Unique ID for this data source.
- is
Collect BooleanDatabase Specifics Statistics Enabled Flag that indicates whether to enable statistics in cluster metrics collection for the project.
- is
Data BooleanExplorer Enabled Flag that indicates whether to enable Data Explorer for the project. If enabled, you can query your database with an easy to use interface.
- is
Performance BooleanAdvisor Enabled Flag that indicates whether to enable Performance Advisor and Profiler for the project. If enabled, you can analyze database logs to recommend performance improvements.
- is
Realtime BooleanPerformance Panel Enabled Flag that indicates whether to enable Real Time Performance Panel for the project. If enabled, you can see real time metrics from your MongoDB database.
- is
Schema BooleanAdvisor Enabled Flag that indicates whether to enable Schema Advisor for the project. If enabled, you receive customized recommendations to optimize your data model and enhance performance. Disable this setting to disable schema suggestions in the Performance Advisor and the Data Explorer.
- name String
The name of the project you want to create. (Cannot be changed via this Provider after creation.)
- org
Id String The ID of the organization you want to create the project within.
- region
Usage StringRestrictions If GOV_REGIONS_ONLY the project can be used for government regions only, otherwise defaults to standard regions. For more information see MongoDB Atlas for Government.
- teams
List<Get
Projects Result Team>
- api
Keys GetProjects Result Api Key[] - cluster
Count number The number of Atlas clusters deployed in the project.
- created string
The ISO-8601-formatted timestamp of when Atlas created the project.
teams.#.team_id
- The unique identifier of the team you want to associate with the project. The team and project must share the same parent organization.teams.#.role_names
- Each string in the array represents a project role assigned to the team. Every user associated with the team inherits these roles. The following are valid roles:
- id string
Autogenerated Unique ID for this data source.
- is
Collect booleanDatabase Specifics Statistics Enabled Flag that indicates whether to enable statistics in cluster metrics collection for the project.
- is
Data booleanExplorer Enabled Flag that indicates whether to enable Data Explorer for the project. If enabled, you can query your database with an easy to use interface.
- is
Performance booleanAdvisor Enabled Flag that indicates whether to enable Performance Advisor and Profiler for the project. If enabled, you can analyze database logs to recommend performance improvements.
- is
Realtime booleanPerformance Panel Enabled Flag that indicates whether to enable Real Time Performance Panel for the project. If enabled, you can see real time metrics from your MongoDB database.
- is
Schema booleanAdvisor Enabled Flag that indicates whether to enable Schema Advisor for the project. If enabled, you receive customized recommendations to optimize your data model and enhance performance. Disable this setting to disable schema suggestions in the Performance Advisor and the Data Explorer.
- name string
The name of the project you want to create. (Cannot be changed via this Provider after creation.)
- org
Id string The ID of the organization you want to create the project within.
- region
Usage stringRestrictions If GOV_REGIONS_ONLY the project can be used for government regions only, otherwise defaults to standard regions. For more information see MongoDB Atlas for Government.
- teams
Get
Projects Result Team[]
- api_
keys Sequence[GetProjects Result Api Key] - cluster_
count int The number of Atlas clusters deployed in the project.
- created str
The ISO-8601-formatted timestamp of when Atlas created the project.
teams.#.team_id
- The unique identifier of the team you want to associate with the project. The team and project must share the same parent organization.teams.#.role_names
- Each string in the array represents a project role assigned to the team. Every user associated with the team inherits these roles. The following are valid roles:
- id str
Autogenerated Unique ID for this data source.
- is_
collect_ booldatabase_ specifics_ statistics_ enabled Flag that indicates whether to enable statistics in cluster metrics collection for the project.
- is_
data_ boolexplorer_ enabled Flag that indicates whether to enable Data Explorer for the project. If enabled, you can query your database with an easy to use interface.
- is_
performance_ booladvisor_ enabled Flag that indicates whether to enable Performance Advisor and Profiler for the project. If enabled, you can analyze database logs to recommend performance improvements.
- is_
realtime_ boolperformance_ panel_ enabled Flag that indicates whether to enable Real Time Performance Panel for the project. If enabled, you can see real time metrics from your MongoDB database.
- is_
schema_ booladvisor_ enabled Flag that indicates whether to enable Schema Advisor for the project. If enabled, you receive customized recommendations to optimize your data model and enhance performance. Disable this setting to disable schema suggestions in the Performance Advisor and the Data Explorer.
- name str
The name of the project you want to create. (Cannot be changed via this Provider after creation.)
- org_
id str The ID of the organization you want to create the project within.
- region_
usage_ strrestrictions If GOV_REGIONS_ONLY the project can be used for government regions only, otherwise defaults to standard regions. For more information see MongoDB Atlas for Government.
- teams
Sequence[Get
Projects Result Team]
- api
Keys List<Property Map> - cluster
Count Number The number of Atlas clusters deployed in the project.
- created String
The ISO-8601-formatted timestamp of when Atlas created the project.
teams.#.team_id
- The unique identifier of the team you want to associate with the project. The team and project must share the same parent organization.teams.#.role_names
- Each string in the array represents a project role assigned to the team. Every user associated with the team inherits these roles. The following are valid roles:
- id String
Autogenerated Unique ID for this data source.
- is
Collect BooleanDatabase Specifics Statistics Enabled Flag that indicates whether to enable statistics in cluster metrics collection for the project.
- is
Data BooleanExplorer Enabled Flag that indicates whether to enable Data Explorer for the project. If enabled, you can query your database with an easy to use interface.
- is
Performance BooleanAdvisor Enabled Flag that indicates whether to enable Performance Advisor and Profiler for the project. If enabled, you can analyze database logs to recommend performance improvements.
- is
Realtime BooleanPerformance Panel Enabled Flag that indicates whether to enable Real Time Performance Panel for the project. If enabled, you can see real time metrics from your MongoDB database.
- is
Schema BooleanAdvisor Enabled Flag that indicates whether to enable Schema Advisor for the project. If enabled, you receive customized recommendations to optimize your data model and enhance performance. Disable this setting to disable schema suggestions in the Performance Advisor and the Data Explorer.
- name String
The name of the project you want to create. (Cannot be changed via this Provider after creation.)
- org
Id String The ID of the organization you want to create the project within.
- region
Usage StringRestrictions If GOV_REGIONS_ONLY the project can be used for government regions only, otherwise defaults to standard regions. For more information see MongoDB Atlas for Government.
- teams List<Property Map>
GetProjectsResultApiKey
- api_
key_ strid - role_
names Sequence[str]
GetProjectsResultTeam
- role_
names Sequence[str] - team_
id str
Package Details
- Repository
- MongoDB Atlas pulumi/pulumi-mongodbatlas
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
mongodbatlas
Terraform Provider.