Add a permission to a lambda function.

    Returns {added: true} if the permission was added and returns
    {added: False} if the permission was not added.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_lamba.add_permission my_function my_id "lambda:*" \\
                           s3.amazonaws.com aws:arn::::bucket-name \\
                           aws-account-id

def add_permission(FunctionName, StatementId, Action, Principal, SourceArn=None,
                   SourceAccount=None, Qualifier=None,
                   region=None, key=None, keyid=None, profile=None):
    '''
    Add a permission to a lambda function.

    Returns {added: true} if the permission was added and returns
    {added: False} if the permission was not added.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_lamba.add_permission my_function my_id "lambda:*" \\
                           s3.amazonaws.com aws:arn::::bucket-name \\
                           aws-account-id

    '''

    try:
        conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
        kwargs = {}
        for key in ('SourceArn', 'SourceAccount', 'Qualifier'):
            if locals()[key] is not None:
                kwargs[key] = str(locals()[key])  # future lint: disable=blacklisted-function
        conn.add_permission(FunctionName=FunctionName, StatementId=StatementId,
                            Action=Action, Principal=str(Principal),  # future lint: disable=blacklisted-function
                            **kwargs)
        return {'updated': True}
    except ClientError as e:
        return {'updated': False, 'error': __utils__['boto3.get_error'](e)}