templates/storage.template.yaml [606:633]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            def timeout(event, context):
                print('Execution is about to time out, sending failure response to CloudFormation')
                cfnresponse.send(event, context, cfnresponse.FAILED, {}, None)
            def handler(event, context):
                # make sure we send a failure to CloudFormation if the function is going to timeout
                timer = threading.Timer((context.get_remaining_time_in_millis() / 1000.00) - 0.5, timeout, args=[event, context])
                timer.start()
                print('Received event: ' + json.dumps(event))
                status = cfnresponse.FAILED
                new_physical_id = None
                returnAttribute = {}
                try:
                    properties = event.get('ResourceProperties')
                    physical_id = event.get('PhysicalResourceId')
                    status, new_physical_id, returnAttribute = {
                        'Create': create,
                        'Update': update,
                        'Delete': delete
                    }.get(event['RequestType'], lambda x, y: (cfnresponse.FAILED, None))(properties, physical_id)
                except Exception as e:
                    print('Exception: ' + str(e))
                    status = cfnresponse.FAILED
                finally:
                    cfnresponse.send(event, context, status, returnAttribute, new_physical_id)
      Runtime: python3.6
      Timeout: 300
      TracingConfig:
        Mode: Active
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



templates/storage.template.yaml [696:723]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            def timeout(event, context):
                print('Execution is about to time out, sending failure response to CloudFormation')
                cfnresponse.send(event, context, cfnresponse.FAILED, {}, None)
            def handler(event, context):
                # make sure we send a failure to CloudFormation if the function is going to timeout
                timer = threading.Timer((context.get_remaining_time_in_millis() / 1000.00) - 0.5, timeout, args=[event, context])
                timer.start()
                print('Received event: ' + json.dumps(event))
                status = cfnresponse.FAILED
                new_physical_id = None
                returnAttribute = {}
                try:
                    properties = event.get('ResourceProperties')
                    physical_id = event.get('PhysicalResourceId')
                    status, new_physical_id, returnAttribute = {
                        'Create': create,
                        'Update': update,
                        'Delete': delete
                    }.get(event['RequestType'], lambda x, y: (cfnresponse.FAILED, None))(properties, physical_id)
                except Exception as e:
                    print('Exception: ' + str(e))
                    status = cfnresponse.FAILED
                finally:
                    cfnresponse.send(event, context, status, returnAttribute, new_physical_id)
      Runtime: python3.6
      Timeout: 300
      TracingConfig:
        Mode: Active
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



