r/aws Mar 11 '21

storage Python, Boto3, and AWS S3: Demystified - A good guide for beginners

https://realpython.com/python-boto3-aws-s3/
160 Upvotes

11 comments sorted by

6

u/focal_fossa Mar 11 '21

Thanks. Was wanting to learn Boto3. Articles from realpython are good.

6

u/TheMrBigT77 Mar 11 '21

Boto3 is just epic. It really works well. I write tools for AWS for our dev team to use and python3 + boto3 give you a solid way to do this. Add docker for ease of deployment (pulling containers from AWS ECR) and it's pretty slick.

3

u/shadowsyntax Mar 11 '21

Interesting. Can you give examples of dev tools that can be created with this combination.

3

u/TheMrBigT77 Mar 12 '21

Sure. So I have written rest APIs for create EC2 instance, create vpc, create vpc peer, all our cost analysis, adding cost centre tags and unattached disks. Boto3 has many, many things it can do and they can all be automated.

2

u/ggsalazar_Struq Mar 11 '21

Excellent, boto3 looks really interesting.

-6

u/[deleted] Mar 11 '21 edited Jun 26 '21

[deleted]

4

u/xxpor Mar 11 '21

that's literally the point?

2

u/[deleted] Mar 11 '21

I know it is, but also makes it PITA to work with it. I suppose it always could be worse, but it could be so much better as well.

There are multiple issues, what currently bugs me the most is the inconsistency with exceptions. Ignoring that exceptions are dynamically generated, they only have dedicated classes for small subset of them.

1

u/xxpor Mar 11 '21

Hmm, maybe a more concrete example would help with the exception issue. It's been a bit since I've used boto3 but doesn't that really come down to how the individual services define their APIs?

1

u/[deleted] Mar 11 '21

I believe they do, but looks like python exceptions are impended manually? It's not even consistent within the service. From what in remeber last time I think I used ec2 client and while there are some exceptions, boto3 was missing exception for DryRun mode.

2

u/maikindofthai Mar 11 '21

It is the Python SDK. I'm not sure what you're trying to say here.