aws-cloudformation / cloudformation-cli-python-plugin

The CloudFormation Provider Development Toolkit Python Plugin allows you to autogenerate Python code based on an input schema.
Apache License 2.0
108 stars 45 forks source link

Timeout Implementation without schema values and entry point values #245

Open carpnick opened 1 year ago

carpnick commented 1 year ago

Looking at the contract as written, how do I guarantee the following lines?(see quoted below). From what I can tell, no plugin(this one included) contains the original start time of the resource call. Is it my handler's problem to track original call time in the callback context? Shouldnt this be included on the generated classes or within the framework Models? I can then just interrogate and respond with error, or even better let framework respond with error... Right now as written in contract - we dont know when to return since we do not have the start time and the resource schema of timeoutinMinutes is not exposed to us via any generated classes, correct? I see it is used to set maximum time on assuming the role only. That doesnt allow us to honor contract for less than 60 minutes for a single request: see here

As I see it we need at least 2 values to make the implementation somewhat generic:

Contract Lines

A create handler MUST return FAILED progress event if it can't reach the desired-state within the timeout specified in the resource schema.

An update handler MUST return FAILED progress event if it can't reach the desired-state within the timeout specified in the resource schema.

A delete handler MUST return FAILED progress event if it can't reach the desired-state within the timeout specified in the resource schema.

Originally posted by @carpnick in https://github.com/aws-cloudformation/cloudformation-cli-python-plugin/discussions/243