是否有一种方法可以列出AWS中的所有资源?所有地区,所有资源。例如列出所有EC2实例,所有vpc, API网关中的所有API等等…我想列出我账户的所有资源,因为我现在很难找到我可以放弃的资源。


当前回答

通过CLI将所有资源导出为CSV格式

步骤1:激活AWS资源资源管理器

https://resource-explorer.console.aws.amazon.com/resource-explorer

步骤2:使用AWS CLI列出资源

Aws resource-explorer-2 search——query-string arn——output text > resources.csv

其他回答

您可以使用标签编辑器。

进入AWS控制台 在“TOP”导航窗格中,单击“资源组”下拉菜单 点击标签编辑器

在这里,我们可以选择要搜索的特定区域,也可以从下拉菜单中选择所有区域。然后我们可以选择我们想要搜索的实际资源,或者我们也可以单击单个资源。

我知道这是个老问题,但我也想帮忙。

实际上,我们有AWS配置,它可以帮助我们搜索云中的所有资源。您也可以执行SQL查询。

我真心鼓励你们了解这项了不起的服务。

试试这个

仅适用于ec2:

from skew import scan

    arn = scan('arn:aws:ec2:us-west-2:123456789012:instance/i-12345678')
    for resource in arn:
        print(resource.data)

所有资源:

arn = scan('arn:aws:*:*:<<youraccountId>>:instance*')
for resource in arn:
    print(resource.data)

参考资料:https://github.com/scopely-devops/skew

AWS计费管理控制台将为您提供每月到目前为止按服务支出的纲要。

使用PacBot (Policy as Code Bot)——一个开源项目,它是一个用于持续合规监控、合规报告和云安全自动化的平台。PacBot发现所有帐户和所有区域的所有资源,然后根据这些策略进行评估,以衡量策略的一致性。

Omni搜索功能也提供了搜索所有发现的资源的能力。您甚至可以通过PacBot终止/删除资源。

Omni搜索

带有结果过滤的搜索结果页

资产360 /资产详情页面

以下是PacBot的主要功能:

Continuous compliance assessment. Detailed compliance reporting. Auto-Fix for policy violations. Omni Search - Ability to search all discovered resources. Simplified policy violation tracking. Self-Service portal. Custom policies and custom auto-fix actions. Dynamic asset grouping to view compliance. Ability to create multiple compliance domains. Exception management. Email Digests. Supports multiple AWS accounts. Completely automated installer. Customizable dashboards. OAuth2 Support. Azure AD integration for login. Role-based access control. Asset 360 degree.