Provider

class aws_cdk.custom_resources.Provider(scope, id, *, on_event_handler, is_complete_handler=None, query_interval=None, total_timeout=None)

Bases: aws_cdk.core.Construct

Defines an AWS CloudFormation custom resource provider.

__init__(scope, id, *, on_event_handler, is_complete_handler=None, query_interval=None, total_timeout=None)
Parameters
  • scope (Construct) –

  • id (str) –

  • on_event_handler (IFunction) – The AWS Lambda function to invoke for all resource lifecycle operations (CREATE/UPDATE/DELETE). This function is responsible to begin the requested resource operation (CREATE/UPDATE/DELETE) and return any additional properties to add to the event, which will later be passed to isComplete. The PhysicalResourceId property must be included in the response.

  • is_complete_handler (Optional[IFunction]) – The AWS Lambda function to invoke in order to determine if the operation is complete. This function will be called immediately after onEvent and then periodically based on the configured query interval as long as it returns false. If the function still returns false and the alloted timeout has passed, the operation will fail. Default: - provider is synchronous. This means that the onEvent handler is expected to finish all lifecycle operations within the initial invocation.

  • query_interval (Optional[Duration]) – Time between calls to the isComplete handler which determines if the resource has been stabilized. The first isComplete will be called immediately after handler and then every queryInterval seconds, and until timeout has been reached or until isComplete returns true. Default: Duration.seconds(5)

  • total_timeout (Optional[Duration]) – Total timeout for the entire operation. The maximum timeout is 2 hours (yes, it can exceed the AWS Lambda 15 minutes) Default: Duration.minutes(30)

Return type

None

Methods

bind(_)

Called by CustomResource which uses this provider.

Parameters

_

deprecated :deprecated: use provider.serviceToken instead

stability :stability: deprecated

Return type

CustomResourceProviderConfig

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

is_complete_handler

The user-defined AWS Lambda function which is invoked asynchronously in order to determine if the operation is complete.

Return type

Optional[IFunction]

node

The construct tree node associated with this construct.

Return type

ConstructNode

on_event_handler

The user-defined AWS Lambda function which is invoked for all resource lifecycle operations (CREATE/UPDATE/DELETE).

Return type

IFunction

service_token

The service token to use in order to define custom resources that are backed by this provider.

Return type

str

Static Methods

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool