class Expiration
| Language | Type name |
|---|---|
.NET | Amazon.CDK.Expiration |
Java | software.amazon.awscdk.core.Expiration |
Python | aws_cdk.core.Expiration |
TypeScript (source) | @aws-cdk/core » Expiration |
Represents a date of expiration.
The amount can be specified either as a Date object, timestamp, Duration or string.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as cdk from '@aws-cdk/core';
const expiration = cdk.Expiration.after(cdk.Duration.minutes(30));
Properties
| Name | Type | Description |
|---|---|---|
| date | date | Expiration value as a Date object. |
date
Type:
date
Expiration value as a Date object.
Methods
| Name | Description |
|---|---|
| is | Check if Exipiration expires after input. |
| is | Check if Exipiration expires before input. |
| to | Exipration Value in a formatted Unix Epoch Time in seconds. |
| static after(t) | Expire once the specified duration has passed since deployment time. |
| static at | Expire at the specified date. |
| static at | Expire at the specified timestamp. |
| static from | Expire at specified date, represented as a string. |
isAfter(t)
public isAfter(t: Duration): boolean
Parameters
- t
Duration— the duration to check against.
Returns
boolean
Check if Exipiration expires after input.
isBefore(t)
public isBefore(t: Duration): boolean
Parameters
- t
Duration— the duration to check against.
Returns
boolean
Check if Exipiration expires before input.
toEpoch()
public toEpoch(): number
Returns
number
Exipration Value in a formatted Unix Epoch Time in seconds.
static after(t)
public static after(t: Duration): Expiration
Parameters
- t
Duration— the duration to wait before expiring.
Returns
Expire once the specified duration has passed since deployment time.
static atDate(d)
public static atDate(d: date): Expiration
Parameters
- d
date— date to expire at.
Returns
Expire at the specified date.
static atTimestamp(t)
public static atTimestamp(t: number): Expiration
Parameters
- t
number— timestamp in unix milliseconds.
Returns
Expire at the specified timestamp.
static fromString(s)
public static fromString(s: string): Expiration
Parameters
- s
string— the string that represents date to expire at.
Returns
Expire at specified date, represented as a string.

.NET
Java
Python
TypeScript (