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
Description: "Duration to control token silent regeneration based on token age. Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`. If set, then the token will be regenerated if it is older than `renew_after`. I.e. if `currentDate - issued_at > renew_after`.",
120
+
Optional: true,
121
+
ValidateFunc: validateDuration,
122
+
},
46
123
"renew_before": {
47
124
Type: schema.TypeString,
48
-
Description: "Duration to control token silent regeneration, valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`. If `expires_in` is set, Terraform will regenerate the token if `expires_in - renew_before < currentDate`.",
125
+
Description: "Duration to control token silent regeneration based on remaining token lifetime. If `expires_in` is set, Terraform will regenerate the token if `expires_at - currentDate < renew_before`. Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h`.",
49
126
Optional: true,
50
127
ValidateFunc: validateDuration,
51
128
RequiredWith: []string{"expires_in"},
@@ -138,6 +215,7 @@ func resourceArgoCDProjectTokenCreate(ctx context.Context, d *schema.ResourceDat
138
215
}
139
216
140
217
renewBefore:=int64(renewBeforeDuration.Seconds())
218
+
141
219
ifrenewBefore>expiresIn {
142
220
return []diag.Diagnostic{
143
221
{
@@ -146,16 +224,6 @@ func resourceArgoCDProjectTokenCreate(ctx context.Context, d *schema.ResourceDat
146
224
},
147
225
}
148
226
}
149
-
150
-
// Arbitrary protection against misconfiguration
151
-
if300>expiresIn-renewBefore {
152
-
return []diag.Diagnostic{
153
-
{
154
-
Severity: diag.Error,
155
-
Summary: "token will expire within 5 minutes, check your settings",
0 commit comments