3 ms·
This is a script I told ChatGPT to write. “Write a Python script that returns a comma separated list of arns of all AWS roles that contain policies I specify w
by scarface74 4y ago
This is a script I told ChatGPT to write.
“Write a Python script that returns a comma separated list of arns of all AWS roles that contain policies I specify with the “-p” parameter using argparse”
Then I noticed there was a bug, AWS API calls are paginated and it would only return the first 50 results.
“that won’t work with more than 50 roles”
Then it modified the code to use “paginators”
Yes, you can find similar code on StackOverflow
https://stackoverflow.com/questions/66127551/list-of-all-roles-with-attached-policies-with-boto3 https://stackoverflow.com/questions/66127551/list-of-all-rol...
But ChatGPT met my specifications exactly.
ChatGPT “knows” the AWS SDK for Python pretty well. I’ve used it to write a dozen or so similar scripts. Some more complicated than the others.
- jeremyjh 4y agoOk that actually sounds hugely useful. It makes sense for very well known APIs it will get them quite accurately.
- scarface74 4y agoI wonder how well it would work if you seeded it with the inputs and outputs of custom APIs and then tell it to write code based on your API.
- jeremyjh 4y agoWell I'd hope that is what is going on in Copilot. It definitely does seem to be trained on my code to some extent, but it doesn't have anything I'd call a semantic understanding of it.