1. Packages
  2. MongoDB Atlas
  3. API Docs
  4. getProjectApiKeys
MongoDB Atlas v3.16.2 published on Friday, Jun 21, 2024 by Pulumi

mongodbatlas.getProjectApiKeys

Explore with Pulumi AI

mongodbatlas logo
MongoDB Atlas v3.16.2 published on Friday, Jun 21, 2024 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",
    });
    
    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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: mongodbatlas:index/getProjectApiKeys:getProjectApiKeys
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ProjectId 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 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 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 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 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 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 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 string
    Description of this Project API key.
    PrivateKey string
    PublicKey string
    ProjectAssignments List<GetProjectApiKeysResultProjectAssignment>
    ApiKeyId 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 string
    Description of this Project API key.
    PrivateKey string
    PublicKey string
    ProjectAssignments []GetProjectApiKeysResultProjectAssignment
    apiKeyId 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 String
    Description of this Project API key.
    privateKey String
    publicKey String
    projectAssignments List<GetProjectApiKeysResultProjectAssignment>
    apiKeyId 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 string
    Description of this Project API key.
    privateKey string
    publicKey string
    projectAssignments GetProjectApiKeysResultProjectAssignment[]
    api_key_id 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 str
    Description of this Project API key.
    private_key str
    public_key str
    project_assignments Sequence[GetProjectApiKeysResultProjectAssignment]
    apiKeyId 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 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 mongodbatlas Terraform Provider.
    mongodbatlas logo
    MongoDB Atlas v3.16.2 published on Friday, Jun 21, 2024 by Pulumi