Add invite resource
Created by: monotek
As gitlab.com does not allow to to create users directly because of missing admin rights it would be nice if it would at least possible to invite users via terraform to groups and / or projects.
Currently i use the following workaound in tf 0.14.4 with local-exec and curl to use the invite api but having a real resource would be more nice.
data "sops_file" "secrets" {
source_file = "secrets.yaml"
}
resource "null_resource" "invite-tesusers" {
for_each = toset(module.user-groups.testusers-group)
provisioner "local-exec" {
command = "curl -s --request POST --header 'PRIVATE-TOKEN: ${data.sops_file.secrets.data.gitlab_token}' --data 'email=${each.value}&access_level=10' 'https://gitlab.com/api/v4/groups/${var.group_id}/invitations'"
}
}
Edited by Timo Furrer