@@ -9,7 +9,8 @@ description: |-
9
9
<!-- Please do not edit this file, it is generated. -->
10
10
# tfe_team_token
11
11
12
- Generates a new team token and overrides existing token if one exists.
12
+ Generates a new team token. If a description is not set, then it follows the legacy behavior to override
13
+ the single team token without a description if it exists.
13
14
14
15
## Example Usage
15
16
@@ -32,7 +33,12 @@ class MyConvertedCode extends TerraformStack {
32
33
name: " my-team-name" ,
33
34
organization: " my-org-name" ,
34
35
});
35
- const tfeTeamTokenTest = new TeamToken (this , " test_1" , {
36
+ new TeamToken (this , " ci" , {
37
+ description: " my second team token" ,
38
+ teamId: test .id ,
39
+ });
40
+ const tfeTeamTokenTest = new TeamToken (this , " test_2" , {
41
+ description: " my team token" ,
36
42
teamId: test .id ,
37
43
});
38
44
/* This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
@@ -47,12 +53,14 @@ class MyConvertedCode extends TerraformStack {
47
53
The following arguments are supported:
48
54
49
55
* ` teamId ` - (Required) ID of the team.
50
- * ` forceRegenerate ` - (Optional) If set to ` true ` , a new token will be
51
- generated even if a token already exists. This will invalidate the existing
52
- token!
56
+ * ` description ` - (Optional) The token's description, which must be unique per team. Required if creating multiple
57
+ tokens for a single team.
53
58
* ` expiredAt ` - (Optional) The token's expiration date. The expiration date must be a date/time string in RFC3339
54
59
format (e.g., "2024-12-31T23:59:59Z"). If no expiration date is supplied, the expiration date will default to null and
55
60
never expire.
61
+ * ` forceRegenerate ` - (Optional) Only applies to legacy tokens without descriptions. If set to ` true ` , a new
62
+ token will be generated even if a token already exists. This will invalidate the existing token! This cannot
63
+ be set with ` description ` .
56
64
57
65
## Example Usage
58
66
@@ -82,6 +90,7 @@ class MyConvertedCode extends TerraformStack {
82
90
rotation_days: 30 ,
83
91
});
84
92
const tfeTeamTokenTest = new TeamToken (this , " test_2" , {
93
+ description: " my team token" ,
85
94
expiredAt: Token .asString (example .rotationRfc3339 ),
86
95
teamId: test .id ,
87
96
});
@@ -99,10 +108,14 @@ class MyConvertedCode extends TerraformStack {
99
108
100
109
## Import
101
110
102
- Team tokens can be imported; use ` <TEAM ID> ` as the import ID. For example:
111
+ Team tokens can be imported either by ` <TOKEN ID> ` or by ` <TEAM ID> ` . Using the team ID will follow the
112
+ legacy behavior where the imported token is the single token of the team that has no description.
113
+
114
+ For example:
103
115
104
116
``` shell
117
+ terraform import tfe_team_token.test at-47qC3LmA47piVan7
105
118
terraform import tfe_team_token.test team-47qC3LmA47piVan7
106
119
```
107
120
108
- <!-- cache-key: cdktf-0.20.8 input-81ad21e38f7d39a442070952309741b9fc85572d00ada484fd6850ada6613dff -->
121
+ <!-- cache-key: cdktf-0.20.8 input-292898c6eaed44c7a5d55942b397c8db6d933d9f88e258bb804dbd6e2a77157c -->
0 commit comments