Skip to content

Commit 40dd232

Browse files
authored
Merge pull request #39 from richardc/import-user
Add support for importing users
2 parents bdb1e5f + 7122cf0 commit 40dd232

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

gitlab/resource_gitlab_user.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ func resourceGitlabUser() *schema.Resource {
1515
Read: resourceGitlabUserRead,
1616
Update: resourceGitlabUserUpdate,
1717
Delete: resourceGitlabUserDelete,
18+
Importer: &schema.ResourceImporter{
19+
State: schema.ImportStatePassthrough,
20+
},
1821

1922
Schema: map[string]*schema.Schema{
2023
"username": {

website/docs/r/user.html.markdown

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,11 @@ for the user.
5151
The resource exports the following attributes:
5252

5353
* `id` - The unique id assigned to the user by the GitLab server.
54+
55+
## Importing users
56+
57+
You can import a user to terraform state using `terraform import <resource> <id>`.
58+
The `id` must be an integer for the id of the user you want to import,
59+
for example:
60+
61+
terraform import gitlab_user.example 42

0 commit comments

Comments
 (0)