File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,7 @@ func resourceGitlabProject() *schema.Resource {
94
94
}
95
95
96
96
func resourceGitlabProjectSetToState (d * schema.ResourceData , project * gitlab.Project ) {
97
+ d .SetId (fmt .Sprintf ("%d" , project .ID ))
97
98
d .Set ("name" , project .Name )
98
99
d .Set ("path" , project .Path )
99
100
d .Set ("description" , project .Description )
Original file line number Diff line number Diff line change @@ -63,3 +63,13 @@ The following additional attributes are exported:
63
63
repository via HTTP.
64
64
65
65
* ` web_url ` - URL that can be used to find the project in a browser.
66
+
67
+ ## Importing projects
68
+
69
+ You can import a project state using ` terraform import <resource> <id> ` . The
70
+ ` id ` can be whatever the [ get single project api] ( get_single_project ) takes for
71
+ its ` :id ` value, so for example:
72
+
73
+ terraform import gitlab_project.example richardc/example
74
+
75
+ [ get_single_project ] : https://docs.gitlab.com/ee/api/projects.html#get-single-project
You can’t perform that action at this time.
0 commit comments