@@ -7,7 +7,8 @@ description: |-
7
7
8
8
# tfe_team_token
9
9
10
- Generates a new team token and overrides existing token if one exists.
10
+ Generates a new team token. If a description is not set, then it follows the legacy behavior to override
11
+ the single team token without a description if it exists.
11
12
12
13
## Example Usage
13
14
@@ -20,7 +21,13 @@ resource "tfe_team" "test" {
20
21
}
21
22
22
23
resource "tfe_team_token" "test" {
23
- team_id = tfe_team.test.id
24
+ team_id = tfe_team.test.id
25
+ description = "my team token"
26
+ }
27
+
28
+ resource "tfe_team_token" "ci" {
29
+ team_id = tfe_team.test.id
30
+ description = "my second team token"
24
31
}
25
32
```
26
33
@@ -29,12 +36,14 @@ resource "tfe_team_token" "test" {
29
36
The following arguments are supported:
30
37
31
38
* ` team_id ` - (Required) ID of the team.
32
- * ` force_regenerate ` - (Optional) If set to ` true ` , a new token will be
33
- generated even if a token already exists. This will invalidate the existing
34
- token!
39
+ * ` description ` - (Optional) The token's description, which must be unique per team. Required if creating multiple
40
+ tokens for a single team.
35
41
* ` expired_at ` - (Optional) The token's expiration date. The expiration date must be a date/time string in RFC3339
36
42
format (e.g., "2024-12-31T23:59:59Z"). If no expiration date is supplied, the expiration date will default to null and
37
43
never expire.
44
+ * ` force_regenerate ` - (Optional) Only applies to legacy tokens without descriptions. If set to ` true ` , a new
45
+ token will be generated even if a token already exists. This will invalidate the existing token! This cannot
46
+ be set with ` description ` .
38
47
39
48
## Example Usage
40
49
@@ -52,6 +61,7 @@ resource "time_rotating" "example" {
52
61
53
62
resource "tfe_team_token" "test" {
54
63
team_id = tfe_team.test.id
64
+ description = "my team token"
55
65
expired_at = time_rotating.example.rotation_rfc3339
56
66
}
57
67
```
@@ -63,8 +73,12 @@ resource "tfe_team_token" "test" {
63
73
64
74
## Import
65
75
66
- Team tokens can be imported; use ` <TEAM ID> ` as the import ID. For example:
76
+ Team tokens can be imported either by ` <TOKEN ID> ` or by ` <TEAM ID> ` . Using the team ID will follow the
77
+ legacy behavior where the imported token is the single token of the team that has no description.
78
+
79
+ For example:
67
80
68
81
``` shell
82
+ terraform import tfe_team_token.test at-47qC3LmA47piVan7
69
83
terraform import tfe_team_token.test team-47qC3LmA47piVan7
70
84
```
0 commit comments