welldone-cloud / aws-list-resources

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EC2::Host

michield opened this issue · comments

I tried this and it's very nice, thanks.

The only thing I notice is that it's not listing my EC2 hosts, even though EC2 has the List operation

Any idea?

Thank you for bringing this up! Are you looking for EC2 instances maybe? "AWS::EC2::Host" and "AWS::EC2::Instance" are two different things unfortunately... "Host" is a dedicated physical machine, while "Instance" are virtual machines. The AWS Cloud Control API unfortunately does not support "AWS::EC2::Instance" at the moment:
https://docs.aws.amazon.com/cloudcontrolapi/latest/userguide/supported-resources.html

I see that CloudFormation does support it though, so I'd be hoping that it's only a matter of time that the Cloud Control API will support it too:
https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ec2-instance.html

If you are looking to discover whether EC2 instances are present, there should be some workarounds though: aws-list-resources will find resource types that can give you a hint that EC2 instances are likely present: "AWS::EC2::Volume", "AWS::EC2::NetworkInterface", "AWS::IAM::InstanceProfile", "AWS::EC2::KeyPair" and "AWS::EC2::EIP". And if the account does not use the default VPC but spun up their own virtual network, there will also be additional resources for: "AWS::EC2::NetworkAcl", "AWS::EC2::RouteTable", "AWS::EC2::Subnet", "AWS::EC2::InternetGateway", etc.