How to choose an AWS profile when using boto3 to connect to CloudFront

后端 未结 4 925
醉话见心
醉话见心 2020-11-30 19:19

I am using the Boto 3 python library, and want to connect to AWS CloudFront. I need to specify the correct AWS Profile (AWS Credentials), but looking at the official documen

4条回答
  •  孤独总比滥情好
    2020-11-30 19:57

    This section of the boto3 documentation is helpful.

    Here's what worked for me:

    session = boto3.Session(profile_name='dev')
    client = session.client('cloudfront')
    

提交回复
热议问题