官术网_书友最值得收藏!

Getting ready

To perform the following example, you will need an AWS account and have access to secret keys for use in your Python code. They will be unique to your account.  We will use the boto3 library for S3 access. You can install this using pip install boto3.  Also, you will need to have environment variables set to authenticate.  These will look like the following:

AWS_ACCESS_KEY_ID=AKIAIDCQ5PH3UMWKZEWA
AWS_SECRET_ACCESS_KEY=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

These are available in the AWS portal under IAM (Identity Access Management) portion of the portal.

It's a good practice to put these keys in environment variables.  Having them in code can lead to their theft.  During the writing of this book, I had this hard coded and accidentally checked them in to GitHub.  The next morning I woke up to critical messages from AWS that I had thousands of servers running!  There are GitHub scrapers looking for these keys and they will get found and use for nefarious purposes.  By the time I had them all turned off, my bill was up to $6000, all accrued overnight. Thankfully, AWS waived these fees!
主站蜘蛛池模板: 开封市| 玉溪市| 灵宝市| 裕民县| 车险| 雅江县| 吉安县| 阿拉善左旗| 塘沽区| 蒲江县| 东台市| 凤庆县| 蚌埠市| 伊宁县| 大丰市| 汉寿县| 建始县| 张掖市| 柳河县| 来宾市| 台中县| 如东县| 绩溪县| 吉水县| 扶沟县| 灵山县| 岚皋县| 凤庆县| 来宾市| 巴南区| 德格县| 瓦房店市| 阿鲁科尔沁旗| 新龙县| 远安县| 利辛县| 浦城县| 营口市| 镶黄旗| 任丘市| 马尔康县|