MongoDB Atlas v3.7.2, Mar 31 23
MongoDB Atlas v3.7.2, Mar 31 23
mongodbatlas.ProjectApiKey
Explore with Pulumi AI
Import
API Keys must be imported using org ID, API Key ID e.g.
$ pulumi import mongodbatlas:index/projectApiKey:ProjectApiKey test 5d09d6a59ccf6445652a444a-6576974933969669
See MongoDB Atlas API - API Key - Documentation for more information.
Example Usage
using System.Collections.Generic;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
return await Deployment.RunAsync(() =>
{
var test = new Mongodbatlas.ProjectApiKey("test", new()
{
Description = "key-name",
ProjectId = "<PROJECT_ID>",
RoleNames = new[]
{
"GROUP_OWNER",
},
});
});
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.NewProjectApiKey(ctx, "test", &mongodbatlas.ProjectApiKeyArgs{
Description: pulumi.String("key-name"),
ProjectId: pulumi.String("<PROJECT_ID>"),
RoleNames: pulumi.StringArray{
pulumi.String("GROUP_OWNER"),
},
})
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.ProjectApiKey;
import com.pulumi.mongodbatlas.ProjectApiKeyArgs;
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) {
var test = new ProjectApiKey("test", ProjectApiKeyArgs.builder()
.description("key-name")
.projectId("<PROJECT_ID>")
.roleNames("GROUP_OWNER")
.build());
}
}
import pulumi
import pulumi_mongodbatlas as mongodbatlas
test = mongodbatlas.ProjectApiKey("test",
description="key-name",
project_id="<PROJECT_ID>",
role_names=["GROUP_OWNER"])
import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";
const test = new mongodbatlas.ProjectApiKey("test", {
description: "key-name",
projectId: "<PROJECT_ID>",
roleNames: ["GROUP_OWNER"],
});
resources:
test:
type: mongodbatlas:ProjectApiKey
properties:
description: key-name
projectId: <PROJECT_ID>
roleNames:
- GROUP_OWNER
Create ProjectApiKey Resource
new ProjectApiKey(name: string, args: ProjectApiKeyArgs, opts?: CustomResourceOptions);
@overload
def ProjectApiKey(resource_name: str,
opts: Optional[ResourceOptions] = None,
description: Optional[str] = None,
project_id: Optional[str] = None,
role_names: Optional[Sequence[str]] = None)
@overload
def ProjectApiKey(resource_name: str,
args: ProjectApiKeyInitArgs,
opts: Optional[ResourceOptions] = None)
func NewProjectApiKey(ctx *Context, name string, args ProjectApiKeyArgs, opts ...ResourceOption) (*ProjectApiKey, error)
public ProjectApiKey(string name, ProjectApiKeyArgs args, CustomResourceOptions? opts = null)
public ProjectApiKey(String name, ProjectApiKeyArgs args)
public ProjectApiKey(String name, ProjectApiKeyArgs args, CustomResourceOptions options)
type: mongodbatlas:ProjectApiKey
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ProjectApiKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ProjectApiKeyInitArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ProjectApiKeyArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ProjectApiKeyArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ProjectApiKeyArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
ProjectApiKey Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The ProjectApiKey resource accepts the following input properties:
- Description string
Description of this Organization API key.
- Project
Id string - Role
Names 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 following are valid roles:
- Description string
Description of this Organization API key.
- Project
Id string - Role
Names []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 following are valid roles:
- description String
Description of this Organization API key.
- project
Id String - role
Names 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 following are valid roles:
- description string
Description of this Organization API key.
- project
Id string - role
Names 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 following are valid roles:
- description str
Description of this Organization API key.
- project_
id str - 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 following are valid roles:
- description String
Description of this Organization API key.
- project
Id String - role
Names 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 following are valid roles:
Outputs
All input properties are implicitly available as output properties. Additionally, the ProjectApiKey resource produces the following output properties:
- Api
Key stringId The unique identifier of the Programmatic API key you want to associate with the Project. The Programmatic API key and Project must share the same parent organization. Note: this is not the
publicKey
of the Programmatic API key but theid
of the key. See Programmatic API Keys for more.- Id string
The provider-assigned unique ID for this managed resource.
- Private
Key string - Public
Key string
- Api
Key stringId The unique identifier of the Programmatic API key you want to associate with the Project. The Programmatic API key and Project must share the same parent organization. Note: this is not the
publicKey
of the Programmatic API key but theid
of the key. See Programmatic API Keys for more.- Id string
The provider-assigned unique ID for this managed resource.
- Private
Key string - Public
Key string
- api
Key StringId The unique identifier of the Programmatic API key you want to associate with the Project. The Programmatic API key and Project must share the same parent organization. Note: this is not the
publicKey
of the Programmatic API key but theid
of the key. See Programmatic API Keys for more.- id String
The provider-assigned unique ID for this managed resource.
- private
Key String - public
Key String
- api
Key stringId The unique identifier of the Programmatic API key you want to associate with the Project. The Programmatic API key and Project must share the same parent organization. Note: this is not the
publicKey
of the Programmatic API key but theid
of the key. See Programmatic API Keys for more.- id string
The provider-assigned unique ID for this managed resource.
- private
Key string - public
Key string
- api_
key_ strid The unique identifier of the Programmatic API key you want to associate with the Project. The Programmatic API key and Project must share the same parent organization. Note: this is not the
publicKey
of the Programmatic API key but theid
of the key. See Programmatic API Keys for more.- id str
The provider-assigned unique ID for this managed resource.
- private_
key str - public_
key str
- api
Key StringId The unique identifier of the Programmatic API key you want to associate with the Project. The Programmatic API key and Project must share the same parent organization. Note: this is not the
publicKey
of the Programmatic API key but theid
of the key. See Programmatic API Keys for more.- id String
The provider-assigned unique ID for this managed resource.
- private
Key String - public
Key String
Look up Existing ProjectApiKey Resource
Get an existing ProjectApiKey resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ProjectApiKeyState, opts?: CustomResourceOptions): ProjectApiKey
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
api_key_id: Optional[str] = None,
description: Optional[str] = None,
private_key: Optional[str] = None,
project_id: Optional[str] = None,
public_key: Optional[str] = None,
role_names: Optional[Sequence[str]] = None) -> ProjectApiKey
func GetProjectApiKey(ctx *Context, name string, id IDInput, state *ProjectApiKeyState, opts ...ResourceOption) (*ProjectApiKey, error)
public static ProjectApiKey Get(string name, Input<string> id, ProjectApiKeyState? state, CustomResourceOptions? opts = null)
public static ProjectApiKey get(String name, Output<String> id, ProjectApiKeyState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Api
Key stringId The unique identifier of the Programmatic API key you want to associate with the Project. The Programmatic API key and Project must share the same parent organization. Note: this is not the
publicKey
of the Programmatic API key but theid
of the key. See Programmatic API Keys for more.- Description string
Description of this Organization API key.
- Private
Key string - Project
Id string - Public
Key string - Role
Names 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 following are valid roles:
- Api
Key stringId The unique identifier of the Programmatic API key you want to associate with the Project. The Programmatic API key and Project must share the same parent organization. Note: this is not the
publicKey
of the Programmatic API key but theid
of the key. See Programmatic API Keys for more.- Description string
Description of this Organization API key.
- Private
Key string - Project
Id string - Public
Key string - Role
Names []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 following are valid roles:
- api
Key StringId The unique identifier of the Programmatic API key you want to associate with the Project. The Programmatic API key and Project must share the same parent organization. Note: this is not the
publicKey
of the Programmatic API key but theid
of the key. See Programmatic API Keys for more.- description String
Description of this Organization API key.
- private
Key String - project
Id String - public
Key String - role
Names 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 following are valid roles:
- api
Key stringId The unique identifier of the Programmatic API key you want to associate with the Project. The Programmatic API key and Project must share the same parent organization. Note: this is not the
publicKey
of the Programmatic API key but theid
of the key. See Programmatic API Keys for more.- description string
Description of this Organization API key.
- private
Key string - project
Id string - public
Key string - role
Names 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 following are valid roles:
- api_
key_ strid The unique identifier of the Programmatic API key you want to associate with the Project. The Programmatic API key and Project must share the same parent organization. Note: this is not the
publicKey
of the Programmatic API key but theid
of the key. See Programmatic API Keys for more.- description str
Description of this Organization API key.
- private_
key str - project_
id str - public_
key str - 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 following are valid roles:
- api
Key StringId The unique identifier of the Programmatic API key you want to associate with the Project. The Programmatic API key and Project must share the same parent organization. Note: this is not the
publicKey
of the Programmatic API key but theid
of the key. See Programmatic API Keys for more.- description String
Description of this Organization API key.
- private
Key String - project
Id String - public
Key String - role
Names 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 following are valid roles:
Package Details
- Repository
- MongoDB Atlas pulumi/pulumi-mongodbatlas
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
mongodbatlas
Terraform Provider.