Open dupuy opened 8 months ago
Thank you for reaching out with your concerns and observations regarding the aws-nuke-exporter
tool. I'd like to address each of your points as follows:
Export Format Issue (Fixed): I'm glad to inform you that the first issue regarding the export format has been corrected. Thanks for bringing this to our attention.
Incomplete Detail and Truncation Concerns: Regarding your second point, it seems you're encountering issues with lines in the aws-nuke
output that have missing closing brackets or are marked with <<OutputTruncated>>
. This typically indicates that the details data is too long and gets truncated in the output. To better assist you, could you please provide more specific examples or clarify the exact nature of the problem you're facing? This will help us understand the issue in depth and explore potential solutions.
Additional Examples and Handling Specific Cases: For the third point, I've added examples in the sample_output/sample_nuke_output.txt
file to demonstrate how the tool handles resources like ECSTask
and NeptuneSnapshot
, including cases where the ID is missing, or the details are incomplete. These examples should help clarify how the exporter processes various scenarios and ensures that the output remains informative and structured.
Regarding the resource type NetpuneSnapshot
(possibly a typo for NeptuneSnapshot
), I acknowledge your concern about whether it's an error from aws-nuke, a bug in the boto code, or an issue with the AWS API itself. This is certainly something worth investigating further. However, as I'm currently limited in time, I encourage the community or other contributors to look into this peculiar case and share any findings or insights.
Your feedback is invaluable in helping us enhance the tool's functionality and reliability. Please feel free to provide any additional information or examples regarding the second point, and I'll do my best to address it promptly.
Thank you for your contribution to making aws-nuke-exporter
better.
Thanks for your very prompt response and the 1.0.3 release, which resolved the problems in two of the cases. However, it didn't correctly handle the missing ID or truncated Detail cases correctly, placing those into RemovalStatus:
% grep 'RemovalStatus": "[^cw]' sample_output/sample_nuke_output.json
"RemovalStatus": "[PolicyArn: \"xxx-xxx-xxx\", PolicyName: \"MigrationHubServiceRolePolicy\", RoleCreateDate: \"xxx-xxx-xxx\", RoleLastUsed: \"xxx-xxx-xxx\", RoleName: \"AWSServiceRoleForMigrationHub\", RolePath: \"/xxx-xxx-xxx - cannot detach from service roles"
"RemovalStatus": "[PolicyName: \"terraform-2023111309155894560000000c\", role:CreateDate:<<OutputTruncated>>"
"RemovalStatus": "arn:aws:ecs:us-east-1:xxxx:cluster/ecs-cluster-xxxx - [ClusterARN: \"arn:aws:ecs:us-east-1:xxxx:cluster/ecs-cluster-xxxx\", TaskARN: \"arn:aws:ecs:us-east-1:xxxx:task/ecs-cluster-xxxx/xxxxxxxxxxxx\"] - would remove"
Also, the sample TXT output for the missing ID case had an ID with ->
, rather than no ID at all, which is the output I get from aws-nuke 2.25.0, the most recent release (from last August). I don't know if there were earlier releases with different behavior.
Anyhow, I came up with PR #6, which handles all the sample cases pretty reasonably (there's no perfect solution for truncated output). Unfortunately you can't use the same name for multiple match groups, which complicates the code a bit, but it's not too painful.
A quick google search turned up the reason for the typo NetpuneSnapshot
: https://github.com/rebuy-de/aws-nuke/issues/1108 and a fix was made last September (but there has been no release since last August).
The
sample_output
folder demonstrates this for two of the three cases:-
is omitted:aws-nuke only prints details when it is possible to filter based on properties. Not all resource types support this.
]
is omitted (scroll right to see<<OutputTruncated>>
):Apparently, sometimes the Details data gets too long and is truncated? I haven't seen this, but it is in your samples.
Some resource types don't have an ID that can be used for filtering, and aws-nuke can only filter with properties. For these, aws-nuke doesn't print an ID, but just skips ahead to Details.
The above cases should be sufficient for test purposes, but I can provide some more (obfuscated) examples.
An entry of particular interest is the one for the resource type
NetpuneSnapshot
(sic). I don't know if this is an aws-nuke error or a bug in the boto code, or in the AWS API itself, nor whether you can use that type for filters (and if you can, whether the filter works correctly). This would bear further investigation, but I dont have time right now.Here is a more extensive list