pingidentity / terraform-provider-pingone

Terraform PingOne provider
https://registry.terraform.io/providers/pingidentity/pingone/
Mozilla Public License 2.0
13 stars 6 forks source link

Add `expiration` support to `pingone_credential_type` resource and data source. #925

Open mjspi opened 3 weeks ago

mjspi commented 3 weeks ago

Community Note

Description

Properties that identify how to evaluate a credential type's expiration date and time are now supported for credentials configured using management.mode = AUTOMATED.

New or Affected Resource(s)

Potential Terraform Configuration

# Copy-paste your PingOne related Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.

# Remember to replace any account/customer sensitive information in the configuration before submitting the issue
resource "pingone_credential_type" "my_credential_type" {
    # ... other configuration params
    management_mode = "AUTOMATED"

    expiration {
      type = "HARD"  # Use "SOFT" if you want a user-defined expiration field

      # Option 1: Define expiration based on a specific timestamp
      timestamp = "2024-12-31T23:59:59Z"  # Specify a fixed expiration date in ISO 8601 format

      # Option 2: Define expiration after a specific duration
      after {
        duration = 30               # Number of time units before expiration (e.g., 30 days)
        time_unit = "DAYS"     # Time unit (e.g., SECONDS, MINUTES, HOURS, DAYS)
      }

      # Option 3: Define expiration with a custom expression
      expression = "now() + 30d"  # Example PingOne Expression Language (PEL) expression for 30 days from now

      # Optional: Specify the field name for SOFT expiration types only
      field_name = "credential_expiration"  # Only required for SOFT expiration type
    }   
}

References