ContextProvider

class aws_cdk.core.ContextProvider

Bases: object

Base class for the model side of context providers.

Instances of this class communicate with context provider plugins in the ‘cdk toolkit’ via context variables (input), outputting specialized queries for more context variables (output).

ContextProvider needs access to a Construct to hook into the context mechanism.

stability :stability: experimental

Static Methods

classmethod get_key(scope, *, provider, props=None)
Parameters
  • scope (Construct) –

  • options

  • provider (str) – The context provider to query.

  • props (Optional[Mapping[str, Any]]) – Provider-specific properties.

return :rtype: GetContextKeyResult :return: the context key or undefined if a key cannot be rendered (due to tokens used in any of the props)

stability :stability: experimental

classmethod get_value(scope, *, dummy_value, provider, props=None)
Parameters
  • scope (Construct) –

  • options

  • dummy_value (Any) – The value to return if the context value was not found and a missing context is reported. This should be a dummy value that should preferably fail during deployment since it represents an invalid state.

  • provider (str) – The context provider to query.

  • props (Optional[Mapping[str, Any]]) – Provider-specific properties.

stability :stability: experimental

Return type

GetContextValueResult