Skip to content

Commit 8c7e8b4

Browse files
committed
Integrate the new library
1 parent d8e4ab4 commit 8c7e8b4

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

docs/resources/project_access_token.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ This resource allows you to create and manage Project Access Token for your GitL
66
## Example Usage
77

88
```hcl
9-
resource "gitlab_deploy_token" "example" {
10-
project = "example/deploying"
9+
resource "gitlab_project_access_token" "example" {
10+
project = "25"
1111
name = "Example project access token"
1212
expires_at = "2020-03-14"
1313
@@ -19,9 +19,9 @@ resource "gitlab_deploy_token" "example" {
1919

2020
The following arguments are supported:
2121

22-
* `project` - (Required, string) The id of the project to add the deploy token to.
22+
* `project` - (Required, string) The id of the project to add the project access token to.
2323

24-
* `name` - (Required, string) A name to describe the deploy token with.
24+
* `name` - (Required, string) A name to describe the project access token.
2525

2626
* `expires_at` - (Optional, string) Time the token will expire it, YYYY-MM-DD format. Will not expire per default.
2727

@@ -31,7 +31,7 @@ The following arguments are supported:
3131

3232
The following attributes are exported in addition to the arguments listed above:
3333

34-
* `token` - The secret token. This is only populated when creating a new deploy token.
34+
* `token` - The secret token. This is only populated when creating a new project access token.
3535

3636
* `active` - True if the token is active.
3737

gitlab/resource_gitlab_project_access_token.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ func resourceGitlabProjectAccessTokenCreate(d *schema.ResourceData, meta interfa
9191
log.Printf("[DEBUG] create gitlab ProjectAccessToken %s %s", *options.Name, options.Scopes)
9292

9393
if v, ok := d.GetOk("expires_at"); ok {
94-
parsedExpiresAt, err := time.Parse("2006-01-02", v.(string))
94+
var parsedExpiresAt gitlab.ISOTime
95+
err := parsedExpiresAt.UnmarshalJSON([]byte(v.(string)))
9596
if err != nil {
9697
return fmt.Errorf("Invalid expires_at date: %v", err)
9798
}

go.mod

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ module github.com/gitlabhq/terraform-provider-gitlab
22

33
go 1.16
44

5-
replace github.com/xanzy/go-gitlab => github.com/randomswdev/go-gitlab v0.46.1-0.20210311212325-5c6b3b46bea4
6-
75
require (
86
github.com/bflad/tfproviderlint v0.27.0
97
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320

0 commit comments

Comments
 (0)