You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Initial Addition of Personal Access Token Resource + some refactors (#1007)
* Initial Addition of Personal Access Token Resource + some refactors + bumping go-gitlab version + fixes from resulting go-gitlab upgrade
* Merge from main
* Update go-gitlab dependencies + Adding reworked setup files for registry enablement + added cleanup to volumes on testacc-down
* Merge from main
* Fixing more squash conflicts
* Merge from main
* Implemented review comments
Co-authored-by: Timo Furrer <[email protected]>
Co-authored-by: Patrick Decat <[email protected]>
value = gitlab_personal_access_token.example.token
34
+
}
35
+
```
36
+
37
+
<!-- schema generated by tfplugindocs -->
38
+
## Schema
39
+
40
+
### Required
41
+
42
+
-`name` (String) The name of the personal access token.
43
+
-`scopes` (Set of String) The scope for the personal access token. It determines the actions which can be performed when authenticating with this token. Valid values are: `api`, `read_user`, `read_api`, `read_repository`, `write_repository`, `read_registry`, `write_registry`, `sudo`.
44
+
-`user_id` (Number) The id of the user.
45
+
46
+
### Optional
47
+
48
+
-`expires_at` (String) The token expires at midnight UTC on that date. The date must be in the format YYYY-MM-DD. Default is never.
49
+
-`id` (String) The ID of this resource.
50
+
51
+
### Read-Only
52
+
53
+
-`active` (Boolean) True if the token is active.
54
+
-`created_at` (String) Time the token has been created, RFC3339 format.
55
+
-`revoked` (Boolean) True if the token is revoked.
56
+
-`token` (String, Sensitive) The personal access token. This is only populated when creating a new personal access token. This attribute is not available for imported resources.
57
+
58
+
## Import
59
+
60
+
Import is supported using the following syntax:
61
+
62
+
```shell
63
+
# A GitLab Personal Access Token can be imported using a key composed of `<user-id>:<token-id>`, e.g.
Description: "The token expires at midnight UTC on that date. The date must be in the format YYYY-MM-DD. Default is never.",
81
-
Type: schema.TypeString,
82
-
Optional: true,
83
-
ForceNew: true,
84
-
ValidateDiagFunc: func(iinterface{}, p cty.Path) diag.Diagnostics {
85
-
v:=i.(string)
86
-
87
-
if_, err:=time.Parse("2006-01-02", v); err!=nil {
88
-
returndiag.Errorf("expected %q to be a valid YYYY-MM-DD date, got %q: %+v", p, i, err)
89
-
}
90
-
91
-
returnnil
92
-
},
79
+
Description: "The token expires at midnight UTC on that date. The date must be in the format YYYY-MM-DD. Default is never.",
80
+
Type: schema.TypeString,
81
+
Optional: true,
82
+
ForceNew: true,
83
+
ValidateDiagFunc: isISO6801Date,
93
84
},
94
85
"token": {
95
86
Description: "The group access token. This is only populated when creating a new group access token. This attribute is not available for imported resources.",
@@ -237,6 +228,6 @@ func resourceGitlabGroupAccessTokenDelete(ctx context.Context, d *schema.Resourc
0 commit comments