class Expiration
Language | Type name |
---|---|
![]() | Amazon.CDK.Expiration |
![]() | github.com/aws/aws-cdk-go/awscdk/v2#Expiration |
![]() | software.amazon.awscdk.Expiration |
![]() | aws_cdk.Expiration |
![]() | aws-cdk-lib » 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-lib';
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 Expiration expires after input. |
is | Check if Expiration expires before input. |
to | Expiration 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 Expiration expires after input.
isBefore(t)
public isBefore(t: Duration): boolean
Parameters
- t
Duration
— the duration to check against.
Returns
boolean
Check if Expiration expires before input.
toEpoch()
public toEpoch(): number
Returns
number
Expiration 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.