Expiration

class aws_cdk.core.Expiration(*args, **kwargs)

Bases: object

Represents a date of expiration.

The amount can be specified either as a Date object, timestamp, Duration or string.

Methods

is_after(t)

Check if Exipiration expires after input.

Parameters

t (Duration) – the duration to check against.

Return type

bool

is_before(t)

Check if Exipiration expires before input.

Parameters

t (Duration) – the duration to check against.

Return type

bool

to_epoch()

Exipration Value in a formatted Unix Epoch Time in seconds.

Return type

Union[int, float]

Attributes

date

Expiration value as a Date object.

Return type

datetime

Static Methods

classmethod after(t)

Expire once the specified duration has passed since deployment time.

Parameters

t (Duration) – the duration to wait before expiring.

Return type

Expiration

classmethod at_date(d)

Expire at the specified date.

Parameters

d (datetime) – date to expire at.

Return type

Expiration

classmethod at_timestamp(t)

Expire at the specified timestamp.

Parameters

t (Union[int, float]) – timestamp in unix milliseconds.

Return type

Expiration

classmethod from_string(s)

Expire at specified date, represented as a string.

Parameters

s (str) – the string that represents date to expire at.

Return type

Expiration