'Implements the ListStackResources API action.
Return summary of the resources belonging to the specified stack.'

def list_stack_resources(self, req):

    self._enforce(req, 'ListStackResources')
    def format_resource_summary(r):
        'Reformat    engine    output    to    AWS    "StackResourceSummary"    format.'
        keymap = {rpc_api.RES_UPDATED_TIME: 'LastUpdatedTimestamp', rpc_api.RES_NAME: 'LogicalResourceId', rpc_api.RES_PHYSICAL_ID: 'PhysicalResourceId', rpc_api.RES_STATUS_DATA: 'ResourceStatusReason', rpc_api.RES_TYPE: 'ResourceType'}
        result = api_utils.reformat_dict_keys(keymap, r)
        result['ResourceStatus'] = self._resource_status(r)
        return result
    con = req.context
    try:
        identity = self._get_identity(con, req.params['StackName'])
        resources = self.rpc_client.list_stack_resources(con, stack_identity=identity)
    except Exception as ex:
        return exception.map_remote_error(ex)
    summaries = [format_resource_summary(r) for r in resources]
    return api_utils.format_response('ListStackResources', {'StackResourceSummaries': summaries})
