def add_permission(FunctionName, StatementId, Action, Principal, SourceArn=None,
                   SourceAccount=None, Qualifier=None,
                   region=None, key=None, keyid=None, profile=None):

    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])
        conn.add_permission(FunctionName=FunctionName, StatementId=StatementId,
                                   Action=Action, Principal=str(Principal),
                                   **kwargs)
        return {'updated': True}
    except ClientError as e:
        return {'updated': False, 'error': salt.utils.boto3.get_error(e)}
.. versionadded:: 2015.8.0
dataset/ETHPy150Open saltstack/salt/salt/modules/boto_lambda.py/add_permission--crossover with--dataset/ETHPy150Open saltstack/salt/salt/cloud/clouds/msazure.py/create_affinity_group