检索与 AWS 账户关联的资源

Retrieve resources associated to an AWS account

AWS Java SDK 是否有 api 可以帮助我检索给定 AWS 帐号的资源列表(vpc、dynamodb、卷、ec2 等...)? 我已经在更高级别浏览了 AWS Java SDK 文档,但所有内容都与给定资源的一个特定 AWS 客户端相关。 我想要一个抽象的 AWS 客户端,这样它就可以向我提供关联 AWS 资源的几个属性到 aws 帐户。 任何帮助表示赞赏。谢谢!!

所有 AWS API 调用都与 特定服务相关 。例如,您可以请求 Amazon VPC 列表、Amazon DynamoDB 表列表、Amazon EBS 卷列表——但每个都需要不同的 API 调用

另一种选择是使用 AWS Config:

AWS Config provides a detailed view of the configuration of AWS resources in your AWS account. This includes how the resources are related to one another and how they were configured in the past so that you can see how the configurations and relationships change over time.

AWS Config 可以定期(例如每天)将 配置快照 传送到 Amazon S3 存储桶中。此快照 (example) 是一个 JSON 文件,其中包含有关 VPC、Amazon EC2 实例和相关资源的信息。

但是,配置快照仅包含与有限数量的服务相关的信息,例如 EC2、VPC、Amazon Redshift、Amazon RDS 和 Amazon S3。 (参见 Supported AWS Resource Types