Using redshift-data boto3 to make cross account redshift calls

0

HI

I am using Boto3 - redshift-data to connect/query to Redshift.

I would like to connect to a redshift cluster in a different account. Where do I set the account id or URL for cross account Redshift query ?

Currently I am doing:

redshift_client_data = boto3.client('redshift-data')
test_query = redshift_client_data.execute_statement(
        ClusterIdentifier='rs-****-d1',
        Database='dw1',
        DbUser='username',

        Sql='select * from ***.address_data limit 35;',

    )

How do we modify clusterIdentifier to do cross account calls ? Thanks

已提问 2 年前3076 查看次数
2 回答
0

See https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html : "To run a query on a cluster that is owned by another account, the owning account must provide an IAM role that the Data API can assume in the calling account."

专家
已回答 2 年前
AWS
专家
已审核 2 年前
0

You can/should specify and API KEY & ID when you're constructing your client which refers to an identity in the target account.

redshift_client = boto3.client('redshift-data',
            aws_access_key_id='abc',
            aws_secret_access_key='123'
        )
profile pictureAWS
专家
Rajiv_G
已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则