# Value Expiration

Parameter Value Expiration gives us the ability to either visually alert or automatically rotate a parameter's values via a user specified duration. This is useful when a company policy requires secrets to be rotated on a regular basis.

Parameter Value Expiration can be set during creation or added to existing parameters.

## Setting a parameter to not change on expiration

This example will show how to create an expiring parameter which does not automatically change the parameter's environment values. Visual indication only.

1. Start by creating a new parameter
2. Check the `EXPIRES` option
3. Set the `EXPIRES IN:` duration

<figure><img src="https://2952342643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MGjN2Xg1mE8iTvg49dw%2Fuploads%2FLaitBpTuAvG6QhKCsxPU%2Fimage.png?alt=media&#x26;token=ad0af14e-18e6-47a1-8f5f-44df306ae3a4" alt="" width="465"><figcaption></figcaption></figure>

4. Add the `ENVIRONMENT VALUE` in the `ADD ENVIRONMENT VALUE` modal, then click `Save`
5. Note the expiration duration is visible in the parameter's detail page:

<figure><img src="https://2952342643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MGjN2Xg1mE8iTvg49dw%2Fuploads%2FhpxzEkY98c5budSaJDbK%2Fimage.png?alt=media&#x26;token=7a917450-6ea7-48e1-86ea-6c4edb974e41" alt=""><figcaption></figcaption></figure>

6. Go back the Parameter List to see the visual indicator next to the parameter's value and hover over the hourglass to quickly view the remaining duration before the parameter expires:

<figure><img src="https://2952342643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MGjN2Xg1mE8iTvg49dw%2Fuploads%2FcuYG8D4Hnmxsa2z4g9fB%2Fimage.png?alt=media&#x26;token=b1689856-ce4e-48e3-9620-c9f36b54103a" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
The hourglass icon will change colors at different stages:

* Black - expiration time is outside of 5 days
* Yellow - expiration time is within 5 days and has not yet expired
* Red - parameter value has expired
  {% endhint %}

## Setting a parameter to automatically rotate values on expiration

1. Start by creating a new parameter
2. Check the `EXPIRES` option
3. Set the `EXPIRES IN:` duration
4. Check the `AUTO-GENERATE VALUE:` option
5. Select and modify the options as needed. The `Generate Password` button is there as a convenience and will generate a copyable password-style string to be pasted into the `ADD ENVIRONMENT VALUE` modal displayed after clicking `Create Parameter` here:

<figure><img src="https://2952342643-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MGjN2Xg1mE8iTvg49dw%2Fuploads%2FbnGMiME9rB3IZxnP2kuR%2Fimage.png?alt=media&#x26;token=074e380e-e3c9-4ffd-a7cb-f2e0fe6dd4cb" alt="" width="465"><figcaption></figcaption></figure>

CloudTruth will check periodically for expired parameters and take the appropriate action to generate a new password and restart the duration clock.
