Skip to main content

views

Creates, updates, deletes, gets or lists a views resource.

Overview

Nameviews
TypeResource
Idaws.resource_explorer_2.views

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
tagsobjectTag key and value pairs that are attached to the view.
viewobjectA view is a structure that defines a set of filters that provide a view into the information in the Amazon Web Services Resource Explorer index. The filters specify which information from the index is visible to the users of the view. For example, you can specify filters that include only resources that are tagged with the key "ENV" and the value "DEVELOPMENT" in the results returned by this view. You could also create a second view that includes only resources that are tagged with "ENV" and "PRODUCTION".

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_viewselectregionRetrieves details of the specified view.
list_viewsselectregionLists the Amazon resource names (ARNs) of the views available in the Amazon Web Services Region in which you call this operation. Always check the NextToken response parameter for a null value when calling a paginated operation. These operations can occasionally return an empty set of results even when there are more results available. The NextToken response parameter value is null only when there are no more results to display.
create_viewinsertregion, ViewNameCreates a view that users can query by using the Search operation. Results from queries that you make using this view include only resources that match the view's Filters. For more information about Amazon Web Services Resource Explorer views, see Managing views in the Amazon Web Services Resource Explorer User Guide. Only the principals with an IAM identity-based policy that grants Allow to the Search action on a Resource with the Amazon resource name (ARN) of this view can Search using views you create with this operation.
update_viewupdateregion, ViewArnModifies some of the details of a view. You can change the filter string and the list of included properties. You can't change the name of the view.
delete_viewdeleteregionDeletes the specified view. If the specified view is the default view for its Amazon Web Services Region, then all Search operations in that Region must explicitly specify the view to use until you configure a new default by calling the AssociateDefaultView operation.
batch_get_viewexecregionRetrieves details about a list of views.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

Retrieves details of the specified view.

SELECT
tags,
view
FROM aws.resource_explorer_2.views
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a view that users can query by using the Search operation. Results from queries that you make using this view include only resources that match the view's Filters. For more information about Amazon Web Services Resource Explorer views, see Managing views in the Amazon Web Services Resource Explorer User Guide. Only the principals with an IAM identity-based policy that grants Allow to the Search action on a Resource with the Amazon resource name (ARN) of this view can Search using views you create with this operation.

INSERT INTO aws.resource_explorer_2.views (
ClientToken,
ViewName,
IncludedProperties,
Scope,
Filters,
Tags,
region
)
SELECT
'{{ ClientToken }}',
'{{ ViewName }}' /* required */,
'{{ IncludedProperties }}',
'{{ Scope }}',
'{{ Filters }}',
'{{ Tags }}',
'{{ region }}'
RETURNING
view
;

UPDATE examples

Modifies some of the details of a view. You can change the filter string and the list of included properties. You can't change the name of the view.

UPDATE aws.resource_explorer_2.views
SET
ViewArn = '{{ ViewArn }}',
IncludedProperties = '{{ IncludedProperties }}',
Filters = '{{ Filters }}'
WHERE
region = '{{ region }}' --required
AND ViewArn = '{{ ViewArn }}' --required
RETURNING
view;

DELETE examples

Deletes the specified view. If the specified view is the default view for its Amazon Web Services Region, then all Search operations in that Region must explicitly specify the view to use until you configure a new default by calling the AssociateDefaultView operation.

DELETE FROM aws.resource_explorer_2.views
WHERE region = '{{ region }}' --required
;

Lifecycle Methods

Retrieves details about a list of views.

EXEC aws.resource_explorer_2.views.batch_get_view
@region='{{ region }}' --required
@@json=
'{
"ViewArns": "{{ ViewArns }}"
}'
;