Skip to main content

assessment_targets

Creates, updates, deletes, gets or lists an assessment_targets resource.

Overview

Nameassessment_targets
TypeResource
Idaws.inspector.assessment_targets

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
assessment_targetsarrayInformation about the assessment targets.
failed_itemsobjectAssessment target details that cannot be described. An error code is provided for each failed item.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_assessment_targetsselectregionDescribes the assessment targets that are specified by the ARNs of the assessment targets.
list_assessment_targetsselectregionLists the ARNs of the assessment targets within this AWS account. For more information about assessment targets, see Amazon Inspector Assessment Targets.
create_assessment_targetinsertregion, assessmentTargetNameCreates a new assessment target using the ARN of the resource group that is generated by CreateResourceGroup. If resourceGroupArn is not specified, all EC2 instances in the current AWS account and region are included in the assessment target. If the service-linked role isn’t already registered, this action also creates and registers a service-linked role to grant Amazon Inspector access to AWS Services needed to perform security assessments. You can create up to 50 assessment targets per AWS account. You can run up to 500 concurrent agents per AWS account. For more information, see Amazon Inspector Assessment Targets.
update_assessment_targetupdateregion, assessmentTargetArn, assessmentTargetNameUpdates the assessment target that is specified by the ARN of the assessment target. If resourceGroupArn is not specified, all EC2 instances in the current AWS account and region are included in the assessment target.
delete_assessment_targetdeleteregionDeletes the assessment target that is specified by the ARN of the assessment target.

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

Describes the assessment targets that are specified by the ARNs of the assessment targets.

SELECT
assessment_targets,
failed_items
FROM aws.inspector.assessment_targets
WHERE region = '{{ region }}' -- required
;

INSERT examples

Creates a new assessment target using the ARN of the resource group that is generated by CreateResourceGroup. If resourceGroupArn is not specified, all EC2 instances in the current AWS account and region are included in the assessment target. If the service-linked role isn’t already registered, this action also creates and registers a service-linked role to grant Amazon Inspector access to AWS Services needed to perform security assessments. You can create up to 50 assessment targets per AWS account. You can run up to 500 concurrent agents per AWS account. For more information, see Amazon Inspector Assessment Targets.

INSERT INTO aws.inspector.assessment_targets (
assessmentTargetName,
resourceGroupArn,
region
)
SELECT
'{{ assessmentTargetName }}' /* required */,
'{{ resourceGroupArn }}',
'{{ region }}'
RETURNING
assessment_target_arn
;

UPDATE examples

Updates the assessment target that is specified by the ARN of the assessment target. If resourceGroupArn is not specified, all EC2 instances in the current AWS account and region are included in the assessment target.

UPDATE aws.inspector.assessment_targets
SET
assessmentTargetArn = '{{ assessmentTargetArn }}',
assessmentTargetName = '{{ assessmentTargetName }}',
resourceGroupArn = '{{ resourceGroupArn }}'
WHERE
region = '{{ region }}' --required
AND assessmentTargetArn = '{{ assessmentTargetArn }}' --required
AND assessmentTargetName = '{{ assessmentTargetName }}' --required;

DELETE examples

Deletes the assessment target that is specified by the ARN of the assessment target.

DELETE FROM aws.inspector.assessment_targets
WHERE region = '{{ region }}' --required
;