mongodbatlas.ProjectInvitation
Explore with Pulumi AI
Example Usage
S
import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";
const test = new mongodbatlas.ProjectInvitation("test", {
username: "test-acc-username",
projectId: "<PROJECT-ID>",
roles: ["GROUP_DATA_ACCESS_READ_WRITE"],
});
import pulumi
import pulumi_mongodbatlas as mongodbatlas
test = mongodbatlas.ProjectInvitation("test",
username="test-acc-username",
project_id="<PROJECT-ID>",
roles=["GROUP_DATA_ACCESS_READ_WRITE"])
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{
Username: pulumi.String("test-acc-username"),
ProjectId: pulumi.String("<PROJECT-ID>"),
Roles: pulumi.StringArray{
pulumi.String("GROUP_DATA_ACCESS_READ_WRITE"),
},
})
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 = new Mongodbatlas.ProjectInvitation("test", new()
{
Username = "test-acc-username",
ProjectId = "<PROJECT-ID>",
Roles = new[]
{
"GROUP_DATA_ACCESS_READ_WRITE",
},
});
});
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()
.username("test-acc-username")
.projectId("<PROJECT-ID>")
.roles("GROUP_DATA_ACCESS_READ_WRITE")
.build());
}
}
resources:
test:
type: mongodbatlas:ProjectInvitation
properties:
username: test-acc-username
projectId: <PROJECT-ID>
roles:
- GROUP_DATA_ACCESS_READ_WRITE
import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";
const test = new mongodbatlas.ProjectInvitation("test", {
username: "test-acc-username",
projectId: "<PROJECT-ID>",
roles: [
"GROUP_READ_ONLY",
"GROUP_DATA_ACCESS_READ_ONLY",
],
});
import pulumi
import pulumi_mongodbatlas as mongodbatlas
test = mongodbatlas.ProjectInvitation("test",
username="test-acc-username",
project_id="<PROJECT-ID>",
roles=[
"GROUP_READ_ONLY",
"GROUP_DATA_ACCESS_READ_ONLY",
])
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{
Username: pulumi.String("test-acc-username"),
ProjectId: pulumi.String("<PROJECT-ID>"),
Roles: pulumi.StringArray{
pulumi.String("GROUP_READ_ONLY"),
pulumi.String("GROUP_DATA_ACCESS_READ_ONLY"),
},
})
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 = new Mongodbatlas.ProjectInvitation("test", new()
{
Username = "test-acc-username",
ProjectId = "<PROJECT-ID>",
Roles = new[]
{
"GROUP_READ_ONLY",
"GROUP_DATA_ACCESS_READ_ONLY",
},
});
});
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()
.username("test-acc-username")
.projectId("<PROJECT-ID>")
.roles(
"GROUP_READ_ONLY",
"GROUP_DATA_ACCESS_READ_ONLY")
.build());
}
}
resources:
test:
type: mongodbatlas:ProjectInvitation
properties:
username: test-acc-username
projectId: <PROJECT-ID>
roles:
- GROUP_READ_ONLY
- GROUP_DATA_ACCESS_READ_ONLY
Create ProjectInvitation Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ProjectInvitation(name: string, args: ProjectInvitationArgs, opts?: CustomResourceOptions);
@overload
def ProjectInvitation(resource_name: str,
args: ProjectInvitationArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ProjectInvitation(resource_name: str,
opts: Optional[ResourceOptions] = None,
project_id: Optional[str] = None,
roles: Optional[Sequence[str]] = None,
username: Optional[str] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var projectInvitationResource = new Mongodbatlas.ProjectInvitation("projectInvitationResource", new()
{
ProjectId = "string",
Roles = new[]
{
"string",
},
Username = "string",
});
example, err := mongodbatlas.NewProjectInvitation(ctx, "projectInvitationResource", &mongodbatlas.ProjectInvitationArgs{
ProjectId: pulumi.String("string"),
Roles: pulumi.StringArray{
pulumi.String("string"),
},
Username: pulumi.String("string"),
})
var projectInvitationResource = new ProjectInvitation("projectInvitationResource", ProjectInvitationArgs.builder()
.projectId("string")
.roles("string")
.username("string")
.build());
project_invitation_resource = mongodbatlas.ProjectInvitation("projectInvitationResource",
project_id="string",
roles=["string"],
username="string")
const projectInvitationResource = new mongodbatlas.ProjectInvitation("projectInvitationResource", {
projectId: "string",
roles: ["string"],
username: "string",
});
type: mongodbatlas:ProjectInvitation
properties:
projectId: string
roles:
- string
username: string
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ProjectInvitation resource accepts the following input properties:
- Project
Id 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.
- Project
Id 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 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.
- project
Id 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.
- project
Id 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:
- Created
At string - Timestamp in ISO 8601 date and time format in UTC when Atlas sent the invitation.
- Expires
At 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.
- Invitation
Id string - Unique 24-hexadecimal digit string that identifies the invitation in Atlas.
- Inviter
Username string - Atlas user who invited
username
to the project.
- Created
At string - Timestamp in ISO 8601 date and time format in UTC when Atlas sent the invitation.
- Expires
At 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.
- Invitation
Id string - Unique 24-hexadecimal digit string that identifies the invitation in Atlas.
- Inviter
Username string - Atlas user who invited
username
to the project.
- created
At String - Timestamp in ISO 8601 date and time format in UTC when Atlas sent the invitation.
- expires
At 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.
- invitation
Id String - Unique 24-hexadecimal digit string that identifies the invitation in Atlas.
- inviter
Username String - Atlas user who invited
username
to the project.
- created
At string - Timestamp in ISO 8601 date and time format in UTC when Atlas sent the invitation.
- expires
At 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.
- invitation
Id string - Unique 24-hexadecimal digit string that identifies the invitation in Atlas.
- inviter
Username 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.
- created
At String - Timestamp in ISO 8601 date and time format in UTC when Atlas sent the invitation.
- expires
At 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.
- invitation
Id String - Unique 24-hexadecimal digit string that identifies the invitation in Atlas.
- inviter
Username 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.
- Created
At string - Timestamp in ISO 8601 date and time format in UTC when Atlas sent the invitation.
- Expires
At string - Timestamp in ISO 8601 date and time format in UTC when the invitation expires. Users have 30 days to accept an invitation.
- Invitation
Id string - Unique 24-hexadecimal digit string that identifies the invitation in Atlas.
- Inviter
Username string - Atlas user who invited
username
to the project. - Project
Id 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.
- Created
At string - Timestamp in ISO 8601 date and time format in UTC when Atlas sent the invitation.
- Expires
At string - Timestamp in ISO 8601 date and time format in UTC when the invitation expires. Users have 30 days to accept an invitation.
- Invitation
Id string - Unique 24-hexadecimal digit string that identifies the invitation in Atlas.
- Inviter
Username string - Atlas user who invited
username
to the project. - Project
Id 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 String - Timestamp in ISO 8601 date and time format in UTC when Atlas sent the invitation.
- expires
At String - Timestamp in ISO 8601 date and time format in UTC when the invitation expires. Users have 30 days to accept an invitation.
- invitation
Id String - Unique 24-hexadecimal digit string that identifies the invitation in Atlas.
- inviter
Username String - Atlas user who invited
username
to the project. - project
Id 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.
- created
At string - Timestamp in ISO 8601 date and time format in UTC when Atlas sent the invitation.
- expires
At string - Timestamp in ISO 8601 date and time format in UTC when the invitation expires. Users have 30 days to accept an invitation.
- invitation
Id string - Unique 24-hexadecimal digit string that identifies the invitation in Atlas.
- inviter
Username string - Atlas user who invited
username
to the project. - project
Id 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.
- created
At String - Timestamp in ISO 8601 date and time format in UTC when Atlas sent the invitation.
- expires
At String - Timestamp in ISO 8601 date and time format in UTC when the invitation expires. Users have 30 days to accept an invitation.
- invitation
Id String - Unique 24-hexadecimal digit string that identifies the invitation in Atlas.
- inviter
Username String - Atlas user who invited
username
to the project. - project
Id 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.
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
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- MongoDB Atlas pulumi/pulumi-mongodbatlas
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
mongodbatlas
Terraform Provider.