Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions,
see Getting Started with Amazon Web Services in China
(PDF).
Creating Resource Explorer views to use for search
All searches must use a view. A view defines filters that determine which resources can
be returned by queries that use the view. Views are also the resource to which the
administrator must grant permissions to control who can use which view.
A view is stored in an Amazon Web Services Region, and returns search results from only that Region's
index. If the Region contains the aggregator index, then the view returns
search results from the index in every Region in the account.
Amazon Resource Explorer can create a default view for you during initial set up if you chose the
relevant options in either Quick
setup or Advanced setup. At any later time, you can create
additional views that have different filters for different sets of users.
You can create a view by using the Amazon Web Services Management Console or by running Amazon CLI commands or their equivalent API
operations in an Amazon SDK.
Minimum permissions
To run this procedure, you must have the following permissions:
- Amazon Web Services Management Console
-
To create a view
-
Open the Resource Explorer console Views page and choose Create
view.
-
On the Create view page, for
Name, enter a name for the view.
The name must be no more than 64 characters long, and can include
letters, digits, and the dash (-) character. The name must be unique
within its Amazon Web Services Region.
-
Choose the Amazon Web Services Region in which you want to create the view. To
create a view that returns resources from all Regions in the account,
choose the Amazon Web Services Region that contains the aggregator index.
-
Choose whether to filter the results.
-
Include all resources
No query filters are included. All resources in the index
associated with the view can be returned in search
results.
-
Include only resources that match a specified
filter
Turns on the Resource filters check box
where you can choose filter names and operators. For an
explanation of each of the available filter names and operators,
see Filters.
-
Choose the optional resource attributes to include in results
from this view. Select the check box next to
Tags to let users search for resources
based on their tag key names and values. If you don't include
tags in the view then users can't make search requests that use
tag keys and values to further filter the results.
-
Optionally, you can attach tags to the view. Expand the
Tags box, and enter up to 50 tag
key/value pairs. You can use tags to categorize resources, or as
part of an attribute-based access control (ABAC) security
permission strategy. For more information, see Adding tags to views.
-
Choose Create view.
The console returns to the Search page where you
can use your new view to perform a search.
Next step: Grant the principals in
your account permissions to search with your new view. For more
information, see Granting access to Resource Explorer views for
search
- Amazon CLI
-
To create a view
Run the following command to create a view in the specified Amazon Web Services Region.
The following example creates a view that returns only resources related to
the Amazon EC2 service that are tagged with a Stage
key and the
value prod
.
$
aws resource-explorer-2 create-view \
--region us-west-2 \
--view-name "My-EC2-Prod-Resources" \
--filters FilterString="service:ec2 tag:stage=prod" \
--included-properties Name=tags
{
"View": {
"Filters": {
"FilterString": "service:ec2 tag:stage=prod"
},
"IncludedProperties": [
{
"Name": "tags"
}
],
"LastUpdatedAt": "2022-08-03T16:13:37.625000+00:00",
"Owner": "123456789012",
"Scope": "arn:aws:iam::123456789012:root",
"ViewArn": "arn:aws:resource-explorer-2:us-west-2:123456789012:view/My-EC2-Prod-Resources/1a2b3c4d-5d6e-7f8a-9b0c-abcd11111111"
}
}
Next step: Grant the principals in your
account permissions to search with your new view. For more information, see
Granting access to Resource Explorer views for
search