Skip to main content

insights

Creates, updates, deletes or gets an insight resource or lists insights in a region

Overview

Nameinsights
TypeResource
DescriptionThe AWS::SecurityHub::Insight resource represents the AWS Security Hub Insight in your account. An AWS Security Hub insight is a collection of related findings.
Idawscc.securityhub.insights

Fields

NameDatatypeDescription
insight_arnstringThe ARN of a Security Hub insight
namestringThe name of a Security Hub insight
filtersobjectOne or more attributes used to filter the findings included in the insight
group_by_attributestringThe grouping attribute for the insight's findings
regionstringAWS region.

For more information, see AWS::SecurityHub::Insight.

Methods

NameResourceAccessible byRequired Params
create_resourceinsightsINSERTFilters, Name, GroupByAttribute, region
delete_resourceinsightsDELETEIdentifier, region
update_resourceinsightsUPDATEIdentifier, PatchDocument, region
list_resourcesinsights_list_onlySELECTregion
get_resourceinsightsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual insight.

SELECT
region,
insight_arn,
name,
filters,
group_by_attribute
FROM awscc.securityhub.insights
WHERE
region = '{{ region }}' AND
Identifier = '{{ insight_arn }}';

INSERT example

Use the following StackQL query and manifest file to create a new insight resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.securityhub.insights (
Name,
Filters,
GroupByAttribute,
region
)
SELECT
'{{ name }}',
'{{ filters }}',
'{{ group_by_attribute }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a insight resource, using stack-deploy.

/*+ update */
UPDATE awscc.securityhub.insights
SET PatchDocument = string('{{ {
"Name": name,
"Filters": filters,
"GroupByAttribute": group_by_attribute
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ insight_arn }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.securityhub.insights
WHERE
Identifier = '{{ insight_arn }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

To operate on the insights resource, the following permissions are required:

securityhub:CreateInsight