Пример #1
0
    def test_get_lambda_config_property_without_property(
            self, mock_boto3_client):
        properties = {"key1": 42, "key2": "string", "key3": [2, 3]}
        property_dict = {"Description": json.dumps(properties)}
        mock_boto3_client.return_value = self.BotoClient(property_dict)

        self.assertEqual(get_lambda_config_property(self.context), properties)
def update_sqs_permissions(event, context):
    """ Institute permission for all accountids in the USofA on sqs queue
    Deletes permission before re-adding if permission-set exists
    Return None
    """
    properties = get_lambda_config_property(context)
    accounts = get_usofa_account_ids(properties['usofa_bucket'])
    delete_permissions(properties['queue_url'], properties['label'])
    set_permissions(properties['queue_url'], properties['label'], properties['permissions'], accounts)
Пример #3
0
def update_sqs_permissions(event, context):
    """ Institute permission for all accountids in the USofA on sqs queue
    Deletes permission before re-adding if permission-set exists
    Return None
    """
    properties = get_lambda_config_property(context)
    accounts = get_usofa_account_ids(properties['usofa_bucket'])
    delete_permissions(properties['queue_url'], properties['label'])
    set_permissions(properties['queue_url'], properties['label'],
                    properties['permissions'], accounts)
Пример #4
0
    def test_get_lambda_config_property_without_property(self, mock_boto3_client):
        properties = {
            "key1": 42,
            "key2": "string",
            "key3": [2, 3]
        }
        property_dict = {"Description": json.dumps(properties)}
        mock_boto3_client.return_value = self.BotoClient(property_dict)

        self.assertEqual(get_lambda_config_property(self.context), properties)