使用资源管理器示例 AWS CLI - AWS Command Line Interface

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

使用资源管理器示例 AWS CLI

以下代码示例向您展示了如何使用 with Resource Explorer 来执行操作和实现常见场景。 AWS Command Line Interface

操作是大型程序的代码摘录,必须在上下文中运行。您可以通过操作了解如何调用单个服务函数,还可以通过函数相关场景的上下文查看操作。

每个示例都包含一个指向完整源代码的链接,您可以在其中找到有关如何在上下文中设置和运行代码的说明。

主题

操作

以下代码示例显示了如何使用associate-default-view

AWS CLI

将资源浏览器视图设置为其 AWS 区域的默认视图

以下associate-default-view示例将由其ARN指定的视图设置为调用该操作的 AWS 区域的默认视图。

aws resource-explorer-2 associate-default-view \ --view-arn arn:aws:resource-explorer-2:us-east-1:123456789012:view/My-Main-View/EXAMPLE8-90ab-cdef-fedc-EXAMPLE11111

输出:

{ "ViewArn": "arn:aws:resource-explorer-2:us-east-1:123456789012:view/My-Main-View/EXAMPLE8-90ab-cdef-fedc-EXAMPLE11111" }

有关更多信息,请参阅《AWS 资源浏览器用户指南》中的在 AWS 区域中设置默认视图

以下代码示例显示了如何使用batch-get-view

AWS CLI

检索有关多个资源浏览器视图的详细信息

以下batch-get-view示例显示了由它们指定的两个视图的详细信息ARNs。在--view-arn 参数ARNs中使用空格分隔多个。

aws resource-explorer-2 batch-get-view \ --view-arns arn:aws:resource-explorer-2:us-east-1:123456789012:view/My-EC2-Only-View/EXAMPLE8-90ab-cdef-fedc-EXAMPLE22222, \ arn:aws:resource-explorer-2:us-east-1:123456789012:view/My-Main-View/EXAMPLE8-90ab-cdef-fedc-EXAMPLE11111

输出:

{ "Views": [ { "Filters": { "FilterString": "service:ec2" }, "IncludedProperties": [ { "Name": "tags" } ], "LastUpdatedAt": "2022-07-13T21:33:45.249000+00:00", "Owner": "123456789012", "Scope": "arn:aws:iam::123456789012:root", "ViewArn": "arn:aws:resource-explorer-2:us-east-1:123456789012:view/My-EC2-Only-View/EXAMPLE8-90ab-cdef-fedc-EXAMPLE22222" }, { "Filters": { "FilterString": "" }, "IncludedProperties": [ { "Name": "tags" } ], "LastUpdatedAt": "2022-07-13T20:34:11.314000+00:00", "Owner": "123456789012", "Scope": "arn:aws:iam::123456789012:root", "ViewArn": "arn:aws:resource-explorer-2:us-east-1:123456789012:view/My-Main-View/EXAMPLE8-90ab-cdef-fedc-EXAMPLE11111" } ] "Errors": [] }

有关视图的更多信息,请参阅《资源浏览器用户指南》中的关于AWS 资源浏览器图。

以下代码示例显示了如何使用create-index

AWS CLI

通过创建索引在 AWS 区域中打开资源浏览器

以下create-index示例在调用该操作的 AWS 区域中创建本地索引。会 AWS CLI自动生成一个随机client-token参数值, AWS 如果您未指定值,则将其包含在对的调用中。

aws resource-explorer-2 create-index \ --region us-east-1

输出:

{ "Arn": "arn:aws:resource-explorer-2:us-east-1:123456789012:index/EXAMPLE8-90ab-cdef-fedc-EXAMPLE22222c", "CreatedAt": "2022-11-01T20:00:59.149Z", "State": "CREATING" }

创建本地索引后,您可以通过运行update-index-type命令将其转换为账户的聚合索引。

有关更多信息,请参阅《资源浏览器用户指南》中的在 AWS 区域中打开AWS 资源浏览器以索引您的资源

以下代码示例显示了如何使用create-view

AWS CLI

示例 1:为区域中的索引创建未经过滤的视图 AWS

以下create-view示例在指定 Region 中创建一个视图, AWS 该视图不经过任何筛选即可返回该区域中的所有结果。该视图在返回的结果中包含可选的 “标签” 字段。由于此视图是在包含聚合器索引的区域中创建的,因此它可以包含账户中包含资源浏览器索引的所有区域的结果。

aws resource-explorer-2 create-view \ --view-name My-Main-View \ --included-properties Name=tags \ --region us-east-1

输出:

{ "View": { "Filters": { "FilterString": "" }, "IncludedProperties": [ { "Name": "tags" } ], "LastUpdatedAt": "2022-07-13T20:34:11.314000+00:00", "Owner": "123456789012", "Scope": "arn:aws:iam::123456789012:root", "ViewArn": "arn:aws:resource-explorer-2:us-east-1:123456789012:view/My-Main-View/EXAMPLE8-90ab-cdef-fedc-EXAMPLE11111" } }

示例 2:创建仅返回与 Amazon 关联的资源的视图 EC2

以下内容在 Region 中create-view创建了一个视图us-east-1, AWS 该视图仅返回该区域中与 Amazon EC2 服务关联的资源。该视图包括返回结果中的可选Tags字段。由于此视图是在包含聚合器索引的区域中创建的,因此它可以包含账户中包含资源浏览器索引的所有区域的结果。

aws resource-explorer-2 create-view \ --view-name My-EC2-Only-View \ --included-properties Name=tags \ --filters FilterString="service:ec2" \ --region us-east-1

输出:

{ "View": { "Filters": { "FilterString": "service:ec2" }, "IncludedProperties": [ { "Name":"tags" } ], "LastUpdatedAt": "2022-07-13T21:35:09.059Z", "Owner": "123456789012", "Scope": "arn:aws:iam::123456789012:root", "ViewArn": "arn:aws:resource-explorer-2:us-east-1:123456789012:view/My-EC2-Only-View/EXAMPLE8-90ab-cdef-fedc-EXAMPLE22222" } }

有关更多信息,请参阅《AWS 资源浏览器用户指南》中的 “创建用于搜索的视图”。

以下代码示例显示了如何使用delete-index

AWS CLI

通过删除某个 AWS 区域的索引来关闭该区域中的资源浏览器

以下delete-index示例删除您发出请求的 AWS 区域中指定的资源浏览器索引。

aws resource-explorer-2 delete-index \ --arn arn:aws:resource-explorer-2:us-west-2:123456789012:index/EXAMPLE8-90ab-cdef-fedc-EXAMPLE22222 \ --region us-west-2

输出:

{ "Arn": "arn:aws:resource-explorer-2:us-west-2:123456789012:index/EXAMPLE8-90ab-cdef-fedc-EXAMPLE22222", "State": "DELETING" }

有关删除索引的更多信息,请参阅《AWS 资源浏览器用户指南》中的在 AWS 区域中关闭AWS资源浏览器

以下代码示例显示了如何使用delete-view

AWS CLI

删除资源浏览器视图

以下delete-view示例删除了由其指定的视图ARN。

aws resource-explorer-2 delete-view \ --view-arn arn:aws:resource-explorer-2:us-east-1:123456789012:view/EC2-Only-View/EXAMPLE8-90ab-cdef-fedc-EXAMPLE11111

输出:

{ "ViewArn": "arn:aws:resource-explorer-2:us-east-1:123456789012:view/EC2-Only-View/EXAMPLE8-90ab-cdef-fedc-EXAMPLE11111" }

有关更多信息,请参阅《AWS 资源浏览器用户指南》中的删除视图

以下代码示例显示了如何使用disassociate-default-view

AWS CLI

移除某个 AWS 区域的默认资源浏览器视图

以下内容disassociate-default-view删除了您调用操作的 AWS 区域的默认资源浏览器视图。执行此操作后,区域中的所有搜索操作都必须明确指定视图,否则操作将失败。

aws resource-explorer-2 disassociate-default-view

此命令不生成任何输出。

有关更多信息,请参阅《AWS 资源浏览器用户指南》中的在 AWS 区域中设置默认视图

以下代码示例显示了如何使用get-default-view

AWS CLI

检索资源浏览器视图,该视图是其 AWS 区域的默认视图

以下get-default-view示例检索视图ARN的默认视图,该视图是您调用该操作的 AWS 区域的默认视图。

aws resource-explorer-2 get-default-view

输出:

{ "ViewArn": "arn:aws:resource-explorer-2:us-east-1:123456789012:view/default-view/EXAMPLE8-90ab-cdef-fedc-EXAMPLE11111" }

有关更多信息,请参阅《AWS 资源浏览器用户指南》中的在 AWS 区域中设置默认视图

以下代码示例显示了如何使用get-index

AWS CLI

示例 1:检索资源浏览器聚合器索引的详细信息

以下get-index示例显示了指定 AWS 区域中资源浏览器索引的详细信息。由于指定的区域包含该账户的聚合器索引,因此输出会列出将数据复制到该区域索引中的区域。

aws resource-explorer-2 get-index \ --region us-east-1

输出:

{ "Arn": "arn:aws:resource-explorer-2:us-east-1:123456789012:index/EXAMPLE8-90ab-cdef-fedc-EXAMPLE11111", "CreatedAt": "2022-07-12T18:59:10.503000+00:00", "LastUpdatedAt": "2022-07-13T18:41:58.799000+00:00", "ReplicatingFrom": [ "ap-south-1", "us-west-2" ], "State": "ACTIVE", "Tags": {}, "Type": "AGGREGATOR" }

示例 2:检索资源浏览器本地索引的详细信息

以下get-index示例显示了指定 AWS 区域中资源浏览器索引的详细信息。由于指定的 Region 包含本地索引,因此输出会列出将该区域索引中的数据复制到的区域。

aws resource-explorer-2 get-index \ --region us-west-2

输出:

{ "Arn": "arn:aws:resource-explorer-2:us-west-2:123456789012:index/EXAMPLE8-90ab-cdef-fedc-EXAMPLE22222", "CreatedAt": "2022-07-12T18:59:10.503000+00:00", "LastUpdatedAt": "2022-07-13T18:41:58.799000+00:00", "ReplicatingTo": [ "us-west-2" ], "State": "ACTIVE", "Tags": {}, "Type": "LOCAL" }

有关索引的更多信息,请参阅《资源浏览器用户指南》中的检查哪些 AWS 区域已开启AWS资源浏览器

以下代码示例显示了如何使用get-view

AWS CLI

检索有关资源浏览器视图的详细信息

以下get-view示例显示了由其指定的视图的详细信息ARN。

aws resource-explorer-2 get-view \ --view-arn arn:aws:resource-explorer-2:us-east-1:123456789012:view/EC2-Only-View/EXAMPLE8-90ab-cdef-fedc-EXAMPLE11111

输出:

{ "Tags" : {}, "View" : { "Filters" : { "FilterString" : "service:ec2" }, "IncludedProperties" : [ { "Name" : "tags" } ], "LastUpdatedAt" : "2022-07-13T21:33:45.249Z", "Owner" : "123456789012", "Scope" : "arn:aws:iam::123456789012:root", "ViewArn" : "arn:aws:resource-explorer-2:us-east-1:123456789012:view/EC2-Only-View/EXAMPLE8-90ab-cdef-fedc-EXAMPLE11111" } }

有关视图的更多信息,请参阅《资源浏览器用户指南》中的关于AWS 资源浏览器图。

以下代码示例显示了如何使用list-indexes

AWS CLI

列出资源浏览器中包含索引的 AWS 区域

以下list-indexes示例列出了资源浏览器具有索引的所有区域的索引。响应指定了每个索引的类型、其 AWS 区域和索引ARN。

aws resource-explorer-2 list-indexes

输出:

{ "Indexes": [ { "Arn": "arn:aws:resource-explorer-2:us-west-2:123456789012:index/EXAMPLE8-90ab-cdef-fedc-EXAMPLE11111", "Region": "us-west-2", "Type": "AGGREGATOR" }, { "Arn": "arn:aws:resource-explorer-2:us-east-1:123456789012:index/EXAMPLE8-90ab-cdef-fedc-EXAMPLE22222", "Region": "us-east-1", "Type": "LOCAL" }, { "Arn": "arn:aws:resource-explorer-2:us-east-2:123456789012:index/EXAMPLE8-90ab-cdef-fedc-EXAMPLE33333", "Region": "us-east-2", "Type": "LOCAL" }, { "Arn": "arn:aws:resource-explorer-2:us-west-1:123456789012:index/EXAMPLE8-90ab-cdef-fedc-EXAMPLE44444", "Region": "us-west-1", "Type": "LOCAL" } ] }

有关索引的更多信息,请参阅《资源浏览器用户指南》中的检查哪些 AWS 区域已开启AWS资源浏览器

以下代码示例显示了如何使用list-supported-resource-types

AWS CLI

列出资源浏览器中包含索引的 AWS 区域

以下list-supported-resource-types示例列出了 &AREXlong; 当前支持的所有资源类型。示例响应包含一个NextToken值,该值表示有更多输出可供通过其他调用进行检索。

aws resource-explorer-2 list-supported-resource-types \ --max-items 10

输出:

{ "ResourceTypes": [ { "ResourceType": "cloudfront:cache-policy", "Service": "cloudfront" }, { "ResourceType": "cloudfront:distribution", "Service": "cloudfront" }, { "ResourceType": "cloudfront:function", "Service": "cloudfront" }, { "ResourceType": "cloudfront:origin-access-identity", "Service": "cloudfront" }, { "ResourceType": "cloudfront:origin-request-policy", "Service": "cloudfront" }, { "ResourceType": "cloudfront:realtime-log-config", "Service": "cloudfront" }, { "ResourceType": "cloudfront:response-headers-policy", "Service": "cloudfront" }, { "ResourceType": "cloudwatch:alarm", "Service": "cloudwatch" }, { "ResourceType": "cloudwatch:dashboard", "Service": "cloudwatch" }, { "ResourceType": "cloudwatch:insight-rule", "Service": "cloudwatch" } ], "NextToken": "eyJOZXh0VG9rZW4iOiBudWxsLCAiYm90b190cnVuY2F0ZV9hbW91bnQiOiAxMH0=" }

要获取输出的下一部分,请再次调用该操作,并将上一个调用的NextToken响应值作为的值传递--starting-token。重复此操作NextToken,直到响应中不存在。

aws resource-explorer-2 list-supported-resource-types \ --max-items 10 \ --starting-token eyJOZXh0VG9rZW4iOiBudWxsLCAiYm90b190cnVuY2F0ZV9hbW91bnQiOiAxMH0=

输出:

{ "ResourceTypes": [ { "ResourceType": "cloudwatch:metric-stream", "Service": "cloudwatch" }, { "ResourceType": "dynamodb:table", "Service": "dynamodb" }, { "ResourceType": "ec2:capacity-reservation", "Service": "ec2" }, { "ResourceType": "ec2:capacity-reservation-fleet", "Service": "ec2" }, { "ResourceType": "ec2:client-vpn-endpoint", "Service": "ec2" }, { "ResourceType": "ec2:customer-gateway", "Service": "ec2" }, { "ResourceType": "ec2:dedicated-host", "Service": "ec2" }, { "ResourceType": "ec2:dhcp-options", "Service": "ec2" }, { "ResourceType": "ec2:egress-only-internet-gateway", "Service": "ec2" }, { "ResourceType": "ec2:elastic-gpu", "Service": "ec2" } ], "NextToken": "eyJOZXh0VG9rZW4iOiBudWxsLCAiYm90b190cnVuY2F0ZV9hbW91bnQiOiAyMH0=" }

有关索引的更多信息,请参阅《资源浏览器用户指南》中的检查哪些 AWS 区域已开启AWS资源浏览器

以下代码示例显示了如何使用list-tags-for-resource

AWS CLI

列出附加到资源资源管理器视图或索引的标签

以下list-tags-for-resource示例列出了附加到带有指定内容的标签键和值对ARN。您必须从包含资源的 AWS 区域调用该操作。

aws resource-explorer-2 list-tags-for-resource \ --resource-arn arn:aws:resource-explorer-2:us-east-1:123456789012:view/My-View/EXAMPLE8-90ab-cdef-fedc-EXAMPLE11111

输出:

{ "Tags": { "application": "MainCorpApp", "department": "1234" } }

有关为视图添加标签的更多信息,请参阅《AWS 资源管理器用户指南》中的 “为视图添加标签以实现访问控制”。

以下代码示例显示了如何使用list-views

AWS CLI

列出某个 AWS 区域中可用的资源浏览器视图

以下list-views示例列出了您在其中调用操作的区域中可用的所有视图。

aws resource-explorer-2 list-views

输出:

{ "Views": [ "arn:aws:resource-explorer-2:us-east-1:123456789012:view/EC2-Only-View/EXAMPLE8-90ab-cdef-fedc-EXAMPLE11111", "arn:aws:resource-explorer-2:us-east-1:123456789012:view/Default-All-Resources-View/EXAMPLE8-90ab-cdef-fedc-EXAMPLE22222", "arn:aws:resource-explorer-2:us-east-1:123456789012:view/Production-Only-View/EXAMPLE8-90ab-cdef-fedc-EXAMPLE33333" ] }

有关视图的更多信息,请参阅《资源浏览器用户指南》中的关于AWS 资源浏览器图。

以下代码示例显示了如何使用search

AWS CLI

示例 1:使用默认视图进行搜索

以下search示例显示了指定中与该服务关联的所有资源。搜索使用该地区的默认视图。示例响应包含一个NextToken值,该值表示有更多输出可供通过其他调用进行检索。

aws resource-explorer-2 search \ --query-string "service:iam"

输出:

{ "Count": { "Complete": true, "TotalResources": 55 }, "NextToken": "AG9VOEF1KLEXAMPLEOhJHVwo5chEXAMPLER5XiEpNrgsEXAMPLE...b0CmOFOryHEXAMPLE", "Resources": [{ "Arn": "arn:aws:iam::123456789012:policy/service-role/Some-Policy-For-A-Service-Role", "LastReportedAt": "2022-07-21T12:34:42Z", "OwningAccountId": "123456789012", "Properties": [], "Region": "global", "ResourceType": "iam:policy", "Service": "iam" }, { "Arn": "arn:aws:iam::123456789012:policy/service-role/Another-Policy-For-A-Service-Role", "LastReportedAt": "2022-07-21T12:34:42Z", "OwningAccountId": "123456789012", "Properties": [], "Region": "global", "ResourceType": "iam:policy", "Service": "iam" }, { ... TRUNCATED FOR BREVITY ... }], "ViewArn": "arn:aws:resource-explorer-2:us-east-1:123456789012:view/my-default-view/EXAMPLE8-90ab-cdef-fedc-EXAMPLE11111" }

示例 2:使用指定视图进行搜索

以下search示例搜索显示了指定 AWS 区域中通过指定视图可见的所有资源(“*”)。EC2由于视图附带了筛选条件,因此结果仅包含与 Amazon 关联的资源。

aws resource-explorer-2 search \ -- query-string "*" \ -- view-arn arn:aws:resource-explorer-2:us-east-1:123456789012:view/My-EC2-view/EXAMPLE8-90ab-cdef-fedc-EXAMPLE22222

输出:

HTTP/1.1 200 OK Date: Tue, 01 Nov 2022 20:00:59 GMT Content-Type: application/json Content-Length: <PayloadSizeBytes> { "Count": { "Complete": true, "TotalResources": 67 }, "Resources": [{ "Arn": "arn:aws:ec2:us-east-1:123456789012:network-acl/acl-1a2b3c4d", "LastReportedAt": "2022-07-21T18:52:02Z", "OwningAccountId": "123456789012", "Properties": [{ "Data": [{ "Key": "Department", "Value": "AppDevelopment" }, { "Key": "Environment", "Value": "Production" }], "LastReportedAt": "2021-11-15T14:48:29Z", "Name": "tags" }], "Region": "us-east-1", "ResourceType": "ec2:network-acl", "Service": "ec2" }, { "Arn": "arn:aws:ec2:us-east-1:123456789012:subnet/subnet-1a2b3c4d", "LastReportedAt": "2022-07-21T21:22:23Z", "OwningAccountId": "123456789012", "Properties": [{ "Data": [{ "Key": "Department", "Value": "AppDevelopment" }, { "Key": "Environment", "Value": "Production" }], "LastReportedAt": "2021-07-29T19:02:39Z", "Name": "tags" }], "Region": "us-east-1", "ResourceType": "ec2:subnet", "Service": "ec2" }, { "Arn": "arn:aws:ec2:us-east-1:123456789012:dhcp-options/dopt-1a2b3c4d", "LastReportedAt": "2022-07-21T06:08:53Z", "OwningAccountId": "123456789012", "Properties": [{ "Data": [{ "Key": "Department", "Value": "AppDevelopment" }, { "Key": "Environment", "Value": "Production" }], "LastReportedAt": "2021-11-15T15:11:05Z", "Name": "tags" }], "Region": "us-east-1", "ResourceType": "ec2:dhcpoptions", "Service": "ec2" }, { ... TRUNCATED FOR BREVITY ... }], "ViewArn": "arn:aws:resource-explorer-2:us-east-1:123456789012:view/My-EC2-view/EXAMPLE8-90ab-cdef-fedc-EXAMPLE22222" }

有关更多信息,请参阅《AWS 资源浏览器用户指南》中的使用AWS 资源浏览器搜索资源

  • 有关API详细信息,请参阅在 “AWS CLI 命令参考”搜索

以下代码示例显示了如何使用tag-resource

AWS CLI

为资源资源管理器视图添加标签

以下tag-resource示例将值为 “production” 的标签键 “environment” 添加到具有指定值的视图中ARN。

aws resource-explorer-2 tag-resource \ --resource-arn arn:aws:resource-explorer-2:us-east-1:123456789012:view/My-View//EXAMPLE8-90ab-cdef-fedc-EXAMPLE11111 \ --tags environment=production

此命令不生成任何输出。

有关更多信息,请参阅《AWS 资源管理器用户指南》中的 “为视图添加标签以实现访问控制”。

以下代码示例显示了如何使用untag-resource

AWS CLI

从资源管理器视图中移除标签

以下untag-resource示例从具有指定密钥名称为 “environment” 的视图中移除所有标签ARN。

aws resource-explorer-2 untag-resource \ --resource-arn arn:aws:resource-explorer-2:us-east-1:123456789012:view/My-View//EXAMPLE8-90ab-cdef-fedc-EXAMPLE11111 \ --tag-keys environment

此命令不生成任何输出。

有关更多信息,请参阅《AWS 资源管理器用户指南》中的 “为视图添加标签以实现访问控制”。

以下代码示例显示了如何使用update-index-type

AWS CLI

更改资源浏览器索引的类型

以下update-index-type示例将指定的索引从类型localaggregator转换为类型,以开启在账户中所有 AWS 区域搜索资源的功能。您必须将请求发送到包含要更新的索引的 AWS 区域。

aws resource-explorer-2 update-index-type \ --arn arn:aws:resource-explorer-2:us-east-1:123456789012:index/EXAMPLE8-90ab-cdef-fedc-EXAMPLE11111 \ --type aggregator \ --region us-east-1

输出:

{ "Arn":"arn:aws:resource-explorer-2:us-east-1:123456789012:index/EXAMPLE8-90ab-cdef-fedc-EXAMPLE11111", "LastUpdatedAt":"2022-07-13T18:41:58.799Z", "State":"updating", "Type":"aggregator" }

有关更改索引类型的更多信息,请参阅《AWS 资源浏览器用户指南》中的通过创建聚合器索引来启用跨区域搜索

以下代码示例显示了如何使用update-view

AWS CLI

示例 1:更新资源浏览器视图的 IncludedProperties 字段

以下update-view示例通过添加`tags`可选视图来更新指定的视图`IncludedProperties`。运行此操作后,使用此视图的搜索操作将包含有关结果中显示的资源所附标签的信息。

aws resource-explorer-2 update-view \ --included-properties Name=tags \ --view-arn arn:aws:resource-explorer-2:us-east-1:123456789012:view/My-View/EXAMPLE8-90ab-cdef-fedc-EXAMPLE22222

输出:

{ "View": { "Filters": { "FilterString": "" }, "IncludedProperties": [ { "Name": "tags" } ], "LastUpdatedAt": "2022-07-19T17:41:21.710000+00:00", "Owner": "123456789012", "Scope": "arn:aws:iam::123456789012:root", "ViewArn": "arn:aws:resource-explorer-2:us-east-1:123456789012:view/My-EC2-Only-View/EXAMPLE8-90ab-cdef-fedc-EXAMPLE11111" } }

示例 2:更新附加到视图的筛选器

以下update-view示例将指定视图更新为使用筛选条件,该筛选条件将结果仅限于与 Amazon EC2 服务关联的资源类型。

aws resource-explorer-2 update-view \ --filters FilterString="service:ec2" \ --view-arn arn:aws:resource-explorer-2:us-east-1:123456789012:view/My-View/EXAMPLE8-90ab-cdef-fedc-EXAMPLE22222

输出:

{ "View": { "Filters": { "FilterString": "service:ec2" }, "IncludedProperties": [], "LastUpdatedAt": "2022-07-19T17:41:21.710000+00:00", "Owner": "123456789012", "Scope": "arn:aws:iam::123456789012:root", "ViewArn": "arn:aws:resource-explorer-2:us-east-1:123456789012:view/My-View/EXAMPLE8-90ab-cdef-fedc-EXAMPLE22222" } }

有关视图的更多信息,请参阅《资源浏览器用户指南》中的关于AWS 资源浏览器图。