Skip to content

Latest commit

Β 

History

History
56 lines (45 loc) Β· 1.64 KB

File metadata and controls

56 lines (45 loc) Β· 1.64 KB

πŸ‘₯πŸ“˜ Resource Documentation: portainer_team_membership

portainer_team_membership

The portainer_team_membership resource allows you to assign an existing user to a team with a specific role in Portainer.

Example Usage

resource "portainer_user" "example_user" {
  username  = "exampleuser"
  password  = "SuperStrongPassword123!"
  role      = 2
  ldap_user = false
}

resource "portainer_team" "example_team" {
  name = "dev-team"
}

resource "portainer_team_membership" "membership" {
  role    = 2
  team_id = portainer_team.example_team.id
  user_id = portainer_user.example_user.id
}

Lifecycle & Behavior

Team membrship are updated if any of the attributes change (e.g. role).

  • To delete a membrship created via Terraform, simply run:
terraform destroy
  • To change a team membrship role id, update the role field and re-apply:
terraform apply

Arguments Reference

Name Type Required Description
role number βœ… yes Role of the user in the team (1 = leader, 2 = member)
team_id number βœ… yes ID of the Portainer team
user_id number βœ… yes ID of the Portainer user

Attributes Reference

Name Description
id ID of the membership

Import

Team memberships can be imported using their numeric membership ID (not the team_id/user_id pair):

terraform import portainer_team_membership.example 11