Skip to content

Commit 1954baa

Browse files
committed
Update documentation for team tokens
1 parent 12ef62a commit 1954baa

File tree

1 file changed

+20
-6
lines changed

1 file changed

+20
-6
lines changed

website/docs/r/team_token.html.markdown

+20-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ description: |-
77

88
# tfe_team_token
99

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.
1112

1213
## Example Usage
1314

@@ -20,7 +21,13 @@ resource "tfe_team" "test" {
2021
}
2122
2223
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"
2431
}
2532
```
2633

@@ -29,12 +36,14 @@ resource "tfe_team_token" "test" {
2936
The following arguments are supported:
3037

3138
* `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.
3541
* `expired_at` - (Optional) The token's expiration date. The expiration date must be a date/time string in RFC3339
3642
format (e.g., "2024-12-31T23:59:59Z"). If no expiration date is supplied, the expiration date will default to null and
3743
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`.
3847

3948
## Example Usage
4049

@@ -52,6 +61,7 @@ resource "time_rotating" "example" {
5261
5362
resource "tfe_team_token" "test" {
5463
team_id = tfe_team.test.id
64+
description = "my team token"
5565
expired_at = time_rotating.example.rotation_rfc3339
5666
}
5767
```
@@ -63,8 +73,12 @@ resource "tfe_team_token" "test" {
6373

6474
## Import
6575

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:
6780

6881
```shell
82+
terraform import tfe_team_token.test at-47qC3LmA47piVan7
6983
terraform import tfe_team_token.test team-47qC3LmA47piVan7
7084
```

0 commit comments

Comments
 (0)