def __init__(self, accounts, settings=None):
        queue_url = os.environ['gitlab_pr_submitter_queue_url']
        account = self.get_queue_account(accounts, queue_url)
        aws_api = AWSApi(1, accounts, settings=settings)
        session = aws_api.get_session(account)

        self.sqs = session.client('sqs')
        self.queue_url = queue_url
Пример #2
0
    def __init__(self, integration, accounts, settings=None):
        """Initiates S3 client from AWSApi."""
        self.state_path = f"state/{integration}"
        self.bucket = os.environ['APP_INTERFACE_STATE_BUCKET']
        account = os.environ['APP_INTERFACE_STATE_BUCKET_ACCOUNT']
        accounts = [a for a in accounts if a['name'] == account]
        aws_api = AWSApi(1, accounts, settings=settings)
        session = aws_api.get_session(account)

        self.client = session.client('s3')