Lazy

class aws_cdk.core.Lazy

Bases: object

Lazily produce a value.

Can be used to return a string, list or numeric value whose actual value will only be calculated later, during synthesis.

Static Methods

classmethod any_value(producer, *, display_hint=None, omit_empty_array=None)
Parameters
  • producer (IAnyProducer) –

  • options

  • display_hint (Optional[str]) – Use the given name as a display hint. Default: - No hint

  • omit_empty_array (Optional[bool]) – If the produced value is an array and it is empty, return ‘undefined’ instead. Default: false

Return type

IResolvable

classmethod list_value(producer, *, display_hint=None, omit_empty=None)
Parameters
  • producer (IListProducer) –

  • options

  • display_hint (Optional[str]) – Use the given name as a display hint. Default: - No hint

  • omit_empty (Optional[bool]) – If the produced list is empty, return ‘undefined’ instead. Default: false

Return type

List[str]

classmethod number_value(producer)
Parameters

producer (INumberProducer) –

Return type

Union[int, float]

classmethod string_value(producer, *, display_hint=None)
Parameters
  • producer (IStringProducer) –

  • options

  • display_hint (Optional[str]) – Use the given name as a display hint. Default: - No hint

Return type

str