OpenWaterFoundation / owf-tstool-aws-plugin

Open Water Foundation AWS plugin for TSTool
GNU General Public License v3.0
0 stars 0 forks source link

AwsBilling - snapshot listing returns a large number of snapshots #49

Closed smalers closed 2 months ago

smalers commented 2 months ago

Listing snapshots seems to return a very large number of snapshots, for example from the TSTool log file. Need to figure out what is going on. The only filter I am using is region.

Status[2](AwsBilling_Command.doEc2Snapshots): Have 39906 snapshots for region eu-west-3
Status[2](AwsBilling_Command.doEc2Snapshots): Fetching snapshot data for region: eu-west-2
Status[2](AwsBilling_Command.doEc2Snapshots): Have 28370 snapshots for region ap-south-1
Status[2](AwsBilling_Command.doEc2Snapshots): Fetching snapshot data for region: eu-north-1
Status[2](AwsBilling_Command.doEc2Snapshots): Have 29297 snapshots for region eu-west-2
Status[2](AwsBilling_Command.doEc2Snapshots): Fetching snapshot data for region: eu-west-1
Status[2](AwsBilling_Command.doEc2Snapshots): Have 22036 snapshots for region eu-north-1
Status[2](AwsBilling_Command.doEc2Snapshots): Fetching snapshot data for region: eu-west-3
Status[2](AwsBilling_Command.doEc2Snapshots): Have 39906 snapshots for region eu-west-3
Status[2](AwsBilling_Command.doEc2Snapshots): Fetching snapshot data for region: eu-west-2
Status[2](AwsBilling_Command.doEc2Snapshots): Have 40690 snapshots for region eu-west-1
Status[2](AwsBilling_Command.doEc2Snapshots): Fetching snapshot data for region: ap-northeast-3
smalers commented 2 months ago

I updated the code to specify the current sessions AWS account number and it reduced the number of snapshots to a small number. It appears that this may list public shapshots, which explains the large number. See: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSnapshots.html. Defaulting the code to list snapshots for the account is probably the right thing to do.

smalers commented 2 months ago

After some testing, filtering on the account does seem like the right thing. Close this issue.