mongodbatlas.TeamProjectAssignment provides a Team Project Assignment resource. It lets you manage the association between a team and a project, enabling you to import, assign, remove, or update the team’s membership.
Example Usage
S
import * as pulumi from "@pulumi/pulumi";
import * as mongodbatlas from "@pulumi/mongodbatlas";
const thisTeamProjectAssignment = new mongodbatlas.TeamProjectAssignment("this", {
projectId: projectId,
teamId: teamId,
roleNames: [
"GROUP_OWNER",
"GROUP_DATA_ACCESS_ADMIN",
],
});
const _this = mongodbatlas.getTeamProjectAssignmentOutput({
projectId: thisTeamProjectAssignment.projectId,
teamId: thisTeamProjectAssignment.teamId,
});
import pulumi
import pulumi_mongodbatlas as mongodbatlas
this_team_project_assignment = mongodbatlas.TeamProjectAssignment("this",
project_id=project_id,
team_id=team_id,
role_names=[
"GROUP_OWNER",
"GROUP_DATA_ACCESS_ADMIN",
])
this = mongodbatlas.get_team_project_assignment_output(project_id=this_team_project_assignment.project_id,
team_id=this_team_project_assignment.team_id)
package main
import (
"github.com/pulumi/pulumi-mongodbatlas/sdk/v4/go/mongodbatlas"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
thisTeamProjectAssignment, err := mongodbatlas.NewTeamProjectAssignment(ctx, "this", &mongodbatlas.TeamProjectAssignmentArgs{
ProjectId: pulumi.Any(projectId),
TeamId: pulumi.Any(teamId),
RoleNames: pulumi.StringArray{
pulumi.String("GROUP_OWNER"),
pulumi.String("GROUP_DATA_ACCESS_ADMIN"),
},
})
if err != nil {
return err
}
_ = mongodbatlas.LookupTeamProjectAssignmentOutput(ctx, mongodbatlas.GetTeamProjectAssignmentOutputArgs{
ProjectId: thisTeamProjectAssignment.ProjectId,
TeamId: thisTeamProjectAssignment.TeamId,
}, nil)
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Mongodbatlas = Pulumi.Mongodbatlas;
return await Deployment.RunAsync(() =>
{
var thisTeamProjectAssignment = new Mongodbatlas.TeamProjectAssignment("this", new()
{
ProjectId = projectId,
TeamId = teamId,
RoleNames = new[]
{
"GROUP_OWNER",
"GROUP_DATA_ACCESS_ADMIN",
},
});
var @this = Mongodbatlas.GetTeamProjectAssignment.Invoke(new()
{
ProjectId = thisTeamProjectAssignment.ProjectId,
TeamId = thisTeamProjectAssignment.TeamId,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.mongodbatlas.TeamProjectAssignment;
import com.pulumi.mongodbatlas.TeamProjectAssignmentArgs;
import com.pulumi.mongodbatlas.MongodbatlasFunctions;
import com.pulumi.mongodbatlas.inputs.GetTeamProjectAssignmentArgs;
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 thisTeamProjectAssignment = new TeamProjectAssignment("thisTeamProjectAssignment", TeamProjectAssignmentArgs.builder()
.projectId(projectId)
.teamId(teamId)
.roleNames(
"GROUP_OWNER",
"GROUP_DATA_ACCESS_ADMIN")
.build());
final var this = MongodbatlasFunctions.getTeamProjectAssignment(GetTeamProjectAssignmentArgs.builder()
.projectId(thisTeamProjectAssignment.projectId())
.teamId(thisTeamProjectAssignment.teamId())
.build());
}
}
resources:
thisTeamProjectAssignment:
type: mongodbatlas:TeamProjectAssignment
name: this
properties:
projectId: ${projectId}
teamId: ${teamId}
roleNames:
- GROUP_OWNER
- GROUP_DATA_ACCESS_ADMIN
variables:
this:
fn::invoke:
function: mongodbatlas:getTeamProjectAssignment
arguments:
projectId: ${thisTeamProjectAssignment.projectId}
teamId: ${thisTeamProjectAssignment.teamId}
Further Examples
- Team Project Assignment
Create TeamProjectAssignment Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new TeamProjectAssignment(name: string, args: TeamProjectAssignmentArgs, opts?: CustomResourceOptions);@overload
def TeamProjectAssignment(resource_name: str,
args: TeamProjectAssignmentArgs,
opts: Optional[ResourceOptions] = None)
@overload
def TeamProjectAssignment(resource_name: str,
opts: Optional[ResourceOptions] = None,
project_id: Optional[str] = None,
role_names: Optional[Sequence[str]] = None,
team_id: Optional[str] = None)func NewTeamProjectAssignment(ctx *Context, name string, args TeamProjectAssignmentArgs, opts ...ResourceOption) (*TeamProjectAssignment, error)public TeamProjectAssignment(string name, TeamProjectAssignmentArgs args, CustomResourceOptions? opts = null)
public TeamProjectAssignment(String name, TeamProjectAssignmentArgs args)
public TeamProjectAssignment(String name, TeamProjectAssignmentArgs args, CustomResourceOptions options)
type: mongodbatlas:TeamProjectAssignment
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 TeamProjectAssignmentArgs
- 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 TeamProjectAssignmentArgs
- 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 TeamProjectAssignmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TeamProjectAssignmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args TeamProjectAssignmentArgs
- 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 teamProjectAssignmentResource = new Mongodbatlas.TeamProjectAssignment("teamProjectAssignmentResource", new()
{
ProjectId = "string",
RoleNames = new[]
{
"string",
},
TeamId = "string",
});
example, err := mongodbatlas.NewTeamProjectAssignment(ctx, "teamProjectAssignmentResource", &mongodbatlas.TeamProjectAssignmentArgs{
ProjectId: pulumi.String("string"),
RoleNames: pulumi.StringArray{
pulumi.String("string"),
},
TeamId: pulumi.String("string"),
})
var teamProjectAssignmentResource = new TeamProjectAssignment("teamProjectAssignmentResource", TeamProjectAssignmentArgs.builder()
.projectId("string")
.roleNames("string")
.teamId("string")
.build());
team_project_assignment_resource = mongodbatlas.TeamProjectAssignment("teamProjectAssignmentResource",
project_id="string",
role_names=["string"],
team_id="string")
const teamProjectAssignmentResource = new mongodbatlas.TeamProjectAssignment("teamProjectAssignmentResource", {
projectId: "string",
roleNames: ["string"],
teamId: "string",
});
type: mongodbatlas:TeamProjectAssignment
properties:
projectId: string
roleNames:
- string
teamId: string
TeamProjectAssignment 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 TeamProjectAssignment resource accepts the following input properties:
- Project
Id string - Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
- Role
Names List<string> - One or more project-level roles assigned to the team.
- Team
Id string - Unique 24-hexadecimal character string that identifies the team.
- Project
Id string - Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
- Role
Names []string - One or more project-level roles assigned to the team.
- Team
Id string - Unique 24-hexadecimal character string that identifies the team.
- project
Id String - Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
- role
Names List<String> - One or more project-level roles assigned to the team.
- team
Id String - Unique 24-hexadecimal character string that identifies the team.
- project
Id string - Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
- role
Names string[] - One or more project-level roles assigned to the team.
- team
Id string - Unique 24-hexadecimal character string that identifies the team.
- project_
id str - Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
- role_
names Sequence[str] - One or more project-level roles assigned to the team.
- team_
id str - Unique 24-hexadecimal character string that identifies the team.
- project
Id String - Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
- role
Names List<String> - One or more project-level roles assigned to the team.
- team
Id String - Unique 24-hexadecimal character string that identifies the team.
Outputs
All input properties are implicitly available as output properties. Additionally, the TeamProjectAssignment resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing TeamProjectAssignment Resource
Get an existing TeamProjectAssignment 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?: TeamProjectAssignmentState, opts?: CustomResourceOptions): TeamProjectAssignment@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
project_id: Optional[str] = None,
role_names: Optional[Sequence[str]] = None,
team_id: Optional[str] = None) -> TeamProjectAssignmentfunc GetTeamProjectAssignment(ctx *Context, name string, id IDInput, state *TeamProjectAssignmentState, opts ...ResourceOption) (*TeamProjectAssignment, error)public static TeamProjectAssignment Get(string name, Input<string> id, TeamProjectAssignmentState? state, CustomResourceOptions? opts = null)public static TeamProjectAssignment get(String name, Output<String> id, TeamProjectAssignmentState state, CustomResourceOptions options)resources: _: type: mongodbatlas:TeamProjectAssignment get: id: ${id}- 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.
- Project
Id string - Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
- Role
Names List<string> - One or more project-level roles assigned to the team.
- Team
Id string - Unique 24-hexadecimal character string that identifies the team.
- Project
Id string - Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
- Role
Names []string - One or more project-level roles assigned to the team.
- Team
Id string - Unique 24-hexadecimal character string that identifies the team.
- project
Id String - Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
- role
Names List<String> - One or more project-level roles assigned to the team.
- team
Id String - Unique 24-hexadecimal character string that identifies the team.
- project
Id string - Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
- role
Names string[] - One or more project-level roles assigned to the team.
- team
Id string - Unique 24-hexadecimal character string that identifies the team.
- project_
id str - Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
- role_
names Sequence[str] - One or more project-level roles assigned to the team.
- team_
id str - Unique 24-hexadecimal character string that identifies the team.
- project
Id String - Unique 24-hexadecimal digit string that identifies your project. Use the /groups endpoint to retrieve all projects to which the authenticated user has access.
- role
Names List<String> - One or more project-level roles assigned to the team.
- team
Id String - Unique 24-hexadecimal character string that identifies the team.
Import
Team Project Assignment resource can be imported using the Project ID & TeamID, in the format PROJECT_ID/TEAM_ID.
$ pulumi import mongodbatlas:index/teamProjectAssignment:TeamProjectAssignment test 9f3a7c2e54b8d1a0e6f4b3c2/a4d9f7b18e52c0fa36b7e9cd
For more information, see: MongoDB Atlas API - Teams Documentation.
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
mongodbatlasTerraform Provider.
