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

mongodbatlas.getProjectApiKeys

Explore with Pulumi AI

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

Example Usage

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

const test = mongodbatlas.getProjectApiKeys({
    pageNum: 1,
    itemsPerPage: 5,
    projectId: "32b6e34b3d91647abb20e7b8",
});
Copy
import pulumi
import pulumi_mongodbatlas as mongodbatlas

test = mongodbatlas.get_project_api_keys(page_num=1,
    items_per_page=5,
    project_id="32b6e34b3d91647abb20e7b8")
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 {
		_, err := mongodbatlas.LookupProjectApiKeys(ctx, &mongodbatlas.LookupProjectApiKeysArgs{
			PageNum:      pulumi.IntRef(1),
			ItemsPerPage: pulumi.IntRef(5),
			ProjectId:    "32b6e34b3d91647abb20e7b8",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

return await Deployment.RunAsync(() => 
{
    var test = Mongodbatlas.GetProjectApiKeys.Invoke(new()
    {
        PageNum = 1,
        ItemsPerPage = 5,
        ProjectId = "32b6e34b3d91647abb20e7b8",
    });

});
Copy
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.inputs.GetProjectApiKeysArgs;
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.getProjectApiKeys(GetProjectApiKeysArgs.builder()
            .pageNum(1)
            .itemsPerPage(5)
            .projectId("32b6e34b3d91647abb20e7b8")
            .build());

    }
}
Copy
variables:
  test:
    fn::invoke:
      function: mongodbatlas:getProjectApiKeys
      arguments:
        pageNum: 1
        itemsPerPage: 5
        projectId: 32b6e34b3d91647abb20e7b8
Copy

Using getProjectApiKeys

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 getProjectApiKeys(args: GetProjectApiKeysArgs, opts?: InvokeOptions): Promise<GetProjectApiKeysResult>
function getProjectApiKeysOutput(args: GetProjectApiKeysOutputArgs, opts?: InvokeOptions): Output<GetProjectApiKeysResult>
Copy
def get_project_api_keys(items_per_page: Optional[int] = None,
                         page_num: Optional[int] = None,
                         project_id: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetProjectApiKeysResult
def get_project_api_keys_output(items_per_page: Optional[pulumi.Input[int]] = None,
                         page_num: Optional[pulumi.Input[int]] = None,
                         project_id: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetProjectApiKeysResult]
Copy
func LookupProjectApiKeys(ctx *Context, args *LookupProjectApiKeysArgs, opts ...InvokeOption) (*LookupProjectApiKeysResult, error)
func LookupProjectApiKeysOutput(ctx *Context, args *LookupProjectApiKeysOutputArgs, opts ...InvokeOption) LookupProjectApiKeysResultOutput
Copy

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

public static class GetProjectApiKeys 
{
    public static Task<GetProjectApiKeysResult> InvokeAsync(GetProjectApiKeysArgs args, InvokeOptions? opts = null)
    public static Output<GetProjectApiKeysResult> Invoke(GetProjectApiKeysInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetProjectApiKeysResult> getProjectApiKeys(GetProjectApiKeysArgs args, InvokeOptions options)
public static Output<GetProjectApiKeysResult> getProjectApiKeys(GetProjectApiKeysArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: mongodbatlas:index/getProjectApiKeys:getProjectApiKeys
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

ProjectId This property is required. string
The unique ID for the project.
ItemsPerPage int
Number of items to return per page, up to a maximum of 500. Defaults to 100.
PageNum int
The page to return. Defaults to 1.
ProjectId This property is required. string
The unique ID for the project.
ItemsPerPage int
Number of items to return per page, up to a maximum of 500. Defaults to 100.
PageNum int
The page to return. Defaults to 1.
projectId This property is required. String
The unique ID for the project.
itemsPerPage Integer
Number of items to return per page, up to a maximum of 500. Defaults to 100.
pageNum Integer
The page to return. Defaults to 1.
projectId This property is required. string
The unique ID for the project.
itemsPerPage number
Number of items to return per page, up to a maximum of 500. Defaults to 100.
pageNum number
The page to return. Defaults to 1.
project_id This property is required. str
The unique ID for the project.
items_per_page int
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.
projectId This property is required. String
The unique ID for the project.
itemsPerPage Number
Number of items to return per page, up to a maximum of 500. Defaults to 100.
pageNum Number
The page to return. Defaults to 1.

getProjectApiKeys Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
ProjectId string
Project ID to assign to Access Key
Results List<GetProjectApiKeysResult>
A list where each element represents a API Key assigned to the project.
ItemsPerPage int
PageNum int
Id string
The provider-assigned unique ID for this managed resource.
ProjectId string
Project ID to assign to Access Key
Results []GetProjectApiKeysResult
A list where each element represents a API Key assigned to the project.
ItemsPerPage int
PageNum int
id String
The provider-assigned unique ID for this managed resource.
projectId String
Project ID to assign to Access Key
results List<GetProjectApiKeysResult>
A list where each element represents a API Key assigned to the project.
itemsPerPage Integer
pageNum Integer
id string
The provider-assigned unique ID for this managed resource.
projectId string
Project ID to assign to Access Key
results GetProjectApiKeysResult[]
A list where each element represents a API Key assigned to the project.
itemsPerPage number
pageNum number
id str
The provider-assigned unique ID for this managed resource.
project_id str
Project ID to assign to Access Key
results Sequence[GetProjectApiKeysResult]
A list where each element represents a API Key assigned to the project.
items_per_page int
page_num int
id String
The provider-assigned unique ID for this managed resource.
projectId String
Project ID to assign to Access Key
results List<Property Map>
A list where each element represents a API Key assigned to the project.
itemsPerPage Number
pageNum Number

Supporting Types

GetProjectApiKeysResult

ApiKeyId This property is required. string
Unique identifier for the API key you want to update. Use the /orgs/{ORG-ID}/apiKeys endpoint to retrieve all API keys to which the authenticated user has access for the specified organization.
Description This property is required. string
Description of this Project API key.
PrivateKey This property is required. string
PublicKey This property is required. string
ProjectAssignments List<GetProjectApiKeysResultProjectAssignment>
ApiKeyId This property is required. string
Unique identifier for the API key you want to update. Use the /orgs/{ORG-ID}/apiKeys endpoint to retrieve all API keys to which the authenticated user has access for the specified organization.
Description This property is required. string
Description of this Project API key.
PrivateKey This property is required. string
PublicKey This property is required. string
ProjectAssignments []GetProjectApiKeysResultProjectAssignment
apiKeyId This property is required. String
Unique identifier for the API key you want to update. Use the /orgs/{ORG-ID}/apiKeys endpoint to retrieve all API keys to which the authenticated user has access for the specified organization.
description This property is required. String
Description of this Project API key.
privateKey This property is required. String
publicKey This property is required. String
projectAssignments List<GetProjectApiKeysResultProjectAssignment>
apiKeyId This property is required. string
Unique identifier for the API key you want to update. Use the /orgs/{ORG-ID}/apiKeys endpoint to retrieve all API keys to which the authenticated user has access for the specified organization.
description This property is required. string
Description of this Project API key.
privateKey This property is required. string
publicKey This property is required. string
projectAssignments GetProjectApiKeysResultProjectAssignment[]
api_key_id This property is required. str
Unique identifier for the API key you want to update. Use the /orgs/{ORG-ID}/apiKeys endpoint to retrieve all API keys to which the authenticated user has access for the specified organization.
description This property is required. str
Description of this Project API key.
private_key This property is required. str
public_key This property is required. str
project_assignments Sequence[GetProjectApiKeysResultProjectAssignment]
apiKeyId This property is required. String
Unique identifier for the API key you want to update. Use the /orgs/{ORG-ID}/apiKeys endpoint to retrieve all API keys to which the authenticated user has access for the specified organization.
description This property is required. String
Description of this Project API key.
privateKey This property is required. String
publicKey This property is required. String
projectAssignments List<Property Map>

GetProjectApiKeysResultProjectAssignment

ProjectId This property is required. string
The unique ID for the project.
RoleNames This property is required. List<string>
List of Project roles that the Programmatic API key needs to have. Ensure you provide: at least one role and ensure all roles are valid for the Project. You must specify an array even if you are only associating a single role with the Programmatic API key. The MongoDB Documentation describes the valid roles that can be assigned.
ProjectId This property is required. string
The unique ID for the project.
RoleNames This property is required. []string
List of Project roles that the Programmatic API key needs to have. Ensure you provide: at least one role and ensure all roles are valid for the Project. You must specify an array even if you are only associating a single role with the Programmatic API key. The MongoDB Documentation describes the valid roles that can be assigned.
projectId This property is required. String
The unique ID for the project.
roleNames This property is required. List<String>
List of Project roles that the Programmatic API key needs to have. Ensure you provide: at least one role and ensure all roles are valid for the Project. You must specify an array even if you are only associating a single role with the Programmatic API key. The MongoDB Documentation describes the valid roles that can be assigned.
projectId This property is required. string
The unique ID for the project.
roleNames This property is required. string[]
List of Project roles that the Programmatic API key needs to have. Ensure you provide: at least one role and ensure all roles are valid for the Project. You must specify an array even if you are only associating a single role with the Programmatic API key. The MongoDB Documentation describes the valid roles that can be assigned.
project_id This property is required. str
The unique ID for the project.
role_names This property is required. Sequence[str]
List of Project roles that the Programmatic API key needs to have. Ensure you provide: at least one role and ensure all roles are valid for the Project. You must specify an array even if you are only associating a single role with the Programmatic API key. The MongoDB Documentation describes the valid roles that can be assigned.
projectId This property is required. String
The unique ID for the project.
roleNames This property is required. List<String>
List of Project roles that the Programmatic API key needs to have. Ensure you provide: at least one role and ensure all roles are valid for the Project. You must specify an array even if you are only associating a single role with the Programmatic API key. The MongoDB Documentation describes the valid roles that can be assigned.

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