MongoDB Atlas v3.30.0 published on Friday, Mar 21, 2025 by Pulumi
mongodbatlas.getProjectApiKeys
Explore with Pulumi AI
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";
const test = mongodbatlas.getProjectApiKeys({
    pageNum: 1,
    itemsPerPage: 5,
    projectId: "32b6e34b3d91647abb20e7b8",
});
import pulumi
import pulumi_mongodbatlas as mongodbatlas
test = mongodbatlas.get_project_api_keys(page_num=1,
    items_per_page=5,
    project_id="32b6e34b3d91647abb20e7b8")
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
	})
}
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",
    });
});
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());
    }
}
variables:
  test:
    fn::invoke:
      function: mongodbatlas:getProjectApiKeys
      arguments:
        pageNum: 1
        itemsPerPage: 5
        projectId: 32b6e34b3d91647abb20e7b8
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>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]func LookupProjectApiKeys(ctx *Context, args *LookupProjectApiKeysArgs, opts ...InvokeOption) (*LookupProjectApiKeysResult, error)
func LookupProjectApiKeysOutput(ctx *Context, args *LookupProjectApiKeysOutputArgs, opts ...InvokeOption) LookupProjectApiKeysResultOutput> 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)
}public static CompletableFuture<GetProjectApiKeysResult> getProjectApiKeys(GetProjectApiKeysArgs args, InvokeOptions options)
public static Output<GetProjectApiKeysResult> getProjectApiKeys(GetProjectApiKeysArgs args, InvokeOptions options)
fn::invoke:
  function: mongodbatlas:index/getProjectApiKeys:getProjectApiKeys
  arguments:
    # arguments dictionaryThe following arguments are supported:
- ProjectId string
- The unique ID for the project.
- ItemsPer intPage 
- 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 string
- The unique ID for the project.
- ItemsPer intPage 
- 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 String
- The unique ID for the project.
- itemsPer IntegerPage 
- 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 string
- The unique ID for the project.
- itemsPer numberPage 
- 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 str
- The unique ID for the project.
- 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.
- projectId String
- The unique ID for the project.
- itemsPer NumberPage 
- 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<GetProject Api Keys Result> 
- A list where each element represents a API Key assigned to the project.
- ItemsPer intPage 
- PageNum int
- Id string
- The provider-assigned unique ID for this managed resource.
- ProjectId string
- Project ID to assign to Access Key
- Results
[]GetProject Api Keys Result 
- A list where each element represents a API Key assigned to the project.
- ItemsPer intPage 
- PageNum int
- id String
- The provider-assigned unique ID for this managed resource.
- projectId String
- Project ID to assign to Access Key
- results
List<GetProject Api Keys Result> 
- A list where each element represents a API Key assigned to the project.
- itemsPer IntegerPage 
- pageNum Integer
- id string
- The provider-assigned unique ID for this managed resource.
- projectId string
- Project ID to assign to Access Key
- results
GetProject Api Keys Result[] 
- A list where each element represents a API Key assigned to the project.
- itemsPer numberPage 
- 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[GetProject Api Keys Result] 
- A list where each element represents a API Key assigned to the project.
- items_per_ intpage 
- 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.
- itemsPer NumberPage 
- pageNum Number
Supporting Types
GetProjectApiKeysResult    
- ApiKey stringId 
- 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 string
- Description of this Project API key.
- PrivateKey string
- PublicKey string
- ProjectAssignments List<GetProject Api Keys Result Project Assignment> 
- ApiKey stringId 
- 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 string
- Description of this Project API key.
- PrivateKey string
- PublicKey string
- ProjectAssignments []GetProject Api Keys Result Project Assignment 
- apiKey StringId 
- 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 String
- Description of this Project API key.
- privateKey String
- publicKey String
- projectAssignments List<GetProject Api Keys Result Project Assignment> 
- apiKey stringId 
- 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 string
- Description of this Project API key.
- privateKey string
- publicKey string
- projectAssignments GetProject Api Keys Result Project Assignment[] 
- api_key_ strid 
- 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 str
- Description of this Project API key.
- private_key str
- public_key str
- project_assignments Sequence[GetProject Api Keys Result Project Assignment] 
- apiKey StringId 
- 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 String
- Description of this Project API key.
- privateKey String
- publicKey String
- projectAssignments List<Property Map>
GetProjectApiKeysResultProjectAssignment      
- ProjectId string
- The unique ID for the project.
- RoleNames 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 string
- The unique ID for the project.
- RoleNames []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 String
- The unique ID for the project.
- roleNames 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 string
- The unique ID for the project.
- roleNames 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 str
- The unique ID for the project.
- role_names 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 String
- The unique ID for the project.
- roleNames 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 mongodbatlasTerraform Provider.