public static void enableTimeToLiveOnTable(final DynamoDbClient dynamoDbClient,
                                               final String tableName,
                                               final String ttlAttributeName) {
        FunctionUtils.doAndHandle(__ -> {
            val ttlSpec = TimeToLiveSpecification.builder()
                .attributeName(ttlAttributeName)
                .enabled(true)
                .build();
            val request = UpdateTimeToLiveRequest.builder()
                .tableName(tableName)
                .timeToLiveSpecification(ttlSpec)
                .build();
            dynamoDbClient.updateTimeToLive(request);
        });
    }
Enable time to live on table.

@param dynamoDbClient   the dynamo db client
@param tableName        the table name
@param ttlAttributeName the ttl attribute name
support/cas-server-support-dynamodb-core/src/main/java/org/apereo/cas/dynamodb/DynamoDbTableUtils.java