2 ms·
Depending on the day of the week, I might be doing a standard enterprisey dev project or I might be doing a “DevOps” project automating some things around AWS (
by scarface74 4y ago
Depending on the day of the week, I might be doing a standard enterprisey dev project or I might be doing a “DevOps” project automating some things around AWS (where I work in ProServe) using the AWS SDK.
Before ChatGPT, I would spend a lot of time searching on Google for the right API call and the response structure:
Problem: I need a simple Python script that list roles in an AWS account that has at least one of a list of command line specified policies.
Before ChatGPT: I would look up the api call to list the roles (the API service area of AWS is huge), then look up the API call to list the policies for the role and then look up the API call for the “paginator” that pages through all of the results since the API call only returns 50 results at a time.
After ChatGPT:
“Write a Python script that allows me to specify a list of AWS IAM roles that contain at least one of a given list of policies”.
I get “working” code and then I start polishing it.
“Use argparse with required parameters and use a paginator to iterate through the roles”
Again expected results.
“I need the list of ARNs printed out as a comma separated list”.
I copy the code into VSCode, test it, and I’m done.
Later on for another project, the customer prefers JavaScript. I copy the code into ChatGPT, and tell it to convert it into JavaScript. It works perfectly and is idiomatic JS along with proper async/await handling
- bob29 4y agoLol dude I just googled “script list IAM roles that contain policy” and this was the top result. Probably less typing than the usual silly authoritative tone people use when composing an “AI” prompt , like they’re Tony Stark or Captain Picard . And trust me, once u google stack overflow enough pretty soon you won’t need to ask anyone how to output a csv https://stackoverflow.com/questions/66127551/list-of-all-roles-with-attached-policies-with-boto3 https://stackoverflow.com/questions/66127551/list-of-all-rol...
- scarface74 4y agothat’s true. But that code snippet didn’t meet all the requirements. I laid out. And it definitely was less typing using ChatGPT once you add all of the requirements I laid out. And then there is the context switch. This is just one little script as part of a larger system where I’m designing an entire system. It’s much easier if I’m already writing out a long set of documentation, diagrams, slides, etc just to open ChatGPT and keep writing English. Not to mention when you’re juggling a couple of projects and one is Node and one is Python. And just in case you are trying to gatekeep, I’ve been programming for a few years - let’s just say my first hobbyist code was in 65C02 assembly language in 1986
- issa 4y agoI agree completely. Hilarious example. But, hell, if a product's pitch is "you'll feel like Tony Stark or Captain Picard" it will probably be successful.
- deleted 4y ago[deleted]
- scarface74 4y agoThe entire thesis is that ChatGPT can give better results than Google. ChatGPT gave me a specific answer with the command line arguments that I specified and allowed me to specify a list of policies and output the result in the format I needed Google gave me a code snippet that I had to modify for my use case.