Output the result of a plan to a file so we can run a delete by reading the logs to delete from file. This would avoid having to hit the aws apis twice to get the same log groups. You could also remove some logs from a selection.
It will delete all log groups in a region in AWS. We should consider adding a warning prompting the user to confirm the action. We should also provide an option of forcing the delete without prompt by using a --force command.
After an API gateway is deleted we can no longer find the log groups in Cloudwatch.
Loop through all API Gateway cloudwatch logs and find log groups where the corresponding api no longer exists. Add these at the end of a plan and delete as floating logs deemed safe to delete.
Currently the application can either obtain AWS credentials from environment variables, or the shared credentials file. But, in the latter case it seems to be only capable of using the default profile.
It would be desirable to let users specify the AWS profile to use (and a region too) as a program argument.
Log groups are filtered by testing whether the log group name contains a string. But, for API gateways the behavior is different. They are filtered by whether their name starts with a given string. For consistency, API gateway should just check whether the string is contained in the name.