mongodbatlas logo
MongoDB Atlas v3.7.2, Mar 31 23

mongodbatlas.ProjectInvitation

Explore with Pulumi AI

Import

~> IMPORTANT: A project invitation can not be imported once it has been accepted. Import a user’s invitation to a project by separating the project_id and the username with a hyphen

 $ pulumi import mongodbatlas:index/projectInvitation:ProjectInvitation my_user 1112222b3bf99403840e8934-my_user@mongodb.com

Example Usage

S

using System.Collections.Generic;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

return await Deployment.RunAsync(() => 
{
    var test = new Mongodbatlas.ProjectInvitation("test", new()
    {
        ProjectId = "<PROJECT-ID>",
        Roles = new[]
        {
            "GROUP_DATA_ACCESS_READ_WRITE",
        },
        Username = "test-acc-username",
    });

});
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.NewProjectInvitation(ctx, "test", &mongodbatlas.ProjectInvitationArgs{
			ProjectId: pulumi.String("<PROJECT-ID>"),
			Roles: pulumi.StringArray{
				pulumi.String("GROUP_DATA_ACCESS_READ_WRITE"),
			},
			Username: pulumi.String("test-acc-username"),
		})
		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.ProjectInvitation;
import com.pulumi.mongodbatlas.ProjectInvitationArgs;
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 ProjectInvitation("test", ProjectInvitationArgs.builder()        
            .projectId("<PROJECT-ID>")
            .roles("GROUP_DATA_ACCESS_READ_WRITE")
            .username("test-acc-username")
            .build());

    }
}
import pulumi
import pulumi_mongodbatlas as mongodbatlas

test = mongodbatlas.ProjectInvitation("test",
    project_id="<PROJECT-ID>",
    roles=["GROUP_DATA_ACCESS_READ_WRITE"],
    username="test-acc-username")
import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";

const test = new mongodbatlas.ProjectInvitation("test", {
    projectId: "<PROJECT-ID>",
    roles: ["GROUP_DATA_ACCESS_READ_WRITE"],
    username: "test-acc-username",
});
resources:
  test:
    type: mongodbatlas:ProjectInvitation
    properties:
      projectId: <PROJECT-ID>
      roles:
        - GROUP_DATA_ACCESS_READ_WRITE
      username: test-acc-username
using System.Collections.Generic;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;

return await Deployment.RunAsync(() => 
{
    var test = new Mongodbatlas.ProjectInvitation("test", new()
    {
        ProjectId = "<PROJECT-ID>",
        Roles = new[]
        {
            "GROUP_READ_ONLY",
            "GROUP_DATA_ACCESS_READ_ONLY",
        },
        Username = "test-acc-username",
    });

});
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.NewProjectInvitation(ctx, "test", &mongodbatlas.ProjectInvitationArgs{
			ProjectId: pulumi.String("<PROJECT-ID>"),
			Roles: pulumi.StringArray{
				pulumi.String("GROUP_READ_ONLY"),
				pulumi.String("GROUP_DATA_ACCESS_READ_ONLY"),
			},
			Username: pulumi.String("test-acc-username"),
		})
		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.ProjectInvitation;
import com.pulumi.mongodbatlas.ProjectInvitationArgs;
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 ProjectInvitation("test", ProjectInvitationArgs.builder()        
            .projectId("<PROJECT-ID>")
            .roles(            
                "GROUP_READ_ONLY",
                "GROUP_DATA_ACCESS_READ_ONLY")
            .username("test-acc-username")
            .build());

    }
}
import pulumi
import pulumi_mongodbatlas as mongodbatlas

test = mongodbatlas.ProjectInvitation("test",
    project_id="<PROJECT-ID>",
    roles=[
        "GROUP_READ_ONLY",
        "GROUP_DATA_ACCESS_READ_ONLY",
    ],
    username="test-acc-username")
import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";

const test = new mongodbatlas.ProjectInvitation("test", {
    projectId: "<PROJECT-ID>",
    roles: [
        "GROUP_READ_ONLY",
        "GROUP_DATA_ACCESS_READ_ONLY",
    ],
    username: "test-acc-username",
});
resources:
  test:
    type: mongodbatlas:ProjectInvitation
    properties:
      projectId: <PROJECT-ID>
      roles:
        - GROUP_READ_ONLY
        - GROUP_DATA_ACCESS_READ_ONLY
      username: test-acc-username

Create ProjectInvitation Resource

new ProjectInvitation(name: string, args: ProjectInvitationArgs, opts?: CustomResourceOptions);
@overload
def ProjectInvitation(resource_name: str,
                      opts: Optional[ResourceOptions] = None,
                      project_id: Optional[str] = None,
                      roles: Optional[Sequence[str]] = None,
                      username: Optional[str] = None)
@overload
def ProjectInvitation(resource_name: str,
                      args: ProjectInvitationArgs,
                      opts: Optional[ResourceOptions] = None)
func NewProjectInvitation(ctx *Context, name string, args ProjectInvitationArgs, opts ...ResourceOption) (*ProjectInvitation, error)
public ProjectInvitation(string name, ProjectInvitationArgs args, CustomResourceOptions? opts = null)
public ProjectInvitation(String name, ProjectInvitationArgs args)
public ProjectInvitation(String name, ProjectInvitationArgs args, CustomResourceOptions options)
type: mongodbatlas:ProjectInvitation
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args ProjectInvitationArgs
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 ProjectInvitationArgs
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 ProjectInvitationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ProjectInvitationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ProjectInvitationArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

ProjectInvitation 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 ProjectInvitation resource accepts the following input properties:

ProjectId string

Unique 24-hexadecimal digit string that identifies the project to which you want to invite a user.

Roles List<string>

List of Atlas roles to assign to the invited user. If the user accepts the invitation, Atlas assigns these roles to them. Refer to the MongoDB Documentation for information on valid roles.

Username string

Email address to which Atlas sent the invitation. The user uses this email address as their Atlas username if they accept this invitation.

ProjectId string

Unique 24-hexadecimal digit string that identifies the project to which you want to invite a user.

Roles []string

List of Atlas roles to assign to the invited user. If the user accepts the invitation, Atlas assigns these roles to them. Refer to the MongoDB Documentation for information on valid roles.

Username string

Email address to which Atlas sent the invitation. The user uses this email address as their Atlas username if they accept this invitation.

projectId String

Unique 24-hexadecimal digit string that identifies the project to which you want to invite a user.

roles List<String>

List of Atlas roles to assign to the invited user. If the user accepts the invitation, Atlas assigns these roles to them. Refer to the MongoDB Documentation for information on valid roles.

username String

Email address to which Atlas sent the invitation. The user uses this email address as their Atlas username if they accept this invitation.

projectId string

Unique 24-hexadecimal digit string that identifies the project to which you want to invite a user.

roles string[]

List of Atlas roles to assign to the invited user. If the user accepts the invitation, Atlas assigns these roles to them. Refer to the MongoDB Documentation for information on valid roles.

username string

Email address to which Atlas sent the invitation. The user uses this email address as their Atlas username if they accept this invitation.

project_id str

Unique 24-hexadecimal digit string that identifies the project to which you want to invite a user.

roles Sequence[str]

List of Atlas roles to assign to the invited user. If the user accepts the invitation, Atlas assigns these roles to them. Refer to the MongoDB Documentation for information on valid roles.

username str

Email address to which Atlas sent the invitation. The user uses this email address as their Atlas username if they accept this invitation.

projectId String

Unique 24-hexadecimal digit string that identifies the project to which you want to invite a user.

roles List<String>

List of Atlas roles to assign to the invited user. If the user accepts the invitation, Atlas assigns these roles to them. Refer to the MongoDB Documentation for information on valid roles.

username String

Email address to which Atlas sent the invitation. The user uses this email address as their Atlas username if they accept this invitation.

Outputs

All input properties are implicitly available as output properties. Additionally, the ProjectInvitation resource produces the following output properties:

CreatedAt string

Timestamp in ISO 8601 date and time format in UTC when Atlas sent the invitation.

ExpiresAt string

Timestamp in ISO 8601 date and time format in UTC when the invitation expires. Users have 30 days to accept an invitation.

Id string

The provider-assigned unique ID for this managed resource.

InvitationId string

Unique 24-hexadecimal digit string that identifies the invitation in Atlas.

InviterUsername string

Atlas user who invited username to the project.

CreatedAt string

Timestamp in ISO 8601 date and time format in UTC when Atlas sent the invitation.

ExpiresAt string

Timestamp in ISO 8601 date and time format in UTC when the invitation expires. Users have 30 days to accept an invitation.

Id string

The provider-assigned unique ID for this managed resource.

InvitationId string

Unique 24-hexadecimal digit string that identifies the invitation in Atlas.

InviterUsername string

Atlas user who invited username to the project.

createdAt String

Timestamp in ISO 8601 date and time format in UTC when Atlas sent the invitation.

expiresAt String

Timestamp in ISO 8601 date and time format in UTC when the invitation expires. Users have 30 days to accept an invitation.

id String

The provider-assigned unique ID for this managed resource.

invitationId String

Unique 24-hexadecimal digit string that identifies the invitation in Atlas.

inviterUsername String

Atlas user who invited username to the project.

createdAt string

Timestamp in ISO 8601 date and time format in UTC when Atlas sent the invitation.

expiresAt string

Timestamp in ISO 8601 date and time format in UTC when the invitation expires. Users have 30 days to accept an invitation.

id string

The provider-assigned unique ID for this managed resource.

invitationId string

Unique 24-hexadecimal digit string that identifies the invitation in Atlas.

inviterUsername string

Atlas user who invited username to the project.

created_at str

Timestamp in ISO 8601 date and time format in UTC when Atlas sent the invitation.

expires_at str

Timestamp in ISO 8601 date and time format in UTC when the invitation expires. Users have 30 days to accept an invitation.

id str

The provider-assigned unique ID for this managed resource.

invitation_id str

Unique 24-hexadecimal digit string that identifies the invitation in Atlas.

inviter_username str

Atlas user who invited username to the project.

createdAt String

Timestamp in ISO 8601 date and time format in UTC when Atlas sent the invitation.

expiresAt String

Timestamp in ISO 8601 date and time format in UTC when the invitation expires. Users have 30 days to accept an invitation.

id String

The provider-assigned unique ID for this managed resource.

invitationId String

Unique 24-hexadecimal digit string that identifies the invitation in Atlas.

inviterUsername String

Atlas user who invited username to the project.

Look up Existing ProjectInvitation Resource

Get an existing ProjectInvitation 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?: ProjectInvitationState, opts?: CustomResourceOptions): ProjectInvitation
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        created_at: Optional[str] = None,
        expires_at: Optional[str] = None,
        invitation_id: Optional[str] = None,
        inviter_username: Optional[str] = None,
        project_id: Optional[str] = None,
        roles: Optional[Sequence[str]] = None,
        username: Optional[str] = None) -> ProjectInvitation
func GetProjectInvitation(ctx *Context, name string, id IDInput, state *ProjectInvitationState, opts ...ResourceOption) (*ProjectInvitation, error)
public static ProjectInvitation Get(string name, Input<string> id, ProjectInvitationState? state, CustomResourceOptions? opts = null)
public static ProjectInvitation get(String name, Output<String> id, ProjectInvitationState 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.
The following state arguments are supported:
CreatedAt string

Timestamp in ISO 8601 date and time format in UTC when Atlas sent the invitation.

ExpiresAt string

Timestamp in ISO 8601 date and time format in UTC when the invitation expires. Users have 30 days to accept an invitation.

InvitationId string

Unique 24-hexadecimal digit string that identifies the invitation in Atlas.

InviterUsername string

Atlas user who invited username to the project.

ProjectId string

Unique 24-hexadecimal digit string that identifies the project to which you want to invite a user.

Roles List<string>

List of Atlas roles to assign to the invited user. If the user accepts the invitation, Atlas assigns these roles to them. Refer to the MongoDB Documentation for information on valid roles.

Username string

Email address to which Atlas sent the invitation. The user uses this email address as their Atlas username if they accept this invitation.

CreatedAt string

Timestamp in ISO 8601 date and time format in UTC when Atlas sent the invitation.

ExpiresAt string

Timestamp in ISO 8601 date and time format in UTC when the invitation expires. Users have 30 days to accept an invitation.

InvitationId string

Unique 24-hexadecimal digit string that identifies the invitation in Atlas.

InviterUsername string

Atlas user who invited username to the project.

ProjectId string

Unique 24-hexadecimal digit string that identifies the project to which you want to invite a user.

Roles []string

List of Atlas roles to assign to the invited user. If the user accepts the invitation, Atlas assigns these roles to them. Refer to the MongoDB Documentation for information on valid roles.

Username string

Email address to which Atlas sent the invitation. The user uses this email address as their Atlas username if they accept this invitation.

createdAt String

Timestamp in ISO 8601 date and time format in UTC when Atlas sent the invitation.

expiresAt String

Timestamp in ISO 8601 date and time format in UTC when the invitation expires. Users have 30 days to accept an invitation.

invitationId String

Unique 24-hexadecimal digit string that identifies the invitation in Atlas.

inviterUsername String

Atlas user who invited username to the project.

projectId String

Unique 24-hexadecimal digit string that identifies the project to which you want to invite a user.

roles List<String>

List of Atlas roles to assign to the invited user. If the user accepts the invitation, Atlas assigns these roles to them. Refer to the MongoDB Documentation for information on valid roles.

username String

Email address to which Atlas sent the invitation. The user uses this email address as their Atlas username if they accept this invitation.

createdAt string

Timestamp in ISO 8601 date and time format in UTC when Atlas sent the invitation.

expiresAt string

Timestamp in ISO 8601 date and time format in UTC when the invitation expires. Users have 30 days to accept an invitation.

invitationId string

Unique 24-hexadecimal digit string that identifies the invitation in Atlas.

inviterUsername string

Atlas user who invited username to the project.

projectId string

Unique 24-hexadecimal digit string that identifies the project to which you want to invite a user.

roles string[]

List of Atlas roles to assign to the invited user. If the user accepts the invitation, Atlas assigns these roles to them. Refer to the MongoDB Documentation for information on valid roles.

username string

Email address to which Atlas sent the invitation. The user uses this email address as their Atlas username if they accept this invitation.

created_at str

Timestamp in ISO 8601 date and time format in UTC when Atlas sent the invitation.

expires_at str

Timestamp in ISO 8601 date and time format in UTC when the invitation expires. Users have 30 days to accept an invitation.

invitation_id str

Unique 24-hexadecimal digit string that identifies the invitation in Atlas.

inviter_username str

Atlas user who invited username to the project.

project_id str

Unique 24-hexadecimal digit string that identifies the project to which you want to invite a user.

roles Sequence[str]

List of Atlas roles to assign to the invited user. If the user accepts the invitation, Atlas assigns these roles to them. Refer to the MongoDB Documentation for information on valid roles.

username str

Email address to which Atlas sent the invitation. The user uses this email address as their Atlas username if they accept this invitation.

createdAt String

Timestamp in ISO 8601 date and time format in UTC when Atlas sent the invitation.

expiresAt String

Timestamp in ISO 8601 date and time format in UTC when the invitation expires. Users have 30 days to accept an invitation.

invitationId String

Unique 24-hexadecimal digit string that identifies the invitation in Atlas.

inviterUsername String

Atlas user who invited username to the project.

projectId String

Unique 24-hexadecimal digit string that identifies the project to which you want to invite a user.

roles List<String>

List of Atlas roles to assign to the invited user. If the user accepts the invitation, Atlas assigns these roles to them. Refer to the MongoDB Documentation for information on valid roles.

username String

Email address to which Atlas sent the invitation. The user uses this email address as their Atlas username if they accept this invitation.

Package Details

Repository
MongoDB Atlas pulumi/pulumi-mongodbatlas
License
Apache-2.0
Notes

This Pulumi package is based on the mongodbatlas Terraform Provider.